Shapes, RLGL, Math, Gui and Easings to new style.

This commit is contained in:
jussi
2023-10-29 15:21:10 +02:00
parent 76911d45a8
commit 0df40e2ac0
11 changed files with 1076 additions and 3952 deletions

670
API.md

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -787,7 +787,7 @@ NOTE: Set nil if no shader
*/
int lcoreLoadShader( lua_State *L ) {
if ( !( lua_isstring( L, 1 ) || lua_isnil( L, 1 ) ) || !( lua_isstring( L, 2 ) || lua_isnil( L, 2 ) ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.LoadShader( string vsFileName, string fsFileName )" );
TraceLog( state->logLevelInvalid, "%s", "Argument needs to be string or nil" );
lua_pushnil( L );
return 1;
}

View File

@@ -13,19 +13,13 @@
Ease linear
- Failure return false
- Success return float
*/
int leasingsEaseLinear( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) || !lua_isnumber( L, 4 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.EaseLinear( float t, float b, float c, float d )" );
lua_pushboolean( L, false );
return 1;
}
float t = lua_tonumber( L, 1 );
float b = lua_tonumber( L, 2 );
float c = lua_tonumber( L, 3 );
float d = lua_tonumber( L, 4 );
float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 );
float d = luaL_checknumber( L, 4 );
lua_pushnumber( L, EaseLinearNone( t, b, c, d ) );
@@ -41,19 +35,13 @@ int leasingsEaseLinear( lua_State *L ) {
Ease sine in
- Failure return false
- Success return float
*/
int leasingsEaseSineIn( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) || !lua_isnumber( L, 4 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.EaseSineIn( float t, float b, float c, float d )" );
lua_pushboolean( L, false );
return 1;
}
float t = lua_tonumber( L, 1 );
float b = lua_tonumber( L, 2 );
float c = lua_tonumber( L, 3 );
float d = lua_tonumber( L, 4 );
float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 );
float d = luaL_checknumber( L, 4 );
lua_pushnumber( L, EaseSineIn( t, b, c, d ) );
@@ -65,19 +53,13 @@ int leasingsEaseSineIn( lua_State *L ) {
Ease sine out
- Failure return false
- Success return float
*/
int leasingsEaseSineOut( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) || !lua_isnumber( L, 4 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.EaseSineOut( float t, float b, float c, float d )" );
lua_pushboolean( L, false );
return 1;
}
float t = lua_tonumber( L, 1 );
float b = lua_tonumber( L, 2 );
float c = lua_tonumber( L, 3 );
float d = lua_tonumber( L, 4 );
float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 );
float d = luaL_checknumber( L, 4 );
lua_pushnumber( L, EaseSineOut( t, b, c, d ) );
@@ -89,19 +71,13 @@ int leasingsEaseSineOut( lua_State *L ) {
Ease sine in out
- Failure return false
- Success return float
*/
int leasingsEaseSineInOut( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) || !lua_isnumber( L, 4 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.EaseSineInOut( float t, float b, float c, float d )" );
lua_pushboolean( L, false );
return 1;
}
float t = lua_tonumber( L, 1 );
float b = lua_tonumber( L, 2 );
float c = lua_tonumber( L, 3 );
float d = lua_tonumber( L, 4 );
float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 );
float d = luaL_checknumber( L, 4 );
lua_pushnumber( L, EaseSineInOut( t, b, c, d ) );
@@ -117,19 +93,13 @@ int leasingsEaseSineInOut( lua_State *L ) {
Ease circle in
- Failure return false
- Success return float
*/
int leasingsEaseCircIn( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) || !lua_isnumber( L, 4 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.EaseCircIn( float t, float b, float c, float d )" );
lua_pushboolean( L, false );
return 1;
}
float t = lua_tonumber( L, 1 );
float b = lua_tonumber( L, 2 );
float c = lua_tonumber( L, 3 );
float d = lua_tonumber( L, 4 );
float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 );
float d = luaL_checknumber( L, 4 );
lua_pushnumber( L, EaseCircIn( t, b, c, d ) );
@@ -141,19 +111,13 @@ int leasingsEaseCircIn( lua_State *L ) {
Ease circle out
- Failure return false
- Success return float
*/
int leasingsEaseCircOut( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) || !lua_isnumber( L, 4 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.EaseCircOut( float t, float b, float c, float d )" );
lua_pushboolean( L, false );
return 1;
}
float t = lua_tonumber( L, 1 );
float b = lua_tonumber( L, 2 );
float c = lua_tonumber( L, 3 );
float d = lua_tonumber( L, 4 );
float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 );
float d = luaL_checknumber( L, 4 );
lua_pushnumber( L, EaseCircOut( t, b, c, d ) );
@@ -165,19 +129,13 @@ int leasingsEaseCircOut( lua_State *L ) {
Ease circle in out
- Failure return false
- Success return float
*/
int leasingsEaseCircInOut( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) || !lua_isnumber( L, 4 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.EaseCircInOut( float t, float b, float c, float d )" );
lua_pushboolean( L, false );
return 1;
}
float t = lua_tonumber( L, 1 );
float b = lua_tonumber( L, 2 );
float c = lua_tonumber( L, 3 );
float d = lua_tonumber( L, 4 );
float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 );
float d = luaL_checknumber( L, 4 );
lua_pushnumber( L, EaseCircInOut( t, b, c, d ) );
@@ -193,19 +151,13 @@ int leasingsEaseCircInOut( lua_State *L ) {
Ease cubic in
- Failure return false
- Success return float
*/
int leasingsEaseCubicIn( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) || !lua_isnumber( L, 4 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.EaseCubicIn( float t, float b, float c, float d )" );
lua_pushboolean( L, false );
return 1;
}
float t = lua_tonumber( L, 1 );
float b = lua_tonumber( L, 2 );
float c = lua_tonumber( L, 3 );
float d = lua_tonumber( L, 4 );
float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 );
float d = luaL_checknumber( L, 4 );
lua_pushnumber( L, EaseCubicIn( t, b, c, d ) );
@@ -217,19 +169,13 @@ int leasingsEaseCubicIn( lua_State *L ) {
Ease cubic out
- Failure return false
- Success return float
*/
int leasingsEaseCubicOut( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) || !lua_isnumber( L, 4 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.EaseCubicOut( float t, float b, float c, float d )" );
lua_pushboolean( L, false );
return 1;
}
float t = lua_tonumber( L, 1 );
float b = lua_tonumber( L, 2 );
float c = lua_tonumber( L, 3 );
float d = lua_tonumber( L, 4 );
float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 );
float d = luaL_checknumber( L, 4 );
lua_pushnumber( L, EaseCubicOut( t, b, c, d ) );
@@ -241,19 +187,13 @@ int leasingsEaseCubicOut( lua_State *L ) {
Ease cubic in out
- Failure return false
- Success return float
*/
int leasingsEaseCubicInOut( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) || !lua_isnumber( L, 4 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.EaseCubicInOut( float t, float b, float c, float d )" );
lua_pushboolean( L, false );
return 1;
}
float t = lua_tonumber( L, 1 );
float b = lua_tonumber( L, 2 );
float c = lua_tonumber( L, 3 );
float d = lua_tonumber( L, 4 );
float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 );
float d = luaL_checknumber( L, 4 );
lua_pushnumber( L, EaseCubicInOut( t, b, c, d ) );
@@ -269,19 +209,13 @@ int leasingsEaseCubicInOut( lua_State *L ) {
Ease quadratic in
- Failure return false
- Success return float
*/
int leasingsEaseQuadIn( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) || !lua_isnumber( L, 4 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.EaseQuadIn( float t, float b, float c, float d )" );
lua_pushboolean( L, false );
return 1;
}
float t = lua_tonumber( L, 1 );
float b = lua_tonumber( L, 2 );
float c = lua_tonumber( L, 3 );
float d = lua_tonumber( L, 4 );
float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 );
float d = luaL_checknumber( L, 4 );
lua_pushnumber( L, EaseQuadIn( t, b, c, d ) );
@@ -293,19 +227,13 @@ int leasingsEaseQuadIn( lua_State *L ) {
Ease quadratic out
- Failure return false
- Success return float
*/
int leasingsEaseQuadOut( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) || !lua_isnumber( L, 4 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.EaseQuadOut( float t, float b, float c, float d )" );
lua_pushboolean( L, false );
return 1;
}
float t = lua_tonumber( L, 1 );
float b = lua_tonumber( L, 2 );
float c = lua_tonumber( L, 3 );
float d = lua_tonumber( L, 4 );
float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 );
float d = luaL_checknumber( L, 4 );
lua_pushnumber( L, EaseQuadOut( t, b, c, d ) );
@@ -317,19 +245,13 @@ int leasingsEaseQuadOut( lua_State *L ) {
Ease quadratic in out
- Failure return false
- Success return float
*/
int leasingsEaseQuadInOut( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) || !lua_isnumber( L, 4 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.EaseQuadInOut( float t, float b, float c, float d )" );
lua_pushboolean( L, false );
return 1;
}
float t = lua_tonumber( L, 1 );
float b = lua_tonumber( L, 2 );
float c = lua_tonumber( L, 3 );
float d = lua_tonumber( L, 4 );
float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 );
float d = luaL_checknumber( L, 4 );
lua_pushnumber( L, EaseQuadInOut( t, b, c, d ) );
@@ -345,19 +267,13 @@ int leasingsEaseQuadInOut( lua_State *L ) {
Ease exponential in
- Failure return false
- Success return float
*/
int leasingsEaseExpoIn( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) || !lua_isnumber( L, 4 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.EaseExpoIn( float t, float b, float c, float d )" );
lua_pushboolean( L, false );
return 1;
}
float t = lua_tonumber( L, 1 );
float b = lua_tonumber( L, 2 );
float c = lua_tonumber( L, 3 );
float d = lua_tonumber( L, 4 );
float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 );
float d = luaL_checknumber( L, 4 );
lua_pushnumber( L, EaseExpoIn( t, b, c, d ) );
@@ -369,19 +285,13 @@ int leasingsEaseExpoIn( lua_State *L ) {
Ease exponential out
- Failure return false
- Success return float
*/
int leasingsEaseExpoOut( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) || !lua_isnumber( L, 4 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.EaseExpoOut( float t, float b, float c, float d )" );
lua_pushboolean( L, false );
return 1;
}
float t = lua_tonumber( L, 1 );
float b = lua_tonumber( L, 2 );
float c = lua_tonumber( L, 3 );
float d = lua_tonumber( L, 4 );
float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 );
float d = luaL_checknumber( L, 4 );
lua_pushnumber( L, EaseExpoOut( t, b, c, d ) );
@@ -393,19 +303,13 @@ int leasingsEaseExpoOut( lua_State *L ) {
Ease exponential in out
- Failure return false
- Success return float
*/
int leasingsEaseExpoInOut( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) || !lua_isnumber( L, 4 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.EaseExpoInOut( float t, float b, float c, float d )" );
lua_pushboolean( L, false );
return 1;
}
float t = lua_tonumber( L, 1 );
float b = lua_tonumber( L, 2 );
float c = lua_tonumber( L, 3 );
float d = lua_tonumber( L, 4 );
float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 );
float d = luaL_checknumber( L, 4 );
lua_pushnumber( L, EaseExpoInOut( t, b, c, d ) );
@@ -421,19 +325,13 @@ int leasingsEaseExpoInOut( lua_State *L ) {
Ease back in
- Failure return false
- Success return float
*/
int leasingsEaseBackIn( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) || !lua_isnumber( L, 4 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.EaseBackIn( float t, float b, float c, float d )" );
lua_pushboolean( L, false );
return 1;
}
float t = lua_tonumber( L, 1 );
float b = lua_tonumber( L, 2 );
float c = lua_tonumber( L, 3 );
float d = lua_tonumber( L, 4 );
float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 );
float d = luaL_checknumber( L, 4 );
lua_pushnumber( L, EaseBackIn( t, b, c, d ) );
@@ -445,19 +343,13 @@ int leasingsEaseBackIn( lua_State *L ) {
Ease back out
- Failure return false
- Success return float
*/
int leasingsEaseBackOut( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) || !lua_isnumber( L, 4 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.EaseBackOut( float t, float b, float c, float d )" );
lua_pushboolean( L, false );
return 1;
}
float t = lua_tonumber( L, 1 );
float b = lua_tonumber( L, 2 );
float c = lua_tonumber( L, 3 );
float d = lua_tonumber( L, 4 );
float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 );
float d = luaL_checknumber( L, 4 );
lua_pushnumber( L, EaseBackOut( t, b, c, d ) );
@@ -469,19 +361,13 @@ int leasingsEaseBackOut( lua_State *L ) {
Ease back in out
- Failure return false
- Success return float
*/
int leasingsEaseBackInOut( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) || !lua_isnumber( L, 4 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.EaseBackInOut( float t, float b, float c, float d )" );
lua_pushboolean( L, false );
return 1;
}
float t = lua_tonumber( L, 1 );
float b = lua_tonumber( L, 2 );
float c = lua_tonumber( L, 3 );
float d = lua_tonumber( L, 4 );
float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 );
float d = luaL_checknumber( L, 4 );
lua_pushnumber( L, EaseBackInOut( t, b, c, d ) );
@@ -497,19 +383,13 @@ int leasingsEaseBackInOut( lua_State *L ) {
Ease bounce in
- Failure return false
- Success return float
*/
int leasingsEaseBounceIn( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) || !lua_isnumber( L, 4 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.EaseBounceIn( float t, float b, float c, float d )" );
lua_pushboolean( L, false );
return 1;
}
float t = lua_tonumber( L, 1 );
float b = lua_tonumber( L, 2 );
float c = lua_tonumber( L, 3 );
float d = lua_tonumber( L, 4 );
float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 );
float d = luaL_checknumber( L, 4 );
lua_pushnumber( L, EaseBounceIn( t, b, c, d ) );
@@ -521,19 +401,13 @@ int leasingsEaseBounceIn( lua_State *L ) {
Ease bounce out
- Failure return false
- Success return float
*/
int leasingsEaseBounceOut( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) || !lua_isnumber( L, 4 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.EaseBounceOut( float t, float b, float c, float d )" );
lua_pushboolean( L, false );
return 1;
}
float t = lua_tonumber( L, 1 );
float b = lua_tonumber( L, 2 );
float c = lua_tonumber( L, 3 );
float d = lua_tonumber( L, 4 );
float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 );
float d = luaL_checknumber( L, 4 );
lua_pushnumber( L, EaseBounceOut( t, b, c, d ) );
@@ -545,19 +419,13 @@ int leasingsEaseBounceOut( lua_State *L ) {
Ease bounce in out
- Failure return false
- Success return float
*/
int leasingsEaseBounceInOut( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) || !lua_isnumber( L, 4 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.EaseBounceInOut( float t, float b, float c, float d )" );
lua_pushboolean( L, false );
return 1;
}
float t = lua_tonumber( L, 1 );
float b = lua_tonumber( L, 2 );
float c = lua_tonumber( L, 3 );
float d = lua_tonumber( L, 4 );
float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 );
float d = luaL_checknumber( L, 4 );
lua_pushnumber( L, EaseBounceInOut( t, b, c, d ) );
@@ -573,19 +441,13 @@ int leasingsEaseBounceInOut( lua_State *L ) {
Ease elastic in
- Failure return false
- Success return float
*/
int leasingsEaseElasticIn( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) || !lua_isnumber( L, 4 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.EaseElasticIn( float t, float b, float c, float d )" );
lua_pushboolean( L, false );
return 1;
}
float t = lua_tonumber( L, 1 );
float b = lua_tonumber( L, 2 );
float c = lua_tonumber( L, 3 );
float d = lua_tonumber( L, 4 );
float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 );
float d = luaL_checknumber( L, 4 );
lua_pushnumber( L, EaseElasticIn( t, b, c, d ) );
@@ -597,19 +459,13 @@ int leasingsEaseElasticIn( lua_State *L ) {
Ease elastic out
- Failure return false
- Success return float
*/
int leasingsEaseElasticOut( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) || !lua_isnumber( L, 4 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.EaseElasticOut( float t, float b, float c, float d )" );
lua_pushboolean( L, false );
return 1;
}
float t = lua_tonumber( L, 1 );
float b = lua_tonumber( L, 2 );
float c = lua_tonumber( L, 3 );
float d = lua_tonumber( L, 4 );
float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 );
float d = luaL_checknumber( L, 4 );
lua_pushnumber( L, EaseElasticOut( t, b, c, d ) );
@@ -621,19 +477,13 @@ int leasingsEaseElasticOut( lua_State *L ) {
Ease elastic in out
- Failure return false
- Success return float
*/
int leasingsEaseElasticInOut( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) || !lua_isnumber( L, 4 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.EaseElasticInOut( float t, float b, float c, float d )" );
lua_pushboolean( L, false );
return 1;
}
float t = lua_tonumber( L, 1 );
float b = lua_tonumber( L, 2 );
float c = lua_tonumber( L, 3 );
float d = lua_tonumber( L, 4 );
float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 );
float d = luaL_checknumber( L, 4 );
lua_pushnumber( L, EaseElasticInOut( t, b, c, d ) );

View File

@@ -15,25 +15,29 @@ Copy a block of pixels from one framebuffer object to another.
Use -1 RenderTexture for window framebuffer.
*/
int lglBlitFramebuffer( lua_State *L ) {
// TODO Currently doesn't support setting window render target because of luaL_checkudata.
RenderTexture *srcTex = luaL_checkudata( L, 1, "RenderTexture" );
RenderTexture *dstTex = luaL_checkudata( L, 2, "RenderTexture" );
if ( !( lua_isuserdata( L, 1 ) || lua_isnil( L, 1 ) ) || !( lua_isuserdata( L, 2 ) || lua_isnil( L, 2 ) ) ) {
TraceLog( state->logLevelInvalid, "%s", "Argument needs to be RenderTexture or nil" );
lua_pushnil( L );
return 1;
}
Rectangle srcRect = uluaGetRectangleIndex( L, 3 );
Rectangle dstRect = uluaGetRectangleIndex( L, 4 );
int mask = luaL_checkinteger( L, 5 );
int filter = luaL_checkinteger( L, 6 );
if ( lua_tointeger( L, 1 ) == -1 ) {
if ( lua_isnil( L, 1 ) ) {
glBindFramebuffer( GL_READ_FRAMEBUFFER, 0 );
}
else {
RenderTexture *srcTex = luaL_checkudata( L, 1, "RenderTexture" );
glBindFramebuffer( GL_READ_FRAMEBUFFER, srcTex->id );
}
if ( lua_tointeger( L, 2 ) == -1 ) {
if ( lua_isnil( L, 2 ) ) {
glBindFramebuffer( GL_DRAW_FRAMEBUFFER, 0 );
}
else {
RenderTexture *dstTex = luaL_checkudata( L, 2, "RenderTexture" );
glBindFramebuffer( GL_DRAW_FRAMEBUFFER, dstTex->id );
}

View File

@@ -2332,10 +2332,6 @@ Color uluaGetColorIndex( lua_State *L, int index ) {
luaL_checktype( L, index, LUA_TTABLE );
Color color = { 0, 0, 0, 255 };
if ( !lua_istable( L, index ) ) {
TraceLog( state->logLevelInvalid, "%s", "Error. Wrong color value. Returning { 0, 0, 0, 255 }" );
return color;
}
int t = index, i = 0;
lua_pushnil( L );
@@ -2388,10 +2384,6 @@ Vector2 uluaGetVector2Index( lua_State *L, int index ) {
luaL_checktype( L, index, LUA_TTABLE );
Vector2 vector = { 0.0f, 0.0f };
if ( !lua_istable( L, index ) ) {
TraceLog( state->logLevelInvalid, "%s", "Error. Wrong vector2 value. Returning { 0, 0 }" );
return vector;
}
int t = index, i = 0;
lua_pushnil( L );
@@ -2432,10 +2424,6 @@ Vector3 uluaGetVector3Index( lua_State *L, int index ) {
luaL_checktype( L, index, LUA_TTABLE );
Vector3 vector = { 0.0f, 0.0f, 0.0f };
if ( !lua_istable( L, index ) ) {
TraceLog( state->logLevelInvalid, "%s", "Error. Wrong vector3 value. Returning { 0, 0, 0 }" );
return vector;
}
int t = index, i = 0;
lua_pushnil( L );
@@ -2482,10 +2470,6 @@ Vector4 uluaGetVector4Index( lua_State *L, int index ) {
luaL_checktype( L, index, LUA_TTABLE );
Vector4 vector = { 0.0f, 0.0f, 0.0f, 0.0f };
if ( !lua_istable( L, index ) ) {
TraceLog( state->logLevelInvalid, "%s", "Error. Wrong vector4 value. Returning { 0, 0, 0, 0 }" );
return vector;
}
int t = index, i = 0;
lua_pushnil( L );
@@ -2538,11 +2522,6 @@ Rectangle uluaGetRectangleIndex( lua_State *L, int index ) {
luaL_checktype( L, index, LUA_TTABLE );
Rectangle rect = { 0.0f, 0.0f, 0.0f, 0.0f };
if ( !lua_istable( L, index ) ) {
TraceLog( state->logLevelInvalid, "%s", "Error. Wrong rectangle value. Returning { 0, 0, 0, 0 }" );
return rect;
}
int t = index, i = 0;
lua_pushnil( L );
@@ -2595,10 +2574,6 @@ Quaternion uluaGetQuaternionIndex( lua_State *L, int index ) {
luaL_checktype( L, index, LUA_TTABLE );
Quaternion quaternion = { 0.0f, 0.0f, 0.0f, 0.0f };
if ( !lua_istable( L, index ) ) {
TraceLog( state->logLevelInvalid, "%s", "Error. Wrong quaternion value. Returning { 0, 0, 0, 0 }" );
return quaternion;
}
int t = index, i = 0;
lua_pushnil( L );
@@ -2652,10 +2627,6 @@ Matrix uluaGetMatrixIndex( lua_State *L, int index ) {
Matrix matrix = { 0.0f };
float m[4][4];
if ( !lua_istable( L, index ) ) {
TraceLog( state->logLevelInvalid, "%s", "Error. Wrong matrix value. Returning MatrixIdentity." );
return MatrixIdentity();
}
int t = index, i = 0;
lua_pushnil( L );
@@ -2691,10 +2662,6 @@ BoundingBox uluaGetBoundingBoxIndex( lua_State *L, int index ) {
luaL_checktype( L, index, LUA_TTABLE );
BoundingBox box = { .min = { 0.0, 0.0, 0.0 }, .max = { 0.0, 0.0, 0.0 } };
if ( !lua_istable( L, index ) ) {
TraceLog( state->logLevelInvalid, "%s", "Error. Wrong boundingbox value. Returning { min{ 0, 0, 0 }, max{ 0, 0, 0 } }." );
return box;
}
int t = index, i = 0;
lua_pushnil( L );
@@ -2736,10 +2703,6 @@ Ray uluaGetRayIndex( lua_State *L, int index ) {
luaL_checktype( L, index, LUA_TTABLE );
Ray ray = { .position = { 0.0, 0.0, 0.0 }, .direction = { 0.0, 0.0, 0.0 } };
if ( !lua_istable( L, index ) ) {
TraceLog( state->logLevelInvalid, "%s", "Error. Wrong ray value. Returning { position{ 0, 0, 0 }, direction{ 0, 0, 0 } }." );
return ray;
}
int t = index, i = 0;
lua_pushnil( L );
@@ -2781,10 +2744,6 @@ NPatchInfo uluaGetNPatchInfoIndex( lua_State *L, int index ) {
luaL_checktype( L, index, LUA_TTABLE );
NPatchInfo npatch = { .source = { 0.0, 0.0, 0.0, 0.0 }, .left = 0, .top = 0, .right = 0, .bottom = 0, .layout = NPATCH_NINE_PATCH };
if ( !lua_istable( L, index ) ) {
TraceLog( state->logLevelInvalid, "%s", "Error. Wrong ray value. Returning { source = { 0.0, 0.0, 0.0, 0.0 }, left = 0, top = 0, right = 0, bottom = 0, layout = NPATCH_NINE_PATCH }." );
return npatch;
}
int t = index, i = 0;
lua_pushnil( L );

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -276,30 +276,17 @@ int ltexturesImageFromImage( lua_State *L ) {
Create an image from text (custom sprite font)
- Failure return -1
- Success return int
- Success return Image
*/
int ltexturesImageText( lua_State *L ) {
// if ( !lua_isnumber( L, 1 ) || !lua_isstring( L, 2 ) || !lua_isnumber( L, 3 )
// || !lua_isnumber( L, 4 ) || !lua_istable( L, 5 ) ) {
// TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.ImageText( Font font, string text, float fontSize, float spacing, Color tint )" );
// lua_pushinteger( L, -1 );
// return 1;
// }
// size_t fontId = lua_tointeger( L, 1 );
// float fontSize = lua_tonumber( L, 3 );
// float spacing = lua_tonumber( L, 4 );
// Color tint = uluaGetColorIndex( L, 5 );
Font *font = luaL_checkudata( L, 1, "Font" );
float fontSize = lua_tonumber( L, 3 );
float spacing = lua_tonumber( L, 4 );
Color tint = uluaGetColorIndex( L, 5 );
// if ( !validFont( fontId ) ) {
// lua_pushinteger( L, -1 );
// return 1;
// }
// int i = newImage();
// *state->images[i] = ImageTextEx( *state->fonts[ fontId ], lua_tostring( L, 2 ), fontSize, spacing, tint );
// lua_pushinteger( L, i );
uluaPushImage( L, ImageTextEx( *font, luaL_checkstring( L, 2 ), fontSize, spacing, tint ) );
return 0;
return 1;
}
/*