Browse Source

- Merged final fixes and cleanup from private repo. Performing final pass for release.

Michael Perry 12 years ago
parent
commit
9a3e854

+ 8 - 8
engine/compilers/Xcode/Torque2D.xcodeproj/project.pbxproj

@@ -30,11 +30,10 @@
 		8609FE38165572EC004662ED /* osxFont.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8609FE37165572EC004662ED /* osxFont.mm */; };
 		861CD8D01678F6C200DAE1A0 /* fileDialog.cc in Sources */ = {isa = PBXBuildFile; fileRef = 861CD8CF1678F6C200DAE1A0 /* fileDialog.cc */; };
 		8652C279165586520052D0CB /* osxAudio.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8652C278165586520052D0CB /* osxAudio.mm */; };
+		8652F2A016C146CF00639EFE /* torque2d.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8652F29F16C146CF00639EFE /* torque2d.icns */; };
 		8658B174165A7BFB0087ABC1 /* osxCPU.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8658B171165A7BFB0087ABC1 /* osxCPU.mm */; };
 		8658B175165A7BFB0087ABC1 /* osxNetwork.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8658B172165A7BFB0087ABC1 /* osxNetwork.mm */; };
 		8658B176165A7BFB0087ABC1 /* osxString.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8658B173165A7BFB0087ABC1 /* osxString.mm */; };
-		865A20B11651530B00527C44 /* Config.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 865A20B01651530B00527C44 /* Config.xcconfig */; };
-		865A20BF165158CA00527C44 /* torque2d.icns in Resources */ = {isa = PBXBuildFile; fileRef = 865A20BE165158CA00527C44 /* torque2d.icns */; };
 		865A20CA16515B1E00527C44 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 869FF8BF1651518C002FE082 /* AppKit.framework */; };
 		865A20CB16515B1E00527C44 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 865A20C116515ACE00527C44 /* AVFoundation.framework */; };
 		865A20CC16515B1E00527C44 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 869FF8BC1651518C002FE082 /* Cocoa.framework */; };
@@ -492,6 +491,7 @@
 		864ECFEE165279E100012416 /* networkProcessList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = networkProcessList.h; sourceTree = "<group>"; };
 		864ECFF016527A8500012416 /* gameInterface_ScriptBinding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gameInterface_ScriptBinding.h; sourceTree = "<group>"; };
 		8652C278165586520052D0CB /* osxAudio.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = osxAudio.mm; sourceTree = "<group>"; };
+		8652F29F16C146CF00639EFE /* torque2d.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = torque2d.icns; sourceTree = "<group>"; };
 		8658B171165A7BFB0087ABC1 /* osxCPU.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = osxCPU.mm; sourceTree = "<group>"; };
 		8658B172165A7BFB0087ABC1 /* osxNetwork.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = osxNetwork.mm; sourceTree = "<group>"; };
 		8658B173165A7BFB0087ABC1 /* osxString.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = osxString.mm; sourceTree = "<group>"; };
@@ -1659,6 +1659,7 @@
 		869FF8AD1651518C002FE082 = {
 			isa = PBXGroup;
 			children = (
+				8652F29F16C146CF00639EFE /* torque2d.icns */,
 				869FF8C21651518C002FE082 /* Torque2D */,
 				865A2351165188AF00527C44 /* platformOSX */,
 				865A21E71651875E00527C44 /* Support_Libraries */,
@@ -2738,7 +2739,7 @@
 		869FF8AF1651518C002FE082 /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
-				LastUpgradeCheck = 0450;
+				LastUpgradeCheck = 0460;
 				ORGANIZATIONNAME = "Michael Perry";
 			};
 			buildConfigurationList = 869FF8B21651518C002FE082 /* Build configuration list for PBXProject "Torque2D" */;
@@ -2763,9 +2764,8 @@
 			isa = PBXResourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				865A20B11651530B00527C44 /* Config.xcconfig in Resources */,
-				865A20BF165158CA00527C44 /* torque2d.icns in Resources */,
 				86C281CD16A4307E00F030F4 /* MainMenu.xib in Resources */,
