瀏覽代碼

Merge pull request #59 from blackberry-gaming/next-sgrenier

Next sgrenier
Sean Paul Taylor 14 年之前
父節點
當前提交
40a3b1bbf2
共有 100 個文件被更改,包括 294 次插入341 次删除
  1. 2 1
      gameplay-encoder/gameplay-encoder.vcxproj
  2. 2 7
      gameplay-encoder/gameplay-encoder.vcxproj.filters
  3. 20 0
      gameplay-encoder/gameplay-encoder.xcodeproj/project.pbxproj
  4. 1 0
      gameplay-encoder/src/Animation.cpp
  5. 2 0
      gameplay-encoder/src/Animation.h
  6. 2 1
      gameplay-encoder/src/AnimationChannel.cpp
  7. 2 3
      gameplay-encoder/src/AnimationChannel.h
  8. 1 0
      gameplay-encoder/src/Animations.cpp
  9. 1 0
      gameplay-encoder/src/Animations.h
  10. 26 10
      gameplay-encoder/src/Base.h
  11. 2 1
      gameplay-encoder/src/BoundingVolume.cpp
  12. 1 1
      gameplay-encoder/src/Camera.cpp
  13. 1 0
      gameplay-encoder/src/Camera.h
  14. 2 1
      gameplay-encoder/src/CameraInstance.cpp
  15. 3 0
      gameplay-encoder/src/CameraInstance.h
  16. 2 2
      gameplay-encoder/src/DAEChannelTarget.cpp
  17. 0 12
      gameplay-encoder/src/DAEChannelTarget.h
  18. 7 4
      gameplay-encoder/src/DAEOptimizer.cpp
  19. 5 11
      gameplay-encoder/src/DAEOptimizer.h
  20. 10 12
      gameplay-encoder/src/DAESceneEncoder.cpp
  21. 4 20
      gameplay-encoder/src/DAESceneEncoder.h
  22. 6 1
      gameplay-encoder/src/DAEUtil.cpp
  23. 4 19
      gameplay-encoder/src/DAEUtil.h
  24. 4 1
      gameplay-encoder/src/Effect.cpp
  25. 1 2
      gameplay-encoder/src/Effect.h
  26. 6 1
      gameplay-encoder/src/EncoderArguments.cpp
  27. 4 2
      gameplay-encoder/src/EncoderArguments.h
  28. 2 2
      gameplay-encoder/src/FileIO.cpp
  29. 1 3
      gameplay-encoder/src/FileIO.h
  30. 2 1
      gameplay-encoder/src/Font.cpp
  31. 1 2
      gameplay-encoder/src/Font.h
  32. 2 1
      gameplay-encoder/src/GPBDecoder.cpp
  33. 1 8
      gameplay-encoder/src/GPBDecoder.h
  34. 2 2
      gameplay-encoder/src/GPBFile.cpp
  35. 7 13
      gameplay-encoder/src/GPBFile.h
  36. 5 3
      gameplay-encoder/src/Glyph.cpp
  37. 1 0
      gameplay-encoder/src/Glyph.h
  38. 2 1
      gameplay-encoder/src/Light.cpp
  39. 1 3
      gameplay-encoder/src/Light.h
  40. 2 2
      gameplay-encoder/src/LightInstance.cpp
  41. 3 1
      gameplay-encoder/src/LightInstance.h
  42. 2 1
      gameplay-encoder/src/Material.cpp
  43. 1 2
      gameplay-encoder/src/Material.h
  44. 2 1
      gameplay-encoder/src/MaterialParameter.cpp
  45. 1 2
      gameplay-encoder/src/MaterialParameter.h
  46. 2 2
      gameplay-encoder/src/Matrix.cpp
  47. 2 2
      gameplay-encoder/src/Matrix.h
  48. 2 1
      gameplay-encoder/src/Mesh.cpp
  49. 1 0
      gameplay-encoder/src/Mesh.h
  50. 2 1
      gameplay-encoder/src/MeshPart.cpp
  51. 1 5
      gameplay-encoder/src/MeshPart.h
  52. 9 8
      gameplay-encoder/src/MeshSkin.cpp
  53. 0 2
      gameplay-encoder/src/MeshSkin.h
  54. 1 0
      gameplay-encoder/src/Model.cpp
  55. 0 2
      gameplay-encoder/src/Model.h
  56. 2 1
      gameplay-encoder/src/Node.cpp
  57. 1 4
      gameplay-encoder/src/Node.h
  58. 2 1
      gameplay-encoder/src/Object.cpp
  59. 2 2
      gameplay-encoder/src/Object.h
  60. 1 5
      gameplay-encoder/src/Quaternion.cpp
  61. 2 5
      gameplay-encoder/src/Quaternion.h
  62. 2 1
      gameplay-encoder/src/Reference.cpp
  63. 1 0
      gameplay-encoder/src/Reference.h
  64. 2 1
      gameplay-encoder/src/ReferenceTable.cpp
  65. 1 3
      gameplay-encoder/src/ReferenceTable.h
  66. 3 3
      gameplay-encoder/src/Scene.cpp
  67. 1 0
      gameplay-encoder/src/Scene.h
  68. 2 3
      gameplay-encoder/src/StringUtil.cpp
  69. 1 2
      gameplay-encoder/src/StringUtil.h
  70. 7 1
      gameplay-encoder/src/TTFFontEncoder.cpp
  71. 5 7
      gameplay-encoder/src/TTFFontEncoder.h
  72. 2 0
      gameplay-encoder/src/Transform.cpp
  73. 3 9
      gameplay-encoder/src/Vector2.cpp
  74. 1 5
      gameplay-encoder/src/Vector2.h
  75. 3 7
      gameplay-encoder/src/Vector3.cpp
  76. 0 6
      gameplay-encoder/src/Vector3.h
  77. 3 7
      gameplay-encoder/src/Vector4.cpp
  78. 1 5
      gameplay-encoder/src/Vector4.h
  79. 2 1
      gameplay-encoder/src/Vertex.cpp
  80. 1 0
      gameplay-encoder/src/Vertex.h
  81. 2 1
      gameplay-encoder/src/VertexElement.cpp
  82. 1 0
      gameplay-encoder/src/VertexElement.h
  83. 1 3
      gameplay-encoder/src/main.cpp
  84. 0 24
      gameplay.sln
  85. 2 3
      gameplay/src/Animation.cpp
  86. 0 1
      gameplay/src/AnimationTarget.cpp
  87. 18 13
      gameplay/src/Base.h
  88. 6 6
      gameplay/src/BoundingSphere.cpp
  89. 8 4
      gameplay/src/Curve.cpp
  90. 7 7
      gameplay/src/DebugNew.cpp
  91. 6 6
      gameplay/src/DebugNew.h
  92. 1 1
      gameplay/src/FileSystem.cpp
  93. 2 2
      gameplay/src/Font.cpp
  94. 1 1
      gameplay/src/Frustum.cpp
  95. 3 1
      gameplay/src/Material.cpp
  96. 1 1
      gameplay/src/Matrix.cpp
  97. 1 1
      gameplay/src/PhysicsRigidBody.h
  98. 2 2
      gameplay/src/Plane.cpp
  99. 1 1
      gameplay/src/Quaternion.cpp
  100. 1 1
      gameplay/src/Ray.cpp

+ 2 - 1
gameplay-encoder/gameplay-encoder.vcxproj

@@ -81,7 +81,6 @@
     <ClInclude Include="src\MaterialParameter.h" />
     <ClInclude Include="src\Matrix.h" />
     <ClInclude Include="src\Mesh.h" />
-    <ClInclude Include="src\Miniball.h" />
     <ClInclude Include="src\Model.h" />
     <ClInclude Include="src\MeshPart.h" />
     <ClInclude Include="src\MeshSkin.h" />
@@ -145,6 +144,8 @@
       <Optimization>Disabled</Optimization>
       <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;NO_BOOST;NO_ZAE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>../external-deps/freetype2/include;../external-deps/collada-dom/include;../external-deps/collada-dom/include/1.4</AdditionalIncludeDirectories>
+      <DisableLanguageExtensions>
+      </DisableLanguageExtensions>
     </ClCompile>
     <Link>
       <SubSystem>Console</SubSystem>

+ 2 - 7
gameplay-encoder/gameplay-encoder.vcxproj.filters

@@ -62,9 +62,6 @@
     </ClCompile>
     <ClCompile Include="src\GPBFile.cpp" />
     <ClCompile Include="src\DAEChannelTarget.cpp" />
-    <ClCompile Include="src\Base.cpp">
-      <Filter>Objects</Filter>
-    </ClCompile>
     <ClCompile Include="src\FileIO.cpp" />
     <ClCompile Include="src\StringUtil.cpp" />
     <ClCompile Include="src\Effect.cpp">
@@ -100,6 +97,7 @@
     <ClCompile Include="src\BoundingVolume.cpp">
       <Filter>Math</Filter>
     </ClCompile>
+    <ClCompile Include="src\Base.cpp" />
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="src\DAESceneEncoder.h" />
@@ -162,9 +160,6 @@
     </ClInclude>
     <ClInclude Include="src\GPBFile.h" />
     <ClInclude Include="src\DAEChannelTarget.h" />
