Ver código fonte

Fixed syntax and compile errors on Mac.

Steve Grenier 14 anos atrás
pai
commit
d095cefffc

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

@@ -144,6 +144,8 @@
       <Optimization>Disabled</Optimization>
       <Optimization>Disabled</Optimization>
       <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;NO_BOOST;NO_ZAE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <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>
       <AdditionalIncludeDirectories>../external-deps/freetype2/include;../external-deps/collada-dom/include;../external-deps/collada-dom/include/1.4</AdditionalIncludeDirectories>
+      <DisableLanguageExtensions>
+      </DisableLanguageExtensions>
     </ClCompile>
     </ClCompile>
     <Link>
     <Link>
       <SubSystem>Console</SubSystem>
       <SubSystem>Console</SubSystem>

+ 23 - 2
gameplay-encoder/gameplay-encoder.xcodeproj/project.pbxproj

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

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

@@ -5,6 +5,7 @@
 #include <cmath>
 #include <cmath>
 #include <cstdio>
 #include <cstdio>
 #include <cstdlib>
 #include <cstdlib>
+#include <cstdarg>
 #include <cassert>
 #include <cassert>
 #include <cmath>
 #include <cmath>
 #include <cfloat>
 #include <cfloat>
@@ -76,9 +77,11 @@ void setIdentityMatrix(float values[]);
 #define ISZERO(x) (fabs(x) < 0.000001f)
 #define ISZERO(x) (fabs(x) < 0.000001f)
 
 
 #ifdef NDEBUG
 #ifdef NDEBUG
-#define DEBUGPRINT (x, ...)
+#define DEBUGPRINT(x)
+#define DEBUGPRINT_VARG(x, ...)
 #else
 #else
-#define DEBUGPRINT(x, ...) printf(x, __VA_ARGS__)
+#define DEBUGPRINT(x)  printf(x)
+#define DEBUGPRINT_VARG(x, ...) printf(x, __VA_ARGS__)
 #endif
 #endif
 
 
 }
 }

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

@@ -96,7 +96,7 @@ void BoundingVolume::merge(const BoundingVolume& v)
     float vx = center.x - v.center.x;
     float vx = center.x - v.center.x;
     float vy = center.y - v.center.y;
     float vy = center.y - v.center.y;
     float vz = center.z - v.center.z;
     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 one sphere is contained inside the other, set to the larger sphere.
     if (d <= (v.radius - radius))
     if (d <= (v.radius - radius))

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