+				8652F2A016C146CF00639EFE /* torque2d.icns in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -3237,7 +3237,7 @@
 				HEADER_SEARCH_PATHS = "";
 				LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks";
 				MACOSX_DEPLOYMENT_TARGET = 10.7;
-				SDKROOT = macosx10.7;
+				SDKROOT = macosx;
 			};
 			name = Shipping;
 		};
@@ -3303,7 +3303,7 @@
 				LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks";
 				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				ONLY_ACTIVE_ARCH = NO;
-				SDKROOT = macosx10.7;
+				SDKROOT = macosx;
 			};
 			name = Debug;
 		};
@@ -3333,7 +3333,7 @@
 				HEADER_SEARCH_PATHS = "";
 				LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks";
 				MACOSX_DEPLOYMENT_TARGET = 10.7;
-				SDKROOT = macosx10.7;
+				SDKROOT = macosx;
 			};
 			name = Release;
 		};

+ 1 - 1
engine/compilers/Xcode/Torque2D/Torque2D-Info.plist

@@ -22,7 +22,7 @@
 	<key>CFBundleExecutable</key>
 	<string>${EXECUTABLE_NAME}</string>
 	<key>CFBundleIconFile</key>
-	<string></string>
+	<string>torque2d</string>
 	<key>CFBundleIdentifier</key>
 	<string>com.garagegames.${PRODUCT_NAME:rfc1034identifier}</string>
 	<key>CFBundleInfoDictionaryVersion</key>

BIN
engine/compilers/Xcode/Torque2D/torque2d.icns


BIN
engine/compilers/Xcode/torque2d.icns


+ 28 - 0
engine/compilers/Xcode_iOS/Torque2D.xcodeproj/project.pbxproj

@@ -15,6 +15,9 @@
 		33230F1656FA2C7C493DA2D2 /* guiSliderCtrl.cc in Sources */ = {isa = PBXBuildFile; fileRef = 332307DBC5B7EEEB22E5A736 /* guiSliderCtrl.cc */; };
 		8610F32F16AEEC670015BCEB /* main.cs in Resources */ = {isa = PBXBuildFile; fileRef = 8610F32D16AEEC670015BCEB /* main.cs */; };
 		8610F33016AEEC670015BCEB /* modules in Resources */ = {isa = PBXBuildFile; fileRef = 8610F32E16AEEC670015BCEB /* modules */; };
+		8652F2A216C1483B00639EFE /* torque2d.png in Resources */ = {isa = PBXBuildFile; fileRef = 8652F2A116C1483B00639EFE /* torque2d.png */; };
+		8652F2A416C148CA00639EFE /* torque2d_retina.png in Resources */ = {isa = PBXBuildFile; fileRef = 8652F2A316C148CA00639EFE /* torque2d_retina.png */; };
+		8652F2A616C1493B00639EFE /* torque2d_ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 8652F2A516C1493B00639EFE /* torque2d_ipad.png */; };
 		86555D2F16B2C29200881446 /* iPadStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 86555D2B16B2C29200881446 /* iPadStoryboard.storyboard */; };
 		86555D3016B2C29200881446 /* iPhoneStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 86555D2D16B2C29200881446 /* iPhoneStoryboard.storyboard */; };
 		86555D3716B2C2B400881446 /* T2DAppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 86555D3216B2C2B400881446 /* T2DAppDelegate.mm */; };
@@ -443,6 +446,10 @@
 		867BB28116AECA110033868F /* jquant2.c in Sources */ = {isa = PBXBuildFile; fileRef = 867BB25316AECA110033868F /* jquant2.c */; };
 		867BB28216AECA110033868F /* jutils.c in Sources */ = {isa = PBXBuildFile; fileRef = 867BB25416AECA110033868F /* jutils.c */; };
 		867BB44416AED2850033868F /* iOSGL2ES.mm in Sources */ = {isa = PBXBuildFile; fileRef = 867BB44316AED2840033868F /* iOSGL2ES.mm */; };
+		869A879216C15A3A00AE96AE /* Default-Portrait~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 869A879116C15A3A00AE96AE /* Default-Portrait~ipad.png */; };
+		869A879416C15A4300AE96AE /* Default-Portrait@2x~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 869A879316C15A4300AE96AE /* Default-Portrait@2x~ipad.png */; };
+		869A879616C15A4900AE96AE /* Default-Landscape~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 869A879516C15A4900AE96AE /* Default-Landscape~ipad.png */; };
+		869A879816C15A4F00AE96AE /* Default-Landscape@2x~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 869A879716C15A4F00AE96AE /* Default-Landscape@2x~ipad.png */; };
 		86A9A3B516AEC786003F01E6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 86A9A3B416AEC786003F01E6 /* UIKit.framework */; };
 		86A9A3B716AEC786003F01E6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 86A9A3B616AEC786003F01E6 /* Foundation.framework */; };
 		86A9A3B916AEC786003F01E6 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 86A9A3B816AEC786003F01E6 /* CoreGraphics.framework */; };
@@ -480,6 +487,9 @@
 		33230911303CCA4C673E1A22 /* guiSliderCtrl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = guiSliderCtrl.h; sourceTree = "<group>"; };
 		8610F32D16AEEC670015BCEB /* main.cs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = main.cs; path = ../../../main.cs; sourceTree = "<group>"; };
 		8610F32E16AEEC670015BCEB /* modules */ = {isa = PBXFileReference; lastKnownFileType = folder; name = modules; path = ../../../modules; sourceTree = "<group>"; };
