From 050a1784930b2d16a29fc5b62d9896e1d628a4cb Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sun, 3 Apr 2016 00:28:36 -0400 Subject: [PATCH 1/3] Mac OS Fixes Added the TextSprite to the Xcode project. Also fixed a few audio compile errors. --- .../Xcode/Torque2D.xcodeproj/project.pbxproj | 67 ++++++++++++++----- engine/source/audio/audioDescriptions.cc | 2 +- engine/source/platformOSX/osxOpenGLDevice.h | 2 + engine/source/platformOSX/osxOpenGLDevice.mm | 14 ++++ engine/source/platformOSX/osxTorqueView.mm | 15 +++++ 5 files changed, 81 insertions(+), 19 deletions(-) diff --git a/engine/compilers/Xcode/Torque2D.xcodeproj/project.pbxproj b/engine/compilers/Xcode/Torque2D.xcodeproj/project.pbxproj index b9cc91515..7e8fc34e5 100755 --- a/engine/compilers/Xcode/Torque2D.xcodeproj/project.pbxproj +++ b/engine/compilers/Xcode/Torque2D.xcodeproj/project.pbxproj @@ -50,7 +50,6 @@ 2AB4C1A316DE9F1100B02479 /* AmbientForceController.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2AB4C1A116DE9F1100B02479 /* AmbientForceController.cc */; }; 2AB97A1D16B66BC70080F940 /* tamlCustom.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2AB97A1B16B66BC70080F940 /* tamlCustom.cc */; }; 2ABF5C8F16569A0C00BBBF1D /* osxMutex.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2ABF5C8E16569A0C00BBBF1D /* osxMutex.mm */; }; - 2AC4404516B0142B00FC4091 /* ImageFont.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2AC4404316B0142B00FC4091 /* ImageFont.cc */; }; 2AC5C7E81667C85700A0D046 /* platformStringTests.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2AC5C7E71667C85700A0D046 /* platformStringTests.cc */; }; 2ACAFD4A1705CF4A0022601C /* tamlJSONParser.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2ACAFD481705CF4A0022601C /* tamlJSONParser.cc */; }; 2ACF5A2816E52D4B00F838D9 /* SpriteBatchQuery.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2ACF5A2516E52D4B00F838D9 /* SpriteBatchQuery.cc */; }; @@ -485,6 +484,11 @@ B350D158174EF62400033EBB /* fileSystem_ScriptBinding.cc in Sources */ = {isa = PBXBuildFile; fileRef = B350D156174EF62400033EBB /* fileSystem_ScriptBinding.cc */; }; B350D164174EF71B00033EBB /* metaScripting_ScriptBinding.cc in Sources */ = {isa = PBXBuildFile; fileRef = B350D161174EF71B00033EBB /* metaScripting_ScriptBinding.cc */; }; B350D172174EF91900033EBB /* audio_ScriptBinding.cc in Sources */ = {isa = PBXBuildFile; fileRef = B350D171174EF91900033EBB /* audio_ScriptBinding.cc */; }; + D000F9731CB0CF4800C4D097 /* audioDescriptions.cc in Sources */ = {isa = PBXBuildFile; fileRef = D000F9711CB0CF4800C4D097 /* audioDescriptions.cc */; }; + D000F97B1CB0D16A00C4D097 /* BitmapFont.cc in Sources */ = {isa = PBXBuildFile; fileRef = D000F9751CB0D16A00C4D097 /* BitmapFont.cc */; }; + D000F97C1CB0D16A00C4D097 /* BitmapFontCharacter.cc in Sources */ = {isa = PBXBuildFile; fileRef = D000F9771CB0D16A00C4D097 /* BitmapFontCharacter.cc */; }; + D000F9801CB0D1B300C4D097 /* FontAsset.cc in Sources */ = {isa = PBXBuildFile; fileRef = D000F97E1CB0D1B300C4D097 /* FontAsset.cc */; }; + D000F9841CB0D25A00C4D097 /* TextSprite.cc in Sources */ = {isa = PBXBuildFile; fileRef = D000F9821CB0D25A00C4D097 /* TextSprite.cc */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -594,9 +598,6 @@ 2AB97A1B16B66BC70080F940 /* tamlCustom.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tamlCustom.cc; sourceTree = ""; }; 2AB97A1C16B66BC70080F940 /* tamlCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tamlCustom.h; sourceTree = ""; }; 2ABF5C8E16569A0C00BBBF1D /* osxMutex.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = osxMutex.mm; sourceTree = ""; }; - 2AC4404216B0142B00FC4091 /* ImageFont_ScriptBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageFont_ScriptBinding.h; sourceTree = ""; }; - 2AC4404316B0142B00FC4091 /* ImageFont.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageFont.cc; sourceTree = ""; }; - 2AC4404416B0142B00FC4091 /* ImageFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageFont.h; sourceTree = ""; }; 2AC5C7E71667C85700A0D046 /* platformStringTests.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = platformStringTests.cc; path = ../../../source/testing/tests/platformStringTests.cc; sourceTree = ""; }; 2ACAFD481705CF4A0022601C /* tamlJSONParser.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = tamlJSONParser.cc; path = json/tamlJSONParser.cc; sourceTree = ""; }; 2ACAFD491705CF4A0022601C /* tamlJSONParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tamlJSONParser.h; path = json/tamlJSONParser.h; sourceTree = ""; }; @@ -928,7 +929,6 @@ 86BC7EC316518D4600D96ADF /* SceneObject.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SceneObject.cc; sourceTree = ""; }; 86BC7EC416518D4600D96ADF /* SceneObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SceneObject.h; sourceTree = ""; }; 86BC7EC516518D4600D96ADF /* SceneObject_ScriptBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SceneObject_ScriptBinding.h; sourceTree = ""; }; - 86BC7EC816518D4600D96ADF /* SceneObjectMoveToEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SceneObjectMoveToEvent.h; sourceTree = ""; }; 86BC7EC916518D4600D96ADF /* SceneObjectRotateToEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SceneObjectRotateToEvent.h; sourceTree = ""; }; 86BC7ECE16518D4600D96ADF /* Scroller.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Scroller.cc; sourceTree = ""; }; 86BC7ECF16518D4600D96ADF /* Scroller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Scroller.h; sourceTree = ""; }; @@ -1540,6 +1540,20 @@ B350D171174EF91900033EBB /* audio_ScriptBinding.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = audio_ScriptBinding.cc; sourceTree = ""; }; B350D173174EF93900033EBB /* undo_ScriptBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = undo_ScriptBinding.h; sourceTree = ""; }; B350D174174EFA6100033EBB /* Utility_ScriptBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Utility_ScriptBinding.h; sourceTree = ""; }; + D000F9711CB0CF4800C4D097 /* audioDescriptions.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = audioDescriptions.cc; sourceTree = ""; }; + D000F9721CB0CF4800C4D097 /* audioDescriptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = audioDescriptions.h; sourceTree = ""; }; + D000F9751CB0D16A00C4D097 /* BitmapFont.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BitmapFont.cc; sourceTree = ""; }; + D000F9761CB0D16A00C4D097 /* BitmapFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitmapFont.h; sourceTree = ""; }; + D000F9771CB0D16A00C4D097 /* BitmapFontCharacter.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BitmapFontCharacter.cc; sourceTree = ""; }; + D000F9781CB0D16A00C4D097 /* BitmapFontCharacter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitmapFontCharacter.h; sourceTree = ""; }; + D000F9791CB0D16A00C4D097 /* BitmapFontCharacterInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitmapFontCharacterInfo.h; sourceTree = ""; }; + D000F97A1CB0D16A00C4D097 /* BitmapFontLineInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitmapFontLineInfo.h; sourceTree = ""; }; + D000F97D1CB0D1B300C4D097 /* FontAsset_ScriptBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontAsset_ScriptBinding.h; sourceTree = ""; }; + D000F97E1CB0D1B300C4D097 /* FontAsset.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontAsset.cc; sourceTree = ""; }; + D000F97F1CB0D1B300C4D097 /* FontAsset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontAsset.h; sourceTree = ""; }; + D000F9811CB0D25A00C4D097 /* TextSprite_ScriptBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextSprite_ScriptBinding.h; sourceTree = ""; }; + D000F9821CB0D25A00C4D097 /* TextSprite.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextSprite.cc; sourceTree = ""; }; + D000F9831CB0D25A00C4D097 /* TextSprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextSprite.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -2122,6 +2136,7 @@ 869FF8C21651518C002FE082 /* Torque2D */ = { isa = PBXGroup; children = ( + D000F9741CB0D16A00C4D097 /* bitmapFont */, 86BC7E7516518D4600D96ADF /* 2d */, 86BC7EE016518D4600D96ADF /* algorithm */, 86BC7EE716518D4600D96ADF /* assets */, @@ -2182,6 +2197,9 @@ 86BC7E7616518D4600D96ADF /* assets */ = { isa = PBXGroup; children = ( + D000F97E1CB0D1B300C4D097 /* FontAsset.cc */, + D000F97F1CB0D1B300C4D097 /* FontAsset.h */, + D000F97D1CB0D1B300C4D097 /* FontAsset_ScriptBinding.h */, 27908E1018A3F904002D41BD /* SkeletonAsset_ScriptBinding.h */, 27908E1118A3F904002D41BD /* SkeletonAsset.cc */, 27908E1218A3F904002D41BD /* SkeletonAsset.h */, @@ -2289,12 +2307,12 @@ 86BC7EB716518D4600D96ADF /* sceneobject */ = { isa = PBXGroup; children = ( + D000F9811CB0D25A00C4D097 /* TextSprite_ScriptBinding.h */, + D000F9821CB0D25A00C4D097 /* TextSprite.cc */, + D000F9831CB0D25A00C4D097 /* TextSprite.h */, 86BC7EBB16518D4600D96ADF /* CompositeSprite.cc */, 86BC7EBC16518D4600D96ADF /* CompositeSprite.h */, 86BC7EBD16518D4600D96ADF /* CompositeSprite_ScriptBinding.h */, - 2AC4404316B0142B00FC4091 /* ImageFont.cc */, - 2AC4404416B0142B00FC4091 /* ImageFont.h */, - 2AC4404216B0142B00FC4091 /* ImageFont_ScriptBinding.h */, 2A25738E16A48DAC00363C6F /* ParticlePlayer.cc */, 2A25738F16A48DAC00363C6F /* ParticlePlayer.h */, 2A25738D16A48DAC00363C6F /* ParticlePlayer_ScriptBinding.h */, @@ -2303,7 +2321,6 @@ 86BC7EC516518D4600D96ADF /* SceneObject_ScriptBinding.h */, 2AA6865A16D69943003CEF0A /* SceneObjectList.cc */, 2AA6865B16D69943003CEF0A /* SceneObjectList.h */, - 86BC7EC816518D4600D96ADF /* SceneObjectMoveToEvent.h */, 86BC7EC916518D4600D96ADF /* SceneObjectRotateToEvent.h */, 2AA6865D16D69943003CEF0A /* SceneObjectSet.cc */, 2AA6865E16D69943003CEF0A /* SceneObjectSet.h */, @@ -2376,6 +2393,8 @@ 86BC7F0016518D4600D96ADF /* audio */ = { isa = PBXGroup; children = ( + D000F9711CB0CF4800C4D097 /* audioDescriptions.cc */, + D000F9721CB0CF4800C4D097 /* audioDescriptions.h */, B350D171174EF91900033EBB /* audio_ScriptBinding.cc */, 86BC7F0116518D4600D96ADF /* audio.cc */, 86BC7F0216518D4600D96ADF /* audio.h */, @@ -3219,6 +3238,20 @@ path = threads; sourceTree = ""; }; + D000F9741CB0D16A00C4D097 /* bitmapFont */ = { + isa = PBXGroup; + children = ( + D000F9751CB0D16A00C4D097 /* BitmapFont.cc */, + D000F9761CB0D16A00C4D097 /* BitmapFont.h */, + D000F9771CB0D16A00C4D097 /* BitmapFontCharacter.cc */, + D000F9781CB0D16A00C4D097 /* BitmapFontCharacter.h */, + D000F9791CB0D16A00C4D097 /* BitmapFontCharacterInfo.h */, + D000F97A1CB0D16A00C4D097 /* BitmapFontLineInfo.h */, + ); + name = bitmapFont; + path = ../../../source/bitmapFont; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -3246,7 +3279,7 @@ 869FF8AF1651518C002FE082 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0510; ORGANIZATIONNAME = "Michael Perry"; }; buildConfigurationList = 869FF8B21651518C002FE082 /* Build configuration list for PBXProject "Torque2D" */; @@ -3348,6 +3381,7 @@ 27908DFB18A3F8CB002D41BD /* AnimationState.c in Sources */, 86D770991656873C0046D71F /* msgBox.cpp in Sources */, 86D770AA1656873C0046D71F /* scriptGroup.cc in Sources */, + D000F9731CB0CF4800C4D097 /* audioDescriptions.cc in Sources */, 86D770AB1656873C0046D71F /* scriptObject.cc in Sources */, 86D770AC1656873C0046D71F /* simBase.cc in Sources */, 86D770AD1656873C0046D71F /* simConsoleEvent.cc in Sources */, @@ -3385,6 +3419,8 @@ 86D7704C165687220046D71F /* centralDir.cc in Sources */, 86D7704D165687220046D71F /* compressor.cc in Sources */, 86D7704E165687220046D71F /* deflate.cc in Sources */, + D000F97C1CB0D16A00C4D097 /* BitmapFontCharacter.cc in Sources */, + D000F97B1CB0D16A00C4D097 /* BitmapFont.cc in Sources */, 86D7704F165687220046D71F /* extraField.cc in Sources */, 86D77050165687220046D71F /* fileHeader.cc in Sources */, 86D77051165687220046D71F /* stored.cc in Sources */, @@ -3426,6 +3462,7 @@ 27908E0A18A3F8CB002D41BD /* SkeletonBounds.c in Sources */, 86D76FD2165687060046D71F /* RemoteDebugger1.cc in Sources */, 86D76FD3165687060046D71F /* RemoteDebuggerBase.cc in Sources */, + D000F9801CB0D1B300C4D097 /* FontAsset.cc in Sources */, 86D76FD4165687060046D71F /* RemoteDebuggerBridge.cc in Sources */, 86D76FD5165687060046D71F /* telnetDebugger.cc in Sources */, 86D76FD6165687060046D71F /* delegateSignal.cpp in Sources */, @@ -3660,6 +3697,7 @@ 865A2331165187FF00527C44 /* jquant2.c in Sources */, 27908E0218A3F8CB002D41BD /* BoneData.c in Sources */, 865A2332165187FF00527C44 /* jutils.c in Sources */, + D000F9841CB0D25A00C4D097 /* TextSprite.cc in Sources */, 865A23421651881300527C44 /* png.c in Sources */, 865A23431651881300527C44 /* pngerror.c in Sources */, 27908E0718A3F8CB002D41BD /* Json.c in Sources */, @@ -3717,7 +3755,6 @@ 2A25739016A48DAC00363C6F /* ParticlePlayer.cc in Sources */, 2AE5B54216A6D860006908D5 /* ParticleAssetFieldCollection.cc in Sources */, 2AF3633916A9BBE0004ED7AA /* ParticleSystem.cc in Sources */, - 2AC4404516B0142B00FC4091 /* ImageFont.cc in Sources */, 2AF1C54016B439BB00C1CF3A /* declaredAssets.cc in Sources */, 2AF1C54116B439BB00C1CF3A /* referencedAssets.cc in Sources */, 2AB97A1D16B66BC70080F940 /* tamlCustom.cc in Sources */, @@ -3768,7 +3805,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libstdc++"; CLANG_WARN_EMPTY_BODY = YES; @@ -3795,7 +3831,6 @@ 865A20AF165152EA00527C44 /* Shipping */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; CLANG_CXX_LIBRARY = "libc++"; COMBINE_HIDPI_IMAGES = YES; CONFIGURATION_BUILD_DIR = ../../..; @@ -3837,7 +3872,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libstdc++"; CLANG_WARN_EMPTY_BODY = YES; @@ -3862,7 +3896,7 @@ HEADER_SEARCH_PATHS = ""; LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.6; - ONLY_ACTIVE_ARCH = NO; + ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; VALID_ARCHS = i386; }; @@ -3872,7 +3906,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libstdc++"; CLANG_WARN_EMPTY_BODY = YES; @@ -3903,7 +3936,6 @@ 869FF8D71651518C002FE082 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; CLANG_CXX_LIBRARY = "libc++"; COMBINE_HIDPI_IMAGES = YES; CONFIGURATION_BUILD_DIR = ../../..; @@ -3946,7 +3978,6 @@ 869FF8D81651518C002FE082 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; CLANG_CXX_LIBRARY = "libc++"; COMBINE_HIDPI_IMAGES = YES; CONFIGURATION_BUILD_DIR = ../../..; diff --git a/engine/source/audio/audioDescriptions.cc b/engine/source/audio/audioDescriptions.cc index f3d6aceed..c4778397f 100644 --- a/engine/source/audio/audioDescriptions.cc +++ b/engine/source/audio/audioDescriptions.cc @@ -1,5 +1,5 @@ #ifndef _AUDIODESCRIPTION_H_ -#include "audio\audioDescriptions.h" +#include "audio/audioDescriptions.h" #endif #include "audio/audio.h" diff --git a/engine/source/platformOSX/osxOpenGLDevice.h b/engine/source/platformOSX/osxOpenGLDevice.h index f6c7b54a2..072c2f7e9 100755 --- a/engine/source/platformOSX/osxOpenGLDevice.h +++ b/engine/source/platformOSX/osxOpenGLDevice.h @@ -73,6 +73,8 @@ class osxOpenGLDevice : public DisplayDevice bool setGammaCorrection(F32 g); + bool getVerticalSync(); + bool setVerticalSync( bool sync ); }; diff --git a/engine/source/platformOSX/osxOpenGLDevice.mm b/engine/source/platformOSX/osxOpenGLDevice.mm index 79da9692f..f286b7669 100755 --- a/engine/source/platformOSX/osxOpenGLDevice.mm +++ b/engine/source/platformOSX/osxOpenGLDevice.mm @@ -407,6 +407,20 @@ //----------------------------------------------------------------------------- +bool osxOpenGLDevice::getVerticalSync() +{ + if (!gGLState.suppSwapInterval) + { + return false; + } + + //Note that this returns the number of frames between Swaps. + //The function returns 0 / false if SwapInterval has not been specified. + return getVerticalSync(); +} + +//----------------------------------------------------------------------------- + bool osxOpenGLDevice::setVerticalSync( bool sync ) { if ([[platState torqueView] contextInitialized]) diff --git a/engine/source/platformOSX/osxTorqueView.mm b/engine/source/platformOSX/osxTorqueView.mm index fa232cf8c..6e2a9a5b1 100755 --- a/engine/source/platformOSX/osxTorqueView.mm +++ b/engine/source/platformOSX/osxTorqueView.mm @@ -165,6 +165,21 @@ - (void)flushBuffer [_openGLContext flushBuffer]; } +//----------------------------------------------------------------------------- +- (int)getVerticalSync +{ + if (_openGLContext != nil) + { + GLint swapInterval = 0; + [_openGLContext getValues:&swapInterval forParameter:NSOpenGLCPSwapInterval]; + return swapInterval; + } + else + { + return 0; + } +} + //----------------------------------------------------------------------------- - (void)setVerticalSync:(bool)sync { From 89884c1208707771eacc76513cd06ce502adbb9c Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sun, 3 Apr 2016 00:43:58 -0400 Subject: [PATCH 2/3] iOS Fixes Included the TextSprite and made changes to fix bugs for iOS. --- .../Torque2D.xcodeproj/project.pbxproj | 57 +++++++++++++++---- engine/source/platformiOS/iOSOGLVideo.h | 1 + engine/source/platformiOS/iOSOGLVideo.mm | 6 ++ 3 files changed, 54 insertions(+), 10 deletions(-) diff --git a/engine/compilers/Xcode_iOS/Torque2D.xcodeproj/project.pbxproj b/engine/compilers/Xcode_iOS/Torque2D.xcodeproj/project.pbxproj index b774b956f..c5a1802c9 100644 --- a/engine/compilers/Xcode_iOS/Torque2D.xcodeproj/project.pbxproj +++ b/engine/compilers/Xcode_iOS/Torque2D.xcodeproj/project.pbxproj @@ -40,7 +40,6 @@ 2AB4C1B016DE9F6700B02479 /* GroupedSceneController.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2AB4C1AA16DE9F6700B02479 /* GroupedSceneController.cc */; }; 2AB4C1B116DE9F6700B02479 /* PickingSceneController.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2AB4C1AD16DE9F6700B02479 /* PickingSceneController.cc */; }; 2AB97A2116B66BE50080F940 /* tamlCustom.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2AB97A1F16B66BE50080F940 /* tamlCustom.cc */; }; - 2AC4404E16B0144500FC4091 /* ImageFont.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2AC4404C16B0144500FC4091 /* ImageFont.cc */; }; 2ACAFD471705CF340022601C /* tamlJSONParser.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2ACAFD451705CF340022601C /* tamlJSONParser.cc */; }; 2ACF5A2C16E52D6A00F838D9 /* SpriteBatchQuery.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2ACF5A2916E52D6A00F838D9 /* SpriteBatchQuery.cc */; }; 2AD42156170434C2005BB8AD /* tamlBinaryReader.cc in Sources */ = {isa = PBXBuildFile; fileRef = 2AD42152170434C2005BB8AD /* tamlBinaryReader.cc */; }; @@ -508,6 +507,11 @@ B350D1A3174F063200033EBB /* math_ScriptBinding.cc in Sources */ = {isa = PBXBuildFile; fileRef = B350D19F174F063200033EBB /* math_ScriptBinding.cc */; }; B350D1A5174F064000033EBB /* frameAllocator_ScriptBinding.cc in Sources */ = {isa = PBXBuildFile; fileRef = B350D1A4174F064000033EBB /* frameAllocator_ScriptBinding.cc */; }; B350D1BB174F06B700033EBB /* platformNetwork_ScriptBinding.cc in Sources */ = {isa = PBXBuildFile; fileRef = B350D1B8174F06B700033EBB /* platformNetwork_ScriptBinding.cc */; }; + D000F9881CB0D44600C4D097 /* TextSprite.cc in Sources */ = {isa = PBXBuildFile; fileRef = D000F9861CB0D44600C4D097 /* TextSprite.cc */; }; + D000F98C1CB0D46D00C4D097 /* FontAsset.cc in Sources */ = {isa = PBXBuildFile; fileRef = D000F98A1CB0D46D00C4D097 /* FontAsset.cc */; }; + D000F9941CB0D48600C4D097 /* BitmapFont.cc in Sources */ = {isa = PBXBuildFile; fileRef = D000F98E1CB0D48600C4D097 /* BitmapFont.cc */; }; + D000F9951CB0D48600C4D097 /* BitmapFontCharacter.cc in Sources */ = {isa = PBXBuildFile; fileRef = D000F9901CB0D48600C4D097 /* BitmapFontCharacter.cc */; }; + D000F9981CB0D5DD00C4D097 /* audioDescriptions.cc in Sources */ = {isa = PBXBuildFile; fileRef = D000F9961CB0D5DD00C4D097 /* audioDescriptions.cc */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -588,9 +592,6 @@ 2AB4C1AF16DE9F6700B02479 /* SceneController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SceneController.h; path = controllers/core/SceneController.h; sourceTree = ""; }; 2AB97A1F16B66BE50080F940 /* tamlCustom.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tamlCustom.cc; sourceTree = ""; }; 2AB97A2016B66BE50080F940 /* tamlCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tamlCustom.h; sourceTree = ""; }; - 2AC4404B16B0144500FC4091 /* ImageFont_ScriptBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageFont_ScriptBinding.h; sourceTree = ""; }; - 2AC4404C16B0144500FC4091 /* ImageFont.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageFont.cc; sourceTree = ""; }; - 2AC4404D16B0144500FC4091 /* ImageFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageFont.h; sourceTree = ""; }; 2ACAFD451705CF340022601C /* tamlJSONParser.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = tamlJSONParser.cc; path = json/tamlJSONParser.cc; sourceTree = ""; }; 2ACAFD461705CF340022601C /* tamlJSONParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tamlJSONParser.h; path = json/tamlJSONParser.h; sourceTree = ""; }; 2ACF5A2916E52D6A00F838D9 /* SpriteBatchQuery.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpriteBatchQuery.cc; sourceTree = ""; }; @@ -784,7 +785,6 @@ 867BAD5216AEC9050033868F /* SceneObject.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SceneObject.cc; sourceTree = ""; }; 867BAD5316AEC9050033868F /* SceneObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SceneObject.h; sourceTree = ""; }; 867BAD5416AEC9050033868F /* SceneObject_ScriptBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SceneObject_ScriptBinding.h; sourceTree = ""; }; - 867BAD5716AEC9050033868F /* SceneObjectMoveToEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SceneObjectMoveToEvent.h; sourceTree = ""; }; 867BAD5816AEC9050033868F /* SceneObjectRotateToEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SceneObjectRotateToEvent.h; sourceTree = ""; }; 867BAD5D16AEC9050033868F /* Scroller.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Scroller.cc; sourceTree = ""; }; 867BAD5E16AEC9050033868F /* Scroller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Scroller.h; sourceTree = ""; }; @@ -1584,6 +1584,20 @@ B350D1C2174F06DE00033EBB /* simSet_ScriptBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = simSet_ScriptBinding.h; sourceTree = ""; }; B350D1C3174F06ED00033EBB /* stringBuffer_ScriptBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stringBuffer_ScriptBinding.h; sourceTree = ""; }; B350D1C4174F06ED00033EBB /* stringUnit_ScriptBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stringUnit_ScriptBinding.h; sourceTree = ""; }; + D000F9851CB0D44600C4D097 /* TextSprite_ScriptBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextSprite_ScriptBinding.h; sourceTree = ""; }; + D000F9861CB0D44600C4D097 /* TextSprite.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextSprite.cc; sourceTree = ""; }; + D000F9871CB0D44600C4D097 /* TextSprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextSprite.h; sourceTree = ""; }; + D000F9891CB0D46D00C4D097 /* FontAsset_ScriptBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontAsset_ScriptBinding.h; sourceTree = ""; }; + D000F98A1CB0D46D00C4D097 /* FontAsset.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontAsset.cc; sourceTree = ""; }; + D000F98B1CB0D46D00C4D097 /* FontAsset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontAsset.h; sourceTree = ""; }; + D000F98E1CB0D48600C4D097 /* BitmapFont.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BitmapFont.cc; sourceTree = ""; }; + D000F98F1CB0D48600C4D097 /* BitmapFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitmapFont.h; sourceTree = ""; }; + D000F9901CB0D48600C4D097 /* BitmapFontCharacter.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BitmapFontCharacter.cc; sourceTree = ""; }; + D000F9911CB0D48600C4D097 /* BitmapFontCharacter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitmapFontCharacter.h; sourceTree = ""; }; + D000F9921CB0D48600C4D097 /* BitmapFontCharacterInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitmapFontCharacterInfo.h; sourceTree = ""; }; + D000F9931CB0D48600C4D097 /* BitmapFontLineInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitmapFontLineInfo.h; sourceTree = ""; }; + D000F9961CB0D5DD00C4D097 /* audioDescriptions.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = audioDescriptions.cc; sourceTree = ""; }; + D000F9971CB0D5DD00C4D097 /* audioDescriptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = audioDescriptions.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -1877,6 +1891,9 @@ 867BACF916AEC9050033868F /* assets */ = { isa = PBXGroup; children = ( + D000F9891CB0D46D00C4D097 /* FontAsset_ScriptBinding.h */, + D000F98A1CB0D46D00C4D097 /* FontAsset.cc */, + D000F98B1CB0D46D00C4D097 /* FontAsset.h */, 27908E1818A3FA9C002D41BD /* SkeletonAsset_ScriptBinding.h */, 27908E1918A3FA9C002D41BD /* SkeletonAsset.cc */, 27908E1A18A3FA9C002D41BD /* SkeletonAsset.h */, @@ -1984,6 +2001,9 @@ 867BAD4516AEC9050033868F /* sceneobject */ = { isa = PBXGroup; children = ( + D000F9851CB0D44600C4D097 /* TextSprite_ScriptBinding.h */, + D000F9861CB0D44600C4D097 /* TextSprite.cc */, + D000F9871CB0D44600C4D097 /* TextSprite.h */, 27908E1C18A3FAB1002D41BD /* SkeletonObject_ScriptBinding.h */, 27908E1D18A3FAB1002D41BD /* SkeletonObject.cc */, 27908E1E18A3FAB1002D41BD /* SkeletonObject.h */, @@ -1992,9 +2012,6 @@ 2AA6866716D69968003CEF0A /* SceneObjectSet_ScriptBinding.h */, 2AA6866816D69968003CEF0A /* SceneObjectSet.cc */, 2AA6866916D69968003CEF0A /* SceneObjectSet.h */, - 2AC4404B16B0144500FC4091 /* ImageFont_ScriptBinding.h */, - 2AC4404C16B0144500FC4091 /* ImageFont.cc */, - 2AC4404D16B0144500FC4091 /* ImageFont.h */, 867BAD4916AEC9050033868F /* CompositeSprite.cc */, 867BAD4A16AEC9050033868F /* CompositeSprite.h */, 867BAD4B16AEC9050033868F /* CompositeSprite_ScriptBinding.h */, @@ -2004,7 +2021,6 @@ 867BAD5216AEC9050033868F /* SceneObject.cc */, 867BAD5316AEC9050033868F /* SceneObject.h */, 867BAD5416AEC9050033868F /* SceneObject_ScriptBinding.h */, - 867BAD5716AEC9050033868F /* SceneObjectMoveToEvent.h */, 867BAD5816AEC9050033868F /* SceneObjectRotateToEvent.h */, 867BAD5D16AEC9050033868F /* Scroller.cc */, 867BAD5E16AEC9050033868F /* Scroller.h */, @@ -2071,6 +2087,8 @@ 867BAD8916AEC9050033868F /* audio */ = { isa = PBXGroup; children = ( + D000F9961CB0D5DD00C4D097 /* audioDescriptions.cc */, + D000F9971CB0D5DD00C4D097 /* audioDescriptions.h */, B350D17B174F053800033EBB /* audio_ScriptBinding.cc */, 867BAD8A16AEC9050033868F /* audio.cc */, 867BAD8B16AEC9050033868F /* audio.h */, @@ -3220,6 +3238,7 @@ 86A9A3BA16AEC786003F01E6 /* Torque2D */ = { isa = PBXGroup; children = ( + D000F98D1CB0D48600C4D097 /* bitmapFont */, 867BACF816AEC9050033868F /* 2d */, 867BAD6916AEC9050033868F /* algorithm */, 867BAD7016AEC9050033868F /* assets */, @@ -3272,6 +3291,20 @@ path = Torque2D; sourceTree = ""; }; + D000F98D1CB0D48600C4D097 /* bitmapFont */ = { + isa = PBXGroup; + children = ( + D000F98E1CB0D48600C4D097 /* BitmapFont.cc */, + D000F98F1CB0D48600C4D097 /* BitmapFont.h */, + D000F9901CB0D48600C4D097 /* BitmapFontCharacter.cc */, + D000F9911CB0D48600C4D097 /* BitmapFontCharacter.h */, + D000F9921CB0D48600C4D097 /* BitmapFontCharacterInfo.h */, + D000F9931CB0D48600C4D097 /* BitmapFontLineInfo.h */, + ); + name = bitmapFont; + path = ../../../source/bitmapFont; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -3425,6 +3458,7 @@ 867BB00B16AEC9050033868F /* assetQuery.cc in Sources */, 867BB00D16AEC9050033868F /* assetTagsManifest.cc in Sources */, 867BB00E16AEC9050033868F /* audio.cc in Sources */, + D000F9981CB0D5DD00C4D097 /* audioDescriptions.cc in Sources */, 27908E5418A3FAE1002D41BD /* AttachmentLoader.c in Sources */, 867BB00F16AEC9050033868F /* AudioAsset.cc in Sources */, 867BB01016AEC9050033868F /* audioBuffer.cc in Sources */, @@ -3530,6 +3564,7 @@ 867BB07D16AEC9050033868F /* guiCanvas.cc in Sources */, 867BB07F16AEC9050033868F /* guiConsole.cc in Sources */, 867BB08016AEC9050033868F /* guiConsoleEditCtrl.cc in Sources */, + D000F9951CB0D48600C4D097 /* BitmapFontCharacter.cc in Sources */, 867BB08116AEC9050033868F /* guiConsoleTextCtrl.cc in Sources */, 867BB08216AEC9050033868F /* guiControl.cc in Sources */, 867BB08316AEC9050033868F /* guiDefaultControlRender.cc in Sources */, @@ -3572,6 +3607,7 @@ 867BB0A816AEC9050033868F /* centralDir.cc in Sources */, 27908E5118A3FAE1002D41BD /* Atlas.c in Sources */, 867BB0A916AEC9050033868F /* compressor.cc in Sources */, + D000F98C1CB0D46D00C4D097 /* FontAsset.cc in Sources */, 867BB0AA16AEC9050033868F /* deflate.cc in Sources */, 867BB0AB16AEC9050033868F /* extraField.cc in Sources */, 867BB0AC16AEC9050033868F /* fileHeader.cc in Sources */, @@ -3725,6 +3761,7 @@ 867BB21D16AECA070033868F /* pngread.c in Sources */, 867BB21E16AECA070033868F /* pngrio.c in Sources */, 867BB21F16AECA070033868F /* pngrtran.c in Sources */, + D000F9881CB0D44600C4D097 /* TextSprite.cc in Sources */, 867BB22016AECA070033868F /* pngrutil.c in Sources */, 867BB22116AECA070033868F /* pngset.c in Sources */, 867BB22216AECA070033868F /* pngtrans.c in Sources */, @@ -3758,6 +3795,7 @@ 27908E4F18A3FAE1002D41BD /* AnimationState.c in Sources */, 867BB26B16AECA110033868F /* jddctmgr.c in Sources */, 867BB26C16AECA110033868F /* jdhuff.c in Sources */, + D000F9941CB0D48600C4D097 /* BitmapFont.cc in Sources */, 867BB26D16AECA110033868F /* jdinput.c in Sources */, 867BB26E16AECA110033868F /* jdmainct.c in Sources */, 867BB26F16AECA110033868F /* jdmarker.c in Sources */, @@ -3781,7 +3819,6 @@ 867BB28116AECA110033868F /* jquant2.c in Sources */, 867BB28216AECA110033868F /* jutils.c in Sources */, 867BB44416AED2850033868F /* iOSGL2ES.mm in Sources */, - 2AC4404E16B0144500FC4091 /* ImageFont.cc in Sources */, 86555D3716B2C2B400881446 /* T2DAppDelegate.mm in Sources */, 86555D3816B2C2B400881446 /* T2DView.mm in Sources */, 86555D3916B2C2B400881446 /* T2DViewController.mm in Sources */, diff --git a/engine/source/platformiOS/iOSOGLVideo.h b/engine/source/platformiOS/iOSOGLVideo.h index 41dfcc368..2e384d92a 100755 --- a/engine/source/platformiOS/iOSOGLVideo.h +++ b/engine/source/platformiOS/iOSOGLVideo.h @@ -54,6 +54,7 @@ class OpenGLDevice : public DisplayDevice const char* getDriverInfo(); bool getGammaCorrection(F32 &g); bool setGammaCorrection(F32 g); + bool getVerticalSync( ); bool setVerticalSync( bool on ); }; diff --git a/engine/source/platformiOS/iOSOGLVideo.mm b/engine/source/platformiOS/iOSOGLVideo.mm index 3b1183784..e78eef1d6 100755 --- a/engine/source/platformiOS/iOSOGLVideo.mm +++ b/engine/source/platformiOS/iOSOGLVideo.mm @@ -261,6 +261,12 @@ void initDummyAgl(void) return true; } +//------------------------------------------------------------------------------ +bool OpenGLDevice::getVerticalSync() +{ + return true; +} + //------------------------------------------------------------------------------ bool OpenGLDevice::setVerticalSync(bool on) { From 0c8b73cc3e7dbf9bd6a7a70e9e7cfe89b78c8ab3 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sun, 3 Apr 2016 10:25:18 -0400 Subject: [PATCH 3/3] Updated the Readme to 3.3 --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c03d07868..f27cb58e3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ ![Torque Logo](http://static.garagegames.com/static/pg/logokits/Torque-Logo_H.png) -## Torque 2D 3.2 +## Torque 2D 3.3 MIT Licensed Open Source version of Torque 2D from GarageGames. Maintained by the T2D Steering Committee and contributions from the community. @@ -21,11 +21,11 @@ If you do not wish to compile the source code yourself, precompiled binary files After downloading a copy of the source code, the following project files for each platform are provided for you and can be found in the `engine/compilers` folder. -* **Windows:** Visual Studio 2010, 2012, or 2013 (works with the free, "Express for Windows Desktop" version) +* **Windows:** Visual Studio 2013 or 2015 (works with the free, "Express for Windows Desktop" version) * **OSX:** Xcode * **Linux:** Make * **iOS:** Xcode_iOS -* **Android:** Eclipse +* **Android:** Eclipse or Android Studio * **Web:** Emscripten/Cmake See the [wiki](https://github.com/GarageGames/Torque2D/wiki) for available guides on platform setup and development.