-    <ClInclude Include="src\Base.h">
-      <Filter>Objects</Filter>
-    </ClInclude>
     <ClInclude Include="src\FileIO.h" />
     <ClInclude Include="src\StringUtil.h" />
     <ClInclude Include="src\Effect.h">
@@ -197,10 +192,10 @@
       <Filter>Objects\Animation</Filter>
     </ClInclude>
     <ClInclude Include="..\gameplay\src\Curve.h" />
-    <ClInclude Include="src\Miniball.h" />
     <ClInclude Include="src\BoundingVolume.h">
       <Filter>Math</Filter>
     </ClInclude>
+    <ClInclude Include="src\Base.h" />
   </ItemGroup>
   <ItemGroup>
     <Filter Include="Objects">

+ 20 - 0
gameplay-encoder/gameplay-encoder.xcodeproj/project.pbxproj

@@ -8,6 +8,8 @@
 
 /* Begin PBXBuildFile section */
 		42475D7C14720ECE00610A6A /* libdom.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42475D7B14720ECE00610A6A /* libdom.a */; };
+		4283905914896E6C00E2B2F5 /* BoundingVolume.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4283905714896E6C00E2B2F5 /* BoundingVolume.cpp */; };
+		4283906314896F1600E2B2F5 /* Curve.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4283906114896F1600E2B2F5 /* Curve.cpp */; };
 		42C8EE0A14724CD700E43619 /* Animation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDB714724CD700E43619 /* Animation.cpp */; };
 		42C8EE0B14724CD700E43619 /* AnimationChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDB914724CD700E43619 /* AnimationChannel.cpp */; };
 		42C8EE0C14724CD700E43619 /* Animations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42C8EDBB14724CD700E43619 /* Animations.cpp */; };
@@ -73,6 +75,10 @@
 /* Begin PBXFileReference section */
 		42475CE6147208A000610A6A /* gameplay-encoder */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "gameplay-encoder"; sourceTree = BUILT_PRODUCTS_DIR; };
 		42475D7B14720ECE00610A6A /* libdom.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libdom.a; path = "../external-deps/collada-dom/lib/macos/libdom.a"; sourceTree = "<group>"; };
+		4283905714896E6C00E2B2F5 /* BoundingVolume.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BoundingVolume.cpp; path = src/BoundingVolume.cpp; sourceTree = SOURCE_ROOT; };
+		4283905814896E6C00E2B2F5 /* BoundingVolume.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BoundingVolume.h; path = src/BoundingVolume.h; sourceTree = SOURCE_ROOT; };
+		4283906114896F1600E2B2F5 /* Curve.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Curve.cpp; path = ../gameplay/src/Curve.cpp; sourceTree = "<group>"; };
+		4283906214896F1600E2B2F5 /* Curve.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Curve.h; path = ../gameplay/src/Curve.h; sourceTree = "<group>"; };
 		42C8EDB714724CD700E43619 /* Animation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Animation.cpp; path = src/Animation.cpp; sourceTree = SOURCE_ROOT; };
 		42C8EDB814724CD700E43619 /* Animation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Animation.h; path = src/Animation.h; sourceTree = SOURCE_ROOT; };
 		42C8EDB914724CD700E43619 /* AnimationChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AnimationChannel.cpp; path = src/AnimationChannel.cpp; sourceTree = SOURCE_ROOT; };
@@ -185,6 +191,7 @@
 		42475CDB147208A000610A6A = {
 			isa = PBXGroup;
 			children = (
+				4283906414896F3000E2B2F5 /* gameplay */,
 				42475CE9147208A000610A6A /* src */,
 				427D4F44147DC9080076760E /* Libraries */,
 				42475CE7147208A000610A6A /* Products */,
@@ -210,6 +217,8 @@
 				42C8EDBC14724CD700E43619 /* Animations.h */,
 				42C8EDBD14724CD700E43619 /* Base.cpp */,
 				42C8EDBE14724CD700E43619 /* Base.h */,
+				4283905714896E6C00E2B2F5 /* BoundingVolume.cpp */,
+				4283905814896E6C00E2B2F5 /* BoundingVolume.h */,
 				42C8EDBF14724CD700E43619 /* Camera.cpp */,
 				42C8EDC014724CD700E43619 /* Camera.h */,
 				42C8EDC114724CD700E43619 /* CameraInstance.cpp */,
@@ -304,6 +313,15 @@
 			name = Libraries;
 			sourceTree = "<group>";
 		};
+		4283906414896F3000E2B2F5 /* gameplay */ = {
+			isa = PBXGroup;
+			children = (
+				4283906114896F1600E2B2F5 /* Curve.cpp */,
+				4283906214896F1600E2B2F5 /* Curve.h */,
+			);
+			name = gameplay;
+			sourceTree = "<group>";
+		};
 /* End PBXGroup section */
 
 /* Begin PBXNativeTarget section */
@@ -396,6 +414,8 @@
 				42C8EE3114724CD700E43619 /* Vector4.cpp in Sources */,
 				42C8EE3214724CD700E43619 /* Vertex.cpp in Sources */,
 				42C8EE3314724CD700E43619 /* VertexElement.cpp in Sources */,
+				4283905914896E6C00E2B2F5 /* BoundingVolume.cpp in Sources */,
+				4283906314896F1600E2B2F5 /* Curve.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

+ 1 - 0
gameplay-encoder/src/Animation.cpp

@@ -1,3 +1,4 @@
+#include "Base.h"
 #include "Animation.h"
 
 namespace gameplay

+ 2 - 0
gameplay-encoder/src/Animation.h

@@ -41,8 +41,10 @@ public:
     AnimationChannel* getAnimationChannel(unsigned int index) const;
 
 private:
+
     std::vector<AnimationChannel*> _channels;
 };
 
 }
+
 #endif

+ 2 - 1
gameplay-encoder/src/AnimationChannel.cpp

@@ -1,3 +1,4 @@
+#include "Base.h"
 #include "AnimationChannel.h"
 
 namespace gameplay
@@ -86,7 +87,7 @@ const std::vector<unsigned int>& AnimationChannel::getInterpolationTypes() const
     return _interpolations;
 }
 
-void AnimationChannel::setTargetId(const std::string str)
+void AnimationChannel::setTargetId(const std::string& str)
 {
     _targetId = str;
 }

+ 2 - 3
gameplay-encoder/src/AnimationChannel.h

@@ -36,7 +36,7 @@ public:
     virtual void writeText(FILE* file);
 
     const std::string& getTargetId() const;
-    void setTargetId(const std::string str);
+    void setTargetId(const std::string& str);
     void setTargetAttribute(unsigned int attrib);
 
     void setKeyTimes(const std::vector<float>& values);
@@ -73,7 +73,6 @@ private:
     std::vector<unsigned int> _interpolations;
 };
 
-
 }
-#endif
 
+#endif

+ 1 - 0
gameplay-encoder/src/Animations.cpp

@@ -1,3 +1,4 @@
+#include "Base.h"
 #include "Animations.h"
 
 namespace gameplay

+ 1 - 0
gameplay-encoder/src/Animations.h

@@ -39,4 +39,5 @@ private:
 };
 
 }
+
 #endif

+ 26 - 10
gameplay-encoder/src/Base.h

@@ -1,22 +1,35 @@
 #ifndef BASE_H_
 #define BASE_H_
 
+// C++ includes
 #include <cmath>
+#include <cstdio>
+#include <cstdlib>
+#include <cstdarg>
+#include <cassert>
+#include <cmath>
+#include <cfloat>
+#include <ctime>
 #include <iostream>
+#include <fstream>
 #include <string>
 #include <vector>
 #include <list>
 #include <map>
-#include <stdio.h>
-#include <stdlib.h>
-#include <iostream>
-#include <string>
+#include <algorithm>
 #include <sys/stat.h>
-#include <vector>
-#include <assert.h>
-#include <math.h>
-#include <float.h>
 
+// Collada includes
+#include <dae.h>
+#include <dae/daeSIDResolver.h>
+#include <dae/domAny.h>
+#include <dom/domCOLLADA.h>
+#include <dom/domConstants.h>
+#include <dom/domElements.h>
+#include <dom/domCamera.h>
+#include <dom/domProfile_COMMON.h>
+
+// Defines
 #ifndef M_1_PI        
 #define M_1_PI                      0.31830988618379067154
 #endif
@@ -64,10 +77,13 @@ void setIdentityMatrix(float values[]);
 #define ISZERO(x) (fabs(x) < 0.000001f)
 
 #ifdef NDEBUG
-#define DEBUGPRINT (x, ...)
+#define DEBUGPRINT(x)
+#define DEBUGPRINT_VARG(x, ...)
 #else
-#define DEBUGPRINT(x, ...) printf(x, __VA_ARGS__)
+#define DEBUGPRINT(x)  printf(x)
+#define DEBUGPRINT_VARG(x, ...) printf(x, __VA_ARGS__)
 #endif
 
 }
+
 #endif

+ 2 - 1
gameplay-encoder/src/BoundingVolume.cpp

@@ -1,3 +1,4 @@
+#include "Base.h"
 #include "BoundingVolume.h"
 
 namespace gameplay
@@ -95,7 +96,7 @@ void BoundingVolume::merge(const BoundingVolume& v)
     float vx = center.x - v.center.x;
     float vy = center.y - v.center.y;
     float vz = center.z - v.center.z;
-    float d = sqrtf(vx * vx + vy * vy + vz * vz);
+    float d = sqrt(vx * vx + vy * vy + vz * vz);
 
     // If one sphere is contained inside the other, set to the larger sphere.
     if (d <= (v.radius - radius))

+ 1 - 1
gameplay-encoder/src/Camera.cpp

@@ -1,4 +1,4 @@
-#include <assert.h>
+#include "Base.h"
 #include "Camera.h"
 
 namespace gameplay

+ 1 - 0
gameplay-encoder/src/Camera.h

@@ -54,4 +54,5 @@ private:
 };
 
 }
+
 #endif

+ 2 - 1
gameplay-encoder/src/CameraInstance.cpp

@@ -1,3 +1,4 @@
+#include "Base.h"
 #include "CameraInstance.h"
 
 namespace gameplay
@@ -50,4 +51,4 @@ void CameraInstance::setCamera(Camera* camera)
     _ref = camera;
 }
 
-}
+}

+ 3 - 0
gameplay-encoder/src/CameraInstance.h

@@ -28,9 +28,12 @@ public:
 
     Camera* getCamera();
     void setCamera(Camera* camera);
+
 private:
+
     Camera* _ref;
 };
 
 }
+
 #endif

+ 2 - 2
gameplay-encoder/src/DAEChannelTarget.cpp

@@ -1,4 +1,4 @@
-
+#include "Base.h"
 #include "DAEChannelTarget.h"
 
 
@@ -98,4 +98,4 @@ void DAEChannelTarget::getPropertyName(size_t index, std::string* str)
     str->clear();
 }
 
-}
+}

+ 0 - 12
gameplay-encoder/src/DAEChannelTarget.h

@@ -1,18 +1,6 @@
 #ifndef DAECHANNELTARGET_H_
 #define DAECHANNELTARGET_H_
 
-#include <dae.h>
-#include <dae/daeSIDResolver.h>
-#include <dae/domAny.h>
-#include <dom/domCOLLADA.h>
-#include <dom/domConstants.h>
-#include <dom/domElements.h>
-#include <dom/domProfile_COMMON.h>
-
-#include <vector>
-
-#include "Base.h"
-
 namespace gameplay
 {
 

+ 7 - 4
gameplay-encoder/src/DAEOptimizer.cpp

@@ -1,9 +1,10 @@
+#include "Base.h"
 #include "DAEOptimizer.h"
-
-#include <algorithm>
-
 #include "StringUtil.h"
 
+namespace gameplay
+{
+
 DAEOptimizer::DAEOptimizer(domCOLLADA* dom)
 {
     _dom = dom;
@@ -122,4 +123,6 @@ void DAEOptimizer::deleteEmptyAnimations()
     {
         daeElement::removeFromParent(*i);
     }
-}
+}
+
+}

+ 5 - 11
gameplay-encoder/src/DAEOptimizer.h

@@ -1,19 +1,11 @@
 #ifndef DAEOPTIMIZER_H_
 #define DAEOPTIMIZER_H_
 
-#include <dae.h>
-#include <dae/daeSIDResolver.h>
-#include <dae/domAny.h>
-#include <dom/domCOLLADA.h>
-#include <dom/domConstants.h>
-#include <dom/domElements.h>
-#include <dom/domProfile_COMMON.h>
-
-#include <vector>
-
-#include "Base.h"
 #include "DAEUtil.h"
 
+namespace gameplay
+{
+
 /**
  * The DAEOptimizer optimizes a COLLADA dom.
  */