@@ -87,7 +87,7 @@ void Matrix::createRotation(float x, float y, float z, float angle, float* dst)
     if (n != 1.0f)
     if (n != 1.0f)
     {
     {
         // Not normalized
         // Not normalized
-        n = sqrtf(n);
+        n = sqrt(n);
         if (n > 0.000001f) // prevent divide too close to zero
         if (n > 0.000001f) // prevent divide too close to zero
         {
         {
             n = 1.0f / n;
             n = 1.0f / n;

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

@@ -88,7 +88,7 @@ public:
     /**
     /**
      * Creates a rotation matrix from the given quaternion.
      * 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.
      * Creates a rotation matrix from the given axis and angle in degrees.

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

@@ -218,7 +218,7 @@ void Mesh::computeBounds()
     }
     }
 
 
     // Convert squared distance to distance for radius
     // Convert squared distance to distance for radius
-    bounds.radius = sqrtf(bounds.radius);
+    bounds.radius = sqrt(bounds.radius);
 }
 }
 
 
 }
 }

+ 6 - 6
gameplay-encoder/src/MeshSkin.cpp

@@ -157,7 +157,7 @@ void MeshSkin::computeBounds()
         return;
         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;
     Node* joint;
 
 
@@ -186,7 +186,7 @@ void MeshSkin::computeBounds()
     unsigned int jointCount = _joints.size();
     unsigned int jointCount = _joints.size();
     unsigned int vertexCount = _mesh->getVertexCount();
     unsigned int vertexCount = _mesh->getVertexCount();
 
 
-    DEBUGPRINT("> %d joints found.\n", jointCount);
+    DEBUGPRINT_VARG("> %d joints found.\n", jointCount);
 
 
     std::vector<AnimationChannel*> channels;
     std::vector<AnimationChannel*> channels;
     std::vector<Node*> channelTargets;
     std::vector<Node*> channelTargets;
@@ -262,11 +262,11 @@ void MeshSkin::computeBounds()
                 if (d > jointBounds.radius)
                 if (d > jointBounds.radius)
                     jointBounds.radius = d;
                     jointBounds.radius = d;
             }
             }
-            jointBounds.radius = sqrtf(jointBounds.radius);
+            jointBounds.radius = sqrt(jointBounds.radius);
         }
         }
         _jointBounds[i] = jointBounds;
         _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");
     DEBUGPRINT("\n");
 
 
@@ -332,7 +332,7 @@ void MeshSkin::computeBounds()
 
 
         curves.push_back(curve);
         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");
     DEBUGPRINT("\n");
 
 
@@ -408,7 +408,7 @@ void MeshSkin::computeBounds()
         else
         else
             time += 33.0f;
             time += 33.0f;
 
 
-        DEBUGPRINT("> %d%%\r", (int)(time / maxDuration * 100.0f));
+        DEBUGPRINT_VARG("> %d%%\r", (int)(time / maxDuration * 100.0f));
     }
     }
     DEBUGPRINT("\n");
     DEBUGPRINT("\n");
 
 

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

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

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

@@ -147,7 +147,7 @@ float Vector2::distance(const Vector2& v)
     float dx = v.x - x;
     float dx = v.x - x;
     float dy = v.y - y;
     float dy = v.y - y;
 
 
-    return sqrtf(dx * dx + dy * dy);
+    return sqrt(dx * dx + dy * dy);
 }
 }
 
 
 
 
@@ -173,7 +173,7 @@ float Vector2::dot(const Vector2& v1, const Vector2& v2)
 
 
 float Vector2::length()
 float Vector2::length()
 {
 {
-    return sqrtf(x * x + y * y);
+    return sqrt(x * x + y * y);
 }
 }
 
 
 
 
@@ -211,7 +211,7 @@ void Vector2::normalize(Vector2* dst)
     if (n == 1.0f)
     if (n == 1.0f)
         return;
         return;
 
 
-    n = sqrtf(n);
+    n = sqrt(n);
     // too close to zero
     // too close to zero
     if (n < MATH_TOLERANCE)
     if (n < MATH_TOLERANCE)
         return;
         return;

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

@@ -92,7 +92,7 @@ float Vector3::angle(const Vector3& v1, const Vector3& v2)
     float dy = v1.z * v2.x - v1.x * v2.z;
     float dy = v1.z * v2.x - v1.x * v2.z;
     float dz = v1.x * v2.y - v1.y * v2.x;
     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));
 }
 }
 
 
 
 
@@ -196,7 +196,7 @@ float Vector3::distance(const Vector3& v)
     float dy = v.y - y;
     float dy = v.y - y;
     float dz = v.z - z;
     float dz = v.z - z;
 
 
-    return sqrtf(dx * dx + dy * dy + dz * dz);
+    return sqrt(dx * dx + dy * dy + dz * dz);
 }
 }
 
 
 
 
@@ -224,7 +224,7 @@ float Vector3::dot(const Vector3& v1, const Vector3& v2)
 
 
 float Vector3::length()
 float Vector3::length()
 {
 {
-    return sqrtf(x * x + y * y + z * z);
+    return sqrt(x * x + y * y + z * z);
 }
 }
 
 
 
 

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

@@ -100,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 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;
     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));
 }
 }
 
 
 
 
@@ -196,7 +196,7 @@ float Vector4::distance(const Vector4& v)
     float dz = v.z - z;
     float dz = v.z - z;
     float dw = v.w - w;
     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);
 }
 }
 
 
 
 
@@ -225,7 +225,7 @@ float Vector4::dot(const Vector4& v1, const Vector4& v2)
 
 
 float Vector4::length()
 float Vector4::length()
 {
 {
-    return sqrtf(x * x + y * y + z * z + w * w);
+    return sqrt(x * x + y * y + z * z + w * w);
 }
 }
 
 
 
 

+ 0 - 5
gameplay/src/Base.h

@@ -6,7 +6,6 @@
 #include <memory>
 #include <memory>
 #include <cstdio>
 #include <cstdio>
 #include <cstdlib>
 #include <cstdlib>
-#include <cstdint>
 #include <cassert>
 #include <cassert>
 #include <cwchar>
 #include <cwchar>
 #include <cwctype>
 #include <cwctype>
@@ -28,13 +27,9 @@
 using std::memcpy;
 using std::memcpy;
 using std::fabs;
 using std::fabs;
 using std::sqrt;
 using std::sqrt;
-using std::sqrtf;
 using std::cos;
 using std::cos;
-using std::cosf;
 using std::sin;
 using std::sin;
-using std::sinf;
 using std::tan;
 using std::tan;
-using std::tanf;
 using std::isspace;
 using std::isspace;
 using std::isdigit;
 using std::isdigit;
 using std::toupper;
 using std::toupper;

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

+ 2 - 2
gameplay/src/Curve.cpp

@@ -7,7 +7,7 @@
 
 
 using std::memcpy;
 using std::memcpy;
 using std::fabs;
 using std::fabs;
-using std::sqrtf;
+using std::sqrt;
 
 
 #ifndef NULL
 #ifndef NULL
 #define NULL 0
 #define NULL 0
@@ -665,7 +665,7 @@ void normalizeQuat(float* q)
     // Do we need to normalize?
     // Do we need to normalize?
     if (fabs(n) > 0.00001f && fabs(n - 1.0f) > 0.00001f)
     if (fabs(n) > 0.00001f && fabs(n - 1.0f) > 0.00001f)
     {
     {
-        n = sqrtf(n);
+        n = sqrt(n);
         q[0] /= n;
         q[0] /= n;
         q[1] /= n;
         q[1] /= n;
         q[2] /= n;
         q[2] /= n;

+ 1 - 1
gameplay/src/Frustum.cpp

@@ -115,7 +115,7 @@ void updatePlane(const Matrix& matrix, Plane* dst)
     Vector3 normal = dst->getNormal();
     Vector3 normal = dst->getNormal();
     if (!normal.isZero())
     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)
         if (normalizeFactor != 1.0f)
         {
         {
             dst->setNormal(Vector3(normal.x * normalizeFactor, normal.y * normalizeFactor, normal.z * normalizeFactor));
             dst->setNormal(Vector3(normal.x * normalizeFactor, normal.y * normalizeFactor, normal.z * normalizeFactor));

+ 1 - 1
gameplay/src/Matrix.cpp

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

+ 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 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 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 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.x = nx * factor;
         _normal.y = ny * factor;
         _normal.y = ny * factor;
@@ -267,7 +267,7 @@ void Plane::normalize()
         return;
         return;
 
 
     // Normalize the plane's normal.
     // 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)
     if (normalizeFactor != 1.0f)
     {
     {

+ 1 - 1
gameplay/src/Quaternion.cpp

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

+ 1 - 1
gameplay/src/Ray.cpp

@@ -135,7 +135,7 @@ void Ray::normalize()
         return;
         return;
 
 
     // Normalize the ray's direction vector.
     // 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 )
     if ( normalizeFactor != 1.0f )
     {
     {

+ 1 - 1
gameplay/src/RenderState.cpp

@@ -420,7 +420,7 @@ RenderState::Blend parseBlend(const char* value)
 {
 {
     // Conver the string to uppercase for comparison
     // Conver the string to uppercase for comparison
     std::string upper(value);
     std::string upper(value);
-    transform(upper.begin(), upper.end(), upper.begin(), toupper);
+    std::transform(upper.begin(), upper.end(), upper.begin(), (int(*)(int))toupper);
     if (upper == "ZERO")
     if (upper == "ZERO")
         return RenderState::BLEND_ZERO;
         return RenderState::BLEND_ZERO;
     if (upper == "ONE")
     if (upper == "ONE")

+ 3 - 3
gameplay/src/Vector2.cpp

@@ -129,7 +129,7 @@ float Vector2::distance(const Vector2& v) const
     float dx = v.x - x;
     float dx = v.x - x;
     float dy = v.y - y;
     float dy = v.y - y;
 
 
-    return sqrtf(dx * dx + dy * dy);
+    return sqrt(dx * dx + dy * dy);
 }
 }
 
 
 float Vector2::distanceSquared(const Vector2& v) const
 float Vector2::distanceSquared(const Vector2& v) const
@@ -151,7 +151,7 @@ float Vector2::dot(const Vector2& v1, const Vector2& v2)
 
 
 float Vector2::length() const
 float Vector2::length() const
 {
 {
-    return sqrtf(x * x + y * y);
+    return sqrt(x * x + y * y);
 }
 }
 
 
 float Vector2::lengthSquared() const
 float Vector2::lengthSquared() const
@@ -185,7 +185,7 @@ void Vector2::normalize(Vector2* dst)
     if (n == 1.0f)
     if (n == 1.0f)
         return;
         return;
 
 
-    n = sqrtf(n);
+    n = sqrt(n);
     // Too close to zero.
     // Too close to zero.
     if (n < MATH_TOLERANCE)
     if (n < MATH_TOLERANCE)
         return;
         return;

+ 3 - 3
gameplay/src/Vector3.cpp

@@ -94,7 +94,7 @@ float Vector3::angle(const Vector3& v1, const Vector3& v2)
     float dy = v1.z * v2.x - v1.x * v2.z;
     float dy = v1.z * v2.x - v1.x * v2.z;
     float dz = v1.x * v2.y - v1.y * v2.x;
     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));
 }
 }
 
 
 void Vector3::add(const Vector3& v)
 void Vector3::add(const Vector3& v)
@@ -191,7 +191,7 @@ float Vector3::distance(const Vector3& v) const
     float dy = v.y - y;
     float dy = v.y - y;
     float dz = v.z - z;
     float dz = v.z - z;
 
 
-    return sqrtf(dx * dx + dy * dy + dz * dz);
+    return sqrt(dx * dx + dy * dy + dz * dz);
 }
 }
 
 
 float Vector3::distanceSquared(const Vector3& v) const
 float Vector3::distanceSquared(const Vector3& v) const
@@ -215,7 +215,7 @@ float Vector3::dot(const Vector3& v1, const Vector3& v2)
 
 
 float Vector3::length() const
 float Vector3::length() const
 {
 {
-    return sqrtf(x * x + y * y + z * z);
+    return sqrt(x * x + y * y + z * z);
 }
 }
 
 
 float Vector3::lengthSquared() const
 float Vector3::lengthSquared() const

+ 3 - 3
gameplay/src/Vector4.cpp

@@ -100,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 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;
     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));
 }
 }
 
 
 void Vector4::add(const Vector4& v)
 void Vector4::add(const Vector4& v)
@@ -191,7 +191,7 @@ float Vector4::distance(const Vector4& v) const
     float dz = v.z - z;
     float dz = v.z - z;
     float dw = v.w - w;
     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);
 }
 }
 
 
 float Vector4::distanceSquared(const Vector4& v) const
 float Vector4::distanceSquared(const Vector4& v) const
@@ -216,7 +216,7 @@ float Vector4::dot(const Vector4& v1, const Vector4& v2)
 
 
 float Vector4::length() const
 float Vector4::length() const
 {
 {
-    return sqrtf(x * x + y * y + z * z + w * w);
+    return sqrt(x * x + y * y + z * z + w * w);
 }
 }