From 68797585e64c2cd3793b7ca15c42eb1792471249 Mon Sep 17 00:00:00 2001 From: Kearwood Gilbert Date: Sun, 5 Nov 2017 17:21:33 -0800 Subject: [PATCH 1/9] Remove OpenAL includes --- kraken/KREngine-common.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/kraken/KREngine-common.h b/kraken/KREngine-common.h index 446ae35..99bac61 100755 --- a/kraken/KREngine-common.h +++ b/kraken/KREngine-common.h @@ -44,13 +44,6 @@ float const D2R = PI * 2 / 360; #include #include #include -#include -#include -#if TARGET_OS_IPHONE -#include -#else -#include -#endif #include "tinyxml2.h" #endif From 90c54912e9778584517be4440f0d2457bfcc19a5 Mon Sep 17 00:00:00 2001 From: Kearwood Gilbert Date: Sun, 5 Nov 2017 17:22:40 -0800 Subject: [PATCH 2/9] Misc fixes for ARC and new XCode --- Kraken.xcodeproj/project.pbxproj | 58 +++++++++++++++++--------------- kraken/KRContext_osx.mm | 6 ++-- kraken/KREngine-common.h | 1 + kraken/KRResource+fbx.cpp | 2 +- kraken_osx/KrakenView.mm | 2 -- 5 files changed, 36 insertions(+), 33 deletions(-) diff --git a/Kraken.xcodeproj/project.pbxproj b/Kraken.xcodeproj/project.pbxproj index bcc36a2..e7d8483 100755 --- a/Kraken.xcodeproj/project.pbxproj +++ b/Kraken.xcodeproj/project.pbxproj @@ -596,7 +596,6 @@ E4F027CA16979CCD00D4427D /* KRAudioManager.h in Headers */ = {isa = PBXBuildFile; fileRef = E4F027C616979CCD00D4427D /* KRAudioManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; E4F027CF16979CE200D4427D /* KRAudioSample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4F027CC16979CE200D4427D /* KRAudioSample.cpp */; }; E4F027D116979CE200D4427D /* KRAudioSample.h in Headers */ = {isa = PBXBuildFile; fileRef = E4F027CD16979CE200D4427D /* KRAudioSample.h */; settings = {ATTRIBUTES = (Public, ); }; }; - E4F027D51697A02D00D4427D /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4F027D41697A02D00D4427D /* OpenAL.framework */; }; E4F027DF1697BFFF00D4427D /* KRAudioBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4F027DC1697BFFF00D4427D /* KRAudioBuffer.cpp */; }; E4F027E11697BFFF00D4427D /* KRAudioBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = E4F027DD1697BFFF00D4427D /* KRAudioBuffer.h */; settings = {ATTRIBUTES = (Public, ); }; }; E4F027F71698115600D4427D /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4F027F61698115600D4427D /* AudioToolbox.framework */; }; @@ -658,10 +657,10 @@ E416AA9B1671375C000F6786 /* KRAnimationCurveManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KRAnimationCurveManager.cpp; sourceTree = ""; }; E41AE1DD16B124CA00980428 /* font.tga */ = {isa = PBXFileReference; lastKnownFileType = file; path = font.tga; sourceTree = ""; }; E41B6BA716BE436100B510EB /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; }; - E41B6BA916BE437800B510EB /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreAudio.framework; sourceTree = DEVELOPER_DIR; }; + E41B6BA916BE437800B510EB /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreAudio.framework; sourceTree = DEVELOPER_DIR; }; E41CAB8B1B75D8DF00F3387D /* KrakenView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KrakenView.h; sourceTree = ""; }; E41CAB8C1B75D8DF00F3387D /* KrakenView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KrakenView.mm; sourceTree = ""; }; - E41CAB911B75DFF100F3387D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; }; + E41CAB911B75DFF100F3387D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; }; E423D7321BEDEE2D0021812E /* kraken.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = kraken.framework; sourceTree = BUILT_PRODUCTS_DIR; }; E423D7351BEDEFBF0021812E /* info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = info.plist; sourceTree = ""; }; E423D7371BEDF0310021812E /* Kraken-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Kraken-Prefix.pch"; sourceTree = ""; }; @@ -699,7 +698,7 @@ E450273816E0491D00FDEC5C /* KRReverbZone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = KRReverbZone.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; E45134B41746A4A300443C21 /* KRBehavior.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KRBehavior.cpp; sourceTree = ""; }; E45134B51746A4A300443C21 /* KRBehavior.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KRBehavior.h; sourceTree = ""; }; - E459040316C30CC5002B00A0 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/AudioUnit.framework; sourceTree = DEVELOPER_DIR; }; + E459040316C30CC5002B00A0 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AudioUnit.framework; sourceTree = DEVELOPER_DIR; }; E45C3C331EB2E5710053A9D2 /* KrakenView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KrakenView.h; sourceTree = ""; }; E45C3C341EB2E5710053A9D2 /* KrakenView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KrakenView.mm; sourceTree = ""; }; E45C3C381EB2F4A90053A9D2 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; @@ -725,7 +724,7 @@ E45E03CC18790EFF006DA23F /* forsyth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = forsyth.h; sourceTree = ""; }; E460292516681CFE00261BB9 /* KRTextureAnimated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KRTextureAnimated.h; sourceTree = ""; }; E460292716681D1000261BB9 /* KRTextureAnimated.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KRTextureAnimated.cpp; sourceTree = ""; }; - E460292916682BD900261BB9 /* libfbxsdk.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfbxsdk.a; path = "../../FBX SDK/2014.2/lib/ios-i386/release/libfbxsdk.a"; sourceTree = FBXSDK; }; + E460292916682BD900261BB9 /* libfbxsdk.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfbxsdk.a; path = "../../../../Applications/Autodesk/FBX SDK/2018.1.1/lib/clang/release/libfbxsdk.a"; sourceTree = FBXSDK; }; E461A151152E54B500F2044A /* KRLight.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KRLight.h; sourceTree = ""; }; E461A155152E54F700F2044A /* KRLight.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = KRLight.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; E461A157152E555400F2044A /* KRPointLight.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = KRPointLight.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; @@ -740,7 +739,7 @@ E46A6B6F1559EF0A000DBD37 /* KRResource+blend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "KRResource+blend.h"; sourceTree = ""; }; E46C214915364DDB009CABF3 /* KRSceneManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KRSceneManager.h; sourceTree = ""; }; E46C214A15364DEC009CABF3 /* KRSceneManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KRSceneManager.cpp; sourceTree = ""; }; - E46DBE7D1512AD4900D59F86 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = ../../../../MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; }; + E46DBE7D1512AD4900D59F86 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = ../../../../MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; }; E46DBE841512B9E200D59F86 /* KREngine-common.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "KREngine-common.h"; sourceTree = ""; }; E46F4A0A155E002100CCF8B8 /* KRDataBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KRDataBlock.h; sourceTree = ""; }; E46F4A0D155E003000CCF8B8 /* KRDataBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KRDataBlock.cpp; sourceTree = ""; }; @@ -803,8 +802,8 @@ E497B94C151BCF2500D3DC67 /* KRResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KRResource.cpp; sourceTree = ""; }; E497B94F151BD2CE00D3DC67 /* KRResource+obj.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "KRResource+obj.cpp"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; E497B952151BEDA600D3DC67 /* KRResource+fbx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "KRResource+fbx.cpp"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; - E497B95C151BF05F00D3DC67 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = ../../../../MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/CoreServices.framework; sourceTree = SDKROOT; }; - E497B95E151BF09600D3DC67 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = ../../../../MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; + E497B95C151BF05F00D3DC67 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = ../../../../MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework; sourceTree = SDKROOT; }; + E497B95E151BF09600D3DC67 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = ../../../../MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; E4AE635B1704FB0A00B460CD /* KRLODGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KRLODGroup.cpp; sourceTree = ""; }; E4AE635C1704FB0A00B460CD /* KRLODGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KRLODGroup.h; sourceTree = ""; }; E4B175AA161F5A1000B8FB80 /* KRTexture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KRTexture.cpp; sourceTree = ""; }; @@ -821,10 +820,10 @@ E4BBBB8B1512A40300F43B5B /* kraken-prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "kraken-prefix.pch"; sourceTree = ""; }; E4BBBB8C1512A40300F43B5B /* kraken.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = kraken.h; sourceTree = ""; }; E4BBBB8D1512A40300F43B5B /* kraken.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = kraken.mm; sourceTree = ""; }; - E4BBBB941512A45500F43B5B /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = ../../../../MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; - E4BBBB961512A46700F43B5B /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = ../../../../MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; - E4BBBB981512A47500F43B5B /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = ../../../../MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; - E4BBBB9A1512A48200F43B5B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = ../../../../MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + E4BBBB941512A45500F43B5B /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = ../../../../MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; + E4BBBB961512A46700F43B5B /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = ../../../../MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; + E4BBBB981512A47500F43B5B /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = ../../../../MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; + E4BBBB9A1512A48200F43B5B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = ../../../../MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; E4C454AB167BB8EC003586CD /* KRMeshCube.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KRMeshCube.h; sourceTree = ""; }; E4C454AE167BB8FC003586CD /* KRMeshCube.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = KRMeshCube.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; E4C454B1167BC04B003586CD /* KRMeshSphere.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = KRMeshSphere.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; @@ -840,7 +839,7 @@ E4CA10EB1637BD47005D9400 /* KRTextureTGA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KRTextureTGA.h; sourceTree = ""; }; E4CA10EE1637BD58005D9400 /* KRTextureTGA.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KRTextureTGA.cpp; sourceTree = ""; }; E4CA10F51638BCAE005D9400 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; - E4CA10F71638BCBB005D9400 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Accelerate.framework; sourceTree = DEVELOPER_DIR; }; + E4CA10F71638BCBB005D9400 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework; sourceTree = DEVELOPER_DIR; }; E4CA11731639CBD1005D9400 /* KRViewport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KRViewport.h; sourceTree = ""; }; E4CA11771639CC8E005D9400 /* KRViewport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KRViewport.cpp; sourceTree = ""; }; E4CE184815FEEDA200F80870 /* font.pvr */ = {isa = PBXFileReference; lastKnownFileType = file; path = font.pvr; sourceTree = ""; }; @@ -911,10 +910,9 @@ E4F027CC16979CE200D4427D /* KRAudioSample.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = KRAudioSample.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; E4F027CD16979CE200D4427D /* KRAudioSample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = KRAudioSample.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; E4F027D21697A01300D4427D /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; }; - E4F027D41697A02D00D4427D /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = ../../../../MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; }; E4F027DC1697BFFF00D4427D /* KRAudioBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = KRAudioBuffer.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; E4F027DD1697BFFF00D4427D /* KRAudioBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = KRAudioBuffer.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - E4F027F61698115600D4427D /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/AudioToolbox.framework; sourceTree = DEVELOPER_DIR; }; + E4F027F61698115600D4427D /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AudioToolbox.framework; sourceTree = DEVELOPER_DIR; }; E4F027F91698116000D4427D /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; E4F89BB218A6DB1200015637 /* KRTriangle3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KRTriangle3.cpp; sourceTree = ""; }; E4F89BB318A6DB1200015637 /* KRTriangle3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KRTriangle3.h; sourceTree = ""; }; @@ -967,7 +965,6 @@ E459040416C30CC5002B00A0 /* AudioUnit.framework in Frameworks */, E41B6BAA16BE437800B510EB /* CoreAudio.framework in Frameworks */, E4F027F71698115600D4427D /* AudioToolbox.framework in Frameworks */, - E4F027D51697A02D00D4427D /* OpenAL.framework in Frameworks */, E4CA10F81638BCBB005D9400 /* Accelerate.framework in Frameworks */, E4BBBB9C1512A4A900F43B5B /* Foundation.framework in Frameworks */, E4BBBB9D1512A4AC00F43B5B /* CoreData.framework in Frameworks */, @@ -1426,6 +1423,7 @@ E4C8E4F616B9B2E20031DDCB /* kraken_standard_assets_osx */, E48C528519C570C50062E439 /* krakenTests */, E491016213C99B9E0098455B /* Products */, + E4BC99271F2571D300562AE6 /* Frameworks */, ); sourceTree = ""; }; @@ -1518,7 +1516,6 @@ E460292916682BD900261BB9 /* libfbxsdk.a */, E4BBBB9A1512A48200F43B5B /* Foundation.framework */, E46DBE7D1512AD4900D59F86 /* OpenGL.framework */, - E4F027D41697A02D00D4427D /* OpenAL.framework */, E4F027F61698115600D4427D /* AudioToolbox.framework */, E4CA10F71638BCBB005D9400 /* Accelerate.framework */, E497B95E151BF09600D3DC67 /* SystemConfiguration.framework */, @@ -1531,6 +1528,13 @@ path = ..; sourceTree = ""; }; + E4BC99271F2571D300562AE6 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; E4C8E4E616B9B2D50031DDCB /* kraken_standard_assets_ios */ = { isa = PBXGroup; children = ( @@ -2510,7 +2514,7 @@ INFOPLIST_FILE = kraken_tvos/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - LIBRARY_SEARCH_PATHS = "\"$(SYSTEM_APPS_DIR)/Autodesk/FBX SDK/2014.2/lib/ios-armv7/debug\""; + LIBRARY_SEARCH_PATHS = "\"$(SYSTEM_APPS_DIR)/Autodesk/FBX SDK/2018.1/lib/ios-armv7/debug\""; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = NO; PRODUCT_BUNDLE_IDENTIFIER = com.krakenengine.kraken; @@ -2554,7 +2558,7 @@ INFOPLIST_FILE = kraken_tvos/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - LIBRARY_SEARCH_PATHS = "\"$(SYSTEM_APPS_DIR)/Autodesk/FBX SDK/2014.2/lib/ios-armv7/release\""; + LIBRARY_SEARCH_PATHS = "\"$(SYSTEM_APPS_DIR)/Autodesk/FBX SDK/2018.1/lib/ios-armv7/release\""; MTL_ENABLE_DEBUG_INFO = NO; ONLY_ACTIVE_ARCH = NO; PRODUCT_BUNDLE_IDENTIFIER = com.krakenengine.kraken; @@ -2603,7 +2607,7 @@ INFOPLIST_FILE = kraken_ios/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - LIBRARY_SEARCH_PATHS = "\"$(SYSTEM_APPS_DIR)/Autodesk/FBX SDK/2014.2/lib/ios-armv7/debug\""; + LIBRARY_SEARCH_PATHS = "\"$(SYSTEM_APPS_DIR)/Autodesk/FBX SDK/2018.1/lib/ios-armv7/debug\""; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = NO; PRODUCT_BUNDLE_IDENTIFIER = com.krakenengine.kraken; @@ -2647,7 +2651,7 @@ INFOPLIST_FILE = kraken_ios/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - LIBRARY_SEARCH_PATHS = "\"$(SYSTEM_APPS_DIR)/Autodesk/FBX SDK/2014.2/lib/ios-armv7/release\""; + LIBRARY_SEARCH_PATHS = "\"$(SYSTEM_APPS_DIR)/Autodesk/FBX SDK/2018.1/lib/ios-armv7/release\""; MTL_ENABLE_DEBUG_INFO = NO; ONLY_ACTIVE_ARCH = NO; PRODUCT_BUNDLE_IDENTIFIER = com.krakenengine.kraken; @@ -2841,14 +2845,14 @@ GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; HEADER_SEARCH_PATHS = ( - "\"/Applications/Autodesk/FBX SDK/2014.2/include\"", + "\"/Applications/Autodesk/FBX SDK/2018.1/include\"/**", /usr/local/include, ); INFOPLIST_FILE = "kraken_osx/Kraken-Info.plist"; LD_DYLIB_INSTALL_NAME = "@rpath/${EXECUTABLE_PATH}"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - "\"$(SYSTEM_APPS_DIR)/Autodesk/FBX SDK/2014.2/lib/ios-i386/release\"", + "\"$(SYSTEM_APPS_DIR)/Autodesk/FBX SDK/2018.1/lib/clang/release\"", "\"$(SYSTEM_APPS_DIR)/Imagination/PowerVR/GraphicsSDK/PVRTexTool/Library/OSX_x86/Static\"", ); MACOSX_DEPLOYMENT_TARGET = 10.7; @@ -2856,7 +2860,7 @@ OTHER_LDFLAGS = "-ObjC"; PRODUCT_BUNDLE_IDENTIFIER = com.krakenengine.kraken; PRODUCT_NAME = kraken; - SDKROOT = macosx; + SDKROOT = macosx10.13; SHARED_PRECOMPS_DIR = "$(CACHE_ROOT)/SharedPrecompiledHeaders_osx"; WRAPPER_EXTENSION = framework; }; @@ -2884,14 +2888,14 @@ GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; HEADER_SEARCH_PATHS = ( - "\"/Applications/Autodesk/FBX SDK/2014.2/include\"", + "\"/Applications/Autodesk/FBX SDK/2018.1/include\"/**", /usr/local/include, ); INFOPLIST_FILE = "kraken_osx/Kraken-Info.plist"; LD_DYLIB_INSTALL_NAME = "@rpath/${EXECUTABLE_PATH}"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - "\"$(SYSTEM_APPS_DIR)/Autodesk/FBX SDK/2014.2/lib/ios-i386/release\"", + "\"$(SYSTEM_APPS_DIR)/Autodesk/FBX SDK/2018.1/lib/clang/release\"", "\"$(SYSTEM_APPS_DIR)/Imagination/PowerVR/GraphicsSDK/PVRTexTool/Library/OSX_x86/Static\"", ); MACOSX_DEPLOYMENT_TARGET = 10.7; @@ -2899,7 +2903,7 @@ OTHER_LDFLAGS = "-ObjC"; PRODUCT_BUNDLE_IDENTIFIER = com.krakenengine.kraken; PRODUCT_NAME = kraken; - SDKROOT = macosx; + SDKROOT = macosx10.13; SHARED_PRECOMPS_DIR = "$(CACHE_ROOT)/SharedPrecompiledHeaders_osx"; WRAPPER_EXTENSION = framework; }; diff --git a/kraken/KRContext_osx.mm b/kraken/KRContext_osx.mm index 80baebe..5ba2377 100755 --- a/kraken/KRContext_osx.mm +++ b/kraken/KRContext_osx.mm @@ -15,8 +15,8 @@ NSOpenGLContext *gRenderContext = nil; void KRContext::destroyDeviceContexts() { - [gStreamerContext release]; - [gRenderContext release]; + gStreamerContext = nil; + gRenderContext = nil; } void KRContext::createDeviceContexts() @@ -79,4 +79,4 @@ void KRContext::attachToView(void *view) NSView *v = (NSView *)view; [gRenderContext setView: v]; [gRenderContext update]; -} \ No newline at end of file +} diff --git a/kraken/KREngine-common.h b/kraken/KREngine-common.h index 99bac61..f475fa2 100755 --- a/kraken/KREngine-common.h +++ b/kraken/KREngine-common.h @@ -88,6 +88,7 @@ using std::queue; #include #include #include +#include #define KRAKEN_HAVE_BLAS 1 #endif diff --git a/kraken/KRResource+fbx.cpp b/kraken/KRResource+fbx.cpp index d84192f..6b9c852 100755 --- a/kraken/KRResource+fbx.cpp +++ b/kraken/KRResource+fbx.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include "fbxsdk.h" #include "KRResource.h" diff --git a/kraken_osx/KrakenView.mm b/kraken_osx/KrakenView.mm index 4e3166a..1833475 100755 --- a/kraken_osx/KrakenView.mm +++ b/kraken_osx/KrakenView.mm @@ -28,8 +28,6 @@ - (void)dealloc { CVDisplayLinkRelease(displayLink); - - [super dealloc]; } From f8e11fc72463a4377ddd2cf214130cfcdcde5c68 Mon Sep 17 00:00:00 2001 From: Kearwood Gilbert Date: Sun, 5 Nov 2017 17:51:13 -0800 Subject: [PATCH 3/9] Remove AppKit include from KREngine-common.h to fix CMake builds --- kraken/KREngine-common.h | 1 - 1 file changed, 1 deletion(-) diff --git a/kraken/KREngine-common.h b/kraken/KREngine-common.h index 58dc0de..4c1a665 100755 --- a/kraken/KREngine-common.h +++ b/kraken/KREngine-common.h @@ -85,7 +85,6 @@ using std::queue; #include #include #include -#include #define KRAKEN_HAVE_BLAS 1 #endif From 7e38a4c31118251e2bc910108bd88d4574ccc7b7 Mon Sep 17 00:00:00 2001 From: Kearwood Gilbert Date: Sun, 5 Nov 2017 19:14:29 -0800 Subject: [PATCH 4/9] Added more files to CMakeLists. Replaced KRHitInfo references with hitinfo. Updated AudioUnitSampleType to always use floats as the Canonical types have been deprecated. Int audio types no longer needed for ios. --- Kraken.xcodeproj/project.pbxproj | 32 ++++++++--------- kraken/CMakeLists.txt | 9 +++++ kraken/KRAnimationAttribute.cpp | 3 ++ kraken/KRAudioManager.cpp | 57 +++++-------------------------- kraken/KRCollider.cpp | 20 +++++------ kraken/KRCollider.h | 6 ++-- kraken/KRMesh.cpp | 16 ++++----- kraken/KROctree.cpp | 8 ++--- kraken/KROctreeNode.cpp | 6 ++-- kraken/KRScene.cpp | 6 ++-- kraken/public/hitinfo.h | 2 +- kraken_win/kraken.vcxproj | 4 +-- kraken_win/kraken.vcxproj.filters | 4 +-- 13 files changed, 73 insertions(+), 100 deletions(-) diff --git a/Kraken.xcodeproj/project.pbxproj b/Kraken.xcodeproj/project.pbxproj index e7d8483..e389bb9 100755 --- a/Kraken.xcodeproj/project.pbxproj +++ b/Kraken.xcodeproj/project.pbxproj @@ -96,7 +96,7 @@ E4159B8419C5760800622D1E /* KRDataBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = E46F4A0A155E002100CCF8B8 /* KRDataBlock.h */; settings = {ATTRIBUTES = (Public, ); }; }; E4159B8519C5760800622D1E /* KREngine-common.h in Headers */ = {isa = PBXBuildFile; fileRef = E46DBE841512B9E200D59F86 /* KREngine-common.h */; settings = {ATTRIBUTES = (Public, ); }; }; E4159B8619C5760800622D1E /* KREngine.h in Headers */ = {isa = PBXBuildFile; fileRef = E491017213C99BDC0098455B /* KREngine.h */; settings = {ATTRIBUTES = (Public, ); }; }; - E4159B8719C5760800622D1E /* KRHitInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = E4C454B7167BD235003586CD /* KRHitInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E4159B8719C5760800622D1E /* HitInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = E4C454B7167BD235003586CD /* HitInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; E4159B8819C5760800622D1E /* KROctree.h in Headers */ = {isa = PBXBuildFile; fileRef = E4924C2515EE95E800B965C6 /* KROctree.h */; settings = {ATTRIBUTES = (Public, ); }; }; E4159B8919C5760800622D1E /* KROctreeNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E4924C2A15EE96AA00B965C6 /* KROctreeNode.h */; settings = {ATTRIBUTES = (Public, ); }; }; E4159B8A19C5760900622D1E /* KRRenderSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = E44F38231683B22C00399B5D /* KRRenderSettings.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -170,7 +170,7 @@ E4159BCE19C5762F00622D1E /* KRContextObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E43B0AD415DDCA0C00A5CB9F /* KRContextObject.cpp */; }; E4159BCF19C5762F00622D1E /* KRDataBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E46F4A0D155E003000CCF8B8 /* KRDataBlock.cpp */; }; E4159BD019C5762F00622D1E /* KREngine.mm in Sources */ = {isa = PBXBuildFile; fileRef = E491016F13C99BDC0098455B /* KREngine.mm */; }; - E4159BD119C5762F00622D1E /* KRHitInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4C454BA167BD248003586CD /* KRHitInfo.cpp */; }; + E4159BD119C5762F00622D1E /* HitInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4C454BA167BD248003586CD /* HitInfo.cpp */; }; E4159BD219C5762F00622D1E /* KROctree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4924C2415EE95E700B965C6 /* KROctree.cpp */; }; E4159BD319C5762F00622D1E /* KROctreeNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4924C2915EE96AA00B965C6 /* KROctreeNode.cpp */; }; E4159BD419C5762F00622D1E /* KRRenderSettings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E44F38271683B24400399B5D /* KRRenderSettings.cpp */; }; @@ -251,7 +251,7 @@ E423D6D11BEDEE2D0021812E /* KRContextObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E43B0AD415DDCA0C00A5CB9F /* KRContextObject.cpp */; }; E423D6D21BEDEE2D0021812E /* KRDataBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E46F4A0D155E003000CCF8B8 /* KRDataBlock.cpp */; }; E423D6D31BEDEE2D0021812E /* KREngine.mm in Sources */ = {isa = PBXBuildFile; fileRef = E491016F13C99BDC0098455B /* KREngine.mm */; }; - E423D6D41BEDEE2D0021812E /* KRHitInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4C454BA167BD248003586CD /* KRHitInfo.cpp */; }; + E423D6D41BEDEE2D0021812E /* HitInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4C454BA167BD248003586CD /* HitInfo.cpp */; }; E423D6D51BEDEE2D0021812E /* KROctree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4924C2415EE95E700B965C6 /* KROctree.cpp */; }; E423D6D61BEDEE2D0021812E /* KROctreeNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4924C2915EE96AA00B965C6 /* KROctreeNode.cpp */; }; E423D6D71BEDEE2D0021812E /* KRRenderSettings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E44F38271683B24400399B5D /* KRRenderSettings.cpp */; }; @@ -330,7 +330,7 @@ E423D7231BEDEE2D0021812E /* KRDataBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = E46F4A0A155E002100CCF8B8 /* KRDataBlock.h */; settings = {ATTRIBUTES = (Public, ); }; }; E423D7241BEDEE2D0021812E /* KREngine-common.h in Headers */ = {isa = PBXBuildFile; fileRef = E46DBE841512B9E200D59F86 /* KREngine-common.h */; settings = {ATTRIBUTES = (Public, ); }; }; E423D7251BEDEE2D0021812E /* KREngine.h in Headers */ = {isa = PBXBuildFile; fileRef = E491017213C99BDC0098455B /* KREngine.h */; settings = {ATTRIBUTES = (Public, ); }; }; - E423D7261BEDEE2D0021812E /* KRHitInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = E4C454B7167BD235003586CD /* KRHitInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E423D7261BEDEE2D0021812E /* HitInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = E4C454B7167BD235003586CD /* HitInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; E423D7271BEDEE2D0021812E /* KROctree.h in Headers */ = {isa = PBXBuildFile; fileRef = E4924C2515EE95E800B965C6 /* KROctree.h */; settings = {ATTRIBUTES = (Public, ); }; }; E423D7281BEDEE2D0021812E /* KROctreeNode.h in Headers */ = {isa = PBXBuildFile; fileRef = E4924C2A15EE96AA00B965C6 /* KROctreeNode.h */; settings = {ATTRIBUTES = (Public, ); }; }; E423D7291BEDEE2D0021812E /* KRRenderSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = E44F38231683B22C00399B5D /* KRRenderSettings.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -516,8 +516,8 @@ E4C454B0167BB8FC003586CD /* KRMeshCube.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4C454AE167BB8FC003586CD /* KRMeshCube.cpp */; }; E4C454B3167BC04C003586CD /* KRMeshSphere.h in Headers */ = {isa = PBXBuildFile; fileRef = E4C454B1167BC04B003586CD /* KRMeshSphere.h */; settings = {ATTRIBUTES = (Public, ); }; }; E4C454B6167BC05C003586CD /* KRMeshSphere.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4C454B4167BC05C003586CD /* KRMeshSphere.cpp */; }; - E4C454B9167BD236003586CD /* KRHitInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = E4C454B7167BD235003586CD /* KRHitInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; - E4C454BC167BD248003586CD /* KRHitInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4C454BA167BD248003586CD /* KRHitInfo.cpp */; }; + E4C454B9167BD236003586CD /* HitInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = E4C454B7167BD235003586CD /* HitInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E4C454BC167BD248003586CD /* HitInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4C454BA167BD248003586CD /* HitInfo.cpp */; }; E4CA10E61637BD0A005D9400 /* KRTexturePVR.h in Headers */ = {isa = PBXBuildFile; fileRef = E4CA10E41637BD0A005D9400 /* KRTexturePVR.h */; settings = {ATTRIBUTES = (Public, ); }; }; E4CA10EA1637BD2B005D9400 /* KRTexturePVR.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4CA10E81637BD2B005D9400 /* KRTexturePVR.cpp */; }; E4CA10ED1637BD47005D9400 /* KRTextureTGA.h in Headers */ = {isa = PBXBuildFile; fileRef = E4CA10EB1637BD47005D9400 /* KRTextureTGA.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -828,8 +828,8 @@ E4C454AE167BB8FC003586CD /* KRMeshCube.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = KRMeshCube.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; E4C454B1167BC04B003586CD /* KRMeshSphere.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = KRMeshSphere.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; E4C454B4167BC05C003586CD /* KRMeshSphere.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = KRMeshSphere.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; - E4C454B7167BD235003586CD /* KRHitInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KRHitInfo.h; sourceTree = ""; }; - E4C454BA167BD248003586CD /* KRHitInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KRHitInfo.cpp; sourceTree = ""; }; + E4C454B7167BD235003586CD /* HitInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HitInfo.h; sourceTree = ""; }; + E4C454BA167BD248003586CD /* HitInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HitInfo.cpp; sourceTree = ""; }; E4C8E4E416B9B2D50031DDCB /* kraken_standard_assets_ios.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = kraken_standard_assets_ios.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; E4C8E4E816B9B2D50031DDCB /* Resources-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Resources-Info.plist"; sourceTree = ""; }; E4C8E4F416B9B2E20031DDCB /* kraken_standard_assets_osx.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = kraken_standard_assets_osx.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -1459,8 +1459,8 @@ E46DBE841512B9E200D59F86 /* KREngine-common.h */, E491017213C99BDC0098455B /* KREngine.h */, E491016F13C99BDC0098455B /* KREngine.mm */, - E4C454BA167BD248003586CD /* KRHitInfo.cpp */, - E4C454B7167BD235003586CD /* KRHitInfo.h */, + E4C454BA167BD248003586CD /* HitInfo.cpp */, + E4C454B7167BD235003586CD /* HitInfo.h */, E4924C2415EE95E700B965C6 /* KROctree.cpp */, E4924C2515EE95E800B965C6 /* KROctree.h */, E4924C2915EE96AA00B965C6 /* KROctreeNode.cpp */, @@ -1698,7 +1698,7 @@ E423D7231BEDEE2D0021812E /* KRDataBlock.h in Headers */, E423D7241BEDEE2D0021812E /* KREngine-common.h in Headers */, E423D7251BEDEE2D0021812E /* KREngine.h in Headers */, - E423D7261BEDEE2D0021812E /* KRHitInfo.h in Headers */, + E423D7261BEDEE2D0021812E /* HitInfo.h in Headers */, E423D7271BEDEE2D0021812E /* KROctree.h in Headers */, E423D7281BEDEE2D0021812E /* KROctreeNode.h in Headers */, E423D7291BEDEE2D0021812E /* KRRenderSettings.h in Headers */, @@ -1781,7 +1781,7 @@ E4159B8419C5760800622D1E /* KRDataBlock.h in Headers */, E4159B8519C5760800622D1E /* KREngine-common.h in Headers */, E4159B8619C5760800622D1E /* KREngine.h in Headers */, - E4159B8719C5760800622D1E /* KRHitInfo.h in Headers */, + E4159B8719C5760800622D1E /* HitInfo.h in Headers */, E4159B8819C5760800622D1E /* KROctree.h in Headers */, E4159B8919C5760800622D1E /* KROctreeNode.h in Headers */, E4159B8A19C5760900622D1E /* KRRenderSettings.h in Headers */, @@ -1845,7 +1845,7 @@ E4CA11751639CBD6005D9400 /* KRViewport.h in Headers */, E461A15D152E563100F2044A /* KRDirectionalLight.h in Headers */, E461A169152E570700F2044A /* KRSpotLight.h in Headers */, - E4C454B9167BD236003586CD /* KRHitInfo.h in Headers */, + E4C454B9167BD236003586CD /* HitInfo.h in Headers */, E4324BA516444C0D0043185B /* KRParticleSystem.h in Headers */, E4324BAC16444DEF0043185B /* KRParticleSystemNewtonian.h in Headers */, E4C454AD167BB8EC003586CD /* KRMeshCube.h in Headers */, @@ -2262,7 +2262,7 @@ E423D6D11BEDEE2D0021812E /* KRContextObject.cpp in Sources */, E423D6D21BEDEE2D0021812E /* KRDataBlock.cpp in Sources */, E423D6D31BEDEE2D0021812E /* KREngine.mm in Sources */, - E423D6D41BEDEE2D0021812E /* KRHitInfo.cpp in Sources */, + E423D6D41BEDEE2D0021812E /* HitInfo.cpp in Sources */, E423D6D51BEDEE2D0021812E /* KROctree.cpp in Sources */, E423D6D61BEDEE2D0021812E /* KROctreeNode.cpp in Sources */, E423D6D71BEDEE2D0021812E /* KRRenderSettings.cpp in Sources */, @@ -2346,7 +2346,7 @@ E48A54FB1EFBB61C00C12516 /* KRDSP_vDSP.cpp in Sources */, E4159BCF19C5762F00622D1E /* KRDataBlock.cpp in Sources */, E4159BD019C5762F00622D1E /* KREngine.mm in Sources */, - E4159BD119C5762F00622D1E /* KRHitInfo.cpp in Sources */, + E4159BD119C5762F00622D1E /* HitInfo.cpp in Sources */, E4159BD219C5762F00622D1E /* KROctree.cpp in Sources */, E4159BD319C5762F00622D1E /* KROctreeNode.cpp in Sources */, E4159BD419C5762F00622D1E /* KRRenderSettings.cpp in Sources */, @@ -2431,7 +2431,7 @@ E43F70E61824D9AB00136169 /* KRStreamer.mm in Sources */, E4C454B0167BB8FC003586CD /* KRMeshCube.cpp in Sources */, E4C454B6167BC05C003586CD /* KRMeshSphere.cpp in Sources */, - E4C454BC167BD248003586CD /* KRHitInfo.cpp in Sources */, + E4C454BC167BD248003586CD /* HitInfo.cpp in Sources */, E44F38291683B24800399B5D /* KRRenderSettings.cpp in Sources */, E414F9A71694D977000B3D58 /* KRUnknownManager.cpp in Sources */, E414F9AD1694DA37000B3D58 /* KRUnknown.cpp in Sources */, diff --git a/kraken/CMakeLists.txt b/kraken/CMakeLists.txt index 05d0a68..3f62459 100644 --- a/kraken/CMakeLists.txt +++ b/kraken/CMakeLists.txt @@ -13,4 +13,13 @@ add_sources(aabb.cpp) add_sources(hitinfo.cpp) # Private Implementation +add_sources(KRAmbientZone.cpp) +add_sources(KRAnimation.cpp) +add_sources(KRAnimationAttribute.cpp) +add_sources(KRAnimationCurve.cpp) +add_sources(KRAnimationCurveManager.cpp) +add_sources(KRAnimationLayer.cpp) +add_sources(KRAnimationManager.cpp) +add_sources(KRAudioBuffer.cpp) +add_sources(KRAudioManager.cpp) add_sources(KRDataBlock.cpp) diff --git a/kraken/KRAnimationAttribute.cpp b/kraken/KRAnimationAttribute.cpp index f2ecebe..3ae0952 100755 --- a/kraken/KRAnimationAttribute.cpp +++ b/kraken/KRAnimationAttribute.cpp @@ -140,6 +140,9 @@ tinyxml2::XMLElement *KRAnimationAttribute::saveXML( tinyxml2::XMLNode *parent) case KRNode::KRENGINE_NODE_SCALE_OFFSET_Z: szAttribute = "scale_offset_z"; break; + case KRNode::KRENGINE_NODE_ATTRIBUTE_COUNT: + // Suppress warning + break; } e->SetAttribute("attribute", szAttribute); diff --git a/kraken/KRAudioManager.cpp b/kraken/KRAudioManager.cpp index 879bcbd..8634529 100755 --- a/kraken/KRAudioManager.cpp +++ b/kraken/KRAudioManager.cpp @@ -144,8 +144,8 @@ void KRAudioManager::setListenerScene(KRScene *scene) void KRAudioManager::renderAudio(UInt32 inNumberFrames, AudioBufferList *ioData) { // uint64_t start_time = mach_absolute_time(); - AudioUnitSampleType *outA = (AudioUnitSampleType *)ioData->mBuffers[0].mData; - AudioUnitSampleType *outB = (AudioUnitSampleType *)ioData->mBuffers[1].mData; // Non-Interleaved only + Float32 *outA = (Float32 *)ioData->mBuffers[0].mData; + Float32 *outB = (Float32 *)ioData->mBuffers[1].mData; // Non-Interleaved only int output_frame = 0; @@ -168,16 +168,6 @@ void KRAudioManager::renderAudio(UInt32 inNumberFrames, AudioBufferList *ioData) float right_channel = block_data[m_output_sample * KRENGINE_MAX_OUTPUT_CHANNELS + 1]; m_output_sample++; -#if CA_PREFER_FIXED_POINT - // Interleaved - // outA[i*2] = (SInt16)(left_channel * 32767.0f); - // outA[i*2 + 1] = (SInt16)(right_channel * 32767.0f); - - // Non-Interleaved - outA[output_frame] = (SInt32)(left_channel * 0x1000000f); - outB[output_frame] = (SInt32)(right_channel * 0x1000000f); -#else - // Interleaved // outA[i*2] = (Float32)left_channel; // outA[i*2 + 1] = (Float32)right_channel; @@ -185,7 +175,6 @@ void KRAudioManager::renderAudio(UInt32 inNumberFrames, AudioBufferList *ioData) // Non-Interleaved outA[output_frame] = (Float32)left_channel; outB[output_frame] = (Float32)right_channel; -#endif output_frame++; } } @@ -417,18 +406,14 @@ OSStatus KRAudioManager::renderInput(void *inRefCon, AudioUnitRenderActionFlags void KRSetAUCanonical(AudioStreamBasicDescription &desc, UInt32 nChannels, bool interleaved) { desc.mFormatID = kAudioFormatLinearPCM; -#if CA_PREFER_FIXED_POINT - desc.mFormatFlags = kAudioFormatFlagsCanonical | (kAudioUnitSampleFractionBits << kLinearPCMFormatFlagsSampleFractionShift); -#else - desc.mFormatFlags = kAudioFormatFlagsCanonical; -#endif + desc.mFormatFlags = kAudioFormatFlagsNativeFloatPacked; desc.mChannelsPerFrame = nChannels; desc.mFramesPerPacket = 1; - desc.mBitsPerChannel = 8 * sizeof(AudioUnitSampleType); + desc.mBitsPerChannel = 8 * sizeof(Float32); if (interleaved) - desc.mBytesPerPacket = desc.mBytesPerFrame = nChannels * sizeof(AudioUnitSampleType); + desc.mBytesPerPacket = desc.mBytesPerFrame = nChannels * sizeof(Float32); else { - desc.mBytesPerPacket = desc.mBytesPerFrame = sizeof(AudioUnitSampleType); + desc.mBytesPerPacket = desc.mBytesPerFrame = sizeof(Float32); desc.mFormatFlags |= kAudioFormatFlagIsNonInterleaved; } } @@ -1128,8 +1113,6 @@ void KRAudioManager::initAudio() &size)); // ---- - // AUCanonical on the iPhone is the 8.24 integer format that is native to the iPhone. - KRSetAUCanonical(desc, 2, false); desc.mSampleRate = 44100.0f; @@ -1487,7 +1470,7 @@ void KRAudioManager::startFrame(float deltaTime) if(source->getEnableOcclusion() && /* FINDME!! DISABLES CODE */ (false)) { - KRHitInfo hitinfo; + HitInfo hitinfo; if(source->getScene().lineCast(m_listener_position, source_world_position, hitinfo, KRAKEN_COLLIDER_AUDIO)) { gain = 0.0f; } @@ -1709,23 +1692,13 @@ void KRAudioManager::renderITD() // Get a pointer to the dataBuffer of the AudioBufferList - AudioUnitSampleType *outA = (AudioUnitSampleType *)ioData->mBuffers[0].mData; - AudioUnitSampleType *outB = (AudioUnitSampleType *)ioData->mBuffers[1].mData; // Non-Interleaved only + Float32 *outA = (Float32 *)ioData->mBuffers[0].mData; + Float32 *outB = (Float32 *)ioData->mBuffers[1].mData; // Non-Interleaved only // ----====---- Zero out accumulation / output buffer ----====---- for (UInt32 i = 0; i < inNumberFrames; ++i) { - #if CA_PREFER_FIXED_POINT - // Interleaved - // outA[i*2] = (SInt16)(left_channel * 32767.0f); - // outA[i*2 + 1] = (SInt16)(right_channel * 32767.0f); - - // Non-Interleaved - outA[i] = (SInt32)(0x1000000f); - outB[i] = (SInt32)(0x1000000f); - #else - // Interleaved // outA[i*2] = (Float32)left_channel; // outA[i*2 + 1] = (Float32)right_channel; @@ -1733,7 +1706,6 @@ void KRAudioManager::renderITD() // Non-Interleaved outA[i] = (Float32)0.0f; outB[i] = (Float32)0.0f; - #endif } // ----====---- Render direct / HRTF audio ----====---- @@ -1768,16 +1740,6 @@ void KRAudioManager::renderITD() // left_channel = 0.0f; // right_channel = 0.0f; - #if CA_PREFER_FIXED_POINT - // Interleaved - // outA[i*2] = (SInt16)(left_channel * 32767.0f); - // outA[i*2 + 1] = (SInt16)(right_channel * 32767.0f); - - // Non-Interleaved - outA[i] += (SInt32)(left_channel * 0x1000000f); - outB[i] += (SInt32)(right_channel * 0x1000000f); - #else - // Interleaved // outA[i*2] = (Float32)left_channel; // outA[i*2 + 1] = (Float32)right_channel; @@ -1785,7 +1747,6 @@ void KRAudioManager::renderITD() // Non-Interleaved outA[i] += (Float32)left_channel; outB[i] += (Float32)right_channel; - #endif sample_frame++; } } diff --git a/kraken/KRCollider.cpp b/kraken/KRCollider.cpp index db28abe..bebcd70 100755 --- a/kraken/KRCollider.cpp +++ b/kraken/KRCollider.cpp @@ -92,7 +92,7 @@ AABB KRCollider::getBounds() { } } -bool KRCollider::lineCast(const Vector3 &v0, const Vector3 &v1, KRHitInfo &hitinfo, unsigned int layer_mask) +bool KRCollider::lineCast(const Vector3 &v0, const Vector3 &v1, HitInfo &hitinfo, unsigned int layer_mask) { if(layer_mask & m_layer_mask ) { // Only test if layer masks have a common bit set loadModel(); @@ -100,15 +100,15 @@ bool KRCollider::lineCast(const Vector3 &v0, const Vector3 &v1, KRHitInfo &hitin if(getBounds().intersectsLine(v0, v1)) { Vector3 v0_model_space = Matrix4::Dot(getInverseModelMatrix(), v0); Vector3 v1_model_space = Matrix4::Dot(getInverseModelMatrix(), v1); - KRHitInfo hitinfo_model_space; + HitInfo hitinfo_model_space; if(hitinfo.didHit()) { Vector3 hit_position_model_space = Matrix4::Dot(getInverseModelMatrix(), hitinfo.getPosition()); - hitinfo_model_space = KRHitInfo(hit_position_model_space, Matrix4::DotNoTranslate(getInverseModelMatrix(), hitinfo.getNormal()), (hit_position_model_space - v0_model_space).magnitude(), hitinfo.getNode()); + hitinfo_model_space = HitInfo(hit_position_model_space, Matrix4::DotNoTranslate(getInverseModelMatrix(), hitinfo.getNormal()), (hit_position_model_space - v0_model_space).magnitude(), hitinfo.getNode()); } if(m_models[0]->lineCast(v0_model_space, v1_model_space, hitinfo_model_space)) { Vector3 hit_position_world_space = Matrix4::Dot(getModelMatrix(), hitinfo_model_space.getPosition()); - hitinfo = KRHitInfo(hit_position_world_space, Vector3::Normalize(Matrix4::DotNoTranslate(getModelMatrix(), hitinfo_model_space.getNormal())), (hit_position_world_space - v0).magnitude(), this); + hitinfo = HitInfo(hit_position_world_space, Vector3::Normalize(Matrix4::DotNoTranslate(getModelMatrix(), hitinfo_model_space.getNormal())), (hit_position_world_space - v0).magnitude(), this); return true; } } @@ -117,7 +117,7 @@ bool KRCollider::lineCast(const Vector3 &v0, const Vector3 &v1, KRHitInfo &hitin return false; } -bool KRCollider::rayCast(const Vector3 &v0, const Vector3 &dir, KRHitInfo &hitinfo, unsigned int layer_mask) +bool KRCollider::rayCast(const Vector3 &v0, const Vector3 &dir, HitInfo &hitinfo, unsigned int layer_mask) { if(layer_mask & m_layer_mask) { // Only test if layer masks have a common bit set loadModel(); @@ -125,15 +125,15 @@ bool KRCollider::rayCast(const Vector3 &v0, const Vector3 &dir, KRHitInfo &hitin if(getBounds().intersectsRay(v0, dir)) { Vector3 v0_model_space = Matrix4::Dot(getInverseModelMatrix(), v0); Vector3 dir_model_space = Vector3::Normalize(Matrix4::DotNoTranslate(getInverseModelMatrix(), dir)); - KRHitInfo hitinfo_model_space; + HitInfo hitinfo_model_space; if(hitinfo.didHit()) { Vector3 hit_position_model_space = Matrix4::Dot(getInverseModelMatrix(), hitinfo.getPosition()); - hitinfo_model_space = KRHitInfo(hit_position_model_space, Vector3::Normalize(Matrix4::DotNoTranslate(getInverseModelMatrix(), hitinfo.getNormal())), (hit_position_model_space - v0_model_space).magnitude(), hitinfo.getNode()); + hitinfo_model_space = HitInfo(hit_position_model_space, Vector3::Normalize(Matrix4::DotNoTranslate(getInverseModelMatrix(), hitinfo.getNormal())), (hit_position_model_space - v0_model_space).magnitude(), hitinfo.getNode()); } if(m_models[0]->rayCast(v0_model_space, dir_model_space, hitinfo_model_space)) { Vector3 hit_position_world_space = Matrix4::Dot(getModelMatrix(), hitinfo_model_space.getPosition()); - hitinfo = KRHitInfo(hit_position_world_space, Vector3::Normalize(Matrix4::DotNoTranslate(getModelMatrix(), hitinfo_model_space.getNormal())), (hit_position_world_space - v0).magnitude(), this); + hitinfo = HitInfo(hit_position_world_space, Vector3::Normalize(Matrix4::DotNoTranslate(getModelMatrix(), hitinfo_model_space.getNormal())), (hit_position_world_space - v0).magnitude(), this); return true; } } @@ -142,7 +142,7 @@ bool KRCollider::rayCast(const Vector3 &v0, const Vector3 &dir, KRHitInfo &hitin return false; } -bool KRCollider::sphereCast(const Vector3 &v0, const Vector3 &v1, float radius, KRHitInfo &hitinfo, unsigned int layer_mask) +bool KRCollider::sphereCast(const Vector3 &v0, const Vector3 &v1, float radius, HitInfo &hitinfo, unsigned int layer_mask) { if(layer_mask & m_layer_mask) { // Only test if layer masks have a common bit set loadModel(); @@ -154,7 +154,7 @@ bool KRCollider::sphereCast(const Vector3 &v0, const Vector3 &v1, float radius, if(getBounds().intersects(sphereCastBounds)) { if(m_models[0]->sphereCast(getModelMatrix(), v0, v1, radius, hitinfo)) { - hitinfo = KRHitInfo(hitinfo.getPosition(), hitinfo.getNormal(), hitinfo.getDistance(), this); + hitinfo = HitInfo(hitinfo.getPosition(), hitinfo.getNormal(), hitinfo.getDistance(), this); return true; } } diff --git a/kraken/KRCollider.h b/kraken/KRCollider.h index 835f630..0292ff1 100755 --- a/kraken/KRCollider.h +++ b/kraken/KRCollider.h @@ -57,9 +57,9 @@ public: virtual void loadXML(tinyxml2::XMLElement *e); virtual AABB getBounds(); - bool lineCast(const Vector3 &v0, const Vector3 &v1, KRHitInfo &hitinfo, unsigned int layer_mask); - bool rayCast(const Vector3 &v0, const Vector3 &v1, KRHitInfo &hitinfo, unsigned int layer_mask); - bool sphereCast(const Vector3 &v0, const Vector3 &v1, float radius, KRHitInfo &hitinfo, unsigned int layer_mask); + bool lineCast(const Vector3 &v0, const Vector3 &v1, HitInfo &hitinfo, unsigned int layer_mask); + bool rayCast(const Vector3 &v0, const Vector3 &v1, HitInfo &hitinfo, unsigned int layer_mask); + bool sphereCast(const Vector3 &v0, const Vector3 &v1, float radius, HitInfo &hitinfo, unsigned int layer_mask); unsigned int getLayerMask(); void setLayerMask(unsigned int layer_mask); diff --git a/kraken/KRMesh.cpp b/kraken/KRMesh.cpp index 6a0a398..3ba28bc 100755 --- a/kraken/KRMesh.cpp +++ b/kraken/KRMesh.cpp @@ -1104,7 +1104,7 @@ KRMesh::model_format_t KRMesh::getModelFormat() const return f; } -bool KRMesh::rayCast(const Vector3 &start, const Vector3 &dir, const Triangle3 &tri, const Vector3 &tri_n0, const Vector3 &tri_n1, const Vector3 &tri_n2, KRHitInfo &hitinfo) +bool KRMesh::rayCast(const Vector3 &start, const Vector3 &dir, const Triangle3 &tri, const Vector3 &tri_n0, const Vector3 &tri_n1, const Vector3 &tri_n2, HitInfo &hitinfo) { Vector3 hit_point; if(tri.rayCast(start, dir, hit_point)) { @@ -1124,7 +1124,7 @@ bool KRMesh::rayCast(const Vector3 &start, const Vector3 &dir, const Triangle3 & distance_v2 /= distance_total; Vector3 normal = Vector3::Normalize(tri_n0 * (1.0 - distance_v0) + tri_n1 * (1.0 - distance_v1) + tri_n2 * (1.0 - distance_v2)); - hitinfo = KRHitInfo(hit_point, normal, new_hit_distance); + hitinfo = HitInfo(hit_point, normal, new_hit_distance); return true; } else { return false; // The hit was farther than an existing hit @@ -1138,7 +1138,7 @@ bool KRMesh::rayCast(const Vector3 &start, const Vector3 &dir, const Triangle3 & } -bool KRMesh::rayCast(const Vector3 &start, const Vector3 &dir, KRHitInfo &hitinfo) const +bool KRMesh::rayCast(const Vector3 &start, const Vector3 &dir, HitInfo &hitinfo) const { m_pData->lock(); bool hit_found = false; @@ -1184,7 +1184,7 @@ bool KRMesh::rayCast(const Vector3 &start, const Vector3 &dir, KRHitInfo &hitinf } -bool KRMesh::sphereCast(const Matrix4 &model_to_world, const Vector3 &v0, const Vector3 &v1, float radius, KRHitInfo &hitinfo) const +bool KRMesh::sphereCast(const Matrix4 &model_to_world, const Vector3 &v0, const Vector3 &v1, float radius, HitInfo &hitinfo) const { m_pData->lock(); @@ -1236,7 +1236,7 @@ bool KRMesh::sphereCast(const Matrix4 &model_to_world, const Vector3 &v0, const return hit_found; } -bool KRMesh::sphereCast(const Matrix4 &model_to_world, const Vector3 &v0, const Vector3 &v1, float radius, const Triangle3 &tri, KRHitInfo &hitinfo) +bool KRMesh::sphereCast(const Matrix4 &model_to_world, const Vector3 &v0, const Vector3 &v1, float radius, const Triangle3 &tri, HitInfo &hitinfo) { Vector3 dir = Vector3::Normalize(v1 - v0); @@ -1261,7 +1261,7 @@ bool KRMesh::sphereCast(const Matrix4 &model_to_world, const Vector3 &v0, const distance_v2 /= distance_total; Vector3 normal = Vector3::Normalize(Matrix4::DotNoTranslate(model_to_world, (tri_n0 * (1.0 - distance_v0) + tri_n1 * (1.0 - distance_v1) + tri_n2 * (1.0 - distance_v2)))); */ - hitinfo = KRHitInfo(new_hit_point, world_tri.calculateNormal(), new_hit_distance); + hitinfo = HitInfo(new_hit_point, world_tri.calculateNormal(), new_hit_distance); return true; } } @@ -1269,10 +1269,10 @@ bool KRMesh::sphereCast(const Matrix4 &model_to_world, const Vector3 &v0, const return false; } -bool KRMesh::lineCast(const Vector3 &v0, const Vector3 &v1, KRHitInfo &hitinfo) const +bool KRMesh::lineCast(const Vector3 &v0, const Vector3 &v1, HitInfo &hitinfo) const { m_pData->lock(); - KRHitInfo new_hitinfo; + HitInfo new_hitinfo; Vector3 dir = Vector3::Normalize(v1 - v0); if(rayCast(v0, dir, new_hitinfo)) { if((new_hitinfo.getPosition() - v0).sqrMagnitude() <= (v1 - v0).sqrMagnitude()) { diff --git a/kraken/KROctree.cpp b/kraken/KROctree.cpp index 8d95449..8d0c65b 100755 --- a/kraken/KROctree.cpp +++ b/kraken/KROctree.cpp @@ -8,7 +8,7 @@ #include "KROctree.h" #include "KRNode.h" -#include "KRHitInfo.h" +#include "HitInfo.h" #include "KRCollider.h" KROctree::KROctree() @@ -97,7 +97,7 @@ std::set &KROctree::getOuterSceneNodes() } -bool KROctree::lineCast(const Vector3 &v0, const Vector3 &v1, KRHitInfo &hitinfo, unsigned int layer_mask) +bool KROctree::lineCast(const Vector3 &v0, const Vector3 &v1, HitInfo &hitinfo, unsigned int layer_mask) { bool hit_found = false; std::vector outer_colliders; @@ -118,7 +118,7 @@ bool KROctree::lineCast(const Vector3 &v0, const Vector3 &v1, KRHitInfo &hitinfo return hit_found; } -bool KROctree::rayCast(const Vector3 &v0, const Vector3 &dir, KRHitInfo &hitinfo, unsigned int layer_mask) +bool KROctree::rayCast(const Vector3 &v0, const Vector3 &dir, HitInfo &hitinfo, unsigned int layer_mask) { bool hit_found = false; for(std::set::iterator outer_nodes_itr=m_outerSceneNodes.begin(); outer_nodes_itr != m_outerSceneNodes.end(); outer_nodes_itr++) { @@ -133,7 +133,7 @@ bool KROctree::rayCast(const Vector3 &v0, const Vector3 &dir, KRHitInfo &hitinfo return hit_found; } -bool KROctree::sphereCast(const Vector3 &v0, const Vector3 &v1, float radius, KRHitInfo &hitinfo, unsigned int layer_mask) +bool KROctree::sphereCast(const Vector3 &v0, const Vector3 &v1, float radius, HitInfo &hitinfo, unsigned int layer_mask) { bool hit_found = false; std::vector outer_colliders; diff --git a/kraken/KROctreeNode.cpp b/kraken/KROctreeNode.cpp index 03a8e80..915834e 100755 --- a/kraken/KROctreeNode.cpp +++ b/kraken/KROctreeNode.cpp @@ -196,7 +196,7 @@ std::set &KROctreeNode::getSceneNodes() } -bool KROctreeNode::lineCast(const Vector3 &v0, const Vector3 &v1, KRHitInfo &hitinfo, unsigned int layer_mask) +bool KROctreeNode::lineCast(const Vector3 &v0, const Vector3 &v1, HitInfo &hitinfo, unsigned int layer_mask) { bool hit_found = false; if(hitinfo.didHit() && v1 != hitinfo.getPosition()) { @@ -224,7 +224,7 @@ bool KROctreeNode::lineCast(const Vector3 &v0, const Vector3 &v1, KRHitInfo &hit return hit_found; } -bool KROctreeNode::rayCast(const Vector3 &v0, const Vector3 &dir, KRHitInfo &hitinfo, unsigned int layer_mask) +bool KROctreeNode::rayCast(const Vector3 &v0, const Vector3 &dir, HitInfo &hitinfo, unsigned int layer_mask) { bool hit_found = false; if(hitinfo.didHit()) { @@ -252,7 +252,7 @@ bool KROctreeNode::rayCast(const Vector3 &v0, const Vector3 &dir, KRHitInfo &hit return hit_found; } -bool KROctreeNode::sphereCast(const Vector3 &v0, const Vector3 &v1, float radius, KRHitInfo &hitinfo, unsigned int layer_mask) +bool KROctreeNode::sphereCast(const Vector3 &v0, const Vector3 &v1, float radius, HitInfo &hitinfo, unsigned int layer_mask) { bool hit_found = false; /* diff --git a/kraken/KRScene.cpp b/kraken/KRScene.cpp index 0872ccf..0d9c37c 100755 --- a/kraken/KRScene.cpp +++ b/kraken/KRScene.cpp @@ -579,17 +579,17 @@ AABB KRScene::getRootOctreeBounds() } -bool KRScene::lineCast(const Vector3 &v0, const Vector3 &v1, KRHitInfo &hitinfo, unsigned int layer_mask) +bool KRScene::lineCast(const Vector3 &v0, const Vector3 &v1, HitInfo &hitinfo, unsigned int layer_mask) { return m_nodeTree.lineCast(v0, v1, hitinfo, layer_mask); } -bool KRScene::rayCast(const Vector3 &v0, const Vector3 &dir, KRHitInfo &hitinfo, unsigned int layer_mask) +bool KRScene::rayCast(const Vector3 &v0, const Vector3 &dir, HitInfo &hitinfo, unsigned int layer_mask) { return m_nodeTree.rayCast(v0, dir, hitinfo, layer_mask); } -bool KRScene::sphereCast(const Vector3 &v0, const Vector3 &v1, float radius, KRHitInfo &hitinfo, unsigned int layer_mask) +bool KRScene::sphereCast(const Vector3 &v0, const Vector3 &v1, float radius, HitInfo &hitinfo, unsigned int layer_mask) { return m_nodeTree.sphereCast(v0, v1, radius, hitinfo, layer_mask); } diff --git a/kraken/public/hitinfo.h b/kraken/public/hitinfo.h index 1565900..91f7785 100755 --- a/kraken/public/hitinfo.h +++ b/kraken/public/hitinfo.h @@ -1,5 +1,5 @@ // -// KRHitInfo.h +// hitinfo.h // KREngine // // Copyright 2012 Kearwood Gilbert. All rights reserved. diff --git a/kraken_win/kraken.vcxproj b/kraken_win/kraken.vcxproj index 6e7707d..68277c8 100755 --- a/kraken_win/kraken.vcxproj +++ b/kraken_win/kraken.vcxproj @@ -151,7 +151,7 @@ - + @@ -229,7 +229,7 @@ - + diff --git a/kraken_win/kraken.vcxproj.filters b/kraken_win/kraken.vcxproj.filters index 8974a5f..2b83751 100755 --- a/kraken_win/kraken.vcxproj.filters +++ b/kraken_win/kraken.vcxproj.filters @@ -102,7 +102,7 @@ Source Files - + Source Files @@ -335,7 +335,7 @@ Header Files - + Header Files From ea1c447f1d6249076425992a2f21295e68a7bf78 Mon Sep 17 00:00:00 2001 From: Kearwood Gilbert Date: Sun, 5 Nov 2017 21:27:09 -0800 Subject: [PATCH 5/9] More CMakeList additions Set up AppKit framework --- CMakeLists.txt | 6 ++++-- kraken/CMakeLists.txt | 16 ++++++++++++++++ kraken/KRCamera.cpp | 6 ++++++ kraken/KRContext_osx.mm | 1 + 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e97d7c..4572f9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,11 +45,13 @@ endmacro() IF(APPLE) # SET(GUI_TYPE MACOSX_BUNDLE) # INCLUDE_DIRECTORIES ( /Developer/Headers/FlatCarbon ) + FIND_LIBRARY(APPKIT_LIBRARY AppKit) FIND_LIBRARY(OPENGL_LIBRARY OpenGL) FIND_LIBRARY(AUDIO_TOOLBOX_LIBRARY AudioToolbox) - MARK_AS_ADVANCED (OPENGL_LIBRARY + MARK_AS_ADVANCED (APPKIT_LIBRARY + OPENGL_LIBRARY AUDIO_TOOLBOX_LIBRARY) - SET(EXTRA_LIBS ${OPENGL_LIBRARY} ${AUDIO_TOOLBOX_LIBRARY}) + SET(EXTRA_LIBS ${APPKIT_LIBRARY} ${OPENGL_LIBRARY} ${AUDIO_TOOLBOX_LIBRARY}) FIND_PATH(COCOA_INCLUDE_DIR OpenGL/gl3.h) ENDIF (APPLE) diff --git a/kraken/CMakeLists.txt b/kraken/CMakeLists.txt index 3f62459..b1dcd34 100644 --- a/kraken/CMakeLists.txt +++ b/kraken/CMakeLists.txt @@ -22,4 +22,20 @@ add_sources(KRAnimationLayer.cpp) add_sources(KRAnimationManager.cpp) add_sources(KRAudioBuffer.cpp) add_sources(KRAudioManager.cpp) +add_sources(KRAudioSample.cpp) +add_sources(KRAudioSource.cpp) +add_sources(KRBehavior.cpp) add_sources(KRDataBlock.cpp) +add_sources(KRBone.cpp) +add_sources(KRBundle.cpp) +add_sources(KRBundleManager.cpp) +add_sources(KRCamera.cpp) +add_sources(KRCollider.cpp) +add_sources(KRContext.cpp) +IF(APPLE) + IF(IOS) + add_sources(KRContext_ios.mm) + ELSE() + add_sources(KRContext_osx.mm) + ENDIF() +ENDIF (APPLE) diff --git a/kraken/KRCamera.cpp b/kraken/KRCamera.cpp index 83677d9..551d28d 100755 --- a/kraken/KRCamera.cpp +++ b/kraken/KRCamera.cpp @@ -1064,6 +1064,9 @@ std::string KRCamera::getDebugText() case KRNode::RENDER_PASS_SHADOWMAP: stream << "shadow"; break; + default: + // Suppress warnings + break; } stream << "\t" << (*itr).object_name << "\t" << (*itr).material_name; vertex_count += (*itr).vertex_count; @@ -1085,6 +1088,9 @@ std::string KRCamera::getDebugText() case KRRenderSettings::KRENGINE_DEBUG_DISPLAY_SIREN_AMBIENT_ZONES: stream << "Siren - Ambient Zones"; break; + case KRRenderSettings::KRENGINE_DEBUG_DISPLAY_NUMBER: + // Suppress warning + break; } return stream.str(); } diff --git a/kraken/KRContext_osx.mm b/kraken/KRContext_osx.mm index 5ba2377..94d18a6 100755 --- a/kraken/KRContext_osx.mm +++ b/kraken/KRContext_osx.mm @@ -7,6 +7,7 @@ // #include "KREngine-common.h" +#include #include "KRContext.h" From 9cf91d6332b98919b3b4e89015bc8c30aa7fd771 Mon Sep 17 00:00:00 2001 From: Kearwood Gilbert Date: Sun, 5 Nov 2017 23:41:22 -0800 Subject: [PATCH 6/9] More CMake conversion, compile fixes --- CMakeLists.txt | 6 ++-- kraken/CMakeLists.txt | 54 ++++++++++++++++++++++++++++++++- kraken/KREngine.h | 2 -- kraken/KREngine.mm | 10 +++---- kraken/KRMesh.cpp | 6 ---- kraken/KRMeshStreamer.h | 60 +++++++++++++++++++++++++++++++++++++ kraken/KRMeshStreamer.mm | 1 + kraken/KRNode.cpp | 4 +++ kraken/KROctree.cpp | 2 +- kraken/KRResource+obj.cpp | 3 +- kraken/KRTextureStreamer.h | 60 +++++++++++++++++++++++++++++++++++++ kraken/KRTextureStreamer.mm | 1 + 12 files changed, 191 insertions(+), 18 deletions(-) create mode 100644 kraken/KRMeshStreamer.h create mode 100644 kraken/KRTextureStreamer.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 4572f9c..06e9ccc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,10 +48,12 @@ IF(APPLE) FIND_LIBRARY(APPKIT_LIBRARY AppKit) FIND_LIBRARY(OPENGL_LIBRARY OpenGL) FIND_LIBRARY(AUDIO_TOOLBOX_LIBRARY AudioToolbox) + FIND_LIBRARY(ACCELERATE_LIBRARY Accelerate) MARK_AS_ADVANCED (APPKIT_LIBRARY OPENGL_LIBRARY - AUDIO_TOOLBOX_LIBRARY) - SET(EXTRA_LIBS ${APPKIT_LIBRARY} ${OPENGL_LIBRARY} ${AUDIO_TOOLBOX_LIBRARY}) + AUDIO_TOOLBOX_LIBRARY + ACCELERATE_LIBRARY) + SET(EXTRA_LIBS ${APPKIT_LIBRARY} ${OPENGL_LIBRARY} ${AUDIO_TOOLBOX_LIBRARY} ${ACCELERATE_LIBRARY}) FIND_PATH(COCOA_INCLUDE_DIR OpenGL/gl3.h) ENDIF (APPLE) diff --git a/kraken/CMakeLists.txt b/kraken/CMakeLists.txt index b1dcd34..b1c1f38 100644 --- a/kraken/CMakeLists.txt +++ b/kraken/CMakeLists.txt @@ -25,7 +25,6 @@ add_sources(KRAudioManager.cpp) add_sources(KRAudioSample.cpp) add_sources(KRAudioSource.cpp) add_sources(KRBehavior.cpp) -add_sources(KRDataBlock.cpp) add_sources(KRBone.cpp) add_sources(KRBundle.cpp) add_sources(KRBundleManager.cpp) @@ -33,9 +32,62 @@ add_sources(KRCamera.cpp) add_sources(KRCollider.cpp) add_sources(KRContext.cpp) IF(APPLE) + add_sources(KREngine.mm) + add_sources(KRStreamer.mm) + add_sources(KRMeshStreamer.mm) + add_sources(KRTextureStreamer.mm) IF(IOS) add_sources(KRContext_ios.mm) ELSE() add_sources(KRContext_osx.mm) ENDIF() ENDIF (APPLE) +add_sources(KRContextObject.cpp) +add_sources(KRDataBlock.cpp) +add_sources(KRDirectionalLight.cpp) +IF(APPLE) + add_sources(KRDSP_vDSP.cpp) +ELSE() + add_sources(KRDSP_slow.cpp) +ENDIF() +add_sources(KRHelpers.cpp) +add_sources(KRLight.cpp) +add_sources(KRLocator.cpp) +add_sources(KRLODGroup.cpp) +add_sources(KRLODSet.cpp) +add_sources(KRMaterial.cpp) +add_sources(KRMaterialManager.cpp) +add_sources(KRMesh.cpp) +add_sources(KRMeshCube.cpp) +add_sources(KRMeshManager.cpp) +add_sources(KRMeshQuad.cpp) +add_sources(KRMeshSphere.cpp) +add_sources(KRModel.cpp) +add_sources(KRNode.cpp) +add_sources(KROctree.cpp) +add_sources(KROctreeNode.cpp) +add_sources(KRParticleSystem.cpp) +add_sources(KRParticleSystemNewtonian.h) +add_sources(KRPointLight.cpp) +add_sources(KRRenderSettings.cpp) +add_sources(KRResource+blend.cpp) +# add_sources(KRResource+fbx.cpp) # TODO - Locate FBX SDK dependencies +add_sources(KRResource+obj.cpp) +add_sources(KRResource.cpp) +add_sources(KRReverbZone.cpp) +add_sources(KRScene.cpp) +add_sources(KRShader.cpp) +add_sources(KRShaderManager.cpp) +add_sources(KRSpotLight.cpp) +add_sources(KRSprite.cpp) +add_sources(KRTexture.cpp) +add_sources(KRTexture2D.cpp) +add_sources(KRTextureAnimated.cpp) +add_sources(KRTextureCube.cpp) +add_sources(KRTextureKTX.cpp) +add_sources(KRTextureManager.cpp) +add_sources(KRTexturePVR.cpp) +add_sources(KRTextureTGA.cpp) +add_sources(KRUnknown.cpp) +add_sources(KRUnknownManager.cpp) +add_sources(KRViewport.cpp) diff --git a/kraken/KREngine.h b/kraken/KREngine.h index 1fa71fd..ca81c56 100755 --- a/kraken/KREngine.h +++ b/kraken/KREngine.h @@ -30,8 +30,6 @@ // // #include "KRTextureManager.h" -#include "Matrix4.h" -#include "Vector3.h" #include "KRMesh.h" #include "KRScene.h" #include "KRContext.h" diff --git a/kraken/KREngine.mm b/kraken/KREngine.mm index c0523a9..e49f2f1 100755 --- a/kraken/KREngine.mm +++ b/kraken/KREngine.mm @@ -32,7 +32,6 @@ #include "KREngine-common.h" #include "KREngine.h" -#include "KRVector3.h" #include "KRScene.h" #include "KRSceneManager.h" #include "KRNode.h" @@ -256,6 +255,7 @@ void kraken::set_debug_text(const std::string &print_text) if(_context) { delete _context; _context = NULL; } + [super dealloc]; } -(int)getParameterCount @@ -732,7 +732,7 @@ void kraken::set_debug_text(const std::string &print_text) -(void) setSunTemperature:(float)t { float i = [self getSunIntensity]; - _settings.light_intensity = KRVector3( + _settings.light_intensity = Vector3( (t < 0.5f ? t * 2.0f : 1.0f) * i, (t < 0.5f ? t * 2.0f : (1.0f - t) * 2.0f) * i, (t < 0.5f ? 1.0f : (1.0f - t) * 2.0f) * i @@ -742,7 +742,7 @@ void kraken::set_debug_text(const std::string &print_text) -(void) setSunIntensity:(float)i { float t = [self getSunTemperature]; - _settings.light_intensity = KRVector3( + _settings.light_intensity = Vector3( (t < 0.5f ? t * 2.0f : 1.0f) * i, (t < 0.5f ? t * 2.0f : (1.0f - t) * 2.0f) * i, (t < 0.5f ? 1.0f : (1.0f - t) * 2.0f) * i @@ -778,7 +778,7 @@ void kraken::set_debug_text(const std::string &print_text) -(void) setAmbientTemperature:(float)t { float i = [self getAmbientIntensity]; - _settings.ambient_intensity = KRVector3( + _settings.ambient_intensity = Vector3( (t < 0.5f ? t * 2.0f : 1.0f) * i, (t < 0.5f ? t * 2.0f : (1.0f - t) * 2.0f) * i, (t < 0.5f ? 1.0f : (1.0f - t) * 2.0f) * i @@ -788,7 +788,7 @@ void kraken::set_debug_text(const std::string &print_text) -(void) setAmbientIntensity:(float)i { float t = [self getAmbientTemperature]; - _settings.ambient_intensity = KRVector3( + _settings.ambient_intensity = Vector3( (t < 0.5f ? t * 2.0f : 1.0f) * i, (t < 0.5f ? t * 2.0f : (1.0f - t) * 2.0f) * i, (t < 0.5f ? 1.0f : (1.0f - t) * 2.0f) * i diff --git a/kraken/KRMesh.cpp b/kraken/KRMesh.cpp index 3ba28bc..6b83209 100755 --- a/kraken/KRMesh.cpp +++ b/kraken/KRMesh.cpp @@ -37,12 +37,7 @@ #include "KRShader.h" #include "KRShaderManager.h" #include "KRContext.h" -#if defined(_WIN32) || defined(_WIN64) #include "../3rdparty/forsyth/forsyth.h" -#else -#include "forsyth.h" -#endif - KRMesh::KRMesh(KRContext &context, std::string name) : KRResource(context, name) { setName(name); @@ -52,7 +47,6 @@ KRMesh::KRMesh(KRContext &context, std::string name) : KRResource(context, name) m_pMetaData = NULL; m_pIndexBaseData = NULL; m_constant = false; - } KRMesh::KRMesh(KRContext &context, std::string name, KRDataBlock *data) : KRResource(context, name) { diff --git a/kraken/KRMeshStreamer.h b/kraken/KRMeshStreamer.h new file mode 100644 index 0000000..beb3666 --- /dev/null +++ b/kraken/KRMeshStreamer.h @@ -0,0 +1,60 @@ +// +// KRMeshManager.h +// KREngine +// +// Copyright 2012 Kearwood Gilbert. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, are +// permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of +// conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list +// of conditions and the following disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY KEARWOOD GILBERT ''AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KEARWOOD GILBERT OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and documentation are those of the +// authors and should not be interpreted as representing official policies, either expressed +// or implied, of Kearwood Gilbert. +// + +#ifndef KRMESHSTREAMER_H +#define KRMESHSTREAMER_H + +#include "KREngine-common.h" + +#include +#include + +class KRContext; + +class KRMeshStreamer +{ +public: + KRMeshStreamer(KRContext &context); + ~KRMeshStreamer(); + + void startStreamer(); + +private: + KRContext &m_context; + + std::thread m_thread; + std::atomic m_stop; + std::atomic m_running; + + void run(); +}; + +#endif /* defined(KRMESHSTREAMER_H) */ diff --git a/kraken/KRMeshStreamer.mm b/kraken/KRMeshStreamer.mm index 82f101c..30dd46c 100755 --- a/kraken/KRMeshStreamer.mm +++ b/kraken/KRMeshStreamer.mm @@ -12,6 +12,7 @@ #include "KRContext.h" #include +#include #if TARGET_OS_IPHONE diff --git a/kraken/KRNode.cpp b/kraken/KRNode.cpp index c43545d..6a5fe1a 100755 --- a/kraken/KRNode.cpp +++ b/kraken/KRNode.cpp @@ -850,6 +850,10 @@ void KRNode::SetAttribute(node_attribute_type attrib, float v) case KRENGINE_NODE_SCALE_OFFSET_Z: setScalingOffset(Vector3(m_scalingOffset.x, m_scalingOffset.y, v)); break; + case KRENGINE_NODE_ATTRIBUTE_NONE: + case KRENGINE_NODE_ATTRIBUTE_COUNT: + // Suppress warnings + break; } } diff --git a/kraken/KROctree.cpp b/kraken/KROctree.cpp index 8d0c65b..4451435 100755 --- a/kraken/KROctree.cpp +++ b/kraken/KROctree.cpp @@ -6,9 +6,9 @@ // Copyright (c) 2012 Kearwood Software. All rights reserved. // +#include "public/kraken.h" #include "KROctree.h" #include "KRNode.h" -#include "HitInfo.h" #include "KRCollider.h" KROctree::KROctree() diff --git a/kraken/KRResource+obj.cpp b/kraken/KRResource+obj.cpp index e044b44..b1473ae 100755 --- a/kraken/KRResource+obj.cpp +++ b/kraken/KRResource+obj.cpp @@ -246,7 +246,8 @@ std::vector KRResource::LoadObj(KRContext &context, const std::str while(*pFace != 0 && iVertex < cVertexData) { pMaterial->start_vertex = iVertex; - int *pMaterialEndFace = pFace + *pFace++; + int *pMaterialEndFace = pFace + *pFace; + ++pFace; while(pFace < pMaterialEndFace && iVertex < cVertexData) { int cFaceVertexes = *pFace; Vector3 firstFaceVertex; diff --git a/kraken/KRTextureStreamer.h b/kraken/KRTextureStreamer.h new file mode 100644 index 0000000..39f3705 --- /dev/null +++ b/kraken/KRTextureStreamer.h @@ -0,0 +1,60 @@ +// +// KRTextureManager.h +// KREngine +// +// Copyright 2012 Kearwood Gilbert. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, are +// permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of +// conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list +// of conditions and the following disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY KEARWOOD GILBERT ''AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KEARWOOD GILBERT OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// The views and conclusions contained in the software and documentation are those of the +// authors and should not be interpreted as representing official policies, either expressed +// or implied, of Kearwood Gilbert. +// + +#ifndef KRTEXTURESTREAMER_H +#define KRTEXTURESTREAMER_H + +#include "KREngine-common.h" + +#include +#include + +class KRContext; + +class KRTextureStreamer +{ +public: + KRTextureStreamer(KRContext &context); + ~KRTextureStreamer(); + + void startStreamer(); + +private: + KRContext &m_context; + + std::thread m_thread; + std::atomic m_stop; + std::atomic m_running; + + void run(); +}; + +#endif /* defined(KRTEXTURESTREAMER_H) */ diff --git a/kraken/KRTextureStreamer.mm b/kraken/KRTextureStreamer.mm index 4aa1230..8fd497f 100755 --- a/kraken/KRTextureStreamer.mm +++ b/kraken/KRTextureStreamer.mm @@ -12,6 +12,7 @@ #include "KRContext.h" #include +#include #if TARGET_OS_IPHONE From d0885edfeb149221df50f1ff8d5c6494c75d8810 Mon Sep 17 00:00:00 2001 From: Kearwood Gilbert Date: Sun, 5 Nov 2017 23:50:32 -0800 Subject: [PATCH 7/9] Removed KRMeshStreamer and KRTextureStreamer dead code (replaced by KRStreamer) --- kraken/CMakeLists.txt | 2 - kraken/KRMeshStreamer.h | 60 ----------------------- kraken/KRMeshStreamer.mm | 92 ---------------------------------- kraken/KRTextureStreamer.h | 60 ----------------------- kraken/KRTextureStreamer.mm | 98 ------------------------------------- 5 files changed, 312 deletions(-) delete mode 100644 kraken/KRMeshStreamer.h delete mode 100755 kraken/KRMeshStreamer.mm delete mode 100644 kraken/KRTextureStreamer.h delete mode 100755 kraken/KRTextureStreamer.mm diff --git a/kraken/CMakeLists.txt b/kraken/CMakeLists.txt index b1c1f38..3658da8 100644 --- a/kraken/CMakeLists.txt +++ b/kraken/CMakeLists.txt @@ -34,8 +34,6 @@ add_sources(KRContext.cpp) IF(APPLE) add_sources(KREngine.mm) add_sources(KRStreamer.mm) - add_sources(KRMeshStreamer.mm) - add_sources(KRTextureStreamer.mm) IF(IOS) add_sources(KRContext_ios.mm) ELSE() diff --git a/kraken/KRMeshStreamer.h b/kraken/KRMeshStreamer.h deleted file mode 100644 index beb3666..0000000 --- a/kraken/KRMeshStreamer.h +++ /dev/null @@ -1,60 +0,0 @@ -// -// KRMeshManager.h -// KREngine -// -// Copyright 2012 Kearwood Gilbert. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, are -// permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of -// conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list -// of conditions and the following disclaimer in the documentation and/or other materials -// provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY KEARWOOD GILBERT ''AS IS'' AND ANY EXPRESS OR IMPLIED -// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KEARWOOD GILBERT OR -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// The views and conclusions contained in the software and documentation are those of the -// authors and should not be interpreted as representing official policies, either expressed -// or implied, of Kearwood Gilbert. -// - -#ifndef KRMESHSTREAMER_H -#define KRMESHSTREAMER_H - -#include "KREngine-common.h" - -#include -#include - -class KRContext; - -class KRMeshStreamer -{ -public: - KRMeshStreamer(KRContext &context); - ~KRMeshStreamer(); - - void startStreamer(); - -private: - KRContext &m_context; - - std::thread m_thread; - std::atomic m_stop; - std::atomic m_running; - - void run(); -}; - -#endif /* defined(KRMESHSTREAMER_H) */ diff --git a/kraken/KRMeshStreamer.mm b/kraken/KRMeshStreamer.mm deleted file mode 100755 index 30dd46c..0000000 --- a/kraken/KRMeshStreamer.mm +++ /dev/null @@ -1,92 +0,0 @@ -// -// KRMeshStreamer.cpp -// Kraken -// -// Created by Kearwood Gilbert on 11/1/2013. -// Copyright (c) 2013 Kearwood Software. All rights reserved. -// - -#include "KRMeshStreamer.h" - -#include "KREngine-common.h" -#include "KRContext.h" - -#include -#include - -#if TARGET_OS_IPHONE - -EAGLContext *gMeshStreamerContext = nil; - -#elif TARGET_OS_MAC - -NSOpenGLContext *gMeshStreamerContext = nil; - -#else - -#error Unsupported Platform -#endif - -KRMeshStreamer::KRMeshStreamer(KRContext &context) : m_context(context) -{ - m_running = false; - m_stop = false; -} - -void KRMeshStreamer::startStreamer() -{ - if(!m_running) { - m_running = true; - -#if TARGET_OS_IPHONE - gMeshStreamerContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2 sharegroup: [EAGLContext currentContext].sharegroup]; -#elif TARGET_OS_MAC - NSOpenGLPixelFormatAttribute pixelFormatAttributes[] = - { -// NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersionLegacy, - 0 - }; - NSOpenGLPixelFormat *pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:pixelFormatAttributes] autorelease]; - gMeshStreamerContext = [[NSOpenGLContext alloc] initWithFormat: pixelFormat shareContext: [NSOpenGLContext currentContext] ]; -#else - #error Unsupported Platform -#endif - - m_thread = std::thread(&KRMeshStreamer::run, this); - } -} - -KRMeshStreamer::~KRMeshStreamer() -{ - if(m_running) { - m_stop = true; - m_thread.join(); - m_running = false; - } - - [gMeshStreamerContext release]; -} - -void KRMeshStreamer::run() -{ - pthread_setname_np("Kraken - Mesh Streamer"); - - std::chrono::microseconds sleep_duration( 100 ); - -#if TARGET_OS_IPHONE - [EAGLContext setCurrentContext: gMeshStreamerContext]; -#elif TARGET_OS_MAC - [gMeshStreamerContext makeCurrentContext]; -#else - #error Unsupported Platform -#endif - - - while(!m_stop) - { - if(m_context.getStreamingEnabled()) { - - } - std::this_thread::sleep_for( sleep_duration ); - } -} diff --git a/kraken/KRTextureStreamer.h b/kraken/KRTextureStreamer.h deleted file mode 100644 index 39f3705..0000000 --- a/kraken/KRTextureStreamer.h +++ /dev/null @@ -1,60 +0,0 @@ -// -// KRTextureManager.h -// KREngine -// -// Copyright 2012 Kearwood Gilbert. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, are -// permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of -// conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list -// of conditions and the following disclaimer in the documentation and/or other materials -// provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY KEARWOOD GILBERT ''AS IS'' AND ANY EXPRESS OR IMPLIED -// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL KEARWOOD GILBERT OR -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// The views and conclusions contained in the software and documentation are those of the -// authors and should not be interpreted as representing official policies, either expressed -// or implied, of Kearwood Gilbert. -// - -#ifndef KRTEXTURESTREAMER_H -#define KRTEXTURESTREAMER_H - -#include "KREngine-common.h" - -#include -#include - -class KRContext; - -class KRTextureStreamer -{ -public: - KRTextureStreamer(KRContext &context); - ~KRTextureStreamer(); - - void startStreamer(); - -private: - KRContext &m_context; - - std::thread m_thread; - std::atomic m_stop; - std::atomic m_running; - - void run(); -}; - -#endif /* defined(KRTEXTURESTREAMER_H) */ diff --git a/kraken/KRTextureStreamer.mm b/kraken/KRTextureStreamer.mm deleted file mode 100755 index 8fd497f..0000000 --- a/kraken/KRTextureStreamer.mm +++ /dev/null @@ -1,98 +0,0 @@ -// -// KRTextureStreamer.cpp -// Kraken -// -// Created by Kearwood Gilbert on 11/1/2013. -// Copyright (c) 2013 Kearwood Software. All rights reserved. -// - -#include "KREngine-common.h" - -#include "KRTextureStreamer.h" -#include "KRContext.h" - -#include -#include - - -#if TARGET_OS_IPHONE - -EAGLContext *gTextureStreamerContext = nil; - -#elif TARGET_OS_MAC - -NSOpenGLContext *gTextureStreamerContext = nil; - -#else - -#error Unsupported Platform -#endif - -KRTextureStreamer::KRTextureStreamer(KRContext &context) : m_context(context) -{ - m_running = false; - m_stop = false; -} - -void KRTextureStreamer::startStreamer() -{ - if(!m_running) { - m_running = true; - -#if TARGET_OS_IPHONE - - gTextureStreamerContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2 sharegroup: [EAGLContext currentContext].sharegroup]; - - -#elif TARGET_OS_MAC - - NSOpenGLPixelFormatAttribute pixelFormatAttributes[] = - { -// NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersionLegacy, - 0 - }; - NSOpenGLPixelFormat *pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:pixelFormatAttributes] autorelease]; - gTextureStreamerContext = [[NSOpenGLContext alloc] initWithFormat: pixelFormat shareContext: [NSOpenGLContext currentContext] ]; - -#else - - #error Unsupported Platform -#endif - - m_thread = std::thread(&KRTextureStreamer::run, this); - } -} - -KRTextureStreamer::~KRTextureStreamer() -{ - if(m_running) { - m_stop = true; - m_thread.join(); - m_running = false; - } - - [gTextureStreamerContext release]; -} - -void KRTextureStreamer::run() -{ - pthread_setname_np("Kraken - Texture Streamer"); - - std::chrono::microseconds sleep_duration( 100 ); - -#if TARGET_OS_IPHONE - [EAGLContext setCurrentContext: gTextureStreamerContext]; -#elif TARGET_OS_MAC - [gTextureStreamerContext makeCurrentContext]; -#else -#error Unsupported Platform -#endif - - while(!m_stop) - { - if(m_context.getStreamingEnabled()) { - m_context.getTextureManager()->doStreaming(); - } - std::this_thread::sleep_for( sleep_duration ); - } -} From 1bbc8511ee616d18b6d6967dc8dcc0d2981fe79b Mon Sep 17 00:00:00 2001 From: Kearwood Gilbert Date: Mon, 6 Nov 2017 00:35:58 -0800 Subject: [PATCH 8/9] Try adding boost to Linux travis-ci config --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index ffd0079..c55b156 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,7 @@ matrix: - ubuntu-toolchain-r-test packages: - libc++-dev + - libboost-dev - os: osx osx_image: xcode9.1 From 8eb5e5f6ab289e3073934cf01054803f4983c719 Mon Sep 17 00:00:00 2001 From: Kearwood Gilbert Date: Mon, 6 Nov 2017 00:44:31 -0800 Subject: [PATCH 9/9] Allow older Boost version for Travis-CI --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 06e9ccc..a5c672c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,7 +78,7 @@ PROPERTIES set(Boost_USE_STATIC_LIBS ON) # only find static libs set(Boost_USE_MULTITHREADED ON) set(Boost_USE_STATIC_RUNTIME OFF) -find_package(Boost 1.65.1) +find_package(Boost 1.54.0) if(Boost_FOUND) include_directories(${Boost_INCLUDE_DIRS}) target_link_libraries(kraken ${Boost_LIBRARIES})