@@ -60,4 +52,6 @@ private:
     std::string _inputPath;
 };
 
+}
+
 #endif

+ 10 - 12
gameplay-encoder/src/DAESceneEncoder.cpp

@@ -1,15 +1,11 @@
-/*
- * DAESceneEncoder.h
- */
-
-#include <algorithm>
-
+#include "Base.h"
 #include "DAESceneEncoder.h"
 #include "DAEOptimizer.h"
 
 //#define ENCODER_PRINT_TIME 1
 
-using namespace gameplay;
+namespace gameplay
+{
 
 DAESceneEncoder::DAESceneEncoder()
     : _collada(NULL), _dom(NULL), file(NULL), _vertexBlendWeights(NULL), _vertexBlendIndices(NULL)
@@ -243,7 +239,7 @@ void DAESceneEncoder::createTrianglesFromPolylist(domMesh* domMesh, domPolylist*
 
 void DAESceneEncoder::write(const std::string& filepath, const EncoderArguments& arguments)
 {
-    _begin = std::clock();
+    _begin = clock();
     const char* nodeId = arguments.getNodeId();
     bool text = arguments.textOutputEnabled();
 
@@ -663,14 +659,14 @@ bool DAESceneEncoder::loadTarget(const domChannelRef& channelRef, AnimationChann
 void DAESceneEncoder::begin()
 {
     #ifdef ENCODER_PRINT_TIME
-    _begin = std::clock();
+    _begin = clock();
     #endif
 }
 
 void DAESceneEncoder::end(const char* str)
 {
     #ifdef ENCODER_PRINT_TIME
-    clock_t time = std::clock() - _begin;
+    clock_t time = clock() - _begin;
     fprintf(stderr,"%5d %s\n", time, str);
     #endif
 }
@@ -1672,7 +1668,7 @@ Mesh* DAESceneEncoder::loadMesh(const domMesh* meshElement, const std::string& g
         domTriangles* triangles = daeSafeCast<domTriangles>(trianglesArray.get(i));
 
         // Parse the material for this subset
-        //std::string materialName = triangles->getMaterial() == NULL ? _T("") : triangles->getMaterial();
+        //string materialName = triangles->getMaterial() == NULL ? _T("") : triangles->getMaterial();
         //if (materialName.size() > 0)
         ///    subset->material = ParseMaterial(bindMaterial, materialName);
 
@@ -1924,4 +1920,6 @@ DAESceneEncoder::DAEPolygonInput::DAEPolygonInput(void) :
 
 DAESceneEncoder::DAEPolygonInput::~DAEPolygonInput(void)
 {
-}
+}
+
+}

+ 4 - 20
gameplay-encoder/src/DAESceneEncoder.h

@@ -1,25 +1,6 @@
-/*
- * DAESceneEncoder.h
- */
-
 #ifndef DAESCENEEENCODER_H_
 #define DAESCENEEENCODER_H_
 
-#include <iostream>
-#include <list>
-#include <vector>
-#include <ctime>
-
-#include <dae.h>
-#include <dae/daeSIDResolver.h>
-#include <dae/domAny.h>
-#include <dom/domCOLLADA.h>
-#include <dom/domConstants.h>
-#include <dom/domElements.h>
-#include <dom/domProfile_COMMON.h>
-#include <dom/domCamera.h>
-
-#include "Base.h"
 #include "StringUtil.h"
 #include "Object.h"
 #include "Node.h"
@@ -42,7 +23,8 @@
 #include "DAEUtil.h"
 #include "EncoderArguments.h"
 
-using namespace gameplay;
+namespace gameplay
+{
 
 /**
  * Class for binary encoding a Collada (DAE) file.
@@ -223,4 +205,6 @@ private:
     clock_t _begin;
 };
 
+}
+
 #endif

+ 6 - 1
gameplay-encoder/src/DAEUtil.cpp

@@ -1,6 +1,9 @@
-
+#include "Base.h"
 #include "DAEUtil.h"
 
+namespace gameplay
+{
+
 /**
  * Returns the index of the skeleton in skeletonArray that points to the given node.
  * 
@@ -301,3 +304,5 @@ int getIndex(const domInstance_controller::domSkeleton_Array& skeletonArray, con
     }
     return -1;
 }
+
+}

+ 4 - 19
gameplay-encoder/src/DAEUtil.h

@@ -1,25 +1,8 @@
-/*
- * DAEUtil.h
- */
-
 #ifndef DAEUTIL_H_
 #define DAEUTIL_H_
 
-#include <iostream>
-#include <list>
-#include <vector>
-
-#include <dae.h>
-#include <dae/daeSIDResolver.h>
-#include <dae/domAny.h>
-#include <dom/domCOLLADA.h>
-#include <dom/domConstants.h>
-#include <dom/domElements.h>
-#include <dom/domProfile_COMMON.h>
-
-#include "Base.h"
-
-using namespace gameplay;
+namespace gameplay
+{
 
 /**
  * Gets the joint names for the given source and appends them to the given list.
@@ -123,4 +106,6 @@ void moveChannelAndSouresToAnimation(domChannelRef& channel, domAnimationRef& an
  */
 bool isEmptyAnimation(domAnimationRef& animation);
 
+}
+
 #endif

+ 4 - 1
gameplay-encoder/src/Effect.cpp

@@ -1,3 +1,4 @@
+#include "Base.h"
 #include "Effect.h"
 
 namespace gameplay
@@ -15,6 +16,7 @@ unsigned int Effect::getTypeId(void) const
 {
     return EFFECT_ID;
 }
+
 const char* Effect::getElementName(void) const
 {
     return "Effect";
@@ -26,6 +28,7 @@ void Effect::writeBinary(FILE* file)
     write(_vertexShader, file);
     write(_fragmentShader, file);
 }
+
 void Effect::writeText(FILE* file)
 {
     fprintElementStart(file);
@@ -34,4 +37,4 @@ void Effect::writeText(FILE* file)
     fprintElementEnd(file);
 }
 
-}
+}

+ 1 - 2
gameplay-encoder/src/Effect.h

@@ -33,7 +33,6 @@ private:
     std::string _fragmentShader;
 };
 
-
 }
