Raymath *Equals functions return bool instead of int.

This commit is contained in:
jussi
2024-07-06 01:03:02 +03:00
parent 61c932f260
commit 528f3f3d82
15 changed files with 154 additions and 126 deletions

View File

@@ -137,13 +137,13 @@ int lmathWrap( lua_State* L ) {
Check whether two given floats are almost equal
- Success return int
- Success return bool
*/
int lmathFloatEquals( lua_State* L ) {
float x = luaL_checknumber( L, 1 );
float y = luaL_checknumber( L, 2 );
lua_pushinteger( L, FloatEquals( x, y ) );
lua_pushboolean( L, FloatEquals( x, y ) == 1 );
return 1;
}
@@ -570,13 +570,13 @@ int lmathVector2ClampValue( lua_State* L ) {
Check whether two given vectors are almost equal
- Success return int
- Success return bool
*/
int lmathVector2Equals( lua_State* L ) {
Vector2 v1 = uluaGetVector2( L, 1 );
Vector2 v2 = uluaGetVector2( L, 2 );
lua_pushinteger( L, Vector2Equals( v1, v2 ) );
lua_pushboolean( L, Vector2Equals( v1, v2 ) == 1 );
return 1;
}
@@ -1136,13 +1136,13 @@ int lmathVector3ClampValue( lua_State* L ) {
Check whether two given vectors are almost equal
- Success return int
- Success return bool
*/
int lmathVector3Equals( lua_State* L ) {
Vector3 v1 = uluaGetVector3( L, 1 );
Vector3 v2 = uluaGetVector3( L, 2 );
lua_pushinteger( L, Vector3Equals( v1, v2 ) );
lua_pushboolean( L, Vector3Equals( v1, v2 ) == 1 );
return 1;
}
@@ -1853,13 +1853,13 @@ int lmathQuaternionTransform( lua_State* L ) {
Check whether two given quaternions are almost equal
- Success return int
- Success return bool
*/
int lmathQuaternionEquals( lua_State* L ) {
Quaternion q1 = uluaGetQuaternion( L, 1 );
Quaternion q2 = uluaGetQuaternion( L, 2 );
lua_pushinteger( L, QuaternionEquals( q1, q2 ) );
lua_pushboolean( L, QuaternionEquals( q1, q2 ) == 1 );
return 1;
}

View File

@@ -1897,7 +1897,7 @@ Returns hexadecimal value for a Color
int ltexturesColorToInt( lua_State* L ) {
Color color = uluaGetColor( L, 1 );
lua_pushinteger( L, ColorToInt( color ) );
lua_pushinteger( L, (unsigned int)ColorToInt( color ) );
return 1;
}