Browse Source

Converted tabs to spaces.

Darryl Gough 13 years ago
parent
commit
1c7a3c6fbf

+ 1 - 1
gameplay/src/AudioBuffer.cpp

@@ -101,7 +101,7 @@ AudioBuffer* AudioBuffer::create(const char* path)
         goto cleanup;
     }
 
-	//NOTE: loadOgg actually sets this null, so it is expected
+    //NOTE: loadOgg actually sets this null, so it is expected
     if (file)    
         fclose(file);
 

+ 10 - 10
gameplay/src/BoundingBox.h

@@ -39,11 +39,11 @@ public:
     /**
      * Constructs a new bounding box from the specified values.
      * 
-     * @param minX The x coordinate of the minimum point of the bounding box.
-     * @param minY The y coordinate of the minimum point of the bounding box.
-     * @param minZ The z coordinate of the minimum point of the bounding box.
-     * @param maxX The x coordinate of the maximum point of the bounding box.
-     * @param maxY The y coordinate of the maximum point of the bounding box.
+     * @param minX The x coordinate of the minimum point of the bounding box.
+     * @param minY The y coordinate of the minimum point of the bounding box.
+     * @param minZ The z coordinate of the minimum point of the bounding box.
+     * @param maxX The x coordinate of the maximum point of the bounding box.
+     * @param maxY The y coordinate of the maximum point of the bounding box.
      * @param maxZ The z coordinate of the maximum point of the bounding box.
      */
     BoundingBox(float minX, float minY, float minZ, float maxX, float maxY, float maxZ);
@@ -178,11 +178,11 @@ public:
     /**
      * Sets this bounding box to the specified values.
      * 
-     * @param minX The x coordinate of the minimum point of the bounding box.
-     * @param minY The y coordinate of the minimum point of the bounding box.
-     * @param minZ The z coordinate of the minimum point of the bounding box.
-     * @param maxX The x coordinate of the maximum point of the bounding box.
-     * @param maxY The y coordinate of the maximum point of the bounding box.
+     * @param minX The x coordinate of the minimum point of the bounding box.
+     * @param minY The y coordinate of the minimum point of the bounding box.
+     * @param minZ The z coordinate of the minimum point of the bounding box.
+     * @param maxX The x coordinate of the maximum point of the bounding box.
+     * @param maxY The y coordinate of the maximum point of the bounding box.
      * @param maxZ The z coordinate of the maximum point of the bounding box.
      */
     void set(float minX, float minY, float minZ, float maxX, float maxY, float maxZ);

+ 26 - 26
gameplay/src/Button.cpp

@@ -40,41 +40,41 @@ bool Button::touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contac
     case Touch::TOUCH_PRESS:
         if (_contactIndex == INVALID_CONTACT_INDEX)
         {
-			if (x > _clipBounds.x && x <= _clipBounds.x + _clipBounds.width &&
-				y > _clipBounds.y && y <= _clipBounds.y + _clipBounds.height)
-			{
-				_contactIndex = (int) contactIndex;
+            if (x > _clipBounds.x && x <= _clipBounds.x + _clipBounds.width &&
+                y > _clipBounds.y && y <= _clipBounds.y + _clipBounds.height)
+            {
+                _contactIndex = (int) contactIndex;
 
-				setState(Control::ACTIVE);
+                setState(Control::ACTIVE);
 
-				notifyListeners(Listener::PRESS);
+                notifyListeners(Listener::PRESS);
 
-				return _consumeInputEvents;
-			}
-			else
-			{
-				setState(Control::NORMAL);
-			}
+                return _consumeInputEvents;
+            }
+            else
+            {
+                setState(Control::NORMAL);
+            }
         }
         break;
 
     case Touch::TOUCH_RELEASE:
         if (_contactIndex == (int) contactIndex)
         {
-			_contactIndex = INVALID_CONTACT_INDEX;
-			notifyListeners(Listener::RELEASE);
-			if (x > _clipBounds.x && x <= _clipBounds.x + _clipBounds.width &&
-				y > _clipBounds.y && y <= _clipBounds.y + _clipBounds.height)
-			{
-				setState(Control::FOCUS);
-
-				notifyListeners(Listener::CLICK);
-			}
-			else
-			{
-				setState(Control::NORMAL);
-			}
-			return _consumeInputEvents;
+            _contactIndex = INVALID_CONTACT_INDEX;
+            notifyListeners(Listener::RELEASE);
+            if (x > _clipBounds.x && x <= _clipBounds.x + _clipBounds.width &&
+                y > _clipBounds.y && y <= _clipBounds.y + _clipBounds.height)
+            {
+                setState(Control::FOCUS);
+
+                notifyListeners(Listener::CLICK);
+            }
+            else
+            {
+                setState(Control::NORMAL);
+            }
+            return _consumeInputEvents;
         }
         break;
     case Touch::TOUCH_MOVE:

+ 9 - 9
gameplay/src/CheckBox.cpp

@@ -84,15 +84,15 @@ bool CheckBox::touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int cont
     switch (evt)
     {
     case Touch::TOUCH_RELEASE:
-		if (_contactIndex == (int) contactIndex && _state == Control::ACTIVE)
-		{
-			if (x > _clipBounds.x && x <= _clipBounds.x + _clipBounds.width &&
-				y > _clipBounds.y && y <= _clipBounds.y + _clipBounds.height)
-			{
-				_checked = !_checked;
-				notifyListeners(Control::Listener::VALUE_CHANGED);
-			}
-		}
+        if (_contactIndex == (int) contactIndex && _state == Control::ACTIVE)
+        {
+            if (x > _clipBounds.x && x <= _clipBounds.x + _clipBounds.width &&
+                y > _clipBounds.y && y <= _clipBounds.y + _clipBounds.height)
+            {
+                _checked = !_checked;
+                notifyListeners(Control::Listener::VALUE_CHANGED);
+            }
+        }
         break;
     }
 

+ 69 - 69
gameplay/src/Container.cpp