-#endif
 
+#endif

+ 6 - 1
gameplay-encoder/src/EncoderArguments.cpp

@@ -1,5 +1,5 @@
+#include "Base.h"
 #include "EncoderArguments.h"
-
 #include "StringUtil.h"
 
 #ifdef WIN32
@@ -7,6 +7,9 @@
     #define realpath(A,B)    _fullpath(B,A,PATH_MAX)
 #endif
 
+namespace gameplay
+{
+
 EncoderArguments::EncoderArguments(size_t argc, const char** argv) :
     _fontSize(0),
     _parseError(false),
@@ -273,3 +276,5 @@ void EncoderArguments::replace_char(char* str, char oldChar, char newChar)
         }
     }
 }
+
+}

+ 4 - 2
gameplay-encoder/src/EncoderArguments.h

@@ -1,8 +1,8 @@
 #ifndef ENCODERARGUMENTS_H_
 #define ENCODERARGUMENTS_H_
 
-
-#include "Base.h"
+namespace gameplay
+{
 
 /**
  * EncoderArguments handles parsing the command line arguments for the GamePlay Encoder.
@@ -111,4 +111,6 @@ private:
     std::vector<std::string> _groupAnimationAnimationId;
 };
 
+}
+
 #endif

+ 2 - 2
gameplay-encoder/src/FileIO.cpp

@@ -1,9 +1,9 @@
+#include "Base.h"
 #include "FileIO.h"
 
 namespace gameplay
 {
 
-
 // Writing out a binary file //
 
 void write(unsigned char value, FILE* file)
@@ -144,4 +144,4 @@ void skipUint(FILE* file)
     fseek(file, sizeof(unsigned int), SEEK_CUR);
 }
 
-}
+}

+ 1 - 3
gameplay-encoder/src/FileIO.h

@@ -1,8 +1,6 @@
 #ifndef FILEIO_H_
 #define FILEIO_H_
 
-#include "Base.h"
-
 namespace gameplay
 {
 
@@ -114,5 +112,5 @@ void skipString(FILE* file);
 void skipUint(FILE* file);
 
 }
-#endif
 
+#endif

+ 2 - 1
gameplay-encoder/src/Font.cpp

@@ -1,3 +1,4 @@
+#include "Base.h"
 #include "Font.h"
 
 namespace gameplay
@@ -50,4 +51,4 @@ void Font::writeText(FILE* file)
     fprintElementEnd(file);
 }
 
-}
+}

+ 1 - 2
gameplay-encoder/src/Font.h

@@ -44,7 +44,6 @@ public:
     };
 };
 
-
 }
-#endif
 
+#endif

+ 2 - 1
gameplay-encoder/src/GPBDecoder.cpp

@@ -1,3 +1,4 @@
+#include "Base.h"
 #include "GPBDecoder.h"
 
 namespace gameplay
@@ -113,4 +114,4 @@ std::string GPBDecoder::readString(FILE* fp)
     return result;
 }
 
-};
+}

+ 1 - 8
gameplay-encoder/src/GPBDecoder.h

@@ -1,14 +1,6 @@
-/*
- * GamePlayFile.h
- */
-
 #ifndef GPBDECODER_H_
 #define GPBDECODER_H_
 
-#include <iostream>
-#include <list>
-#include <assert.h>
-
 #include "FileIO.h"
 
 namespace gameplay
@@ -40,6 +32,7 @@ public:
     std::string readString(FILE* fp);
 
 private:
+
     FILE* _file;
     FILE* _outFile;
 };

+ 2 - 2
gameplay-encoder/src/GPBFile.cpp

@@ -1,3 +1,4 @@
+#include "Base.h"
 #include "GPBFile.h"
 
 namespace gameplay
@@ -240,5 +241,4 @@ void GPBFile::adjust()
     //   This can be merged into one animation. Same for scale animations.
 }
 
-
-}
+}

+ 7 - 13
gameplay-encoder/src/GPBFile.h

@@ -1,14 +1,6 @@
-/*
- * GPBFile.h
- */
-
 #ifndef GPBFILE_H_
 #define GPBFILE_H_
 
-#include <iostream>
-#include <list>
-#include <algorithm>
-
 #include "FileIO.h"
 #include "Object.h"
 #include "Scene.h"
