From 4bf2fb3f8c0291670370fe0729db73f4136312c8 Mon Sep 17 00:00:00 2001 From: Michael Fessenden Date: Fri, 22 Sep 2017 10:51:46 -0400 Subject: [PATCH] restore zlib directory for older versions of Xcode --- CHANGELOG.md | 6 +---- .../AppIcon.appiconset/Contents.json | 2 +- README.md | 24 +++++++++++++++---- Resources/roguelike-16x16.tmx | 2 +- SKTiled.xcodeproj/project.pbxproj | 12 ++-------- Sources/SKTileLayer.swift | 8 ++++--- Sources/SKTilemap.swift | 2 +- zlib/include.h | 1 + zlib/module.modulemap | 5 ++++ 9 files changed, 36 insertions(+), 26 deletions(-) create mode 100644 zlib/include.h create mode 100644 zlib/module.modulemap diff --git a/CHANGELOG.md b/CHANGELOG.md index a8b8fe7d..11e4faf8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ Change Log - add `SKTilesetData.setTexture(_:forFrame:)` - add `SKTilesetData.setDuration(interval:forFrame:)` - add `SKTileObject.tileData` property -- add `SKTiledSceneCamera.clampZoomValue` +- add `SKTiledSceneCamera.clampZoomValue` - add `SKTiledSceneCamera.zoomClamping` property - remove `SKTile.pauseAnimation` @@ -29,8 +29,6 @@ Change Log - invert layer y-offsets properly - add `DemoController` to manage scenes in iOS/macOS demo targets - - - add `SKTilemap.getLayer(atPath:)` - add `SKTilemapDelegate.didAddNavigationGraph(_:)` - add `SKTilemap.newTileLayer(named:group:)` @@ -73,8 +71,6 @@ Change Log - update API for new layer & object types, more consistent naming, etc. - improved grid drawing quality - debug functions moved to `SKTiled+Debug.swift` - - - add `SKObjectGroup.textObjects` - add `SKTilemap.textObjects` - add `SKTilemap.showGrid` diff --git a/Demo/Assets.xcassets/AppIcon.appiconset/Contents.json b/Demo/Assets.xcassets/AppIcon.appiconset/Contents.json index a3bcfe89..c5d32414 100644 --- a/Demo/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/Demo/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -212,4 +212,4 @@ "properties" : { "pre-rendered" : true } -} \ No newline at end of file +} diff --git a/README.md b/README.md index 88f5a92f..6ada761e 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ > SKTiled is a Swift framework for using [Tiled][tiled-url] assets with Apple's SpriteKit. [![Swift Version][swift-image]][swift-url] +[![Xcode Version][xcode9-image]][xcode-downloads-url] [![Build Status][travis-image]][travis-url] [![License][license-image]][license-url] [![Platforms][platforms-image]][platforms-url] @@ -13,10 +14,11 @@ **SKTiled** is a framework for using [Tiled][tiled-url] assets with [Apple's SpriteKit][spritekit-url], built from the ground up with Swift. This project began life as an exercise to learn Apple's new programming language for a game project, but I've decided to release it as open source with the hopes that others will find it useful. **SKTiled** is up-to-date and supports **Tiled's** major features, including all map & object types. -Current release is Swift 3.2/macOS 10.11/iOS 10+. For Swift 4, see the [**swift4**][swift4-url] branch. +![Demo Image][demo-iphone-img] -![Demo Image][demo-image] +- for Xcode 8, see the [**xcode8**][branch-xcode8-url] branch +- for Swift 4, see the [**swift4**][branch-swift4-url] branch Check out the [Official Documentation](https://mfessenden.github.io/SKTiled). @@ -45,7 +47,7 @@ Check out the [Official Documentation](https://mfessenden.github.io/SKTiled). - iOS 9+ - macOS 10.12+ -- Xcode 9+ +- Xcode 9/Swift 3.2 ## Installation @@ -266,6 +268,7 @@ let allWalkable = tilemap.getTilesWithProperty("walkable", true") - [Clint Bellanger: Isometric Tiles Math](http://clintbellanger.net/articles/isometric_math) +[swift4-image]:https://img.shields.io/badge/Swift-4-brightgreen.svg [swift-image]:https://img.shields.io/badge/Swift-3.2-brightgreen.svg [swift-url]: https://swift.org/ [license-image]:https://img.shields.io/badge/License-MIT-blue.svg @@ -277,10 +280,21 @@ let allWalkable = tilemap.getTilesWithProperty("walkable", true") [carthage-image]:https://img.shields.io/badge/Carthage-compatible-4BC51D.svg [carthage-url]:https://github.com/Carthage/Carthage [pod-image]:https://img.shields.io/cocoapods/v/SKTiled.svg + +[xcode8-image]:https://img.shields.io/badge/Xcode-8-orange.svg +[xcode9-image]:https://img.shields.io/badge/Xcode-9-orange.svg +[xcode-downloads-url]:https://developer.apple.com/download/more/ + [pod-url]:https://cocoapods.org/pods/SKTiled -[swift4-url]:https://github.com/mfessenden/SKTiled/tree/swift4 + +[branch-master-url]:https://github.com/mfessenden/SKTiled +[branch-xcode8-url]:https://github.com/mfessenden/SKTiled/tree/xcode8 +[branch-swift4-url]:https://github.com/mfessenden/SKTiled/tree/swift4 + [header-image]:https://mfessenden.github.io/SKTiled/images/Header-@1x.png -[demo-image]:https://mfessenden.github.io/SKTiled/images/images/demo-macos-iso.png +[demo-mac-image]:https://mfessenden.github.io/SKTiled/images/demo-macos-iso.png +[demo-iphone-img]:https://mfessenden.github.io/SKTiled/images/demo-iphone.png + diff --git a/Resources/roguelike-16x16.tmx b/Resources/roguelike-16x16.tmx index 52e71c92..a15f49e0 100644 --- a/Resources/roguelike-16x16.tmx +++ b/Resources/roguelike-16x16.tmx @@ -78,7 +78,7 @@ - + eJztl1EKwzAMQ/u1+x+zu8XYR8EIyZbdZmXQgNm6JPaLbJfs/dq292OP/ZF9x90MHc7VvPtFjMeotM7Os4PFtVPObEw5kVdxdnLncFY+j7kdOJimqzjxk+1VbEzDbt5j/Gp0euPQTrGv4nR8IUfkQS58dmI4+XbPq3hZDSvfSp8up/NblZuM80wfqVqZ5Kjqoyq2wxmf8bszkFPFOMPJ9p3lrGqmm6cVnJk/Jwbmw/E34XR9O5xXMjLOlf2+krOKG+fUWrbGZcV4qt8dTvVcxewyxj7K1rh1EH1m94cpZ6ZTp1YnNe9oz/R0dY1rcP3kDsbiqvtUZZXu8exdNuaverdPcs841cg0ZHnBPWc5mX+Xk+nKcvhrTswr07bbj925DmfmD+9ILB8uJ5tXnOw/T+ccEy0zDa40VbtdTqXlxId7d2PzXdbJ/euIUe1FXd36VJyTPCAnY0C/VT1crafL2amDX3Gutofz4byL8wMKo/+y diff --git a/SKTiled.xcodeproj/project.pbxproj b/SKTiled.xcodeproj/project.pbxproj index af556ffc..12d5e5f8 100644 --- a/SKTiled.xcodeproj/project.pbxproj +++ b/SKTiled.xcodeproj/project.pbxproj @@ -1174,7 +1174,6 @@ PRODUCT_NAME = SKTiledDemo; SDKROOT = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 3.1; }; name = Debug; }; @@ -1194,7 +1193,6 @@ PRODUCT_NAME = SKTiledDemo; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.1; }; name = Release; }; @@ -1224,7 +1222,6 @@ SDKROOT = macosx; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 3.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -1255,7 +1252,6 @@ PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = macosx; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -1285,7 +1281,6 @@ PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 3.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -1314,7 +1309,6 @@ PRODUCT_NAME = SKTiled; PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -1366,8 +1360,8 @@ ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = "-lz"; SDKROOT = iphoneos; - SWIFT_INCLUDE_PATHS = zlib; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -1411,8 +1405,8 @@ MTL_ENABLE_DEBUG_INFO = NO; OTHER_LDFLAGS = "-lz"; SDKROOT = iphoneos; - SWIFT_INCLUDE_PATHS = zlib; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.2; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -1431,7 +1425,6 @@ PRODUCT_BUNDLE_IDENTIFIER = com.supermeerkat.SKTiled; PRODUCT_NAME = SKTiledDemo; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 3.1; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -1449,7 +1442,6 @@ PRODUCT_BUNDLE_IDENTIFIER = com.supermeerkat.SKTiledDemo; PRODUCT_NAME = SKTiledDemo; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 3.1; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; diff --git a/Sources/SKTileLayer.swift b/Sources/SKTileLayer.swift index bff70c2e..73ba9a97 100644 --- a/Sources/SKTileLayer.swift +++ b/Sources/SKTileLayer.swift @@ -2351,11 +2351,13 @@ extension SKTiledLayerObject { /** Returns a tile coordinate for a given vector_int2 coordinate. - - parameter vec2: `int2` vector int2. + - parameter vec2: `int2` vector int2 coordinate. + - parameter offsetX: `CGFloat` x-offset value. + - parameter offsetY: `CGFloat` y-offset value. - returns: `CGPoint` position in layer. */ - public func pointForCoordinate(vec2: int2) -> CGPoint { - return self.pointForCoordinate(coord: vec2.cgPoint) + public func pointForCoordinate(vec2: int2, offsetX: CGFloat=0, offsetY: CGFloat=0) -> CGPoint { + return self.pointForCoordinate(coord: vec2.cgPoint, offsetX: offsetX, offsetY: offsetY) } /** diff --git a/Sources/SKTilemap.swift b/Sources/SKTilemap.swift index 096e7225..075381e6 100644 --- a/Sources/SKTilemap.swift +++ b/Sources/SKTilemap.swift @@ -719,7 +719,7 @@ public class SKTilemap: SKNode, SKTiledObject { /** Returns a tile coordinate for a given vector_int2 coordinate. - - parameter vec2: `int2` vector int2. + - parameter vec2: `int2` vector int2 coordinate. - returns: `CGPoint` position in layer. */ public func pointForCoordinate(vec2: int2) -> CGPoint { diff --git a/zlib/include.h b/zlib/include.h new file mode 100644 index 00000000..4470a1fd --- /dev/null +++ b/zlib/include.h @@ -0,0 +1 @@ +#include diff --git a/zlib/module.modulemap b/zlib/module.modulemap new file mode 100644 index 00000000..d7e3f91d --- /dev/null +++ b/zlib/module.modulemap @@ -0,0 +1,5 @@ +module zlib [system] { + header "include.h" + link "z" + export * +}