Skip to content

Commit

Permalink
Removed bool type from raymath, it broke raylib
Browse files Browse the repository at this point in the history
  • Loading branch information
raysan5 committed Apr 23, 2022
1 parent ff95f05 commit 233cf39
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/raymath.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)))));

Expand Down Expand Up @@ -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)))));
Expand Down

0 comments on commit 233cf39

Please sign in to comment.