diff --git a/Spine.podspec b/Spine.podspec index 8c67181ad..396a18711 100644 --- a/Spine.podspec +++ b/Spine.podspec @@ -18,7 +18,8 @@ Spine runtimes for iOS. s.platform = :ios, '13.0' s.xcconfig = { - 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/SpineCppLite/spine-cpp/spine-cpp/include" "$(PODS_ROOT)/SpineCppLite/spine-cpp/spine-cpp-lite"' + 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/SpineCppLite/spine-cpp/spine-cpp/include" "$(PODS_ROOT)/SpineCppLite/spine-cpp/spine-cpp-lite"', + 'MTL_HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/SpineShadersStructs"' } s.resource_bundles = { diff --git a/spine-ios/Example/Spine iOS Example.xcodeproj/project.pbxproj b/spine-ios/Example/Spine iOS Example.xcodeproj/project.pbxproj index d73405880..7ecf1f5ad 100644 --- a/spine-ios/Example/Spine iOS Example.xcodeproj/project.pbxproj +++ b/spine-ios/Example/Spine iOS Example.xcodeproj/project.pbxproj @@ -462,7 +462,7 @@ SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OBJC_BRIDGING_HEADER = "Spine iOS Example/Spine iOS Example-Bridging-Header.h"; - SWIFT_OBJC_INTEROP_MODE = objcxx; + SWIFT_OBJC_INTEROP_MODE = objc; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -506,7 +506,7 @@ SUPPORTS_MACCATALYST = NO; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OBJC_BRIDGING_HEADER = "Spine iOS Example/Spine iOS Example-Bridging-Header.h"; - SWIFT_OBJC_INTEROP_MODE = objcxx; + SWIFT_OBJC_INTEROP_MODE = objc; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; diff --git a/spine-ios/Sources/Spine/Metal/SpineShaders.metal b/spine-ios/Sources/Spine/Metal/SpineShaders.metal index 559077087..964c7f521 100644 --- a/spine-ios/Sources/Spine/Metal/SpineShaders.metal +++ b/spine-ios/Sources/Spine/Metal/SpineShaders.metal @@ -2,27 +2,15 @@ #include using namespace metal; -typedef enum SpineVertexInputIndex { - SpineVertexInputIndexVertices = 0, - SpineVertexInputIndexTransform = 1, - SpineVertexInputIndexViewportSize = 2, -} SpineVertexInputIndex; - -typedef enum SpineTextureIndex { - SpineTextureIndexBaseColor = 0, -} SpineTextureIndex; - -typedef struct { - simd_float2 position; - simd_float4 color; - simd_float2 uv; -} SpineVertex; - -typedef struct { - simd_float2 translation; - simd_float2 scale; - simd_float2 offset; -} SpineTransform; +#if __has_include("spine-ios/Sources/SpineShadersStructs/SpineShadersStructs.h") +// Cocoapods Target + #include "spine-ios/Sources/SpineShadersStructs/SpineShadersStructs.h" +#elif __has_include("../../SpineShadersStructs/SpineShadersStructs.h") +// Swift Package target + #include "../../SpineShadersStructs/SpineShadersStructs.h" +#else + #error "Header not found. Please correct Header search path" +#endif struct RasterizerData { simd_float4 position [[position]];