+		8652F2A116C1483B00639EFE /* torque2d.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = torque2d.png; path = ../torque2d.png; sourceTree = "<group>"; };
+		8652F2A316C148CA00639EFE /* torque2d_retina.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = torque2d_retina.png; path = ../torque2d_retina.png; sourceTree = "<group>"; };
+		8652F2A516C1493B00639EFE /* torque2d_ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = torque2d_ipad.png; path = ../torque2d_ipad.png; sourceTree = "<group>"; };
 		86555D2C16B2C29200881446 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/iPadStoryboard.storyboard; sourceTree = "<group>"; };
 		86555D2E16B2C29200881446 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/iPhoneStoryboard.storyboard; sourceTree = "<group>"; };
 		86555D3116B2C2B400881446 /* T2DAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = T2DAppDelegate.h; sourceTree = "<group>"; };
@@ -1346,6 +1356,10 @@
 		867BB25416AECA110033868F /* jutils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = jutils.c; path = ../../lib/ljpeg/jutils.c; sourceTree = "<group>"; };
 		867BB44216AED2840033868F /* iOSGL2ES.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iOSGL2ES.h; sourceTree = "<group>"; };
 		867BB44316AED2840033868F /* iOSGL2ES.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = iOSGL2ES.mm; sourceTree = "<group>"; };
+		869A879116C15A3A00AE96AE /* Default-Portrait~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Portrait~ipad.png"; sourceTree = "<group>"; };
+		869A879316C15A4300AE96AE /* Default-Portrait@2x~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Portrait@2x~ipad.png"; sourceTree = "<group>"; };
+		869A879516C15A4900AE96AE /* Default-Landscape~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape~ipad.png"; sourceTree = "<group>"; };
+		869A879716C15A4F00AE96AE /* Default-Landscape@2x~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape@2x~ipad.png"; sourceTree = "<group>"; };
 		86A9A3B016AEC786003F01E6 /* Torque2D.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Torque2D.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		86A9A3B416AEC786003F01E6 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
 		86A9A3B616AEC786003F01E6 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
@@ -2794,6 +2808,13 @@
 		86A9A3BB16AEC786003F01E6 /* Supporting Files */ = {
 			isa = PBXGroup;
 			children = (
+				869A879716C15A4F00AE96AE /* Default-Landscape@2x~ipad.png */,
+				869A879516C15A4900AE96AE /* Default-Landscape~ipad.png */,
+				869A879316C15A4300AE96AE /* Default-Portrait@2x~ipad.png */,
+				869A879116C15A3A00AE96AE /* Default-Portrait~ipad.png */,
+				8652F2A516C1493B00639EFE /* torque2d_ipad.png */,
+				8652F2A316C148CA00639EFE /* torque2d_retina.png */,
+				8652F2A116C1483B00639EFE /* torque2d.png */,
 				86A9A3BC16AEC786003F01E6 /* Torque2D-Info.plist */,
 				86555D2B16B2C29200881446 /* iPadStoryboard.storyboard */,
 				86555D2D16B2C29200881446 /* iPhoneStoryboard.storyboard */,
@@ -2867,6 +2888,13 @@
 				8610F33016AEEC670015BCEB /* modules in Resources */,
 				86555D2F16B2C29200881446 /* iPadStoryboard.storyboard in Resources */,
 				86555D3016B2C29200881446 /* iPhoneStoryboard.storyboard in Resources */,
+				8652F2A216C1483B00639EFE /* torque2d.png in Resources */,
+				8652F2A416C148CA00639EFE /* torque2d_retina.png in Resources */,
+				8652F2A616C1493B00639EFE /* torque2d_ipad.png in Resources */,
+				869A879216C15A3A00AE96AE /* Default-Portrait~ipad.png in Resources */,
+				869A879416C15A4300AE96AE /* Default-Portrait@2x~ipad.png in Resources */,
+				869A879616C15A4900AE96AE /* Default-Landscape~ipad.png in Resources */,
+				869A879816C15A4F00AE96AE /* Default-Landscape@2x~ipad.png in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

BIN
engine/compilers/Xcode_iOS/Torque2D/Default-Landscape@2x~ipad.png


BIN
engine/compilers/Xcode_iOS/Torque2D/Default-Landscape~ipad.png


BIN
engine/compilers/Xcode_iOS/Torque2D/Default-Portrait@2x~ipad.png


BIN
engine/compilers/Xcode_iOS/Torque2D/Default-Portrait~ipad.png


+ 12 - 0
engine/compilers/Xcode_iOS/Torque2D/Torque2D-Info.plist

@@ -8,6 +8,18 @@
 	<string>${PRODUCT_NAME}</string>
 	<key>CFBundleExecutable</key>
 	<string>${EXECUTABLE_NAME}</string>
+	<key>CFBundleIcons</key>
+	<dict>
+		<key>CFBundlePrimaryIcon</key>
+		<dict>
+			<key>CFBundleIconFiles</key>
+			<array>
+				<string>torque2d.png</string>
+				<string>torque2d_retina.png</string>
+				<string>torque2d_ipad.png</string>
+			</array>
+		</dict>
+	</dict>
 	<key>CFBundleIdentifier</key>
 	<string>com.garagegames.${PRODUCT_NAME:rfc1034identifier}</string>
 	<key>CFBundleInfoDictionaryVersion</key>

BIN
engine/compilers/Xcode_iOS/torque2d.png


BIN
engine/compilers/Xcode_iOS/torque2d_ipad.png


BIN
engine/compilers/Xcode_iOS/torque2d_retina.png


+ 1 - 1
engine/source/2d/core/ParticleSystem.h

@@ -92,7 +92,7 @@ public:
     void freeParticle( ParticleNode* pParticleNode );
 
     inline U32 getActiveParticleCount( void ) const { return mActiveParticleCount; };
-    inline U32 getAllocatedParticleCount( void ) const { return mParticlePool.size() * mParticlePoolBlockSize; }
+    inline U32 getAllocatedParticleCount( void ) const { return (U32)mParticlePool.size() * mParticlePoolBlockSize; }
 };
 
 #endif // _PARTICLE_SYSTEM_H_

+ 110 - 88
engine/source/2d/sceneobject/ParticlePlayer.cc

@@ -207,7 +207,7 @@ void ParticlePlayer::preIntegrate( const F32 totalTime, const F32 elapsedTime, D
     Parent::preIntegrate( totalTime, elapsedTime, pDebugStats );
 
     // Finish if the camera idle distance is zero.
-    if ( mIsZero(mCameraIdleDistance) )
+    if ( mIsZero(mCameraIdleDistance) || !validRender() )
         return;
 
     // Fetch current position.
@@ -256,14 +256,10 @@ void ParticlePlayer::integrateObject( const F32 totalTime, const F32 elapsedTime
 
     // Finish if no need to integrate.
     if (    !mPlaying ||
-            mCameraIdle ||
             mPaused ||
             mEmitters.size() == 0 )
         return;
 
-    // Yes, so update the particle player age.
-    mAge += elapsedTime;
-
     // Fetch particle asset.
     ParticleAsset* pParticleAsset = mParticleAsset;
 
@@ -271,106 +267,119 @@ void ParticlePlayer::integrateObject( const F32 totalTime, const F32 elapsedTime
     if ( pParticleAsset == NULL )
         return;
 
-    // Iterate the emitters.
-    for( typeEmitterVector::iterator emitterItr = mEmitters.begin(); emitterItr != mEmitters.end(); ++emitterItr )
+    // Reset active particle count.
+    U32 activeParticleCount = 0;
+
+    // Is the camera idle?
+    if ( !mCameraIdle )
     {
-        // Fetch the emitter node.
-        EmitterNode* pEmitterNode = *emitterItr;
+        // No, so update the particle player age.
+        mAge += elapsedTime;
 
-        // Fetch the asset emitter.
-        ParticleAssetEmitter* pParticleAssetEmitter = pEmitterNode->getAssetEmitter();
+        // Iterate the emitters.
+        for( typeEmitterVector::iterator emitterItr = mEmitters.begin(); emitterItr != mEmitters.end(); ++emitterItr )
+        {
+            // Fetch the emitter node.
+            EmitterNode* pEmitterNode = *emitterItr;
 
-        // Fetch the first particle node.
-        ParticleSystem::ParticleNode* pParticleNode = pEmitterNode->getFirstParticle();
+            // Fetch the asset emitter.
+            ParticleAssetEmitter* pParticleAssetEmitter = pEmitterNode->getAssetEmitter();
 
-        // Fetch the particle node head.
-        ParticleSystem::ParticleNode* pParticleNodeHead = pEmitterNode->getParticleNodeHead();
+            // Fetch the first particle node.
+            ParticleSystem::ParticleNode* pParticleNode = pEmitterNode->getFirstParticle();
 
-        // Process All particle nodes.
-        while ( pParticleNode != pParticleNodeHead )
-        {
-            // Update the particle age.
-            pParticleNode->mParticleAge += elapsedTime;
+            // Fetch the particle node head.
+            ParticleSystem::ParticleNode* pParticleNodeHead = pEmitterNode->getParticleNodeHead();
 
-            // Has the particle expired?
-            // NOTE:-   If we're in single-particle mode then the particle lives as long as the particle player does.
-            if (    ( !pParticleAssetEmitter->getSingleParticle() && pParticleNode->mParticleAge > pParticleNode->mParticleLifetime ) ||
-                    ( mIsZero(pParticleNode->mParticleLifetime) ) )
+            // Process All particle nodes.
+            while ( pParticleNode != pParticleNodeHead )
             {
-                // Yes, so fetch next particle before we kill it.
-                pParticleNode = pParticleNode->mNextNode;
+                // Update the particle age.
+                pParticleNode->mParticleAge += elapsedTime;
 
-                // Kill the particle.
-                // NOTE:-   Because we move to the next particle the particle to kill is now the previous!
-                pEmitterNode->freeParticle( pParticleNode->mPreviousNode );
-            }
-            else
-            {
-                // No, so integrate the particle.
-                integrateParticle( pEmitterNode, pParticleNode, pParticleNode->mParticleAge / pParticleNode->mParticleLifetime, elapsedTime );
+                // Has the particle expired?
+                // NOTE:-   If we're in single-particle mode then the particle lives as long as the particle player does.
+                if (    ( !pParticleAssetEmitter->getSingleParticle() && pParticleNode->mParticleAge > pParticleNode->mParticleLifetime ) ||
+                        ( mIsZero(pParticleNode->mParticleLifetime) ) )
+                {
+                    // Yes, so fetch next particle before we kill it.
+                    pParticleNode = pParticleNode->mNextNode;
 
-                // Move to the next particle node.
-                pParticleNode = pParticleNode->mNextNode;
-            }
-        };
+                    // Kill the particle.
+                    // NOTE:-   Because we move to the next particle the particle to kill is now the previous!
+                    pEmitterNode->freeParticle( pParticleNode->mPreviousNode );
+                }
+                else
+                {
+                    // No, so integrate the particle.
+                    integrateParticle( pEmitterNode, pParticleNode, pParticleNode->mParticleAge / pParticleNode->mParticleLifetime, elapsedTime );
 
-        // Skip generating new particles if the emitter is paused.
-        if ( pEmitterNode->getPaused() )
-            continue;
+                    // Move to the next particle node.
+                    pParticleNode = pParticleNode->mNextNode;
 
-        // Are we in single-particle mode?
-        if ( pParticleAssetEmitter->getSingleParticle() )
-        {
-            // Yes, so do we have a single particle yet?
-            if ( pParticleNodeHead->mNextNode == pParticleNodeHead )
+                    // Only count particles when not in single-particle mode.
+                    activeParticleCount++;
+                }
+            };
+
+            // Skip generating new particles if the emitter is paused.
+            if ( pEmitterNode->getPaused() )
+                continue;
+
+            // Are we in single-particle mode?
+            if ( pParticleAssetEmitter->getSingleParticle() )
             {
-                // No, so generate a single particle.
-                pEmitterNode->createParticle();
+                // Yes, so do we have a single particle yet?
+                if ( pParticleNodeHead->mNextNode == pParticleNodeHead )
+                {
+                    // No, so generate a single particle.
+                    pEmitterNode->createParticle();
+                }
             }
-        }
-        else
-        {
-            // Accumulate the last generation time as we need to handle very small time-integrations correctly.
-            //
-            // NOTE:    We need to do this if there's an emission target but the time-integration is so small
-            //          that rounding results in no emission.  Downside to good FPS!
-            pEmitterNode->setTimeSinceLastGeneration( pEmitterNode->getTimeSinceLastGeneration() + elapsedTime );
+            else
+            {
+                // Accumulate the last generation time as we need to handle very small time-integrations correctly.
+                //
+                // NOTE:    We need to do this if there's an emission target but the time-integration is so small
+                //          that rounding results in no emission.  Downside to good FPS!
+                pEmitterNode->setTimeSinceLastGeneration( pEmitterNode->getTimeSinceLastGeneration() + elapsedTime );
 
-            // Fetch the particle player age.
-            const F32 particlePlayerAge = mAge;
+                // Fetch the particle player age.
+                const F32 particlePlayerAge = mAge;
 
-            // Fetch the quantity base and variation fields.
-            const ParticleAssetField& quantityBaseField = pParticleAssetEmitter->getQuantityBaseField();
-            const ParticleAssetField& quantityVaritationField = pParticleAssetEmitter->getQuantityBaseField();
+                // Fetch the quantity base and variation fields.
+                const ParticleAssetField& quantityBaseField = pParticleAssetEmitter->getQuantityBaseField();
+                const ParticleAssetField& quantityVaritationField = pParticleAssetEmitter->getQuantityBaseField();
 
-            // Fetch the emissions.
-            const F32 baseEmission = quantityBaseField.getFieldValue( particlePlayerAge );
-            const F32 varEmission = quantityVaritationField.getFieldValue( particlePlayerAge ) * 0.5f;
+                // Fetch the emissions.
+                const F32 baseEmission = quantityBaseField.getFieldValue( particlePlayerAge );
+                const F32 varEmission = quantityVaritationField.getFieldValue( particlePlayerAge ) * 0.5f;
 
-            // Fetch the emission scale.
-            const F32 effectEmission = pParticleAsset->getQuantityScaleField().getFieldValue( particlePlayerAge ) * getEmissionRateScale();
+                // Fetch the emission scale.
+                const F32 effectEmission = pParticleAsset->getQuantityScaleField().getFieldValue( particlePlayerAge ) * getEmissionRateScale();
 
-            // Calculate the local emission.
-            const F32 localEmission = mClampF(  (baseEmission + CoreMath::mGetRandomF(-varEmission, varEmission)) * effectEmission,
-                                                quantityBaseField.getMinValue(),
-                                                quantityBaseField.getMaxValue() );
+                // Calculate the local emission.
+                const F32 localEmission = mClampF(  (baseEmission + CoreMath::mGetRandomF(-varEmission, varEmission)) * effectEmission,
+                                                    quantityBaseField.getMinValue(),
+                                                    quantityBaseField.getMaxValue() );
 
-            // Calculate the final time-independent emission count.
-            const U32 emissionCount = U32(mFloor( localEmission * pEmitterNode->getTimeSinceLastGeneration() ));
+                // Calculate the final time-independent emission count.
+                const U32 emissionCount = U32(mFloor( localEmission * pEmitterNode->getTimeSinceLastGeneration() ));
 
-            // Do we have an emission?
-            if ( emissionCount > 0 )
-            {
-                // Yes, so remove this emission from accumulated time.
-                pEmitterNode->setTimeSinceLastGeneration( getMax(0.0f, pEmitterNode->getTimeSinceLastGeneration() - (emissionCount / localEmission) ) );
+                // Do we have an emission?
+                if ( emissionCount > 0 )
+                {
+                    // Yes, so remove this emission from accumulated time.
+                    pEmitterNode->setTimeSinceLastGeneration( getMax(0.0f, pEmitterNode->getTimeSinceLastGeneration() - (emissionCount / localEmission) ) );
 
-                // Suppress Precision Errors.
-                if ( mIsZero( pEmitterNode->getTimeSinceLastGeneration() ) )
-                    pEmitterNode->setTimeSinceLastGeneration( 0.0f );
+                    // Suppress Precision Errors.
+                    if ( mIsZero( pEmitterNode->getTimeSinceLastGeneration() ) )
+                        pEmitterNode->setTimeSinceLastGeneration( 0.0f );
 
-                // Generate the required emission.
-                for ( U32 n = 0; n < emissionCount; n++ )
-                    pEmitterNode->createParticle();
+                    // Generate the required emission.
+                    for ( U32 n = 0; n < emissionCount; n++ )
+                        pEmitterNode->createParticle();
+                }
             }
         }
     }
@@ -378,10 +387,23 @@ void ParticlePlayer::integrateObject( const F32 totalTime, const F32 elapsedTime
     // Fetch the particle life-mode.
     const ParticleAsset::LifeMode lifeMode = pParticleAsset->getLifeMode();
 
-    // Finish if we're waiting for particles already.
-    if ( mWaitingForParticles || lifeMode == ParticleAsset::INFINITE )
+    // Finish if the particle player is in "infinite" mode.
+    if ( lifeMode == ParticleAsset::INFINITE )
         return;
 
+    // Are we waiting for particles and there are non left?
+    if ( mWaitingForParticles )
+    {
+        // Yes, so are there any particles left?
+        if ( activeParticleCount == 0 )
+        {
+            // No, so stop the player immediately.
+            stop( false, mWaitingForDelete );
+        }
+
+        return;
+    }
+
     // Fetch the particle lifetime.
     const F32 lifetime = pParticleAsset->getLifetime();
 
@@ -395,7 +417,7 @@ void ParticlePlayer::integrateObject( const F32 totalTime, const F32 elapsedTime
             play( false );
         }
         return;
-    };
+    }
 
     // Stop life-mode?
     if ( lifeMode == ParticleAsset::STOP )
@@ -407,7 +429,7 @@ void ParticlePlayer::integrateObject( const F32 totalTime, const F32 elapsedTime
             stop( true, false );
         }
         return;
-    };
+    }
 
     // kill life-mode?
     if ( lifeMode == ParticleAsset::KILL )
@@ -419,7 +441,7 @@ void ParticlePlayer::integrateObject( const F32 totalTime, const F32 elapsedTime
             stop( true, true );
         }
         return;
-    };
+    }
 }
 
 //------------------------------------------------------------------------------

+ 0 - 3
engine/source/2d/sceneobject/ParticlePlayer.h

@@ -190,9 +190,6 @@ public:
     inline void setPaused( const bool paused ) { mPaused = paused; }
     inline bool getPaused( void ) const { return mPaused; }
 
-    bool moveEffectTo( const F32 moveTime, const F32 timeStep, U32& peakCount, F32& peakTime );
-    bool findParticlePeak( const F32 searchTime, const F32 timeStep, const U32 peakLimit, U32& peakCount, F32& peakTime );
-
     /// Declare Console Object.
     DECLARE_CONOBJECT(ParticlePlayer);
 

+ 2 - 2
engine/source/game/version.h

@@ -24,8 +24,8 @@
 #define _ENGINE_VERSION_H_
 
 // Engine Version.
-#define T2D_ENGINE_VERSION      		"v1.7.5"        ///< Engine Version String.
-#define T2D_IPHONETOOLS_VERSION      	"v1.5"          ///< Engine Version String for iPhone tools. Changing this will allow a fresh AppData folder to avoid conflicts with other builds existing on the system.
+#define T2D_ENGINE_VERSION      		"v2.0"        ///< Engine Version String.
+#define T2D_IPHONETOOLS_VERSION      	"v2.0"          ///< Engine Version String for iPhone tools. Changing this will allow a fresh AppData folder to avoid conflicts with other builds existing on the system.
 
 /// Gets the specified version number.  The version number is specified as a global in version.cc
 U32 getVersionNumber();

+ 1 - 1
engine/source/gui/guiControl.h

@@ -130,7 +130,7 @@ public:
 
     /// @name Keyboard Input
     /// @{
-    GuiControl *mFirstResponder;
+    SimObjectPtr<GuiControl> mFirstResponder;
     static GuiControl *smPrevResponder;
     static GuiControl *smCurResponder;
     /// @}

+ 13 - 13
engine/source/platformOSX/osxInput.mm

@@ -130,7 +130,7 @@ void Input::reactivate()
 
 //------------------------------------------------------------------------------
 // Print the entire input state to the console
-#pragma message ("Input::echoInputState not yet implemented")
+// Not yet implemented or unnecessary. Will resolve in the next platform update
 void Input::echoInputState()
 {
 }
@@ -279,33 +279,33 @@ InputManager *Input::getManager()
 }
 
 //------------------------------------------------------------------------------
-#pragma message ("Input::getKeyCode not yet implemented")
+// Not yet implemented. Will resolve in the next platform update
 U16 Input::getKeyCode(U16 asciiCode)
 {
     return 0;
 }
 
 //------------------------------------------------------------------------------
-#pragma message ("Input::getAscii not yet implemented")
+// Not yet implemented. Will resolve in the next platform update
 U16 Input::getAscii(U16 keyCode, KEY_STATE keyState)
 {
     return 0;
 }
 
 //------------------------------------------------------------------------------
-#pragma message ("Input::pushCursor not yet implemented")
+// Not yet implemented. Will resolve in the next platform update
 void Input::pushCursor(S32 cursorID)
 {
 }
 
 //------------------------------------------------------------------------------
-#pragma message ("Input::popCursor not yet implemented")
+// Not yet implemented. Will resolve in the next platform update
 void Input::popCursor()
 {
 }
 
 //-----------------------------------------------------------------------------
-#pragma message ("Input::refreshCursor not yet implemented")
+// Not yet implemented. Will resolve in the next platform update
 void Input::refreshCursor()
 {
 }
@@ -333,20 +333,20 @@ S32 Input::getDoubleClickHeight()
 }
 
 //------------------------------------------------------------------------------
-#pragma message ("Input::setCursorPos not yet implemented")
+// Not yet implemented. Will resolve in the next platform update
 void Input::setCursorPos(S32 x, S32 y)
 {
 }
 
 //-----------------------------------------------------------------------------
-#pragma message ("Input::setCursorState not yet implemented")
+// Not yet implemented. Will resolve in the next platform update
 void Input::setCursorState(bool on)
 {
 
 }
 
 //-----------------------------------------------------------------------------
-#pragma message ("Input::setCursorShape not yet implemented")
+// Not yet implemented. Will resolve in the next platform update
 void Input::setCursorShape(U32 cursorID)
 {
 
@@ -355,28 +355,28 @@ void Input::setCursorShape(U32 cursorID)
 #pragma mark ---- Platform Namespace Functions ----
 
 //------------------------------------------------------------------------------
-#pragma message ("Input::getClipBoard not yet implemented")
+// Not yet implemented. Will resolve in the next platform update
 const char *Platform::getClipboard()
 {
     return NULL;
 }
 
 //-----------------------------------------------------------------------------
-#pragma message ("Input::setClipBoard not yet implemented")
+// Not yet implemented. Will resolve in the next platform update
 bool Platform::setClipboard(const char *text)
 {
     return false;
 }
 
 //-----------------------------------------------------------------------------
-#pragma message ("Input::enableKeyboardTranslation not yet implemented")
+// Not yet implemented. Will resolve in the next platform update
 void Platform::enableKeyboardTranslation(void)
 {
 
 }
 
 //-----------------------------------------------------------------------------
-#pragma message ("Input::disableKeyboardTranslation not yet implemented")
+// Not yet implemented. Will resolve in the next platform update
 void Platform::disableKeyboardTranslation(void)
 {
 

+ 21 - 3
engine/source/platformOSX/osxOpenGLDevice.mm

@@ -88,7 +88,25 @@ bool osxOpenGLDevice::enumDisplayModes( CGDirectDisplayID display )
             // Skip the mode.
             continue;
         }
-        
+
+        // Prepare the resolution.
+        Resolution foundResolution( width, height, bitDepth );
+
+        // Ensure this isn't already in the list.
+        bool alreadyPresent = false;
+        for( Vector<Resolution>::iterator itr = mResolutionList.begin(); itr != mResolutionList.end(); ++itr )
+        {
+            if ( *itr == foundResolution )
+            {
+                alreadyPresent = true;
+                break;
+            }
+        }
+
+        // Skip if already present.
+        if ( alreadyPresent )
+            continue;
+
         // Store the resolution.
         mResolutionList.push_back( Resolution( width, height, bitDepth ) );
     }
@@ -360,14 +378,14 @@ const char* osxOpenGLDevice::getDriverInfo()
 }
 
 //-----------------------------------------------------------------------------
-#pragma message ("osxOpenGLDevice::getGammaCorrection not yet implemented")
+// Not yet implemented. Will resolve in the next video update
 bool osxOpenGLDevice::getGammaCorrection(F32 &g)
 {
     return false;
 }
 
 //-----------------------------------------------------------------------------
-#pragma message ("osxOpenGLDevice::setGammaCorrection not yet implemented")
+// Not yet implemented. Will resolve in the next video update
 bool osxOpenGLDevice::setGammaCorrection(F32 g)
 {
     return false;

+ 1 - 1
engine/source/platformOSX/osxPopupMenu.mm

@@ -170,7 +170,7 @@ bool PopupMenu::handleSelect(U32 command, const char *text /* = NULL */)
 }
 
 //-----------------------------------------------------------------------------