@@ -24,11 +16,12 @@
 
 namespace gameplay
 {
-    /**
-     * Increment the version number when making a change that break binary compatibility.
-     * [0] is major, [1] is minor.
-     */
-    const unsigned char VERSION[2] = {1, 1};
+
+/**
+ * Increment the version number when making a change that break binary compatibility.
+ * [0] is major, [1] is minor.
+ */
+const unsigned char VERSION[2] = {1, 1};
 
 /**
  * The GamePlay Binary file class handles writing the GamePlay Binary file.
@@ -116,4 +109,5 @@ private:
 };
 
 }
+
 #endif

+ 5 - 3
gameplay-encoder/src/Glyph.cpp

@@ -1,3 +1,4 @@
+#include "Base.h"
 #include "Glyph.h"
 
 namespace gameplay
@@ -10,10 +11,10 @@ Glyph::Glyph(void) :
     fillArray(uvCoords, 0.0f, 4);
 }
 
-
-Glyph::~Glyph(void)
+    Glyph::~Glyph(void)
 {
 }
+
 const char* Glyph::getElementName(void) const
 {
     return "Glyph";
@@ -28,6 +29,7 @@ void Glyph::writeBinary(FILE* file)
     write(uvCoords, 4, file);
 
 }
+
 void Glyph::writeText(FILE* file)
 {
     fprintElementStart(file);
@@ -37,4 +39,4 @@ void Glyph::writeText(FILE* file)
     fprintElementEnd(file);
 }
 
-}
+}

+ 1 - 0
gameplay-encoder/src/Glyph.h

@@ -30,4 +30,5 @@ public:
 };
 
 }
+
 #endif

+ 2 - 1
gameplay-encoder/src/Light.cpp

@@ -1,3 +1,4 @@
+#include "Base.h"
 #include "Light.h"
 #include "DAESceneEncoder.h"
 
@@ -227,4 +228,4 @@ void Light::setFalloffExponent(float value)
     }
 }
 
-}
+}

+ 1 - 3
gameplay-encoder/src/Light.h

@@ -77,8 +77,6 @@ private:
     float _outerAngle;
 };
 
-
-
 }
-#endif
 
+#endif

+ 2 - 2
gameplay-encoder/src/LightInstance.cpp

@@ -1,5 +1,5 @@
+#include "Base.h"
 #include "LightInstance.h"
-#include "assert.h"
 
 namespace gameplay
 {
@@ -52,4 +52,4 @@ bool LightInstance::isAmbient() const
     return _ref != NULL && _ref->isAmbient();
 }
 
-}
+}

+ 3 - 1
gameplay-encoder/src/LightInstance.h

@@ -32,9 +32,11 @@ public:
     bool isAmbient() const;
 
 private:
+
     Light* _ref;
+
 };
 
 }
-#endif
 
+#endif

+ 2 - 1
gameplay-encoder/src/Material.cpp

@@ -1,3 +1,4 @@
+#include "Base.h"
 #include "Material.h"
 
 namespace gameplay
@@ -35,4 +36,4 @@ void Material::writeText(FILE* file)
     fprintElementEnd(file);
 }
 
-}
+}

+ 1 - 2
gameplay-encoder/src/Material.h

@@ -32,7 +32,6 @@ private:
     Effect* _effect;
 };
 
-
 }
-#endif
 
+#endif

+ 2 - 1
gameplay-encoder/src/MaterialParameter.cpp

@@ -1,3 +1,4 @@
+#include "Base.h"
 #include "MaterialParameter.h"
 
 namespace gameplay
@@ -35,4 +36,4 @@ void MaterialParameter::writeText(FILE* file)
     fprintElementEnd(file);
 }
 
-}
+}

+ 1 - 2
gameplay-encoder/src/MaterialParameter.h

@@ -30,7 +30,6 @@ private:
     unsigned int _type;
 };
 
-
 }
-#endif
 
+#endif

+ 2 - 2
gameplay-encoder/src/Matrix.cpp

@@ -1,9 +1,9 @@
+#include "Base.h"
 #include "Matrix.h"
 
 namespace gameplay
 {
 
-
 Matrix::Matrix(void)
 {
     setIdentity(m);
@@ -87,7 +87,7 @@ void Matrix::createRotation(float x, float y, float z, float angle, float* dst)
     if (n != 1.0f)
     {
         // Not normalized
-        n = sqrtf(n);
+        n = sqrt(n);
         if (n > 0.000001f) // prevent divide too close to zero
         {
             n = 1.0f / n;

+ 2 - 2
gameplay-encoder/src/Matrix.h

@@ -12,7 +12,6 @@
 #define TORADIANS(degrees) (degrees * (PI / 180.0f))
 #define TODEGREES(radians) (radians * (180.0f / PI))
 
-
 namespace gameplay
 {
 
@@ -89,7 +88,7 @@ public:
     /**
      * Creates a rotation matrix from the given quaternion.
      */
-    static void Matrix::createRotation(const Quaternion& q, float* dst);
+    static void createRotation(const Quaternion& q, float* dst);
 
     /**
      * Creates a rotation matrix from the given axis and angle in degrees.
@@ -166,4 +165,5 @@ public:
 };
 
 }
+
 #endif

+ 2 - 1
gameplay-encoder/src/Mesh.cpp

@@ -1,3 +1,4 @@
+#include "Base.h"
 #include "Mesh.h"
 #include "Model.h"
 
@@ -217,7 +218,7 @@ void Mesh::computeBounds()
     }
 
     // Convert squared distance to distance for radius
-    bounds.radius = sqrtf(bounds.radius);
+    bounds.radius = sqrt(bounds.radius);
 }
 
 }

+ 1 - 0
gameplay-encoder/src/Mesh.h

@@ -76,4 +76,5 @@ private:
 };
 
 }
+
 #endif

+ 2 - 1
gameplay-encoder/src/MeshPart.cpp

@@ -1,3 +1,4 @@
+#include "Base.h"
 #include "MeshPart.h"
 
 namespace gameplay
@@ -104,4 +105,4 @@ void MeshPart::updateIndexFormat(unsigned int newIndex)
     }
 }
 
-}
+}

+ 1 - 5
gameplay-encoder/src/MeshPart.h

@@ -1,8 +1,6 @@
 #ifndef MESHPART_H_
 #define MESHPART_H_
 
-#include <vector>
-
 #include "Base.h"
 #include "Object.h"
 #include "Vertex.h"
@@ -85,8 +83,6 @@ private:
     std::vector<unsigned int> _indices;
 };
 
-
-
 }
-#endif
 
+#endif

+ 9 - 8
gameplay-encoder/src/MeshSkin.cpp

@@ -1,3 +1,4 @@
+#include "Base.h"
 #include "MeshSkin.h"
 #include "Node.h"
 #include "StringUtil.h"
@@ -156,7 +157,7 @@ void MeshSkin::computeBounds()
         return;
     }
 
-    DEBUGPRINT("\nComputing bounds for skin of mesh: %s\n", _mesh->getId().c_str());
+    DEBUGPRINT_VARG("\nComputing bounds for skin of mesh: %s\n", _mesh->getId().c_str());
 
     Node* joint;
 
@@ -167,7 +168,7 @@ void MeshSkin::computeBounds()
     {
         // Is this parent in the list of joints that form the skeleton?
         // If not, then it's simply a parent node to the root joint
-        if (std::find(_joints.begin(), _joints.end(), parent) != _joints.end())
+        if (find(_joints.begin(), _joints.end(), parent) != _joints.end())
         {
             rootJoint = parent;
         }
@@ -185,7 +186,7 @@ void MeshSkin::computeBounds()
     unsigned int jointCount = _joints.size();
     unsigned int vertexCount = _mesh->getVertexCount();
 
-    DEBUGPRINT("> %d joints found.\n", jointCount);
+    DEBUGPRINT_VARG("> %d joints found.\n", jointCount);
 
     std::vector<AnimationChannel*> channels;
     std::vector<Node*> channelTargets;
@@ -210,7 +211,7 @@ void MeshSkin::computeBounds()
                 AnimationChannel* channel = animation->getAnimationChannel(k);
                 if (channel->getTargetId() == joint->getId())
                 {
-                    if (std::find(channels.begin(), channels.end(), channel) == channels.end())
+                    if (find(channels.begin(), channels.end(), channel) == channels.end())
                     {
                         channels.push_back(channel);
                         channelTargets.push_back(joint);
@@ -261,11 +262,11 @@ void MeshSkin::computeBounds()
                 if (d > jointBounds.radius)
                     jointBounds.radius = d;
             }
-            jointBounds.radius = sqrtf(jointBounds.radius);
+            jointBounds.radius = sqrt(jointBounds.radius);
         }
         _jointBounds[i] = jointBounds;
 
-        DEBUGPRINT("> %d%%\r", (int)((float)(i+1) / (float)jointCount * 100.0f));
+        DEBUGPRINT_VARG("> %d%%\r", (int)((float)(i+1) / (float)jointCount * 100.0f));
     }
     DEBUGPRINT("\n");
 
@@ -331,7 +332,7 @@ void MeshSkin::computeBounds()
 
         curves.push_back(curve);
 
-        DEBUGPRINT("> %d%%\r", (int)((float)(i+1) / (float)channelCount * 100.0f));
+        DEBUGPRINT_VARG("> %d%%\r", (int)((float)(i+1) / (float)channelCount * 100.0f));
     }
     DEBUGPRINT("\n");
 
@@ -407,7 +408,7 @@ void MeshSkin::computeBounds()
         else
             time += 33.0f;
 
-        DEBUGPRINT("> %d%%\r", (int)(time / maxDuration * 100.0f));
+        DEBUGPRINT_VARG("> %d%%\r", (int)(time / maxDuration * 100.0f));
     }
     DEBUGPRINT("\n");
 

+ 0 - 2
gameplay-encoder/src/MeshSkin.h

@@ -1,8 +1,6 @@
 #ifndef MESHSKIN_H_
 #define MESHSKIN_H_
 
-#include <vector>
-
 #include "Base.h"
 #include "Object.h"
 #include "Matrix.h"

+ 1 - 0
gameplay-encoder/src/Model.cpp

@@ -1,3 +1,4 @@
+#include "Base.h"
 #include "Model.h"
 
 namespace gameplay

+ 0 - 2
gameplay-encoder/src/Model.h

@@ -1,8 +1,6 @@
 #ifndef MODEL_H_
 #define MODEL_H_
 
-#include <list>
-
 #include "Object.h"
 #include "Mesh.h"
 #include "MeshSkin.h"

+ 2 - 1
gameplay-encoder/src/Node.cpp

@@ -1,3 +1,4 @@
+#include "Base.h"
 #include "Node.h"
 
 #define NODE 1
@@ -320,4 +321,4 @@ bool Node::hasLight() const
     return _light != NULL;
 }
 
-}
+}

+ 1 - 4
gameplay-encoder/src/Node.h

@@ -1,8 +1,6 @@
 #ifndef NODE_H_
 #define NODE_H_
 
-#include <list>
-
 #include "Object.h"
 #include "CameraInstance.h"
 #include "LightInstance.h"
@@ -185,7 +183,6 @@ private:
     bool _joint;
 };
 
-
 }
-#endif
 
+#endif

+ 2 - 1
gameplay-encoder/src/Object.cpp

@@ -1,3 +1,4 @@
+#include "Base.h"
 #include "Object.h"
 
 namespace gameplay
@@ -76,4 +77,4 @@ void Object::writeBinaryXref(FILE* file)
     write(xref, file);
 }
 
-}
+}

+ 2 - 2
gameplay-encoder/src/Object.h

@@ -1,11 +1,11 @@
 #ifndef OBJ_H_
 #define OBJ_H_
 
-#include "Base.h"
 #include "FileIO.h"
 
 namespace gameplay
 {
+
 /**
  * Object is the abstract base class of all the objects that can be written in the GamePlay Binary file.
  */
@@ -35,7 +35,6 @@ public:
         FONT_ID = 128,
     };
 
-
     /**
      * Constructor.
      */
@@ -137,6 +136,7 @@ public:
     }
 
 private:
+
     /**
      * Saves where this object was written to in the binary file.
      */

+ 1 - 5
gameplay-encoder/src/Quaternion.cpp

@@ -1,7 +1,3 @@
-/*
- * Quaternion.cpp
- */
-
 #include "Base.h"
 #include "Quaternion.h"
 
@@ -162,7 +158,7 @@ void Quaternion::normalize(Quaternion* dst) const
     if (n == 1.0f)
         return;
 
-    n = sqrtf(n);
+    n = sqrt(n);
     // too close to zero
     if (n < 0.000001f)
         return;

+ 2 - 5
gameplay-encoder/src/Quaternion.h

@@ -1,7 +1,3 @@
-/*
- * Quaternion.h
- */
-
 #ifndef QUATERNION_H_
 #define QUATERNION_H_
 
@@ -308,4 +304,5 @@ private:
 };
 
 }
-#endif /* QUATERNION_H_ */
+
+#endif

+ 2 - 1
gameplay-encoder/src/Reference.cpp

@@ -1,3 +1,4 @@
+#include "Base.h"
 #include "Reference.h"
 
 namespace gameplay
@@ -83,4 +84,4 @@ Object* Reference::getObj()
     return _ref;
 }
 
-}
+}

+ 1 - 0
gameplay-encoder/src/Reference.h

@@ -53,4 +53,5 @@ private:
 };
 
 }
+
 #endif

+ 2 - 1
gameplay-encoder/src/ReferenceTable.cpp

@@ -1,3 +1,4 @@
+#include "Base.h"
 #include "ReferenceTable.h"
 
 namespace gameplay
@@ -65,4 +66,4 @@ std::map<std::string, Reference>::iterator ReferenceTable::end()
     return _table.end();
 }
 
