diff --git a/src/models.c b/src/models.c index 935b9779..60e9ca7a 100644 --- a/src/models.c +++ b/src/models.c @@ -45,10 +45,10 @@ #include "utils.h" // Required for: fopen() Android mapping -#include // Required for: malloc(), free(), fabs() +#include // Required for: malloc(), free() #include // Required for: FILE, fopen(), fclose() #include // Required for: strncmp() [Used in LoadModelAnimations()], strlen() [Used in LoadTextureFromCgltfImage()] -#include // Required for: sinf(), cosf(), sqrtf() +#include // Required for: sinf(), cosf(), sqrtf(), fabsf() #include "rlgl.h" // raylib OpenGL abstraction layer to OpenGL 1.1, 2.1, 3.3+ or ES2 @@ -2513,9 +2513,9 @@ void DrawBoundingBox(BoundingBox box, Color color) { Vector3 size; - size.x = (float)fabs(box.max.x - box.min.x); - size.y = (float)fabs(box.max.y - box.min.y); - size.z = (float)fabs(box.max.z - box.min.z); + 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); Vector3 center = { box.min.x + size.x/2.0f, box.min.y + size.y/2.0f, box.min.z + size.z/2.0f }; @@ -2761,7 +2761,7 @@ RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight) RayHitInfo result = { 0 }; - if (fabs(ray.direction.y) > EPSILON) + if (fabsf(ray.direction.y) > EPSILON) { float distance = (ray.position.y - groundHeight)/-ray.direction.y; diff --git a/src/rlgl.h b/src/rlgl.h index f2c796de..536f8103 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -612,10 +612,10 @@ RLAPI int GetPixelDataSize(int width, int height, int format);// Get pixel data #endif #endif -#include // Required for: malloc(), free(), fabs() +#include // Required for: malloc(), free() #include // Required for: fopen(), fseek(), fread(), fclose() [LoadText] #include // Required for: strcmp(), strlen() [Used in rlglInit(), on extensions loading] -#include // Required for: atan2f() +#include // Required for: atan2f(), fabs() #if !defined(RLGL_STANDALONE) #include "raymath.h" // Required for: Vector3 and Matrix functions @@ -3662,7 +3662,7 @@ void SetVrConfiguration(VrDeviceInfo hmd, Shader distortion) // Compute distortion scale parameters // NOTE: To get lens max radius, lensShift must be normalized to [-1..1] - float lensRadius = (float)fabs(-1.0f - 4.0f*lensShift); + float lensRadius = fabsf(-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 4fb38867..02c0eeb7 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -42,8 +42,7 @@ #include "rlgl.h" // raylib OpenGL abstraction layer to OpenGL 1.1, 2.1, 3.3+ or ES2 -#include // Required for: fabs() -#include // Required for: sinf(), asinf(), cosf(), acosf(), sqrtf() +#include // Required for: sinf(), asinf(), cosf(), acosf(), sqrtf(), fabsf() //---------------------------------------------------------------------------------- // Defines and Macros @@ -1471,8 +1470,8 @@ bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec) int recCenterX = (int)(rec.x + rec.width/2.0f); int recCenterY = (int)(rec.y + rec.height/2.0f); - float dx = (float)fabs(center.x - recCenterX); - float dy = (float)fabs(center.y - recCenterY); + float dx = fabsf(center.x - (float)recCenterX); + float dy = fabsf(center.y - (float)recCenterY); if (dx > (rec.width/2.0f + radius)) { return false; } if (dy > (rec.height/2.0f + radius)) { return false; } @@ -1493,8 +1492,8 @@ Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2) if (CheckCollisionRecs(rec1, rec2)) { - float dxx = (float)fabs(rec1.x - rec2.x); - float dyy = (float)fabs(rec1.y - rec2.y); + float dxx = fabsf(rec1.x - rec2.x); + float dyy = fabsf(rec1.y - rec2.y); if (rec1.x <= rec2.x) { diff --git a/src/textures.c b/src/textures.c index 95a6f113..98b060d7 100644 --- a/src/textures.c +++ b/src/textures.c @@ -64,9 +64,10 @@ #include "config.h" // Defines module configuration flags #endif -#include // Required for: malloc(), free(), fabs() +#include // Required for: malloc(), free() #include // Required for: FILE, fopen(), fclose(), fread() #include // Required for: strlen() [Used in ImageTextEx()] +#include // Required for: fabsf() #include "utils.h" // Required for: fopen() Android mapping @@ -2688,7 +2689,7 @@ void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float sc // Draw a part of a texture (defined by a rectangle) void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint) { - Rectangle destRec = { position.x, position.y, (float)fabs(sourceRec.width), (float)fabs(sourceRec.height) }; + Rectangle destRec = { position.x, position.y, fabsf(sourceRec.width), fabsf(sourceRec.height) }; Vector2 origin = { 0.0f, 0.0f }; DrawTexturePro(texture, sourceRec, destRec, origin, 0.0f, tint);