-#pragma message ("PopupMenu::showPopup not yet implemented")
+// Not yet implemented or no longer necessary. Will resolve in the next platform update
 void PopupMenu::showPopup(S32 x /* = -1 */, S32 y /* = -1 */)
 {
     // Get the position of the cursor

+ 11 - 0
engine/source/platformOSX/osxTorqueView.mm

@@ -100,6 +100,17 @@
     NSSize size = [[self window] frame].size;
 
     [[osxPlatState sharedPlatState] setWindowSize:(S32)size.width height:(S32)size.height];
+    
+    NSRect frame = NSMakeRect(0, 0, size.width, size.height);
+    
+    S32 barHeight = frame.size.height;
+    frame = [NSWindow frameRectForContentRect:frame styleMask:NSTitledWindowMask];
+    barHeight -= frame.size.height;
+    
+    NSRect viewFrame = NSMakeRect(0, barHeight, frame.size.width, frame.size.height);
+    
+    [self setFrame:viewFrame];
+    [self updateContext];
 }
 
 #pragma mark ---- OSXTorqueView OpenGL Handling ----

+ 2 - 1
engine/source/platformOSX/osxWindow.mm

@@ -88,7 +88,6 @@ void Platform::initWindow(const Point2I &initialSize, const char *name)
     // Create the NSWindow
     osxPlatState * platState = [osxPlatState sharedPlatState];
     