-}
+}

+ 1 - 3
gameplay-encoder/src/ReferenceTable.h

@@ -1,8 +1,6 @@
 #ifndef REFTABLE_H_
 #define REFTABLE_H_
 
-#include <map>
-
 #include "FileIO.h"
 #include "Reference.h"
 #include "Object.h"
@@ -56,5 +54,5 @@ private:
 };
 
 }
-#endif
 
+#endif

+ 3 - 3
gameplay-encoder/src/Scene.cpp

@@ -1,5 +1,4 @@
-#include <algorithm>
-
+#include "Base.h"
 #include "Scene.h"
 
 namespace gameplay
@@ -40,6 +39,7 @@ void Scene::writeBinary(FILE* file)
     }
     write(_ambientColor, Light::COLOR_SIZE, file);
 }
+
 void Scene::writeText(FILE* file)
 {
     fprintElementStart(file);
@@ -113,4 +113,4 @@ void Scene::calcAmbientColor(const Node* node, float* values) const
     }
 }
 
-}
+}

+ 1 - 0
gameplay-encoder/src/Scene.h

@@ -68,4 +68,5 @@ private:
 };
 
 }
+
 #endif

+ 2 - 3
gameplay-encoder/src/StringUtil.cpp

@@ -1,7 +1,6 @@
+#include "Base.h"
 #include "StringUtil.h"
 
-#include <string>
-
 namespace gameplay
 {
 
@@ -100,4 +99,4 @@ bool equalsIgnoreCase(const std::string& a, const char* b)
     return true;
 }
 
-}
+}

+ 1 - 2
gameplay-encoder/src/StringUtil.h

@@ -1,8 +1,6 @@
 #ifndef STRINGUTIL_H_
 #define STRINGUTIL_H_
 
-#include <string>
-
 namespace gameplay
 {
 
@@ -20,4 +18,5 @@ bool equals(const std::string& a, const char* b);
 bool equalsIgnoreCase(const std::string& a, const char* b);
 
 }
+
 #endif

+ 7 - 1
gameplay-encoder/src/TTFFontEncoder.cpp

@@ -1,6 +1,10 @@
+#include "Base.h"
 #include "TTFFontEncoder.h"
 #include "GPBFile.h"
 
+namespace gameplay
+{
+
 void drawBitmap(unsigned char* dstBitmap, int x, int y, int dstWidth, unsigned char* srcBitmap, int srcWidth, int srcHeight)
 {
     // offset dst bitmap by x,y.
@@ -325,4 +329,6 @@ int writeFont(const char* filename, unsigned int fontSize, const char* id, bool
     FT_Done_Face(face);
     FT_Done_FreeType(library);
     return 0;
-}
+}
+
+}

+ 5 - 7
gameplay-encoder/src/TTFFontEncoder.h

@@ -1,9 +1,4 @@
-#include <stdio.h>
 #include <ft2build.h>
-#include "string.h"
-#include <fstream>
-#include <math.h>
-
 #include FT_FREETYPE_H
 
 #define START_INDEX     32
@@ -11,6 +6,8 @@
 
 #define GLYPH_PADDING   4
 
+namespace gameplay
+{
 
 // Structure of Glyph.
 class Glyph
@@ -21,7 +18,6 @@ public:
     float uvCoords[4];
 };
 
-
 void drawBitmap(unsigned char* dstBitmap, int x, int y, int dstWidth, unsigned char* srcBitmap, int srcWidth, int srcHeight);
 
 void writeUint(FILE* fp, unsigned int i);
@@ -30,4 +26,6 @@ void writeFloat(FILE* fp, float f);
 
 void writeString(FILE* fp, const char* str);
 
-int writeFont(const char* filename, unsigned int fontSize, const char* id, bool fontpreview);
+int writeFont(const char* filename, unsigned int fontSize, const char* id, bool fontpreview);
+
+}

+ 2 - 0
gameplay-encoder/src/Transform.cpp

@@ -0,0 +1,2 @@
+#include "Base.h"
+#include "Transform.h"

+ 3 - 9
gameplay-encoder/src/Vector2.cpp

@@ -1,7 +1,3 @@
-/*
- * Vector2.cpp
- */
-
 #include "Base.h"
 #include "Vector2.h"
 #include "FileIO.h"
@@ -151,7 +147,7 @@ float Vector2::distance(const Vector2& v)
     float dx = v.x - x;
     float dy = v.y - y;
 
-    return sqrtf(dx * dx + dy * dy);
+    return sqrt(dx * dx + dy * dy);
 }
 
 
@@ -177,7 +173,7 @@ float Vector2::dot(const Vector2& v1, const Vector2& v2)
 
 float Vector2::length()
 {
-    return sqrtf(x * x + y * y);
+    return sqrt(x * x + y * y);
 }
 
 
@@ -215,7 +211,7 @@ void Vector2::normalize(Vector2* dst)
     if (n == 1.0f)
         return;
 
-    n = sqrtf(n);
+    n = sqrt(n);
     // too close to zero
     if (n < MATH_TOLERANCE)
         return;
@@ -319,5 +315,3 @@ void Vector2::writeText(FILE* file) const
 }
 
 }
-
-

+ 1 - 5
gameplay-encoder/src/Vector2.h

@@ -1,13 +1,9 @@
-/*
- * Vector2.h
- */
-
 #ifndef VECTOR2_H_
 #define VECTOR2_H_
 
-
 namespace gameplay
 {
+
 // Forward declare
 class Matrix;
 

+ 3 - 7
gameplay-encoder/src/Vector3.cpp

@@ -1,7 +1,3 @@
-/*
- * Vector3.cpp
- */
-
 #include "Base.h"
 #include "Vector3.h"
 #include "FileIO.h"
@@ -96,7 +92,7 @@ float Vector3::angle(const Vector3& v1, const Vector3& v2)
     float dy = v1.z * v2.x - v1.x * v2.z;
     float dz = v1.x * v2.y - v1.y * v2.x;
 
-    return atan2f(sqrtf(dx * dx + dy * dy + dz * dz) + MATH_FLOAT_SMALL, dot(v1, v2));
+    return atan2f(sqrt(dx * dx + dy * dy + dz * dz) + MATH_FLOAT_SMALL, dot(v1, v2));
 }
 
 
@@ -200,7 +196,7 @@ float Vector3::distance(const Vector3& v)
     float dy = v.y - y;
     float dz = v.z - z;
 
-    return sqrtf(dx * dx + dy * dy + dz * dz);
+    return sqrt(dx * dx + dy * dy + dz * dz);
 }
 
 
@@ -228,7 +224,7 @@ float Vector3::dot(const Vector3& v1, const Vector3& v2)
 
 float Vector3::length()
 {
-    return sqrtf(x * x + y * y + z * z);
+    return sqrt(x * x + y * y + z * z);
 }
 
 

+ 0 - 6
gameplay-encoder/src/Vector3.h

@@ -1,12 +1,6 @@
-/*
- * Vector3.h
- */
-
 #ifndef VECTOR3_H_
 #define VECTOR3_H_
 
-#include <cstdio>
-
 namespace gameplay
 {
 

+ 3 - 7
gameplay-encoder/src/Vector4.cpp

@@ -1,7 +1,3 @@
-/*
- * Vector4.cpp
- */
-
 #include "Base.h"
 #include "Vector4.h"
 #include "FileIO.h"
@@ -104,7 +100,7 @@ float Vector4::angle(const Vector4& v1, const Vector4& v2)
     float dy = v1.w * v2.y - v1.y * v2.w - v1.z * v2.x + v1.x * v2.z;
     float dz = v1.w * v2.z - v1.z * v2.w - v1.x * v2.y + v1.y * v2.x;
 
-    return atan2f(sqrtf(dx * dx + dy * dy + dz * dz) + MATH_FLOAT_SMALL, dot(v1, v2));
+    return atan2f(sqrt(dx * dx + dy * dy + dz * dz) + MATH_FLOAT_SMALL, dot(v1, v2));
 }
 
 
@@ -200,7 +196,7 @@ float Vector4::distance(const Vector4& v)
     float dz = v.z - z;
     float dw = v.w - w;
 
-    return sqrtf(dx * dx + dy * dy + dz * dz + dw * dw);
+    return sqrt(dx * dx + dy * dy + dz * dz + dw * dw);
 }
 
 
@@ -229,7 +225,7 @@ float Vector4::dot(const Vector4& v1, const Vector4& v2)
 
 float Vector4::length()
 {
-    return sqrtf(x * x + y * y + z * z + w * w);
+    return sqrt(x * x + y * y + z * z + w * w);
 }
 
 

+ 1 - 5
gameplay-encoder/src/Vector4.h

@@ -1,7 +1,3 @@
-/*
- * Vector4.h
- */
-
 #ifndef VECTOR4_H_
 #define VECTOR4_H_
 
@@ -367,4 +363,4 @@ public:
 
 }
 
-#endif
+#endif

+ 2 - 1
gameplay-encoder/src/Vertex.cpp

@@ -1,3 +1,4 @@
+#include "Base.h"
 #include "Vertex.h"
 
 namespace gameplay
@@ -102,4 +103,4 @@ void Vertex::writeText(FILE* file) const
     }
 }
 
