Renamed start, end arguments to a, b to avoid using Lua keyword end in argument names.

This commit is contained in:
jussi
2023-10-15 18:54:19 +03:00
parent c3352b8ed7
commit 7af7e70031
7 changed files with 28 additions and 28 deletions

8
API.md
View File

@@ -3283,7 +3283,7 @@ Draw pixel within an image
--- ---
> success = RL.ImageDrawLine( Image dst, Vector2 start, Vector2 end, Color color ) > success = RL.ImageDrawLine( Image dst, Vector2 a, Vector2 b, Color color )
Draw line within an image Draw line within an image
@@ -4880,7 +4880,7 @@ Clamp float value
--- ---
> result = RL.Lerp( float start, float end, float amount ) > result = RL.Lerp( float a, float b, float amount )
Calculate linear interpolation between two floats Calculate linear interpolation between two floats
@@ -4889,7 +4889,7 @@ Calculate linear interpolation between two floats
--- ---
> result = RL.Normalize( float value, float start, float end ) > result = RL.Normalize( float value, float a, float b )
Normalize input value within input range Normalize input value within input range
@@ -5035,7 +5035,7 @@ Calculate angle from two vectors
--- ---
> result = RL.Vector2LineAngle( Vector2 start, Vector2 end ) > result = RL.Vector2LineAngle( Vector2 a, Vector2 b )
Calculate angle defined by a two vectors line. Calculate angle defined by a two vectors line.
NOTE: Parameters need to be normalized. NOTE: Parameters need to be normalized.

View File

@@ -2710,11 +2710,11 @@ function RL.ImageDrawPixel( dst, position, color ) end
---- Failure return false ---- Failure return false
---- Success return true ---- Success return true
---@param dst any ---@param dst any
---@param start table ---@param a table
---@param end table ---@param b table
---@param color table ---@param color table
---@return any success ---@return any success
function RL.ImageDrawLine( dst, start, end, color ) end function RL.ImageDrawLine( dst, a, b, color ) end
---Draw circle within an image ---Draw circle within an image
---- Failure return false ---- Failure return false
@@ -4174,20 +4174,20 @@ function RL.Clamp( value, min, max ) end
---Calculate linear interpolation between two floats ---Calculate linear interpolation between two floats
---- Failure return false ---- Failure return false
---- Success return float ---- Success return float
---@param start number ---@param a number
---@param end number ---@param b number
---@param amount number ---@param amount number
---@return any result ---@return any result
function RL.Lerp( start, end, amount ) end function RL.Lerp( a, b, amount ) end
---Normalize input value within input range ---Normalize input value within input range
---- Failure return false ---- Failure return false
---- Success return float ---- Success return float
---@param value number ---@param value number
---@param start number ---@param a number
---@param end number ---@param b number
---@return any result ---@return any result
function RL.Normalize( value, start, end ) end function RL.Normalize( value, a, b ) end
---Remap input value within input range to output range ---Remap input value within input range to output range
---- Failure return false ---- Failure return false
@@ -4312,10 +4312,10 @@ function RL.Vector2Angle( v1, v2 ) end
---Current implementation should be aligned with glm::angle. ---Current implementation should be aligned with glm::angle.
---- Failure return false ---- Failure return false
---- Success return float ---- Success return float
---@param start table ---@param a table
---@param end table ---@param b table
---@return any result ---@return any result
function RL.Vector2LineAngle( start, end ) end function RL.Vector2LineAngle( a, b ) end
---Scale vector ( multiply by value ) ---Scale vector ( multiply by value )
---- Failure return false ---- Failure return false

View File

@@ -101,6 +101,8 @@ Detailed changes:
- ADDED: GetFontTexture - ADDED: GetFontTexture
- CHANGED: Renamed doc_parser.lua to docgen.lua - CHANGED: Renamed doc_parser.lua to docgen.lua
- FIXED: isValidRenderTexture checks that it is TEXTURE_TYPE_RENDER_TEXTURE - FIXED: isValidRenderTexture checks that it is TEXTURE_TYPE_RENDER_TEXTURE
- FIXED: isValidTexture on CreateMaterial
- CHANGED: Renamed start, end arguments to a, b to avoid using Lua keyword "end" in argument names
------------------------------------------------------------------------ ------------------------------------------------------------------------
Release: ReiLua version 0.4.0 Using Raylib 4.2 Release: ReiLua version 0.4.0 Using Raylib 4.2

4
lib/.gitignore vendored
View File

@@ -1,3 +1 @@
liblua.a *
libluajit.a
libraylib.a

