aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRay <raysan5@gmail.com>2016-11-02 00:50:08 +0100
committerRay <raysan5@gmail.com>2016-11-02 00:50:08 +0100
commitf16f39e8aaf0ee95a31600e549c0221d1ce46fdd (patch)
tree96e7d491afe01a81784f10ce594bc5e0ea5f27bd /src
parent64f67f6e9f414a54dfc3fb519b892ecd5517f2cf (diff)
downloadraylib-f16f39e8aaf0ee95a31600e549c0221d1ce46fdd.tar.gz
raylib-f16f39e8aaf0ee95a31600e549c0221d1ce46fdd.zip
code tweaks to avoid some warnings
Diffstat (limited to 'src')
-rw-r--r--src/models.c18
-rw-r--r--src/rlgl.c2
2 files changed, 10 insertions, 10 deletions
diff --git a/src/models.c b/src/models.c
index c0f04387..ad084f05 100644
--- a/src/models.c
+++ b/src/models.c
@@ -1411,7 +1411,7 @@ bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, floa
float dy = centerA.y - centerB.y; // Y distance between centers
float dz = centerA.z - centerB.z; // Y distance between centers
- float distance = sqrt(dx*dx + dy*dy + dz*dz); // Distance between centers
+ float distance = sqrtf(dx*dx + dy*dy + dz*dz); // Distance between centers
if (distance <= (radiusA + radiusB)) collision = true;
@@ -1441,14 +1441,14 @@ bool CheckCollisionBoxSphere(BoundingBox box, Vector3 centerSphere, float radius
float dmin = 0;
- if (centerSphere.x < box.min.x) dmin += pow(centerSphere.x - box.min.x, 2);
- else if (centerSphere.x > box.max.x) dmin += pow(centerSphere.x - box.max.x, 2);
+ if (centerSphere.x < box.min.x) dmin += powf(centerSphere.x - box.min.x, 2);
+ else if (centerSphere.x > box.max.x) dmin += powf(centerSphere.x - box.max.x, 2);
- if (centerSphere.y < box.min.y) dmin += pow(centerSphere.y - box.min.y, 2);
- else if (centerSphere.y > box.max.y) dmin += pow(centerSphere.y - box.max.y, 2);
+ if (centerSphere.y < box.min.y) dmin += powf(centerSphere.y - box.min.y, 2);
+ else if (centerSphere.y > box.max.y) dmin += powf(centerSphere.y - box.max.y, 2);
- if (centerSphere.z < box.min.z) dmin += pow(centerSphere.z - box.min.z, 2);
- else if (centerSphere.z > box.max.z) dmin += pow(centerSphere.z - box.max.z, 2);
+ if (centerSphere.z < box.min.z) dmin += powf(centerSphere.z - box.min.z, 2);
+ else if (centerSphere.z > box.max.z) dmin += powf(centerSphere.z - box.max.z, 2);
if (dmin <= (radiusSphere*radiusSphere)) collision = true;
@@ -1487,8 +1487,8 @@ bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadi
float collisionDistance = 0;
// Check if ray origin is inside the sphere to calculate the correct collision point
- if (distance < sphereRadius) collisionDistance = vector + sqrt(d);
- else collisionDistance = vector - sqrt(d);
+ if (distance < sphereRadius) collisionDistance = vector + sqrtf(d);
+ else collisionDistance = vector - sqrtf(d);
VectorScale(&offset, collisionDistance);
Vector3 cPoint = VectorAdd(ray.position, offset);
diff --git a/src/rlgl.c b/src/rlgl.c
index e2804e9c..d3bba07b 100644
--- a/src/rlgl.c
+++ b/src/rlgl.c
@@ -3882,7 +3882,7 @@ static void SetStereoConfig(VrDeviceInfo hmd)
// Fovy is normally computed with: 2*atan2(hmd.vScreenSize, 2*hmd.eyeToScreenDistance)*RAD2DEG
// ...but with lens distortion it is increased (see Oculus SDK Documentation)
//float fovy = 2.0f*atan2(hmd.vScreenSize*0.5f*distortionScale, hmd.eyeToScreenDistance)*RAD2DEG; // Really need distortionScale?
- float fovy = 2.0f*atan2(hmd.vScreenSize*0.5f, hmd.eyeToScreenDistance)*RAD2DEG;
+ float fovy = 2.0f*(float)atan2(hmd.vScreenSize*0.5f, hmd.eyeToScreenDistance)*RAD2DEG;
// Compute camera projection matrices
float projOffset = 4.0f*lensShift; // Scaled to projection space coordinates [-1..1]