-}
+}

+ 1 - 0
gameplay-encoder/src/Vertex.h

@@ -92,4 +92,5 @@ public:
 };
 
 }
+
 #endif

+ 2 - 1
gameplay-encoder/src/VertexElement.cpp

@@ -1,3 +1,4 @@
+#include "Base.h"
 #include "VertexElement.h"
 
 namespace gameplay
@@ -72,4 +73,4 @@ const char* VertexElement::usageStr(unsigned int usage)
     }
 }
 
-}
+}

+ 1 - 0
gameplay-encoder/src/VertexElement.h

@@ -31,4 +31,5 @@ public:
 };
 
 }
+
 #endif

+ 1 - 3
gameplay-encoder/src/main.cpp

@@ -1,5 +1,4 @@
-#include <string>
-
+#include "Base.h"
 #include "DAESceneEncoder.h"
 #include "TTFFontEncoder.h"
 #include "GPBDecoder.h"
@@ -83,4 +82,3 @@ int main(int argc, const char** argv)
 
     return 0;
 }
-

+ 0 - 24
gameplay.sln

@@ -25,18 +25,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample03-character", "gamep
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gameplay-encoder", "gameplay-encoder\gameplay-encoder.vcxproj", "{9D69B743-4872-4DD1-8E30-0087C64298D7}"
 EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D3CA8AE2-3ED6-458B-963A-EDA671E6F51C}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample04-sandbox", "gameplay-samples\sample04-sandbox\sample04-sandbox.vcxproj", "{FA260001-5B2E-41B7-86DD-C7F26DF3A485}"
-	ProjectSection(ProjectDependencies) = postProject
-		{1032BA4B-57EB-4348-9E03-29DD63E80E4A} = {1032BA4B-57EB-4348-9E03-29DD63E80E4A}
-	EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "demo00-dragon", "gameplay-demos\demo00-dragon\demo00-dragon.vcxproj", "{D20F2DDA-9825-4B10-BF8E-5ED10BD7C047}"
-	ProjectSection(ProjectDependencies) = postProject
-		{1032BA4B-57EB-4348-9E03-29DD63E80E4A} = {1032BA4B-57EB-4348-9E03-29DD63E80E4A}
-	EndProjectSection
-EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Win32 = Debug|Win32
@@ -80,18 +68,6 @@ Global
 		{9D69B743-4872-4DD1-8E30-0087C64298D7}.DebugMem|Win32.Build.0 = Debug|Win32
 		{9D69B743-4872-4DD1-8E30-0087C64298D7}.Release|Win32.ActiveCfg = Release|Win32
 		{9D69B743-4872-4DD1-8E30-0087C64298D7}.Release|Win32.Build.0 = Release|Win32
-		{FA260001-5B2E-41B7-86DD-C7F26DF3A485}.Debug|Win32.ActiveCfg = Debug|Win32
-		{FA260001-5B2E-41B7-86DD-C7F26DF3A485}.Debug|Win32.Build.0 = Debug|Win32
-		{FA260001-5B2E-41B7-86DD-C7F26DF3A485}.DebugMem|Win32.ActiveCfg = DebugMem|Win32
-		{FA260001-5B2E-41B7-86DD-C7F26DF3A485}.DebugMem|Win32.Build.0 = DebugMem|Win32
-		{FA260001-5B2E-41B7-86DD-C7F26DF3A485}.Release|Win32.ActiveCfg = Release|Win32
-		{FA260001-5B2E-41B7-86DD-C7F26DF3A485}.Release|Win32.Build.0 = Release|Win32
-		{D20F2DDA-9825-4B10-BF8E-5ED10BD7C047}.Debug|Win32.ActiveCfg = Debug|Win32
-		{D20F2DDA-9825-4B10-BF8E-5ED10BD7C047}.Debug|Win32.Build.0 = Debug|Win32
-		{D20F2DDA-9825-4B10-BF8E-5ED10BD7C047}.DebugMem|Win32.ActiveCfg = DebugMem|Win32
-		{D20F2DDA-9825-4B10-BF8E-5ED10BD7C047}.DebugMem|Win32.Build.0 = DebugMem|Win32
-		{D20F2DDA-9825-4B10-BF8E-5ED10BD7C047}.Release|Win32.ActiveCfg = Release|Win32
-		{D20F2DDA-9825-4B10-BF8E-5ED10BD7C047}.Release|Win32.Build.0 = Release|Win32
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 2 - 3
gameplay/src/Animation.cpp

@@ -5,7 +5,6 @@
 #include "AnimationTarget.h"
 #include "Game.h"
 #include "Transform.h"
-#include <string.h>
 #include "Properties.h"
 
 #define ANIMATION_DEFAULT_CLIP_SUFFIX "__default__clip"
@@ -48,7 +47,7 @@ Animation::~Animation()
 
     SAFE_DELETE(_defaultClip);
 