@@ -730,26 +730,26 @@ bool Container::touchEventScroll(Touch::TouchEvent evt, int x, int y, unsigned i
     switch(evt)
     {
     case Touch::TOUCH_PRESS:
-    	if (_contactIndex == INVALID_CONTACT_INDEX)
-    	{
-    		_contactIndex = (int) contactIndex;
-    		_contactIndices++;
-			_scrollingLastX = _scrollingFirstX = x;
-			_scrollingLastY = _scrollingFirstY = y;
-			_scrollingVelocity.set(0, 0);
-			_scrolling = true;
-			_scrollingStartTimeX = _scrollingStartTimeY = 0;
-
-			if (_scrollBarOpacityClip && _scrollBarOpacityClip->isPlaying())
-			{
-				_scrollBarOpacityClip->stop();
-				_scrollBarOpacityClip = NULL;
-			}
-			_scrollBarOpacity = 1.0f;
+        if (_contactIndex == INVALID_CONTACT_INDEX)
+        {
+            _contactIndex = (int) contactIndex;
+            _contactIndices++;
+            _scrollingLastX = _scrollingFirstX = x;
+            _scrollingLastY = _scrollingFirstY = y;
+            _scrollingVelocity.set(0, 0);
+            _scrolling = true;
+            _scrollingStartTimeX = _scrollingStartTimeY = 0;
+
+            if (_scrollBarOpacityClip && _scrollBarOpacityClip->isPlaying())
+            {
+                _scrollBarOpacityClip->stop();
+                _scrollBarOpacityClip = NULL;
+            }
+            _scrollBarOpacity = 1.0f;
             _dirty = true;
-			return _consumeInputEvents;
-    	}
-		break;
+            return _consumeInputEvents;
+        }
+        break;
     case Touch::TOUCH_MOVE:
         if (_scrolling && _contactIndex == (int) contactIndex)
         {
@@ -814,58 +814,58 @@ bool Container::touchEventScroll(Touch::TouchEvent evt, int x, int y, unsigned i
         break;
 
     case Touch::TOUCH_RELEASE:
-    	if (_contactIndex == (int) contactIndex)
-    	{
-    		_contactIndex = INVALID_CONTACT_INDEX;
-    		_contactIndices--;
-			_scrolling = false;
-			double gameTime = Game::getAbsoluteTime();
-			float timeSinceLastMove = (float)(gameTime - _scrollingLastTime);
-			if (timeSinceLastMove > SCROLL_INERTIA_DELAY)
-			{
-				_scrollingVelocity.set(0, 0);
-				_scrollingMouseVertically = _scrollingMouseHorizontally = false;
+        if (_contactIndex == (int) contactIndex)
+        {
+            _contactIndex = INVALID_CONTACT_INDEX;
+            _contactIndices--;
+            _scrolling = false;
+            double gameTime = Game::getAbsoluteTime();
+            float timeSinceLastMove = (float)(gameTime - _scrollingLastTime);
+            if (timeSinceLastMove > SCROLL_INERTIA_DELAY)
+            {
+                _scrollingVelocity.set(0, 0);
+                _scrollingMouseVertically = _scrollingMouseHorizontally = false;
                 _dirty = true;
-				return _consumeInputEvents;
-			}
-
-			int dx = _scrollingLastX - _scrollingFirstX;
-			int dy = _scrollingLastY - _scrollingFirstY;
-
-			float timeTakenX = (float)(gameTime - _scrollingStartTimeX);
-			float elapsedSecsX = timeTakenX * 0.001f;
-			float timeTakenY = (float)(gameTime - _scrollingStartTimeY);
-			float elapsedSecsY = timeTakenY * 0.001f;
-
-			float vx = dx;
-			float vy = dy;
-			if (elapsedSecsX > 0)
-				vx = (float)dx / elapsedSecsX;
-			if (elapsedSecsY > 0)
-				vy = (float)dy / elapsedSecsY;
-
-			if (_scrollingMouseVertically)
-			{
-				float yRatio = _totalHeight / _absoluteBounds.height;
-				vy *= yRatio;
-				_scrollingVelocity.set(0, -vy);
-			}
-			else if (_scrollingMouseHorizontally)
-			{
-				float xRatio = _totalWidth / _absoluteBounds.width;
-				vx *= xRatio;
-				_scrollingVelocity.set(-vx, 0);
-			}
-			else
-			{
-				_scrollingVelocity.set(vx, vy);
-			}
-
-			_scrollingMouseVertically = _scrollingMouseHorizontally = false;
+                return _consumeInputEvents;
+            }
+
+            int dx = _scrollingLastX - _scrollingFirstX;
+            int dy = _scrollingLastY - _scrollingFirstY;
+
+            float timeTakenX = (float)(gameTime - _scrollingStartTimeX);
+            float elapsedSecsX = timeTakenX * 0.001f;
+            float timeTakenY = (float)(gameTime - _scrollingStartTimeY);
+            float elapsedSecsY = timeTakenY * 0.001f;
+
+            float vx = dx;
+            float vy = dy;
+            if (elapsedSecsX > 0)
+                vx = (float)dx / elapsedSecsX;
+            if (elapsedSecsY > 0)
+                vy = (float)dy / elapsedSecsY;
+
+            if (_scrollingMouseVertically)
+            {
+                float yRatio = _totalHeight / _absoluteBounds.height;
+                vy *= yRatio;
+                _scrollingVelocity.set(0, -vy);
+            }
+            else if (_scrollingMouseHorizontally)
+            {
+                float xRatio = _totalWidth / _absoluteBounds.width;
+                vx *= xRatio;
+                _scrollingVelocity.set(-vx, 0);
+            }
+            else
+            {
+                _scrollingVelocity.set(vx, vy);
+            }
+
+            _scrollingMouseVertically = _scrollingMouseHorizontally = false;
             _dirty = true;
-			return _consumeInputEvents;
-    	}
-    	break;
+            return _consumeInputEvents;
+        }
+        break;
     }
 
     return false;

+ 11 - 11
gameplay/src/Control.cpp

@@ -744,20 +744,20 @@ bool Control::touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int conta
     case Touch::TOUCH_RELEASE:
         if (_contactIndex == (int)contactIndex)
         {
-			_contactIndex = INVALID_CONTACT_INDEX;
+            _contactIndex = INVALID_CONTACT_INDEX;
 
-			// Always trigger Listener::RELEASE
-			notifyListeners(Listener::RELEASE);
+            // Always trigger Listener::RELEASE
+            notifyListeners(Listener::RELEASE);
 
-			// Only trigger Listener::CLICK if both PRESS and RELEASE took place within the control's bounds.
-			if (x > _clipBounds.x && x <= _clipBounds.x + _clipBounds.width &&
-				y > _clipBounds.y && y <= _clipBounds.y + _clipBounds.height)
-			{
-				// Leave this control in the FOCUS state.
-				notifyListeners(Listener::CLICK);
-			}
+            // Only trigger Listener::CLICK if both PRESS and RELEASE took place within the control's bounds.
+            if (x > _clipBounds.x && x <= _clipBounds.x + _clipBounds.width &&
+                y > _clipBounds.y && y <= _clipBounds.y + _clipBounds.height)
+            {
+                // Leave this control in the FOCUS state.
+                notifyListeners(Listener::CLICK);
+            }
 
-			return _consumeInputEvents;
+            return _consumeInputEvents;
         }
         break;
     }

+ 1 - 1
gameplay/src/Font.cpp

@@ -139,7 +139,7 @@ Font* Font::create(const char* family, Style style, unsigned int size, Glyph* gl
 
     // Create batch for the font.
     SpriteBatch* batch = SpriteBatch::create(texture, __fontEffect, 128);
-	
+    
     // Release __fontEffect since the SpriteBatch keeps a reference to it
     SAFE_RELEASE(__fontEffect);
 

+ 1 - 1
gameplay/src/Form.cpp

@@ -40,7 +40,7 @@ static std::vector<Form*> __forms;
 
 Form::Form() : _theme(NULL), _frameBuffer(NULL), _spriteBatch(NULL), _node(NULL), _nodeQuad(NULL), _nodeMaterial(NULL) , _u2(0), _v1(0)
 {
-	_consumeInputEvents = false;
+    _consumeInputEvents = false;
 }
 
 Form::~Form()

+ 13 - 13
gameplay/src/MathUtil.h

@@ -8,32 +8,32 @@ namespace gameplay
  */
 class MathUtil
 {
-	friend class Matrix;
-	friend class Vector3;
+    friend class Matrix;
+    friend class Vector3;
 
 private:
 
-	inline static void addMatrix(const float* m, float scalar, float* dst);
+    inline static void addMatrix(const float* m, float scalar, float* dst);
 
-	inline static void addMatrix(const float* m1, const float* m2, float* dst);
+    inline static void addMatrix(const float* m1, const float* m2, float* dst);
 
-	inline static void subtractMatrix(const float* m1, const float* m2, float* dst);
+    inline static void subtractMatrix(const float* m1, const float* m2, float* dst);
 
-	inline static void multiplyMatrix(const float* m, float scalar, float* dst);
+    inline static void multiplyMatrix(const float* m, float scalar, float* dst);
 
-	inline static void multiplyMatrix(const float* m1, const float* m2, float* dst);
+    inline static void multiplyMatrix(const float* m1, const float* m2, float* dst);
 
-	inline static void negateMatrix(const float* m, float* dst);
+    inline static void negateMatrix(const float* m, float* dst);
 
-	inline static void transposeMatrix(const float* m, float* dst);
+    inline static void transposeMatrix(const float* m, float* dst);
 
-	inline static void transformVector4(const float* m, float x, float y, float z, float w, float* dst);
+    inline static void transformVector4(const float* m, float x, float y, float z, float w, float* dst);
 
-	inline static void transformVector4(const float* m, const float* v, float* dst);
+    inline static void transformVector4(const float* m, const float* v, float* dst);
 
-	inline static void crossVector3(const float* v1, const float* v2, float* dst);
+    inline static void crossVector3(const float* v1, const float* v2, float* dst);
 
-	MathUtil();
+    MathUtil();
 };
 
 }

+ 123 - 123
gameplay/src/MathUtil.inl

@@ -3,173 +3,173 @@ namespace gameplay
 
 inline void MathUtil::addMatrix(const float* m, float scalar, float* dst)
 {
-	dst[0]  = m[0]  + scalar;
-	dst[1]  = m[1]  + scalar;
-	dst[2]  = m[2]  + scalar;
-	dst[3]  = m[3]  + scalar;
-	dst[4]  = m[4]  + scalar;
-	dst[5]  = m[5]  + scalar;
-	dst[6]  = m[6]  + scalar;
-	dst[7]  = m[7]  + scalar;
-	dst[8]  = m[8]  + scalar;
-	dst[9]  = m[9]  + scalar;
-	dst[10] = m[10] + scalar;
-	dst[11] = m[11] + scalar;
-	dst[12] = m[12] + scalar;
-	dst[13] = m[13] + scalar;
-	dst[14] = m[14] + scalar;
-	dst[15] = m[15] + scalar;
+    dst[0]  = m[0]  + scalar;
+    dst[1]  = m[1]  + scalar;
+    dst[2]  = m[2]  + scalar;
+    dst[3]  = m[3]  + scalar;
+    dst[4]  = m[4]  + scalar;
+    dst[5]  = m[5]  + scalar;
+    dst[6]  = m[6]  + scalar;
+    dst[7]  = m[7]  + scalar;
+    dst[8]  = m[8]  + scalar;
+    dst[9]  = m[9]  + scalar;
+    dst[10] = m[10] + scalar;
+    dst[11] = m[11] + scalar;
+    dst[12] = m[12] + scalar;
+    dst[13] = m[13] + scalar;
+    dst[14] = m[14] + scalar;
+    dst[15] = m[15] + scalar;
 }
 
 inline void MathUtil::addMatrix(const float* m1, const float* m2, float* dst)
 {
-	dst[0]  = m1[0]  + m2[0];
-	dst[1]  = m1[1]  + m2[1];
-	dst[2]  = m1[2]  + m2[2];
-	dst[3]  = m1[3]  + m2[3];
-	dst[4]  = m1[4]  + m2[4];
-	dst[5]  = m1[5]  + m2[5];
-	dst[6]  = m1[6]  + m2[6];
-	dst[7]  = m1[7]  + m2[7];
-	dst[8]  = m1[8]  + m2[8];
-	dst[9]  = m1[9]  + m2[9];
-	dst[10] = m1[10] + m2[10];
-	dst[11] = m1[11] + m2[11];
-	dst[12] = m1[12] + m2[12];
-	dst[13] = m1[13] + m2[13];
-	dst[14] = m1[14] + m2[14];
-	dst[15] = m1[15] + m2[15];
+    dst[0]  = m1[0]  + m2[0];
+    dst[1]  = m1[1]  + m2[1];
+    dst[2]  = m1[2]  + m2[2];
+    dst[3]  = m1[3]  + m2[3];
+    dst[4]  = m1[4]  + m2[4];
+    dst[5]  = m1[5]  + m2[5];
+    dst[6]  = m1[6]  + m2[6];
+    dst[7]  = m1[7]  + m2[7];
+    dst[8]  = m1[8]  + m2[8];
+    dst[9]  = m1[9]  + m2[9];
+    dst[10] = m1[10] + m2[10];
+    dst[11] = m1[11] + m2[11];
+    dst[12] = m1[12] + m2[12];
+    dst[13] = m1[13] + m2[13];
+    dst[14] = m1[14] + m2[14];
+    dst[15] = m1[15] + m2[15];
 }
 
 inline void MathUtil::subtractMatrix(const float* m1, const float* m2, float* dst)
 {
-	dst[0]  = m1[0]  - m2[0];
-	dst[1]  = m1[1]  - m2[1];
-	dst[2]  = m1[2]  - m2[2];
-	dst[3]  = m1[3]  - m2[3];
-	dst[4]  = m1[4]  - m2[4];
-	dst[5]  = m1[5]  - m2[5];
-	dst[6]  = m1[6]  - m2[6];
-	dst[7]  = m1[7]  - m2[7];
-	dst[8]  = m1[8]  - m2[8];
-	dst[9]  = m1[9]  - m2[9];
-	dst[10] = m1[10] - m2[10];
-	dst[11] = m1[11] - m2[11];
-	dst[12] = m1[12] - m2[12];
-	dst[13] = m1[13] - m2[13];
-	dst[14] = m1[14] - m2[14];
-	dst[15] = m1[15] - m2[15];
+    dst[0]  = m1[0]  - m2[0];
+    dst[1]  = m1[1]  - m2[1];
+    dst[2]  = m1[2]  - m2[2];
+    dst[3]  = m1[3]  - m2[3];
+    dst[4]  = m1[4]  - m2[4];
+    dst[5]  = m1[5]  - m2[5];
+    dst[6]  = m1[6]  - m2[6];
+    dst[7]  = m1[7]  - m2[7];
+    dst[8]  = m1[8]  - m2[8];
+    dst[9]  = m1[9]  - m2[9];
+    dst[10] = m1[10] - m2[10];
+    dst[11] = m1[11] - m2[11];
+    dst[12] = m1[12] - m2[12];
+    dst[13] = m1[13] - m2[13];
+    dst[14] = m1[14] - m2[14];
+    dst[15] = m1[15] - m2[15];
 }
 
 inline void MathUtil::multiplyMatrix(const float* m, float scalar, float* dst)
 {
-	dst[0]  = m[0]  * scalar;
-	dst[1]  = m[1]  * scalar;
-	dst[2]  = m[2]  * scalar;
-	dst[3]  = m[3]  * scalar;
-	dst[4]  = m[4]  * scalar;
-	dst[5]  = m[5]  * scalar;
-	dst[6]  = m[6]  * scalar;
-	dst[7]  = m[7]  * scalar;
-	dst[8]  = m[8]  * scalar;
-	dst[9]  = m[9]  * scalar;
-	dst[10] = m[10] * scalar;
-	dst[11] = m[11] * scalar;
-	dst[12] = m[12] * scalar;
-	dst[13] = m[13] * scalar;
-	dst[14] = m[14] * scalar;
-	dst[15] = m[15] * scalar;
+    dst[0]  = m[0]  * scalar;
+    dst[1]  = m[1]  * scalar;
+    dst[2]  = m[2]  * scalar;
+    dst[3]  = m[3]  * scalar;
+    dst[4]  = m[4]  * scalar;
+    dst[5]  = m[5]  * scalar;
+    dst[6]  = m[6]  * scalar;
+    dst[7]  = m[7]  * scalar;
+    dst[8]  = m[8]  * scalar;
+    dst[9]  = m[9]  * scalar;
+    dst[10] = m[10] * scalar;
+    dst[11] = m[11] * scalar;
+    dst[12] = m[12] * scalar;
+    dst[13] = m[13] * scalar;
+    dst[14] = m[14] * scalar;
+    dst[15] = m[15] * scalar;
 }
 
 inline void MathUtil::multiplyMatrix(const float* m1, const float* m2, float* dst)
 {
-	// Support the case where m1 or m2 is the same array as dst.
-	float product[16];
-
-	product[0]  = m1[0] * m2[0]  + m1[4] * m2[1] + m1[8]   * m2[2]  + m1[12] * m2[3];
-	product[1]  = m1[1] * m2[0]  + m1[5] * m2[1] + m1[9]   * m2[2]  + m1[13] * m2[3];
-	product[2]  = m1[2] * m2[0]  + m1[6] * m2[1] + m1[10]  * m2[2]  + m1[14] * m2[3];
-	product[3]  = m1[3] * m2[0]  + m1[7] * m2[1] + m1[11]  * m2[2]  + m1[15] * m2[3];
-
-	product[4]  = m1[0] * m2[4]  + m1[4] * m2[5] + m1[8]   * m2[6]  + m1[12] * m2[7];
-	product[5]  = m1[1] * m2[4]  + m1[5] * m2[5] + m1[9]   * m2[6]  + m1[13] * m2[7];
-	product[6]  = m1[2] * m2[4]  + m1[6] * m2[5] + m1[10]  * m2[6]  + m1[14] * m2[7];
-	product[7]  = m1[3] * m2[4]  + m1[7] * m2[5] + m1[11]  * m2[6]  + m1[15] * m2[7];
-
-	product[8]  = m1[0] * m2[8]  + m1[4] * m2[9] + m1[8]   * m2[10] + m1[12] * m2[11];
-	product[9]  = m1[1] * m2[8]  + m1[5] * m2[9] + m1[9]   * m2[10] + m1[13] * m2[11];
-	product[10] = m1[2] * m2[8]  + m1[6] * m2[9] + m1[10]  * m2[10] + m1[14] * m2[11];
-	product[11] = m1[3] * m2[8]  + m1[7] * m2[9] + m1[11]  * m2[10] + m1[15] * m2[11];
-
-	product[12] = m1[0] * m2[12] + m1[4] * m2[13] + m1[8]  * m2[14] + m1[12] * m2[15];
-	product[13] = m1[1] * m2[12] + m1[5] * m2[13] + m1[9]  * m2[14] + m1[13] * m2[15];
-	product[14] = m1[2] * m2[12] + m1[6] * m2[13] + m1[10] * m2[14] + m1[14] * m2[15];
-	product[15] = m1[3] * m2[12] + m1[7] * m2[13] + m1[11] * m2[14] + m1[15] * m2[15];
-
-	memcpy(dst, product, MATRIX_SIZE);
+    // Support the case where m1 or m2 is the same array as dst.
+    float product[16];
+
+    product[0]  = m1[0] * m2[0]  + m1[4] * m2[1] + m1[8]   * m2[2]  + m1[12] * m2[3];
+    product[1]  = m1[1] * m2[0]  + m1[5] * m2[1] + m1[9]   * m2[2]  + m1[13] * m2[3];
+    product[2]  = m1[2] * m2[0]  + m1[6] * m2[1] + m1[10]  * m2[2]  + m1[14] * m2[3];
+    product[3]  = m1[3] * m2[0]  + m1[7] * m2[1] + m1[11]  * m2[2]  + m1[15] * m2[3];
+
+    product[4]  = m1[0] * m2[4]  + m1[4] * m2[5] + m1[8]   * m2[6]  + m1[12] * m2[7];
+    product[5]  = m1[1] * m2[4]  + m1[5] * m2[5] + m1[9]   * m2[6]  + m1[13] * m2[7];
+    product[6]  = m1[2] * m2[4]  + m1[6] * m2[5] + m1[10]  * m2[6]  + m1[14] * m2[7];
+    product[7]  = m1[3] * m2[4]  + m1[7] * m2[5] + m1[11]  * m2[6]  + m1[15] * m2[7];
+
+    product[8]  = m1[0] * m2[8]  + m1[4] * m2[9] + m1[8]   * m2[10] + m1[12] * m2[11];
+    product[9]  = m1[1] * m2[8]  + m1[5] * m2[9] + m1[9]   * m2[10] + m1[13] * m2[11];
+    product[10] = m1[2] * m2[8]  + m1[6] * m2[9] + m1[10]  * m2[10] + m1[14] * m2[11];
+    product[11] = m1[3] * m2[8]  + m1[7] * m2[9] + m1[11]  * m2[10] + m1[15] * m2[11];
+
+    product[12] = m1[0] * m2[12] + m1[4] * m2[13] + m1[8]  * m2[14] + m1[12] * m2[15];
+    product[13] = m1[1] * m2[12] + m1[5] * m2[13] + m1[9]  * m2[14] + m1[13] * m2[15];
+    product[14] = m1[2] * m2[12] + m1[6] * m2[13] + m1[10] * m2[14] + m1[14] * m2[15];
+    product[15] = m1[3] * m2[12] + m1[7] * m2[13] + m1[11] * m2[14] + m1[15] * m2[15];
+
+    memcpy(dst, product, MATRIX_SIZE);
 }
 
 inline void MathUtil::negateMatrix(const float* m, float* dst)
 {
-	dst[0]  = -m[0];
-	dst[1]  = -m[1];
-	dst[2]  = -m[2];
-	dst[3]  = -m[3];
-	dst[4]  = -m[4];
-	dst[5]  = -m[5];
-	dst[6]  = -m[6];
-	dst[7]  = -m[7];
-	dst[8]  = -m[8];
-	dst[9]  = -m[9];
-	dst[10] = -m[10];
-	dst[11] = -m[11];
-	dst[12] = -m[12];
-	dst[13] = -m[13];
-	dst[14] = -m[14];
-	dst[15] = -m[15];
+    dst[0]  = -m[0];
+    dst[1]  = -m[1];
+    dst[2]  = -m[2];
+    dst[3]  = -m[3];
+    dst[4]  = -m[4];
+    dst[5]  = -m[5];
+    dst[6]  = -m[6];
+    dst[7]  = -m[7];
+    dst[8]  = -m[8];
+    dst[9]  = -m[9];
+    dst[10] = -m[10];
+    dst[11] = -m[11];
+    dst[12] = -m[12];
+    dst[13] = -m[13];
+    dst[14] = -m[14];
+    dst[15] = -m[15];
 }
 
 inline void MathUtil::transposeMatrix(const float* m, float* dst)
 {
-	float t[16] = {
-		m[0], m[4], m[8], m[12],
-		m[1], m[5], m[9], m[13],
-		m[2], m[6], m[10], m[14],
-		m[3], m[7], m[11], m[15]
-	};
-	memcpy(dst, t, MATRIX_SIZE);
+    float t[16] = {
+        m[0], m[4], m[8], m[12],
+        m[1], m[5], m[9], m[13],
+        m[2], m[6], m[10], m[14],
+        m[3], m[7], m[11], m[15]
+    };
+    memcpy(dst, t, MATRIX_SIZE);
 }
 
 inline void MathUtil::transformVector4(const float* m, float x, float y, float z, float w, float* dst)
 {
-	dst[0] = x * m[0] + y * m[4] + z * m[8] + w * m[12];
-	dst[1] = x * m[1] + y * m[5] + z * m[9] + w * m[13];
-	dst[2] = x * m[2] + y * m[6] + z * m[10] + w * m[14];
+    dst[0] = x * m[0] + y * m[4] + z * m[8] + w * m[12];
+    dst[1] = x * m[1] + y * m[5] + z * m[9] + w * m[13];
+    dst[2] = x * m[2] + y * m[6] + z * m[10] + w * m[14];
 }
 
 inline void MathUtil::transformVector4(const float* m, const float* v, float* dst)
 {
     // Handle case where v == dst.
     float x = v[0] * m[0] + v[1] * m[4] + v[2] * m[8] + v[3] * m[12];
-	float y = v[0] * m[1] + v[1] * m[5] + v[2] * m[9] + v[3] * m[13];
+    float y = v[0] * m[1] + v[1] * m[5] + v[2] * m[9] + v[3] * m[13];
     float z = v[0] * m[2] + v[1] * m[6] + v[2] * m[10] + v[3] * m[14];
     float w = v[0] * m[3] + v[1] * m[7] + v[2] * m[11] + v[3] * m[15];
 
     dst[0] = x;
     dst[1] = y;
-	dst[2] = z;
-	dst[3] = w;
+    dst[2] = z;
+    dst[3] = w;
 }
 
 inline void MathUtil::crossVector3(const float* v1, const float* v2, float* dst)
 {
-	float x = (v1[1] * v2[2]) - (v1[2] * v2[1]);
-	float y = (v1[2] * v2[0]) - (v1[0] * v2[2]);
-	float z = (v1[0] * v2[1]) - (v1[1] * v2[0]);
+    float x = (v1[1] * v2[2]) - (v1[2] * v2[1]);
+    float y = (v1[2] * v2[0]) - (v1[0] * v2[2]);
+    float z = (v1[0] * v2[1]) - (v1[1] * v2[0]);
 
-	dst[0] = x;
-	dst[1] = y;
-	dst[2] = z;
+    dst[0] = x;
+    dst[1] = y;
+    dst[2] = z;
 }
 
 }

+ 185 - 185
gameplay/src/MathUtilNeon.inl

@@ -3,227 +3,227 @@ namespace gameplay
 
 inline void MathUtil::addMatrix(const float* m, float scalar, float* dst)
 {
-	asm volatile(
-		"vld1.32 {q0, q1}, [%1]! 	\n\t" // M[m0-m7]
-		"vld1.32 {q2, q3}, [%1] 	\n\t" // M[m8-m15]
-		"vld1.32 {d8[0]},  [%2] 	\n\t" // s
-		"vmov.f32 s17, s16          \n\t" // s
-		"vmov.f32 s18, s16          \n\t" // s
-		"vmov.f32 s19, s16          \n\t" // s
-
-		"vadd.f32 q8, q0, q4  		\n\t" // DST->M[m0-m3] = M[m0-m3] + s
-		"vadd.f32 q9, q1, q4 		\n\t" // DST->M[m4-m7] = M[m4-m7] + s
-		"vadd.f32 q10, q2, q4 		\n\t" // DST->M[m8-m11] = M[m8-m11] + s
-		"vadd.f32 q11, q3, q4 		\n\t" // DST->M[m12-m15] = M[m12-m15] + s
-
-		"vst1.32 {q8, q9}, [%0]!  	\n\t" // DST->M[m0-m7]
-		"vst1.32 {q10, q11}, [%0]   \n\t" // DST->M[m8-m15]
-		:
-		: "r"(dst), "r"(m), "r"(&scalar)
-		: "q0", "q1", "q2", "q3", "q4", "q8", "q9", "q10", "q11", "memory"
-	);
+    asm volatile(
+        "vld1.32 {q0, q1}, [%1]!    \n\t" // M[m0-m7]
+        "vld1.32 {q2, q3}, [%1]     \n\t" // M[m8-m15]
+        "vld1.32 {d8[0]},  [%2]     \n\t" // s
+        "vmov.f32 s17, s16          \n\t" // s
+        "vmov.f32 s18, s16          \n\t" // s
+        "vmov.f32 s19, s16          \n\t" // s
+
+        "vadd.f32 q8, q0, q4        \n\t" // DST->M[m0-m3] = M[m0-m3] + s
+        "vadd.f32 q9, q1, q4        \n\t" // DST->M[m4-m7] = M[m4-m7] + s
+        "vadd.f32 q10, q2, q4       \n\t" // DST->M[m8-m11] = M[m8-m11] + s
+        "vadd.f32 q11, q3, q4       \n\t" // DST->M[m12-m15] = M[m12-m15] + s
+
+        "vst1.32 {q8, q9}, [%0]!    \n\t" // DST->M[m0-m7]
+        "vst1.32 {q10, q11}, [%0]   \n\t" // DST->M[m8-m15]
+        :
+        : "r"(dst), "r"(m), "r"(&scalar)
+        : "q0", "q1", "q2", "q3", "q4", "q8", "q9", "q10", "q11", "memory"
+    );
 }
 
 inline void MathUtil::addMatrix(const float* m1, const float* m2, float* dst)
 {
-	asm volatile(
-		"vld1.32 	{q0, q1}, 	[%1]! 	\n\t" // M1[m0-m7]
-		"vld1.32 	{q2, q3}, 	[%1] 	\n\t" // M1[m8-m15]
-		"vld1.32 	{q8, q9}, 	[%2]! 	\n\t" // M2[m0-m7]
-		"vld1.32 	{q10, q11}, [%2]  	\n\t" // M2[m8-m15]
-
-		"vadd.f32   q12, q0, q8 		\n\t" // DST->M[m0-m3] = M1[m0-m3] + M2[m0-m3]
-		"vadd.f32   q13, q1, q9			\n\t" // DST->M[m4-m7] = M1[m4-m7] + M2[m4-m7]
-		"vadd.f32   q14, q2, q10		\n\t" // DST->M[m8-m11] = M1[m8-m11] + M2[m8-m11]
-		"vadd.f32   q15, q3, q11		\n\t" // DST->M[m12-m15] = M1[m12-m15] + M2[m12-m15]
-
-		"vst1.32    {q12, q13}, [%0]!   \n\t" // DST->M[m0-m7]
-		"vst1.32    {q14, q15}, [%0]    \n\t" // DST->M[m8-m15]
-		:
-		: "r"(dst), "r"(m1), "r"(m2)
-		: "q0", "q1", "q2", "q3", "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15", "memory"
-	);
+    asm volatile(
+        "vld1.32     {q0, q1},     [%1]! \n\t" // M1[m0-m7]
+        "vld1.32     {q2, q3},     [%1]  \n\t" // M1[m8-m15]
+        "vld1.32     {q8, q9},     [%2]! \n\t" // M2[m0-m7]
+        "vld1.32     {q10, q11}, [%2]    \n\t" // M2[m8-m15]
+
+        "vadd.f32   q12, q0, q8          \n\t" // DST->M[m0-m3] = M1[m0-m3] + M2[m0-m3]
+        "vadd.f32   q13, q1, q9          \n\t" // DST->M[m4-m7] = M1[m4-m7] + M2[m4-m7]
+        "vadd.f32   q14, q2, q10         \n\t" // DST->M[m8-m11] = M1[m8-m11] + M2[m8-m11]
+        "vadd.f32   q15, q3, q11         \n\t" // DST->M[m12-m15] = M1[m12-m15] + M2[m12-m15]
+
+        "vst1.32    {q12, q13}, [%0]!    \n\t" // DST->M[m0-m7]
+        "vst1.32    {q14, q15}, [%0]     \n\t" // DST->M[m8-m15]
+        :
+        : "r"(dst), "r"(m1), "r"(m2)
+        : "q0", "q1", "q2", "q3", "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15", "memory"
+    );
 }
 
 inline void MathUtil::subtractMatrix(const float* m1, const float* m2, float* dst)
 {
-	asm volatile(
-		"vld1.32 	{q0, q1}, 	[%1]! 	\n\t" // M1[m0-m7]
-		"vld1.32 	{q2, q3}, 	[%1] 	\n\t" // M1[m8-m15]
-		"vld1.32 	{q8, q9}, 	[%2]! 	\n\t" // M2[m0-m7]
-		"vld1.32 	{q10, q11}, [%2] 	\n\t" // M2[m8-m15]
-
-		"vsub.f32   q12, q0, q8 		\n\t" // DST->M[m0-m3] = M1[m0-m3] - M2[m0-m3]
-		"vsub.f32   q13, q1, q9			\n\t" // DST->M[m4-m7] = M1[m4-m7] - M2[m4-m7]
-		"vsub.f32   q14, q2, q10		\n\t" // DST->M[m8-m11] = M1[m8-m11] - M2[m8-m11]
-		"vsub.f32   q15, q3, q11		\n\t" // DST->M[m12-m15] = M1[m12-m15] - M2[m12-m15]
-
-		"vst1.32    {q12, q13}, [%0]!   \n\t" // DST->M[m0-m7]
-		"vst1.32    {q14, q15}, [%0]    \n\t" // DST->M[m8-m15]
-		:
-		: "r"(dst), "r"(m1), "r"(m2)
-		: "q0", "q1", "q2", "q3", "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15", "memory"
-	);
+    asm volatile(
+        "vld1.32     {q0, q1},     [%1]!  \n\t" // M1[m0-m7]
+        "vld1.32     {q2, q3},     [%1]   \n\t" // M1[m8-m15]
+        "vld1.32     {q8, q9},     [%2]!  \n\t" // M2[m0-m7]
+        "vld1.32     {q10, q11}, [%2]     \n\t" // M2[m8-m15]
+
+        "vsub.f32   q12, q0, q8         \n\t" // DST->M[m0-m3] = M1[m0-m3] - M2[m0-m3]
+        "vsub.f32   q13, q1, q9         \n\t" // DST->M[m4-m7] = M1[m4-m7] - M2[m4-m7]
+        "vsub.f32   q14, q2, q10        \n\t" // DST->M[m8-m11] = M1[m8-m11] - M2[m8-m11]
+        "vsub.f32   q15, q3, q11        \n\t" // DST->M[m12-m15] = M1[m12-m15] - M2[m12-m15]
+
+        "vst1.32    {q12, q13}, [%0]!   \n\t" // DST->M[m0-m7]
+        "vst1.32    {q14, q15}, [%0]    \n\t" // DST->M[m8-m15]
+        :
+        : "r"(dst), "r"(m1), "r"(m2)
+        : "q0", "q1", "q2", "q3", "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15", "memory"
+    );
 }
 
 inline void MathUtil::multiplyMatrix(const float* m, float scalar, float* dst)
 {
-	asm volatile(
-		"vld1.32 	{d0[0]},	 	[%2]     	\n\t" // M[m0-m7]
-		"vld1.32	{q4-q5},  		[%1]!    	\n\t" // M[m8-m15]
-		"vld1.32	{q6-q7},  		[%1]		\n\t" // s
-
-		"vmul.f32 	q8, q4, d0[0]    			\n\t" // DST->M[m0-m3] = M[m0-m3] * s
-		"vmul.f32 	q9, q5, d0[0]    			\n\t" // DST->M[m4-m7] = M[m4-m7] * s
-		"vmul.f32 	q10, q6, d0[0]    			\n\t" // DST->M[m8-m11] = M[m8-m11] * s
-		"vmul.f32 	q11, q7, d0[0]   		 	\n\t" // DST->M[m12-m15] = M[m12-m15] * s
-
-		"vst1.32 	{q8-q9},   		[%0]! 		\n\t" // DST->M[m0-m7]
-		"vst1.32 	{q10-q11}, 		[%0]		\n\t" // DST->M[m8-m15]
-		:
-		: "r"(dst), "r"(m), "r"(&scalar)
-		: "q0", "q4", "q5", "q6", "q7", "q8", "q9", "q10", "q11", "memory"
-	);
+    asm volatile(
+        "vld1.32     {d0[0]},         [%2]        \n\t" // M[m0-m7]
+        "vld1.32    {q4-q5},          [%1]!       \n\t" // M[m8-m15]
+        "vld1.32    {q6-q7},          [%1]        \n\t" // s
+
+        "vmul.f32     q8, q4, d0[0]               \n\t" // DST->M[m0-m3] = M[m0-m3] * s
+        "vmul.f32     q9, q5, d0[0]               \n\t" // DST->M[m4-m7] = M[m4-m7] * s
+        "vmul.f32     q10, q6, d0[0]              \n\t" // DST->M[m8-m11] = M[m8-m11] * s
+        "vmul.f32     q11, q7, d0[0]              \n\t" // DST->M[m12-m15] = M[m12-m15] * s
+
+        "vst1.32     {q8-q9},           [%0]!     \n\t" // DST->M[m0-m7]
+        "vst1.32     {q10-q11},         [%0]      \n\t" // DST->M[m8-m15]
+        :
+        : "r"(dst), "r"(m), "r"(&scalar)
+        : "q0", "q4", "q5", "q6", "q7", "q8", "q9", "q10", "q11", "memory"
+    );
 }
 
 inline void MathUtil::multiplyMatrix(const float* m1, const float* m2, float* dst)
 {
-	asm volatile(
-		"vld1.32	 {d16 - d19}, [%1]!	  \n\t"       // M1[m0-m7]
-		"vld1.32     {d20 - d23}, [%1]    \n\t"       // M1[m8-m15]
-		"vld1.32     {d0 - d3}, [%2]!     \n\t"       // M2[m0-m7]
-		"vld1.32     {d4 - d7}, [%2]      \n\t"       // M2[m8-m15]
-
-		"vmul.f32    q12, q8, d0[0]     \n\t"         // DST->M[m0-m3] = M1[m0-m3] * M2[m0]
-		"vmul.f32    q13, q8, d2[0]     \n\t"         // DST->M[m4-m7] = M1[m4-m7] * M2[m4]
-		"vmul.f32    q14, q8, d4[0]     \n\t"         // DST->M[m8-m11] = M1[m8-m11] * M2[m8]
-		"vmul.f32    q15, q8, d6[0]     \n\t"         // DST->M[m12-m15] = M1[m12-m15] * M2[m12]
-
-		"vmla.f32    q12, q9, d0[1]     \n\t"         // DST->M[m0-m3] += M1[m0-m3] * M2[m1]
-		"vmla.f32    q13, q9, d2[1]     \n\t"         // DST->M[m4-m7] += M1[m4-m7] * M2[m5]
-		"vmla.f32    q14, q9, d4[1]     \n\t"         // DST->M[m8-m11] += M1[m8-m11] * M2[m9]
-		"vmla.f32    q15, q9, d6[1]     \n\t"         // DST->M[m12-m15] += M1[m12-m15] * M2[m13]
-
-		"vmla.f32    q12, q10, d1[0]    \n\t"         // DST->M[m0-m3] += M1[m0-m3] * M2[m2]
-		"vmla.f32    q13, q10, d3[0]    \n\t"         // DST->M[m4-m7] += M1[m4-m7] * M2[m6]
-		"vmla.f32    q14, q10, d5[0]    \n\t"         // DST->M[m8-m11] += M1[m8-m11] * M2[m10]
-		"vmla.f32    q15, q10, d7[0]    \n\t"         // DST->M[m12-m15] += M1[m12-m15] * M2[m14]
-
-		"vmla.f32    q12, q11, d1[1]    \n\t"         // DST->M[m0-m3] += M1[m0-m3] * M2[m3]
-		"vmla.f32    q13, q11, d3[1]    \n\t"         // DST->M[m4-m7] += M1[m4-m7] * M2[m7]
-		"vmla.f32    q14, q11, d5[1]    \n\t"         // DST->M[m8-m11] += M1[m8-m11] * M2[m11]
-		"vmla.f32    q15, q11, d7[1]    \n\t"         // DST->M[m12-m15] += M1[m12-m15] * M2[m15]
-
-		"vst1.32    {d24 - d27}, [%0]!    \n\t"       // DST->M[m0-m7]
-		"vst1.32    {d28 - d31}, [%0]     \n\t"       // DST->M[m8-m15]
-
-		: // output
-		: "r"(dst), "r"(m1), "r"(m2) // input - note *value* of pointer doesn't change.
-		: "memory", "q0", "q1", "q2", "q3", "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15"
-	);
+    asm volatile(
+        "vld1.32     {d16 - d19}, [%1]! \n\t"       // M1[m0-m7]
+        "vld1.32     {d20 - d23}, [%1]  \n\t"       // M1[m8-m15]
+        "vld1.32     {d0 - d3}, [%2]!   \n\t"       // M2[m0-m7]
+        "vld1.32     {d4 - d7}, [%2]    \n\t"       // M2[m8-m15]
+
+        "vmul.f32    q12, q8, d0[0]     \n\t"         // DST->M[m0-m3] = M1[m0-m3] * M2[m0]
+        "vmul.f32    q13, q8, d2[0]     \n\t"         // DST->M[m4-m7] = M1[m4-m7] * M2[m4]
+        "vmul.f32    q14, q8, d4[0]     \n\t"         // DST->M[m8-m11] = M1[m8-m11] * M2[m8]
+        "vmul.f32    q15, q8, d6[0]     \n\t"         // DST->M[m12-m15] = M1[m12-m15] * M2[m12]
+
+        "vmla.f32    q12, q9, d0[1]     \n\t"         // DST->M[m0-m3] += M1[m0-m3] * M2[m1]
+        "vmla.f32    q13, q9, d2[1]     \n\t"         // DST->M[m4-m7] += M1[m4-m7] * M2[m5]
+        "vmla.f32    q14, q9, d4[1]     \n\t"         // DST->M[m8-m11] += M1[m8-m11] * M2[m9]
+        "vmla.f32    q15, q9, d6[1]     \n\t"         // DST->M[m12-m15] += M1[m12-m15] * M2[m13]
+
+        "vmla.f32    q12, q10, d1[0]    \n\t"         // DST->M[m0-m3] += M1[m0-m3] * M2[m2]
+        "vmla.f32    q13, q10, d3[0]    \n\t"         // DST->M[m4-m7] += M1[m4-m7] * M2[m6]
+        "vmla.f32    q14, q10, d5[0]    \n\t"         // DST->M[m8-m11] += M1[m8-m11] * M2[m10]
+        "vmla.f32    q15, q10, d7[0]    \n\t"         // DST->M[m12-m15] += M1[m12-m15] * M2[m14]
+
+        "vmla.f32    q12, q11, d1[1]    \n\t"         // DST->M[m0-m3] += M1[m0-m3] * M2[m3]
+        "vmla.f32    q13, q11, d3[1]    \n\t"         // DST->M[m4-m7] += M1[m4-m7] * M2[m7]
+        "vmla.f32    q14, q11, d5[1]    \n\t"         // DST->M[m8-m11] += M1[m8-m11] * M2[m11]
+        "vmla.f32    q15, q11, d7[1]    \n\t"         // DST->M[m12-m15] += M1[m12-m15] * M2[m15]
+
+        "vst1.32    {d24 - d27}, [%0]!  \n\t"       // DST->M[m0-m7]
+        "vst1.32    {d28 - d31}, [%0]   \n\t"       // DST->M[m8-m15]
+
+        : // output
+        : "r"(dst), "r"(m1), "r"(m2) // input - note *value* of pointer doesn't change.
+        : "memory", "q0", "q1", "q2", "q3", "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15"
+    );
 }
 
 inline void MathUtil::negateMatrix(const float* m, float* dst)
 {
-	asm volatile(
-		"vld1.32 	{q0-q1},  [%1]! 	\n\t" // load m0-m7
-		"vld1.32 	{q2-q3},  [%1]   	\n\t" // load m8-m15
-
-		"vneg.f32 	q4, q0 				\n\t" // negate m0-m3
-		"vneg.f32 	q5, q1 				\n\t" // negate m4-m7
-		"vneg.f32 	q6, q2 				\n\t" // negate m8-m15
-		"vneg.f32 	q7, q3 				\n\t" // negate m8-m15
-
-		"vst1.32 	{q4-q5},  [%0]!		\n\t" // store m0-m7
-		"vst1.32 	{q6-q7},  [%0]		\n\t" // store m8-m15
-		:
-		: "r"(dst), "r"(m)
-		: "q0", "q1", "q2", "q3", "q4", "q5", "q6", "q7", "memory"
-	);
+    asm volatile(
+        "vld1.32     {q0-q1},  [%1]!     \n\t" // load m0-m7
+        "vld1.32     {q2-q3},  [%1]      \n\t" // load m8-m15
+
+        "vneg.f32     q4, q0             \n\t" // negate m0-m3
+        "vneg.f32     q5, q1             \n\t" // negate m4-m7
+        "vneg.f32     q6, q2             \n\t" // negate m8-m15
+        "vneg.f32     q7, q3             \n\t" // negate m8-m15
+
+        "vst1.32     {q4-q5},  [%0]!     \n\t" // store m0-m7
+        "vst1.32     {q6-q7},  [%0]      \n\t" // store m8-m15
+        :
+        : "r"(dst), "r"(m)
+        : "q0", "q1", "q2", "q3", "q4", "q5", "q6", "q7", "memory"
+    );
 }
 
 inline void MathUtil::transposeMatrix(const float* m, float* dst)
 {
-	asm volatile(
-		"vld4.32 {d0[0], d2[0], d4[0], d6[0]}, [%1]! 	\n\t" // DST->M[m0, m4, m8, m12] = M[m0-m3]
-		"vld4.32 {d0[1], d2[1], d4[1], d6[1]}, [%1]!	\n\t" // DST->M[m1, m5, m9, m12] = M[m4-m7]
-		"vld4.32 {d1[0], d3[0], d5[0], d7[0]}, [%1]!	\n\t" // DST->M[m2, m6, m10, m12] = M[m8-m11]
-		"vld4.32 {d1[1], d3[1], d5[1], d7[1]}, [%1] 	\n\t" // DST->M[m3, m7, m11, m12] = M[m12-m15]
-
-		"vst1.32 {q0-q1}, [%0]! 						\n\t" // DST->M[m0-m7]
-		"vst1.32 {q2-q3}, [%0] 							\n\t" // DST->M[m8-m15]
-		:
-		: "r"(dst), "r"(m)
-		: "q0", "q1", "q2", "q3", "memory"
-	);
+    asm volatile(
+        "vld4.32 {d0[0], d2[0], d4[0], d6[0]}, [%1]!    \n\t" // DST->M[m0, m4, m8, m12] = M[m0-m3]
+        "vld4.32 {d0[1], d2[1], d4[1], d6[1]}, [%1]!    \n\t" // DST->M[m1, m5, m9, m12] = M[m4-m7]
+        "vld4.32 {d1[0], d3[0], d5[0], d7[0]}, [%1]!    \n\t" // DST->M[m2, m6, m10, m12] = M[m8-m11]
+        "vld4.32 {d1[1], d3[1], d5[1], d7[1]}, [%1]     \n\t" // DST->M[m3, m7, m11, m12] = M[m12-m15]
+
+        "vst1.32 {q0-q1}, [%0]!                         \n\t" // DST->M[m0-m7]
+        "vst1.32 {q2-q3}, [%0]                          \n\t" // DST->M[m8-m15]
+        :
+        : "r"(dst), "r"(m)
+        : "q0", "q1", "q2", "q3", "memory"
+    );
 }
 
 inline void MathUtil::transformVector4(const float* m, float x, float y, float z, float w, float* dst)
 {
-	asm volatile(
-		"vld1.32	{d0[0]},		[%1]	\n\t"	// V[x]
-		"vld1.32	{d0[1]},    	[%2]	\n\t"	// V[y]
-		"vld1.32	{d1[0]},		[%3]	\n\t"	// V[z]
-		"vld1.32	{d1[1]},		[%4]	\n\t"	// V[w]
-		"vld1.32	{d18 - d21},	[%5]!	\n\t"	// M[m0-m7]
-		"vld1.32	{d22 - d25},	[%5]	\n\t"	// M[m8-m15]
-
-		"vmul.f32 q13,  q9, d0[0]			\n\t"	// DST->V = M[m0-m3] * V[x]
-		"vmla.f32 q13, q10, d0[1]      		\n\t"	// DST->V += M[m4-m7] * V[y]
-		"vmla.f32 q13, q11, d1[0]      		\n\t"	// DST->V += M[m8-m11] * V[z]
-		"vmla.f32 q13, q12, d1[1]      		\n\t"	// DST->V += M[m12-m15] * V[w]
-
-		"vst1.32 {d26}, [%0]!        		\n\t"	// DST->V[x, y]
-		"vst1.32 {d27[0]}, [%0]        		\n\t"	// DST->V[z]
-		:
-		: "r"(dst), "r"(&x), "r"(&y), "r"(&z), "r"(&w), "r"(m)
-		: "q0", "q9", "q10","q11", "q12", "q13", "memory"
-	);
+    asm volatile(
+        "vld1.32    {d0[0]},        [%1]    \n\t"    // V[x]
+        "vld1.32    {d0[1]},        [%2]    \n\t"    // V[y]
+        "vld1.32    {d1[0]},        [%3]    \n\t"    // V[z]
+        "vld1.32    {d1[1]},        [%4]    \n\t"    // V[w]
+        "vld1.32    {d18 - d21},    [%5]!   \n\t"    // M[m0-m7]
+        "vld1.32    {d22 - d25},    [%5]    \n\t"    // M[m8-m15]
+
+        "vmul.f32 q13,  q9, d0[0]           \n\t"    // DST->V = M[m0-m3] * V[x]
+        "vmla.f32 q13, q10, d0[1]           \n\t"    // DST->V += M[m4-m7] * V[y]
+        "vmla.f32 q13, q11, d1[0]           \n\t"    // DST->V += M[m8-m11] * V[z]
+        "vmla.f32 q13, q12, d1[1]           \n\t"    // DST->V += M[m12-m15] * V[w]
+
+        "vst1.32 {d26}, [%0]!               \n\t"    // DST->V[x, y]
+        "vst1.32 {d27[0]}, [%0]             \n\t"    // DST->V[z]
+        :
+        : "r"(dst), "r"(&x), "r"(&y), "r"(&z), "r"(&w), "r"(m)
+        : "q0", "q9", "q10","q11", "q12", "q13", "memory"
+    );
 }
 
 inline void MathUtil::transformVector4(const float* m, const float* v, float* dst)
 {
-	asm volatile
-	(
-		"vld1.32	{d0, d1}, [%1]		\n\t"   // V[x, y, z, w]
-		"vld1.32    {d18 - d21}, [%2]!  \n\t"   // M[m0-m7]
-		"vld1.32    {d22 - d25}, [%2]  \n\t"    // M[m8-m15]
-
-		"vmul.f32   q13, q9, d0[0]      \n\t"   // DST->V = M[m0-m3] * V[x]
-		"vmla.f32   q13, q10, d0[1]     \n\t"   // DST->V = M[m4-m7] * V[y]
-		"vmla.f32   q13, q11, d1[0]     \n\t"   // DST->V = M[m8-m11] * V[z]
-		"vmla.f32   q13, q12, d1[1]     \n\t"   // DST->V = M[m12-m15] * V[w]
-
-		"vst1.32    {d26, d27}, [%0]    \n\t"   // DST->V
-		:
-		: "r"(dst), "r"(v), "r"(m)
-		: "q0", "q9", "q10","q11", "q12", "q13", "memory"
-	);
+    asm volatile
+    (
+        "vld1.32    {d0, d1}, [%1]     \n\t"   // V[x, y, z, w]
+        "vld1.32    {d18 - d21}, [%2]! \n\t"   // M[m0-m7]
+        "vld1.32    {d22 - d25}, [%2]  \n\t"    // M[m8-m15]
+
+        "vmul.f32   q13, q9, d0[0]     \n\t"   // DST->V = M[m0-m3] * V[x]
+        "vmla.f32   q13, q10, d0[1]    \n\t"   // DST->V = M[m4-m7] * V[y]
+        "vmla.f32   q13, q11, d1[0]    \n\t"   // DST->V = M[m8-m11] * V[z]
+        "vmla.f32   q13, q12, d1[1]    \n\t"   // DST->V = M[m12-m15] * V[w]
+
+        "vst1.32    {d26, d27}, [%0]   \n\t"   // DST->V
+        :
+        : "r"(dst), "r"(v), "r"(m)
+        : "q0", "q9", "q10","q11", "q12", "q13", "memory"
+    );
 }
 
 inline void MathUtil::crossVector3(const float* v1, const float* v2, float* dst)
 {
-	asm volatile(
-		"vld1.32 {d1[1]},  [%1] 		\n\t" //
-		"vld1.32 {d0},     [%2]         \n\t" //
-		"vmov.f32 s2, s1                \n\t" // q0 = (v1y, v1z, v1z, v1x)
-
-		"vld1.32 {d2[1]},  [%3]	    	\n\t" //
-		"vld1.32 {d3},     [%4]         \n\t" //
-		"vmov.f32 s4, s7          		\n\t" // q1 = (v2z, v2x, v2y, v2z)
-
-		"vmul.f32 d4, d0, d2  			\n\t" // x = v1y * v2z, y = v1z * v2x
-		"vmls.f32 d4, d1, d3  			\n\t" // x -= v1z * v2y, y-= v1x - v2z
-
-		"vmul.f32 d5, d3, d1[1]			\n\t" // z = v1x * v2y
-		"vmls.f32 d5, d0, d2[1]         \n\t" // z-= v1y * vx
-
-		"vst1.32 {d4}, 	  [%0]!    		\n\t" // V[x, y]
-		"vst1.32 {d5[0]}, [%0]     		\n\t" // V[z]
-		:
-		: "r"(dst), "r"(v1), "r"((v1+1)), "r"(v2), "r"((v2+1))
-		: "q0", "q1", "q2", "memory"
-	);
+    asm volatile(
+        "vld1.32 {d1[1]},  [%1]         \n\t" //
+        "vld1.32 {d0},     [%2]         \n\t" //
+        "vmov.f32 s2, s1                \n\t" // q0 = (v1y, v1z, v1z, v1x)
+
+        "vld1.32 {d2[1]},  [%3]         \n\t" //
+        "vld1.32 {d3},     [%4]         \n\t" //
+        "vmov.f32 s4, s7                  \n\t" // q1 = (v2z, v2x, v2y, v2z)
+
+        "vmul.f32 d4, d0, d2            \n\t" // x = v1y * v2z, y = v1z * v2x
+        "vmls.f32 d4, d1, d3            \n\t" // x -= v1z * v2y, y-= v1x - v2z
+
+        "vmul.f32 d5, d3, d1[1]         \n\t" // z = v1x * v2y
+        "vmls.f32 d5, d0, d2[1]         \n\t" // z-= v1y * vx
+
+        "vst1.32 {d4},       [%0]!      \n\t" // V[x, y]
+        "vst1.32 {d5[0]}, [%0]          \n\t" // V[z]
+        :
+        : "r"(dst), "r"(v1), "r"((v1+1)), "r"(v2), "r"((v2+1))
+        : "q0", "q1", "q2", "memory"
+    );
 }
 
 }