-    [platState setWindowSize:initialSize.x height:initialSize.y];
     
     NSRect frame = NSMakeRect(0, 0, [platState windowWidth], [platState windowHeight]);
     
@@ -106,6 +105,8 @@ void Platform::initWindow(const Point2I &initialSize, const char *name)
 
     [platState setWindow:tempWindow];
     
+    [platState setWindowSize:initialSize.x height:initialSize.y];
+    
     [platState updateWindowTitle:name];
     
     // Set up TorqueView and add it here:

+ 27 - 3
engine/source/platformOSX/platformOSX.mm

@@ -125,15 +125,39 @@ static osxPlatState * tempSharedPlatState = nil;
 
 - (void)setWindowSize:(int)width height:(int)height
 {
+    // Store the width and height in the state
+    _windowSize.x = width;
+    _windowSize.y = height;
+    
+    // Get the window's current frame
     NSRect frame = NSMakeRect([_window frame].origin.x, [_window frame].origin.y, width, height);
 
+    // Get the starting position of the bar height
+    F32 barOffset = frame.size.height;
+    
+    // If we are not going to full screen mode, get a new frame offset that accounts
+    // for the title bar height
     if (!_fullscreen)
+    {
         frame = [NSWindow frameRectForContentRect:frame styleMask:NSTitledWindowMask];
 
-    [_window setFrame:frame display:YES];
+        // Set the new window frame
+        [_window setFrame:frame display:YES];
+        
+        // Get the new position of the title bar
+        barOffset -= frame.size.height;
+    }
+    else
+    {
+        // Otherwise, just go straight full screen
+        [_window toggleFullScreen:self];
+    }
     
-    _windowSize.x = width;
-    _windowSize.y = height;
+    // Update the frame of the torqueView to match the window
+    frame = NSMakeRect([_window frame].origin.x, [_window frame].origin.y, width, height); 
+    NSRect viewFrame = NSMakeRect(0, 0, frame.size.width, frame.size.height);
+     
+    [_torqueView setFrame:viewFrame];
     
     [_torqueView updateContext];
 }