-    /*std::vector<Channel*>::iterator channelIter = _channels.begin();
+    /*vector<Channel*>::iterator channelIter = _channels.begin();
     while (channelIter != _channels.end())
     {
         Animation::Channel* channel = *channelIter;
@@ -108,7 +107,7 @@ void Animation::createClips(const char* animationFile)
         const char* repeat = pClip->getString("repeatCount");
         if (repeat)
         {
-            if (((std::string)repeat).compare(ANIMATION_INDEFINITE_STR) == 0)
+            if (strcmp(repeat, ANIMATION_INDEFINITE_STR) == 0)
             {
                 clip->setRepeatCount(AnimationClip::REPEAT_INDEFINITE);
             }

+ 0 - 1
gameplay/src/AnimationTarget.cpp

@@ -2,7 +2,6 @@
 #include "AnimationTarget.h"
 #include "Animation.h"
 #include "Game.h"
-#include <string.h>
 #include "Transform.h"
 
 namespace gameplay

+ 18 - 13
gameplay/src/Base.h

@@ -3,32 +3,37 @@
 
 // C/C++
 #include <new>
+#include <memory>
 #include <cstdio>
+#include <cstdlib>
 #include <cassert>
-#include <memory>
-#include <iostream>
-#include <string>
 #include <cwchar>
 #include <cwctype>
 #include <cctype>
 #include <cmath>
+#include <cstdarg>
+#include <ctime>
+#include <iostream>
+#include <string>
 #include <vector>
 #include <list>
 #include <stack>
 #include <map>
 #include <algorithm>
-#include <ctime>
 #include <limits>
 #include <functional>
-#include <assert.h>
-#include <string.h>
-#include <ctype.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <time.h>
-#include <math.h>
-#include <cstdarg>
+
+// Bring common functions from C into global namespace
+using std::memcpy;
+using std::fabs;
+using std::sqrt;
+using std::cos;
+using std::sin;
+using std::tan;
+using std::isspace;
+using std::isdigit;
+using std::toupper;
+using std::tolower;
 
 // Common
 #ifndef NULL

+ 6 - 6
gameplay/src/BoundingSphere.cpp

@@ -38,7 +38,7 @@ bool BoundingSphere::intersects(const BoundingSphere& sphere) const
     float vy = sphere.center.y - center.y;
     float vz = sphere.center.z - center.z;
 
-    return sqrtf(vx * vx + vy * vy + vz * vz) <= (radius + sphere.radius);
+    return sqrt(vx * vx + vy * vy + vz * vz) <= (radius + sphere.radius);
 }
 
 bool BoundingSphere::intersects(const BoundingBox& box) const
@@ -86,7 +86,7 @@ bool BoundingSphere::intersects(const BoundingBox& box) const
     cpY -= center.y;
     cpZ -= center.z;
 
-    return sqrtf(cpX * cpX + cpY * cpY + cpZ * cpZ) <= radius;
+    return sqrt(cpX * cpX + cpY * cpY + cpZ * cpZ) <= radius;
 }
 
 bool BoundingSphere::intersects(const Frustum& frustum) const
@@ -144,7 +144,7 @@ float BoundingSphere::intersects(const Ray& ray) const
     else
     {
         // The intersection is at the smaller positive root.
-        float sqrtDisc = sqrtf(discriminant);
+        float sqrtDisc = sqrt(discriminant);
         float t0 = (-B - sqrtDisc) * 0.5f;
         float t1 = (-B + sqrtDisc) * 0.5f;
         return (t0 > 0.0f && t0 < t1) ? t0 : t1;
@@ -162,7 +162,7 @@ void BoundingSphere::merge(const BoundingSphere& sphere)
     float vx = center.x - sphere.center.x;
     float vy = center.y - sphere.center.y;
     float vz = center.z - sphere.center.z;
-    float d = sqrtf(vx * vx + vy * vy + vz * vz);
+    float d = sqrt(vx * vx + vy * vy + vz * vz);
 
     // If one sphere is contained inside the other, set to the larger sphere.
     if (d <= (sphere.radius - radius))
@@ -231,7 +231,7 @@ void BoundingSphere::merge(const BoundingBox& box)
     v1x = center.x - fx;
     v1y = center.y - fy;
     v1z = center.z - fz;
-    float distance = sqrtf(v1x * v1x + v1y * v1y + v1z * v1z);
+    float distance = sqrt(v1x * v1x + v1y * v1y + v1z * v1z);
 
     // If the box is inside the sphere, we are done.
     if (distance <= radius)
@@ -297,7 +297,7 @@ void BoundingSphere::transform(const Matrix& matrix)
 
 float BoundingSphere::distance(const BoundingSphere& sphere, const Vector3& point)
 {
-    return sqrtf((point.x - sphere.center.x) * (point.x - sphere.center.x) +
+    return sqrt((point.x - sphere.center.x) * (point.x - sphere.center.x) +
                  (point.y - sphere.center.y) * (point.y - sphere.center.x) +
                  (point.z - sphere.center.z) * (point.z - sphere.center.x));
 }

+ 8 - 4
gameplay/src/Curve.cpp

@@ -1,9 +1,13 @@
 // Purposely not including Base.h here, or any other gameplay dependencies
 // so this class can be reused between gameplay and gameplay-encoder.
 #include "Curve.h"
-#include <assert.h>
-#include <math.h>
-#include <memory.h>
+#include <cassert>
+#include <cmath>
+#include <memory>
+
+using std::memcpy;
+using std::fabs;
+using std::sqrt;
 
 #ifndef NULL
 #define NULL 0
@@ -661,7 +665,7 @@ void normalizeQuat(float* q)
     // Do we need to normalize?
     if (fabs(n) > 0.00001f && fabs(n - 1.0f) > 0.00001f)
     {
-        n = sqrtf(n);
+        n = sqrt(n);
         q[0] /= n;
         q[1] /= n;
         q[2] /= n;

+ 7 - 7
gameplay/src/DebugNew.cpp

@@ -18,39 +18,39 @@ struct MemoryAllocationRecord
 MemoryAllocationRecord* __memoryAllocations = 0;
 int __memoryAllocationCount = 0;
 
-void* debugAlloc(std::size_t size, const char* file, int line);
+void* debugAlloc(size_t size, const char* file, int line);
 void debugFree(void* p);
 
 #ifdef _MSC_VER
 #pragma warning( disable : 4290 )
 #endif
 
-void* operator new (std::size_t size, const char* file, int line)
+void* operator new (size_t size, const char* file, int line)
 {
     return debugAlloc(size, file, line);
 }
 
-void* operator new[] (std::size_t size, const char* file, int line)
+void* operator new[] (size_t size, const char* file, int line)
 {
     return operator new (size, file, line);
 }
 
-void* operator new (std::size_t size) throw(std::bad_alloc)
+void* operator new (size_t size) throw(bad_alloc)
 {
     return operator new (size, "", 0);
 }
 
-void* operator new[] (std::size_t size) throw(std::bad_alloc)
+void* operator new[] (size_t size) throw(bad_alloc)
 {
     return operator new (size, "", 0);
 }
 
-void* operator new (std::size_t size, const std::nothrow_t&) throw()
+void* operator new (size_t size, const nothrow_t&) throw()
 {
     return operator new (size, "", 0);
 }
 
-void* operator new[] (std::size_t size, const std::nothrow_t&) throw()
+void* operator new[] (size_t size, const nothrow_t&) throw()
 {
     return operator new (size, "", 0);
 }

+ 6 - 6
gameplay/src/DebugNew.h

@@ -18,12 +18,12 @@ extern void printMemoryLeaks();
 #ifdef _MSC_VER
 #pragma warning( disable : 4290 ) // C++ exception specification ignored.
 #endif
-void* operator new (std::size_t size, const char* file, int line);
-void* operator new[] (std::size_t size, const char* file, int line);
-void* operator new (std::size_t size) throw(std::bad_alloc);
-void* operator new[] (std::size_t size) throw(std::bad_alloc);
-void* operator new (std::size_t size, const std::nothrow_t&) throw();
-void* operator new[] (std::size_t size, const std::nothrow_t&) throw();
+void* operator new (size_t size, const char* file, int line);
+void* operator new[] (size_t size, const char* file, int line);
+void* operator new (size_t size) throw(bad_alloc);
+void* operator new[] (size_t size) throw(bad_alloc);
+void* operator new (size_t size, const nothrow_t&) throw();
+void* operator new[] (size_t size, const nothrow_t&) throw();
 void operator delete (void* p) throw();
 void operator delete[] (void* p) throw();
 void operator delete (void* p, const char* file, int line) throw();

+ 1 - 1
gameplay/src/FileSystem.cpp

@@ -30,7 +30,7 @@ FILE* FileSystem::openFile(const char* path, const char* mode)
     fullPath += path;
 
     FILE* fp = fopen(fullPath.c_str(), mode);
-    
+
 // Win32 doesnt support a asset or bundle definitions.
 #ifdef WIN32
     if (fp == NULL)

+ 2 - 2
gameplay/src/Font.cpp

@@ -992,8 +992,8 @@ void Font::reverseLines(char* text)
 
         unsigned int textLength = strcspn(text, "\n");
 
-        std::string line = std::string(text, textLength);
-        std::string reversedLine = std::string(line.rbegin(), line.rend());
+        std::string line(text, textLength);
+        std::string reversedLine(line.rbegin(), line.rend());
         memcpy(text, reversedLine.c_str(), textLength);
 
         text += textLength;

+ 1 - 1
gameplay/src/Frustum.cpp

@@ -115,7 +115,7 @@ void updatePlane(const Matrix& matrix, Plane* dst)
     Vector3 normal = dst->getNormal();
     if (!normal.isZero())
     {
-        float normalizeFactor = 1.0f / ::sqrtf(normal.x * normal.x + normal.y * normal.y + normal.z * normal.z);
+        float normalizeFactor = 1.0f / sqrt(normal.x * normal.x + normal.y * normal.y + normal.z * normal.z);
         if (normalizeFactor != 1.0f)
         {
             dst->setNormal(Vector3(normal.x * normalizeFactor, normal.y * normalizeFactor, normal.z * normalizeFactor));

+ 3 - 1
gameplay/src/Material.cpp

@@ -230,7 +230,9 @@ bool Material::loadPass(Technique* technique, Properties* passProperties)
         char* token = strtok((char*)defines, ";");
         while (token)
         {
-            define += "#define " + std::string(token) + "\n";
+            define += "#define ";
+            define += token;
+            define += "\n";
             token = strtok(NULL, ";");
         }
     }

+ 1 - 1
gameplay/src/Matrix.cpp

@@ -226,7 +226,7 @@ void Matrix::createRotation(const Vector3& axis, float angle, Matrix* dst)
     if (n != 1.0f)
     {
         // Not normalized.
-        n = sqrtf(n);
+        n = sqrt(n);
         // Prevent divide too close to zero.
         if (n > 0.000001f)
         {

+ 1 - 1
gameplay/src/PhysicsRigidBody.h

@@ -51,7 +51,7 @@ public:
         CollisionPair(PhysicsRigidBody* rbA, PhysicsRigidBody* rbB);
 
         /**
-         * Less than operator (needed for use as a key in std::map).
+         * Less than operator (needed for use as a key in map).
          * 
          * @param cp The collision pair to compare.
          * @return True if this pair is "less than" the given pair; false otherwise.

+ 2 - 2
gameplay/src/Plane.cpp

@@ -252,7 +252,7 @@ void Plane::transform(const Matrix& matrix)
         float ny = _normal.x * inverted.m[4] + _normal.y * inverted.m[5] + _normal.z * inverted.m[6] + _distance * inverted.m[7];
         float nz = _normal.x * inverted.m[8] + _normal.y * inverted.m[9] + _normal.z * inverted.m[10] + _distance * inverted.m[11];
         float d = _normal.x * inverted.m[12]+ _normal.y * inverted.m[13] + _normal.z * inverted.m[14]+ _distance * inverted.m[15];
-        float factor = 1.0f / sqrtf(nx * nx + ny * ny + nz * nz);
+        float factor = 1.0f / sqrt(nx * nx + ny * ny + nz * nz);
 
         _normal.x = nx * factor;
         _normal.y = ny * factor;
@@ -267,7 +267,7 @@ void Plane::normalize()
         return;
 
     // Normalize the plane's normal.
-    float normalizeFactor = 1.0f / sqrtf(_normal.x * _normal.x + _normal.y * _normal.y + _normal.z * _normal.z);
+    float normalizeFactor = 1.0f / sqrt(_normal.x * _normal.x + _normal.y * _normal.y + _normal.z * _normal.z);
 
     if (normalizeFactor != 1.0f)
     {

+ 1 - 1
gameplay/src/Quaternion.cpp

@@ -167,7 +167,7 @@ void Quaternion::normalize(Quaternion* dst) const
     if (n == 1.0f)
         return;
 
-    n = sqrtf(n);
+    n = sqrt(n);
     // Too close to zero.
     if (n < 0.000001f)
         return;

+ 1 - 1
gameplay/src/Ray.cpp

@@ -135,7 +135,7 @@ void Ray::normalize()
         return;
 
     // Normalize the ray's direction vector.
-    float normalizeFactor = 1.0f / sqrtf(_direction.x * _direction.x + _direction.y * _direction.y + _direction.z * _direction.z);
+    float normalizeFactor = 1.0f / sqrt(_direction.x * _direction.x + _direction.y * _direction.y + _direction.z * _direction.z);
 
     if ( normalizeFactor != 1.0f )
     {

部分文件因文件數量過多而無法顯示