+ 2 - 2
gameplay/src/Matrix.cpp

@@ -654,9 +654,9 @@ void Matrix::multiply(const Matrix& m)
 
 void Matrix::multiply(const Matrix& m1, const Matrix& m2, Matrix* dst)
 {
-	GP_ASSERT(dst);
+    GP_ASSERT(dst);
 
-	MathUtil::multiplyMatrix(m1.m, m2.m, dst->m);
+    MathUtil::multiplyMatrix(m1.m, m2.m, dst->m);
 }
 
 void Matrix::negate()

+ 4 - 4
gameplay/src/PhysicsController.cpp

@@ -173,8 +173,8 @@ bool PhysicsController::rayTest(const Ray& ray, float distance, PhysicsControlle
         {
         }
 
-		virtual bool needsCollision(btBroadphaseProxy* proxy0) const
-		{
+        virtual bool needsCollision(btBroadphaseProxy* proxy0) const
+        {
             if (!btCollisionWorld::ClosestRayResultCallback::needsCollision(proxy0))
                 return false;
 
@@ -248,8 +248,8 @@ bool PhysicsController::sweepTest(PhysicsCollisionObject* object, const Vector3&
         {
         }
 
-		virtual bool needsCollision(btBroadphaseProxy* proxy0) const
-		{
+        virtual bool needsCollision(btBroadphaseProxy* proxy0) const
+        {
             if (!btCollisionWorld::ClosestConvexResultCallback::needsCollision(proxy0))
                 return false;
 

+ 15 - 15
gameplay/src/PlatformLinux.cpp

@@ -426,10 +426,10 @@ Platform* Platform::create(Game* game, void* attachToWindow)
     GLXFBConfig* configs;
     int configCount = 0;
     configs = glXChooseFBConfig(__display, DefaultScreen(__display), configAttribs, &configCount);
-    if( configCount == 0 || configs == 0 )	
-    {	
+    if( configCount == 0 || configs == 0 )    
+    {    
         perror( "glXChooseFBConfig" );
-        return NULL;	
+        return NULL;    
     }
 
     // Create the windows
@@ -494,11 +494,11 @@ void cleanupX11()
         glXMakeCurrent(__display, None, NULL);
 
         if (__context)
-     	    glXDestroyContext(__display, __context);
+             glXDestroyContext(__display, __context);
         if (__window)
-     	    XDestroyWindow(__display, __window);
+             XDestroyWindow(__display, __window);
 
-     	XCloseDisplay(__display);
+         XCloseDisplay(__display);
     }
 }
 
@@ -508,14 +508,14 @@ double timespec2millis(struct timespec *a)
     return (1000.0 * a->tv_sec) + (0.000001 * a->tv_nsec);
 }
 
-void updateWindowSize()	
-{	
-    GP_ASSERT(__display);	
+void updateWindowSize()    
+{    
+    GP_ASSERT(__display);    
     GP_ASSERT(__window);
-    XWindowAttributes windowAttrs;	
-    XGetWindowAttributes(__display, __window, &windowAttrs);  	
-    __windowSize[0] = windowAttrs.width;	
-    __windowSize[1] = windowAttrs.height;	
+    XWindowAttributes windowAttrs;    
+    XGetWindowAttributes(__display, __window, &windowAttrs);      
+    __windowSize[0] = windowAttrs.width;    
+    __windowSize[1] = windowAttrs.height;    
 }
 
 int Platform::enterMessagePump()
@@ -540,9 +540,9 @@ int Platform::enterMessagePump()
     // Run the game.
     _game->run();
 
-    // Setup select for message handling (to allow non-blocking)	
+    // Setup select for message handling (to allow non-blocking)    
     int x11_fd = ConnectionNumber(__display);
-	
+    
     pollfd xpolls[1];
     xpolls[0].fd = x11_fd;
     xpolls[0].events = POLLIN|POLLPRI;

+ 1 - 1
gameplay/src/PlatformMacOSX.mm

@@ -638,7 +638,7 @@ Platform::~Platform()
 
 Platform* Platform::create(Game* game, void* attachToWindow)
 {
-	__attachToWindow = attachToWindow;
+    __attachToWindow = attachToWindow;
     Platform* platform = new Platform(game);
     
     return platform;

+ 70 - 70
gameplay/src/PlatformQNX.cpp

@@ -565,8 +565,8 @@ Platform* Platform::create(Game* game, void* attachToWindow)
     int screenSwapInterval = WINDOW_VSYNC ? 1 : 0;
     int screenTransparency = SCREEN_TRANSPARENCY_NONE;
 
-	char *width_str = getenv("WIDTH");
-	char *height_str = getenv("HEIGHT");
+    char *width_str = getenv("WIDTH");
+    char *height_str = getenv("HEIGHT");
 
     // Hard-coded to (0,0).
     int windowPosition[] =
@@ -633,74 +633,74 @@ Platform* Platform::create(Game* game, void* attachToWindow)
         goto error;
     }
 
-	if (width_str && height_str)
-	{
-		__screenWindowSize[0] = atoi(width_str);
-		__screenWindowSize[1] = atoi(height_str);
-	}
-	else
-	{
-		int angle = atoi(getenv("ORIENTATION"));
-
-		screen_display_t screen_display;
-		rc = screen_get_window_property_pv(__screenWindow, SCREEN_PROPERTY_DISPLAY, (void **)&screen_display);
-		if (rc)
-		{
-			perror("screen_get_window_property_pv(SCREEN_PROPERTY_DISPLAY)");
-			goto error;
-		}
-
-		screen_display_mode_t screen_mode;
-		rc = screen_get_display_property_pv(screen_display, SCREEN_PROPERTY_MODE, (void**)&screen_mode);
-		if (rc)
-		{
-			perror("screen_get_display_property_pv(SCREEN_PROPERTY_MODE)");
-			goto error;
-		}
-
-		int size[2];
-		rc = screen_get_window_property_iv(__screenWindow, SCREEN_PROPERTY_BUFFER_SIZE, size);
-		if (rc)
-		{
-			perror("screen_get_window_property_iv(SCREEN_PROPERTY_BUFFER_SIZE)");
-			goto error;
-		}
-
-		__screenWindowSize[0] = size[0];
-		__screenWindowSize[1] = size[1];
-
-		if ((angle == 0) || (angle == 180))
-		{
-			if (((screen_mode.width > screen_mode.height) && (size[0] < size[1])) ||
-				((screen_mode.width < screen_mode.height) && (size[0] > size[1])))
-			{
-				__screenWindowSize[1] = size[0];
-				__screenWindowSize[0] = size[1];
-			}
-		}
-		else if ((angle == 90) || (angle == 270))
-		{
-			if (((screen_mode.width > screen_mode.height) && (size[0] > size[1])) ||
-				((screen_mode.width < screen_mode.height) && (size[0] < size[1])))
-			{
-				__screenWindowSize[1] = size[0];
-				__screenWindowSize[0] = size[1];
-			}
-		}
-		else
-		{
-			perror("Navigator returned an unexpected orientation angle.");
-			goto error;
-		}
-
-
-	    rc = screen_set_window_property_iv(__screenWindow, SCREEN_PROPERTY_ROTATION, &angle);
-	    if (rc)
-	    {
-	        perror("screen_set_window_property_iv(SCREEN_PROPERTY_ROTATION)");
-	        goto error;
-	    }
-	}
+    if (width_str && height_str)
+    {
+        __screenWindowSize[0] = atoi(width_str);
+        __screenWindowSize[1] = atoi(height_str);
+    }
+    else
+    {
+        int angle = atoi(getenv("ORIENTATION"));
+
+        screen_display_t screen_display;
+        rc = screen_get_window_property_pv(__screenWindow, SCREEN_PROPERTY_DISPLAY, (void **)&screen_display);
+        if (rc)
+        {
+            perror("screen_get_window_property_pv(SCREEN_PROPERTY_DISPLAY)");
+            goto error;
+        }
+
+        screen_display_mode_t screen_mode;
+        rc = screen_get_display_property_pv(screen_display, SCREEN_PROPERTY_MODE, (void**)&screen_mode);
+        if (rc)
+        {
+            perror("screen_get_display_property_pv(SCREEN_PROPERTY_MODE)");
+            goto error;
+        }
+
+        int size[2];
+        rc = screen_get_window_property_iv(__screenWindow, SCREEN_PROPERTY_BUFFER_SIZE, size);
+        if (rc)
+        {
+            perror("screen_get_window_property_iv(SCREEN_PROPERTY_BUFFER_SIZE)");
+            goto error;
+        }
+
+        __screenWindowSize[0] = size[0];
+        __screenWindowSize[1] = size[1];
+
+        if ((angle == 0) || (angle == 180))
+        {
+            if (((screen_mode.width > screen_mode.height) && (size[0] < size[1])) ||
+                ((screen_mode.width < screen_mode.height) && (size[0] > size[1])))
+            {
+                __screenWindowSize[1] = size[0];
+                __screenWindowSize[0] = size[1];
+            }
+        }
+        else if ((angle == 90) || (angle == 270))
+        {
+            if (((screen_mode.width > screen_mode.height) && (size[0] > size[1])) ||
+                ((screen_mode.width < screen_mode.height) && (size[0] < size[1])))
+            {
+                __screenWindowSize[1] = size[0];
+                __screenWindowSize[0] = size[1];
+            }
+        }
+        else
+        {
+            perror("Navigator returned an unexpected orientation angle.");
+            goto error;
+        }
+
+
+        rc = screen_set_window_property_iv(__screenWindow, SCREEN_PROPERTY_ROTATION, &angle);
+        if (rc)
+        {
+            perror("screen_set_window_property_iv(SCREEN_PROPERTY_ROTATION)");
+            goto error;
+        }
+    }
 
     rc = screen_set_window_property_iv(__screenWindow, SCREEN_PROPERTY_BUFFER_SIZE, __screenWindowSize);
     if (rc)

+ 3 - 3
gameplay/src/PlatformWin32.cpp

@@ -763,9 +763,9 @@ Platform* Platform::create(Game* game, void* attachToWindow)
             DEVMODE dm;
             memset(&dm, 0, sizeof(dm));
             dm.dmSize= sizeof(dm);
-            dm.dmPelsWidth	= __width;
-            dm.dmPelsHeight	= __height;
-            dm.dmBitsPerPel	= 32;
+            dm.dmPelsWidth    = __width;
+            dm.dmPelsHeight    = __height;
+            dm.dmBitsPerPel    = 32;
             dm.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
 
             // Try to set selected mode and get results. NOTE: CDS_FULLSCREEN gets rid of start bar.

+ 4 - 4
gameplay/src/PlatformiOS.mm

@@ -51,7 +51,7 @@ int getKey(unichar keyCode);
 
 @interface View : UIView <UIKeyInput>
 {
-    EAGLContext* context;	
+    EAGLContext* context;
     CADisplayLink* displayLink;
     GLuint defaultFramebuffer;
     GLuint colorRenderbuffer;
@@ -237,7 +237,7 @@ int getKey(unichar keyCode);
 {
     if (interval >= 1)
     {
-        swapInterval = interval;		
+        swapInterval = interval;        
         if (updating)
         {
             [self stopUpdating];
@@ -555,7 +555,7 @@ int getKey(unichar keyCode);
 }
 
 - (void)applicationWillEnterForeground:(UIApplication*)application 
-{	
+{    
     [viewController startUpdating];
 }
 
@@ -565,7 +565,7 @@ int getKey(unichar keyCode);
 }
 
 - (void)applicationWillTerminate:(UIApplication*)application 
-{	
+{    
     [viewController stopUpdating];
 }
 

+ 10 - 10
gameplay/src/RadioButton.cpp

@@ -102,16 +102,16 @@ bool RadioButton::touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int c
         {
             if (_contactIndex == (int) _contactIndex && _state == Control::ACTIVE)
             {
-				if (x > _clipBounds.x && x <= _clipBounds.x + _clipBounds.width &&
-					y > _clipBounds.y && y <= _clipBounds.y + _clipBounds.height)
-				{
-					if (!_selected)
-					{
-						RadioButton::clearSelected(_groupId);
-						_selected = true;
-						notifyListeners(Listener::VALUE_CHANGED);
-					}
-				}
+                if (x > _clipBounds.x && x <= _clipBounds.x + _clipBounds.width &&
+                    y > _clipBounds.y && y <= _clipBounds.y + _clipBounds.height)
+                {
+                    if (!_selected)
+                    {
+                        RadioButton::clearSelected(_groupId);
+                        _selected = true;
+                        notifyListeners(Listener::VALUE_CHANGED);
+                    }
+                }
             }
         }
         break;

+ 1 - 1
gameplay/src/ScriptController.cpp

@@ -23,7 +23,7 @@
         return LuaArray<type>((type*)NULL); \
     \
     /* Declare a LuaArray to store the values. */ \
-	LuaArray<type> arr(size); \
+    LuaArray<type> arr(size); \
     \
     /* Push the first key. */ \
     lua_pushnil(sc->_lua); \

+ 44 - 44
gameplay/src/ScriptController.h

@@ -39,46 +39,46 @@ class LuaArray
 {
 public:
 
-	/**
-	 * Creates a LuaArray to store a single pointer value.
-	 */
-	LuaArray(T* param);
-
-	/**
-	 * Allocates a LuaArray to store an array of values.
-	 *
-	 * Individual items in the array can be set using the 
-	 * set(unsigned int, const T&) method.
-	 * 
-	 * @param count Number of elements to store in the parameter.
-	 */
-	LuaArray(int count);
-
-	/**
-	 * Copy construcotr.
-	 */
-	LuaArray(const LuaArray<T>& copy);
-
-	/**
-	 * Destructor.
-	 */
-	~LuaArray();
-
-	/**
-	 * Assignment operator.
-	 */
-	LuaArray<T>& operator = (const LuaArray<T>& p);
-
-	/**
-	 * Copies the value of the object pointed to by itemPtr into the specified
+    /**
+     * Creates a LuaArray to store a single pointer value.
+     */
+    LuaArray(T* param);
+
+    /**
+     * Allocates a LuaArray to store an array of values.
+     *
+     * Individual items in the array can be set using the 
+     * set(unsigned int, const T&) method.
+     * 
+     * @param count Number of elements to store in the parameter.
+     */
+    LuaArray(int count);
+
+    /**
+     * Copy construcotr.
+     */
+    LuaArray(const LuaArray<T>& copy);
+
+    /**
+     * Destructor.
+     */
+    ~LuaArray();
+
+    /**
+     * Assignment operator.
+     */
+    LuaArray<T>& operator = (const LuaArray<T>& p);
+
+    /**
+     * Copies the value of the object pointed to by itemPtr into the specified
      * index of this LuaArray's array.
-	 */
-	void set(unsigned int index, const T* itemPtr);
+     */
+    void set(unsigned int index, const T* itemPtr);
 
-	/**
-	 * Conversion operator from LuaArray to T*.
-	 */
-	operator T* () const;
+    /**
+     * Conversion operator from LuaArray to T*.
+     */
+    operator T* () const;
 
     /**
      * Overloades [] operator to get/set item value at index.
@@ -87,14 +87,14 @@ public:
 
 private:
 
-	struct Data
-	{
+    struct Data
+    {
         Data() : value(NULL), refCount(0) { }
-		T* value;
-		int refCount;
-	};
+        T* value;
+        int refCount;
+    };
 
-	Data* _data;
+    Data* _data;
 };
 
 /**

+ 32 - 32
gameplay/src/ScriptController.inl

@@ -6,71 +6,71 @@ namespace gameplay
 template <typename T>
 ScriptUtil::LuaArray<T>::LuaArray(T* param)
 {
-	_data = new ScriptUtil::LuaArray<T>::Data();
-	_data->value = param;
+    _data = new ScriptUtil::LuaArray<T>::Data();
+    _data->value = param;
 
-	// Initial ref count of zero means no memory management
-	_data->refCount = 0;
+    // Initial ref count of zero means no memory management
+    _data->refCount = 0;
 }
 
 template <typename T>
 ScriptUtil::LuaArray<T>::LuaArray(int count)
 {
-	_data = new ScriptUtil::LuaArray<T>::Data();
+    _data = new ScriptUtil::LuaArray<T>::Data();
 
-	// Allocate a chunk of memory to store 'count' number of T.
-	// Use new instead of malloc since we track memory allocations
-	// int DebugMem configurations.
-	_data->value = (T*)new unsigned char[sizeof(T) * count];
+    // Allocate a chunk of memory to store 'count' number of T.
+    // Use new instead of malloc since we track memory allocations
+    // int DebugMem configurations.
+    _data->value = (T*)new unsigned char[sizeof(T) * count];
 
-	// Positive ref count means we automatically cleanup memory
-	_data->refCount = 1;
+    // Positive ref count means we automatically cleanup memory
+    _data->refCount = 1;
 }
 
 template <typename T>
 ScriptUtil::LuaArray<T>::LuaArray(const ScriptUtil::LuaArray<T>& copy)
 {
-	_data = copy._data;
-	++_data->refCount;
+    _data = copy._data;
+    ++_data->refCount;
 }
 
 template <typename T>
 ScriptUtil::LuaArray<T>::~LuaArray()
 {
-	if ((--_data->refCount) <= 0)
-	{
+    if ((--_data->refCount) <= 0)
+    {
         // Non managed arrays/pointers start with ref count zero, so only delete data if
         // the decremented ref count == 0 (otherwise it will be -1).
         if (_data->refCount == 0)
         {
             unsigned char* value = (unsigned char*)_data->value;
-		    SAFE_DELETE_ARRAY(value);
+            SAFE_DELETE_ARRAY(value);
         }
 
         SAFE_DELETE(_data);
-	}
+    }
 }
 
 template <typename T>
 ScriptUtil::LuaArray<T>& ScriptUtil::LuaArray<T>::operator = (const ScriptUtil::LuaArray<T>& p)
 {
     _data = p._data;
-	++_data->refCount;
+    ++_data->refCount;
 }
 
 template <typename T>
 void ScriptUtil::LuaArray<T>::set(unsigned int index, const T* itemPtr)
 {
-	// WARNING: The following code will only work properly for arrays of pointers
-	// to objects (i.e. T**) or for simple structs that are being passed
-	// in as read-only. Since the memory is directly copied, any member data that
-	// is modified with the object that is copied, will not modify the original object.
-	// What is even scarier is that if an array of objects that contain virtual functions
-	// is copied here, then the vtables are copied directly, meaning the new object
-	// contains a copy of a vtable that points to functions in the old object. Calling
-	// virtual fucntions on the new object would then call the functions on the old object.
-	// If the old object is deleted, the vtable on the new object would point to addressess
-	// for functions that no longer exist.
+    // WARNING: The following code will only work properly for arrays of pointers
+    // to objects (i.e. T**) or for simple structs that are being passed
+    // in as read-only. Since the memory is directly copied, any member data that
+    // is modified with the object that is copied, will not modify the original object.
+    // What is even scarier is that if an array of objects that contain virtual functions
+    // is copied here, then the vtables are copied directly, meaning the new object
+    // contains a copy of a vtable that points to functions in the old object. Calling
+    // virtual fucntions on the new object would then call the functions on the old object.
+    // If the old object is deleted, the vtable on the new object would point to addressess
+    // for functions that no longer exist.
     if (itemPtr)
         memcpy((void*)&_data->value[index], (void*)itemPtr, sizeof(T));
     else
@@ -80,7 +80,7 @@ void ScriptUtil::LuaArray<T>::set(unsigned int index, const T* itemPtr)
 template <typename T>
 ScriptUtil::LuaArray<T>::operator T* () const
 {
-	return _data->value;
+    return _data->value;
 }
 
 template <typename T>
@@ -111,7 +111,7 @@ ScriptUtil::LuaArray<T> ScriptUtil::getObjectPointer(int index, const char* type
         if (size <= 0)
             return LuaArray<T>((T*)NULL);
 
-		LuaArray<T> arr(size);
+        LuaArray<T> arr(size);
 
         // Push the first key.
         lua_pushnil(sc->_lua);
@@ -128,7 +128,7 @@ ScriptUtil::LuaArray<T> ScriptUtil::getObjectPointer(int index, const char* type
                     if (lua_rawequal(sc->_lua, -1, -2))
                     {
                         lua_pop(sc->_lua, 2);
-						arr.set(i, (T*)((ScriptUtil::LuaObject*)p)->instance);
+                        arr.set(i, (T*)((ScriptUtil::LuaObject*)p)->instance);
                         lua_pop(sc->_lua, 1);
                         continue;
                     }
@@ -142,7 +142,7 @@ ScriptUtil::LuaArray<T> ScriptUtil::getObjectPointer(int index, const char* type
                         if (lua_rawequal(sc->_lua, -1, -2))
                         {
                             lua_pop(sc->_lua, 2);
-							arr.set(i, (T*)((ScriptUtil::LuaObject*)p)->instance);
+                            arr.set(i, (T*)((ScriptUtil::LuaObject*)p)->instance);
                             lua_pop(sc->_lua, 1);
                             continue;
                         }

+ 1 - 1
gameplay/src/Texture.cpp

@@ -402,7 +402,7 @@ GLubyte* Texture::readCompressedPVRTC(const char* path, FILE* file, GLsizei* wid
     read = fread(data, 1, dataSize, file);
     if (read != dataSize)
     {
-		SAFE_DELETE_ARRAY(data);
+        SAFE_DELETE_ARRAY(data);
         GP_ERROR("Failed to read texture data from PVR file '%s'.", path);
         return NULL;
     }

+ 1 - 1
gameplay/src/gameplay-main-ios.mm

@@ -15,7 +15,7 @@ int main(int argc, char** argv)
     Platform* platform = Platform::create(game);
     GP_ASSERT(platform);
     int result = platform->enterMessagePump();
-	delete platform;
+    delete platform;
     [p release];
     return result;
 }

+ 1 - 1
gameplay/src/gameplay-main-macosx.mm

@@ -15,7 +15,7 @@ int main(int argc, char** argv)
     Platform* platform = Platform::create(game);
     GP_ASSERT(platform);
     int result = platform->enterMessagePump();
-	delete platform;
+    delete platform;
     [p release];
     return result;
 }