View File

@@ -1661,7 +1661,7 @@ int lmodelsCreateMaterial( lua_State *L ) {
lua_pushnil( L ); lua_pushnil( L );
while ( lua_next( L, t4 ) != 0 ) { while ( lua_next( L, t4 ) != 0 ) {
if ( strcmp( "texture", (char*)lua_tostring( L, -2 ) ) == 0 && lua_isnumber( L, -1 ) ) { if ( strcmp( "texture", (char*)lua_tostring( L, -2 ) ) == 0 && isValidTexture( L, lua_gettop( L ), true ) ) {
state->materials[i]->maps[map].texture = uluaGetTexture( L, lua_gettop( L ) ); state->materials[i]->maps[map].texture = uluaGetTexture( L, lua_gettop( L ) );
} }
else if ( strcmp( "color", (char*)lua_tostring( L, -2 ) ) == 0 && lua_istable( L, -1 ) ) { else if ( strcmp( "color", (char*)lua_tostring( L, -2 ) ) == 0 && lua_istable( L, -1 ) ) {

View File

@@ -39,7 +39,7 @@ int lmathClamp( lua_State *L ) {
} }
/* /*
> result = RL.Lerp( float start, float end, float amount ) > result = RL.Lerp( float a, float b, float amount )
Calculate linear interpolation between two floats Calculate linear interpolation between two floats
@@ -48,7 +48,7 @@ Calculate linear interpolation between two floats
*/ */
int lmathLerp( lua_State *L ) { int lmathLerp( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) ) { if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.Lerp( float start, float end, float amount )" ); TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.Lerp( float a, float b, float amount )" );
lua_pushboolean( L, false ); lua_pushboolean( L, false );
return 1; return 1;
} }
@@ -62,7 +62,7 @@ int lmathLerp( lua_State *L ) {
} }
/* /*
> result = RL.Normalize( float value, float start, float end ) > result = RL.Normalize( float value, float a, float b )
Normalize input value within input range Normalize input value within input range
@@ -71,7 +71,7 @@ Normalize input value within input range
*/ */
int lmathNormalize( lua_State *L ) { int lmathNormalize( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) ) { if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) || !lua_isnumber( L, 3 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.Normalize( float value, float start, float end )" ); TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.Normalize( float value, float a, float b )" );
lua_pushboolean( L, false ); lua_pushboolean( L, false );
return 1; return 1;
} }
@@ -404,7 +404,7 @@ int lmathVector2Angle( lua_State *L ) {
} }
/* /*
> result = RL.Vector2LineAngle( Vector2 start, Vector2 end ) > result = RL.Vector2LineAngle( Vector2 a, Vector2 b )
Calculate angle defined by a two vectors line. Calculate angle defined by a two vectors line.
NOTE: Parameters need to be normalized. NOTE: Parameters need to be normalized.
@@ -415,7 +415,7 @@ Current implementation should be aligned with glm::angle.
*/ */
int lmathVector2LineAngle( lua_State *L ) { int lmathVector2LineAngle( lua_State *L ) {
if ( !lua_istable( L, 1 ) || !lua_istable( L, 2 ) ) { if ( !lua_istable( L, 1 ) || !lua_istable( L, 2 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.Vector2LineAngle( Vector2 start, Vector2 end )" ); TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.Vector2LineAngle( Vector2 a, Vector2 b )" );
lua_pushboolean( L, false ); lua_pushboolean( L, false );
return 1; return 1;
} }

View File

@@ -1365,7 +1365,7 @@ int ltexturesImageDrawPixel( lua_State *L ) {
} }
/* /*
> success = RL.ImageDrawLine( Image dst, Vector2 start, Vector2 end, Color color ) > success = RL.ImageDrawLine( Image dst, Vector2 a, Vector2 b, Color color )
Draw line within an image Draw line within an image
@@ -1374,7 +1374,7 @@ Draw line within an image
*/ */
int ltexturesImageDrawLine( lua_State *L ) { int ltexturesImageDrawLine( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_istable( L, 2 ) || !lua_istable( L, 3 ) || !lua_istable( L, 4 ) ) { if ( !lua_isnumber( L, 1 ) || !lua_istable( L, 2 ) || !lua_istable( L, 3 ) || !lua_istable( L, 4 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.ImageDrawLine( Image dst, Vector2 start, Vector2 end, Color color )" ); TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.ImageDrawLine( Image dst, Vector2 a, Vector2 b, Color color )" );
lua_pushboolean( L, false ); lua_pushboolean( L, false );
return 1; return 1;
} }