diff options
| author | Ray <[email protected]> | 2018-05-28 00:48:45 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2018-05-28 00:48:45 +0200 |
| commit | 0148432588b1ead0676a7aa6fecba2d10c315153 (patch) | |
| tree | dea1266285a4209c471c043b9608cc202f88cb0b | |
| parent | dbff40944a72df4b5435520fc09f3fb68e3cebdf (diff) | |
| download | raylib-0148432588b1ead0676a7aa6fecba2d10c315153.tar.gz raylib-0148432588b1ead0676a7aa6fecba2d10c315153.zip | |
fabsf() not working with TCC
Replaced by fabs() that seem to work ok
| -rw-r--r-- | src/camera.h | 4 | ||||
| -rw-r--r-- | src/external/jar_xm.h | 2 | ||||
| -rw-r--r-- | src/models.c | 8 | ||||
| -rw-r--r-- | src/raymath.h | 8 | ||||
| -rw-r--r-- | src/rlgl.c | 2 | ||||
| -rw-r--r-- | src/shapes.c | 12 |
6 files changed, 18 insertions, 18 deletions
diff --git a/src/camera.h b/src/camera.h index 8067e7bf..6bada666 100644 --- a/src/camera.h +++ b/src/camera.h @@ -244,8 +244,8 @@ void SetCameraMode(Camera camera, int mode) distance.y = sqrtf(dx*dx + dy*dy); // Camera angle calculation - cameraAngle.x = asinf(fabsf(dx)/distance.x); // Camera angle in plane XZ (0 aligned with Z, move positive CCW) - cameraAngle.y = -asinf(fabsf(dy)/distance.y); // Camera angle in plane XY (0 aligned with X, move positive CW) + cameraAngle.x = asinf(fabs(dx)/distance.x); // Camera angle in plane XZ (0 aligned with Z, move positive CCW) + cameraAngle.y = -asinf(fabs(dy)/distance.y); // Camera angle in plane XY (0 aligned with X, move positive CW) // NOTE: Just testing what cameraAngle means //cameraAngle.x = 0.0f*DEG2RAD; // Camera angle in plane XZ (0 aligned with Z, move positive CCW) diff --git a/src/external/jar_xm.h b/src/external/jar_xm.h index 9d4f5b5b..c8c9e3c9 100644 --- a/src/external/jar_xm.h +++ b/src/external/jar_xm.h @@ -2365,7 +2365,7 @@ static void jar_xm_tick(jar_xm_context_t* ctx) { float panning, volume; panning = ch->panning + - (ch->panning_envelope_panning - .5f) * (.5f - fabsf(ch->panning - .5f)) * 2.0f; + (ch->panning_envelope_panning - .5f) * (.5f - fabs(ch->panning - .5f)) * 2.0f; if(ch->tremor_on) { volume = .0f; diff --git a/src/models.c b/src/models.c index afeee0fc..b389333b 100644 --- a/src/models.c +++ b/src/models.c @@ -1837,9 +1837,9 @@ void DrawBoundingBox(BoundingBox box, Color color) { Vector3 size; - size.x = fabsf(box.max.x - box.min.x); - size.y = fabsf(box.max.y - box.min.y); - size.z = fabsf(box.max.z - box.min.z); + size.x = fabs(box.max.x - box.min.x); + size.y = fabs(box.max.y - box.min.y); + size.z = fabs(box.max.z - box.min.z); Vector3 center = { box.min.x + size.x/2.0f, box.min.y + size.y/2.0f, box.min.z + size.z/2.0f }; @@ -2074,7 +2074,7 @@ RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight) RayHitInfo result = { 0 }; - if (fabsf(ray.direction.y) > EPSILON) + if (fabs(ray.direction.y) > EPSILON) { float distance = (ray.position.y - groundHeight)/-ray.direction.y; diff --git a/src/raymath.h b/src/raymath.h index b0046522..51a9e6db 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -296,17 +296,17 @@ RMDEF Vector3 Vector3Perpendicular(Vector3 v) { Vector3 result = { 0 }; - float min = fabsf(v.x); + float min = fabs(v.x); Vector3 cardinalAxis = {1.0f, 0.0f, 0.0f}; - if (fabsf(v.y) < min) + if (fabs(v.y) < min) { - min = fabsf(v.y); + min = fabs(v.y); Vector3 tmp = {0.0f, 1.0f, 0.0f}; cardinalAxis = tmp; } - if (fabsf(v.z) < min) + if (fabs(v.z) < min) { Vector3 tmp = {0.0f, 0.0f, 1.0f}; cardinalAxis = tmp; @@ -3948,7 +3948,7 @@ static void SetStereoConfig(VrDeviceInfo hmd) // Compute distortion scale parameters // NOTE: To get lens max radius, lensShift must be normalized to [-1..1] - float lensRadius = fabsf(-1.0f - 4.0f*lensShift); + float lensRadius = fabs(-1.0f - 4.0f*lensShift); float lensRadiusSq = lensRadius*lensRadius; float distortionScale = hmd.lensDistortionValues[0] + hmd.lensDistortionValues[1]*lensRadiusSq + diff --git a/src/shapes.c b/src/shapes.c index dc547e0d..604dcb87 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -648,8 +648,8 @@ bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2) { bool collision = false; - float dx = fabsf((rec1.x + rec1.width/2) - (rec2.x + rec2.width/2)); - float dy = fabsf((rec1.y + rec1.height/2) - (rec2.y + rec2.height/2)); + float dx = fabs((rec1.x + rec1.width/2) - (rec2.x + rec2.width/2)); + float dy = fabs((rec1.y + rec1.height/2) - (rec2.y + rec2.height/2)); if ((dx <= (rec1.width/2 + rec2.width/2)) && ((dy <= (rec1.height/2 + rec2.height/2)))) collision = true; @@ -678,8 +678,8 @@ bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec) int recCenterX = rec.x + rec.width/2; int recCenterY = rec.y + rec.height/2; - float dx = fabsf(center.x - recCenterX); - float dy = fabsf(center.y - recCenterY); + float dx = fabs(center.x - recCenterX); + float dy = fabs(center.y - recCenterY); if (dx > (rec.width/2.0f + radius)) { return false; } if (dy > (rec.height/2.0f + radius)) { return false; } @@ -700,8 +700,8 @@ Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2) if (CheckCollisionRecs(rec1, rec2)) { - float dxx = fabsf(rec1.x - rec2.x); - float dyy = fabsf(rec1.y - rec2.y); + float dxx = fabs(rec1.x - rec2.x); + float dyy = fabs(rec1.y - rec2.y); if (rec1.x <= rec2.x) { |