+ 7 - 3
engine/source/platformiOS/main.mm

@@ -87,7 +87,9 @@ void _iOSGameInnerLoop()
 
 void _iOSGameResignActive()
 {
-	Con::executef( 1, "oniOSResignActive" );
+    if ( Con::isFunction("oniOSResignActive") )
+        Con::executef( 1, "oniOSResignActive" );
+    
     appIsRunning = false;
 }
 
@@ -95,14 +97,16 @@ void _iOSGameBecomeActive()
 {
 	clearPendingMultitouchEvents( );
     
-	Con::executef( 1, "oniOSBecomeActive" );
+    if ( Con::isFunction("oniOSBecomeActive") )
+        Con::executef( 1, "oniOSBecomeActive" );
     
     appIsRunning = true;
 }
 
 void _iOSGameWillTerminate()
 {
-	Con::executef( 1, "oniOSWillTerminate" );
+    if ( Con::isFunction("oniOSWillTerminate") )
+        Con::executef( 1, "oniOSWillTerminate" );
     
 	Con::executef( 1, "onExit" );
     

+ 6 - 3
modules/Sandbox/1/scripts/toolbox.cs

@@ -46,9 +46,12 @@ function ToyCategorySelectList::onSelect(%this)
     }
     else
     {
-        %firstToyButton = ToyListArray.getObject(0);
-        if (isObject(%firstToyButton))
-            %firstToyButton.performSelect();
+        if ( ToyListArray.getCount() > 0 )
+        {
+            %firstToyButton = ToyListArray.getObject(0);
+            if (isObject(%firstToyButton))
+                %firstToyButton.performSelect();
+        }
     }
 }