summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRay <[email protected]>2022-04-24 00:38:11 +0200
committerRay <[email protected]>2022-04-24 00:38:11 +0200
commit233cf3970c9148c4963cfdea20e49e761104f9de (patch)
tree3d984a07e264202253f1f738cc61ecbc4d95dbf3
parentff95f05386e6836701ba83d77e3e075b853630dc (diff)
downloadraylib-233cf3970c9148c4963cfdea20e49e761104f9de.tar.gz
raylib-233cf3970c9148c4963cfdea20e49e761104f9de.zip
Removed bool type from raymath, it broke raylib
-rw-r--r--src/raymath.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/raymath.h b/src/raymath.h
index 21f5cf43..22814cce 100644
--- a/src/raymath.h
+++ b/src/raymath.h
@@ -159,7 +159,6 @@ typedef struct float16 {
} float16;
#include <math.h> // Required for: sinf(), cosf(), tan(), atan2f(), sqrtf(), fminf(), fmaxf(), fabs()
-#include <stdbool.h> // Required for: bool, false, true
//----------------------------------------------------------------------------------
// Module Functions Definition - Utils math
@@ -200,9 +199,9 @@ RMAPI float Remap(float value, float inputStart, float inputEnd, float outputSta
}
// Check whether two given floats are almost equal
-RMAPI bool FloatEquals(float x, float y)
+RMAPI int FloatEquals(float x, float y)
{
- bool result = (fabsf(x - y)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(x), fabsf(y))));
+ int result = (fabsf(x - y)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(x), fabsf(y))));
return result;
}
@@ -475,9 +474,9 @@ RMAPI Vector2 Vector2ClampValue(Vector2 v, float min, float max)
}
// Check whether two given vectors are almost equal
-RMAPI bool Vector2Equals(Vector2 p, Vector2 q)
+RMAPI int Vector2Equals(Vector2 p, Vector2 q)
{
- bool result = ((fabsf(p.x - q.x)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.x), fabsf(q.x))))) &&
+ int result = ((fabsf(p.x - q.x)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.x), fabsf(q.x))))) &&
((fabsf(p.y - q.y)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.y), fabsf(q.y)))));
return result;
@@ -971,9 +970,9 @@ RMAPI Vector3 Vector3ClampValue(Vector3 v, float min, float max)
}
// Check whether two given vectors are almost equal
-RMAPI bool Vector3Equals(Vector3 p, Vector3 q)
+RMAPI int Vector3Equals(Vector3 p, Vector3 q)
{
- bool result = ((fabsf(p.x - q.x)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.x), fabsf(q.x))))) &&
+ int result = ((fabsf(p.x - q.x)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.x), fabsf(q.x))))) &&
((fabsf(p.y - q.y)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.y), fabsf(q.y))))) &&
((fabsf(p.z - q.z)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.z), fabsf(q.z)))));
@@ -2000,9 +1999,9 @@ RMAPI Quaternion QuaternionTransform(Quaternion q, Matrix mat)
}
// Check whether two given quaternions are almost equal
-RMAPI bool QuaternionEquals(Quaternion p, Quaternion q)
+RMAPI int QuaternionEquals(Quaternion p, Quaternion q)
{
- bool result = ((fabsf(p.x - q.x)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.x), fabsf(q.x))))) &&
+ int result = ((fabsf(p.x - q.x)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.x), fabsf(q.x))))) &&
((fabsf(p.y - q.y)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.y), fabsf(q.y))))) &&
((fabsf(p.z - q.z)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.z), fabsf(q.z))))) &&
((fabsf(p.w - q.w)) <= (EPSILON*fmaxf(1.0f, fmaxf(fabsf(p.w), fabsf(q.w)))));