summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjussi2024-11-20 18:23:42 +0200
committerjussi2024-11-20 18:23:42 +0200
commit479726a5e468a2f4d0f9337f082889082e535bfb (patch)
treed342d5ddd7ea69b1be343ae62dfd0ef1ddcef8a7 /src
parentcf2c2eb05bd5d30169771b0087df84a53124f766 (diff)
downloadreilua-enhanced-479726a5e468a2f4d0f9337f082889082e535bfb.tar.gz
reilua-enhanced-479726a5e468a2f4d0f9337f082889082e535bfb.tar.bz2
reilua-enhanced-479726a5e468a2f4d0f9337f082889082e535bfb.zip
Initial switch to raylib 5.5.
Diffstat (limited to 'src')
-rw-r--r--src/audio.c24
-rw-r--r--src/core.c77
-rw-r--r--src/lua_core.c32
-rw-r--r--src/models.c16
-rw-r--r--src/rlgl.c21
-rw-r--r--src/shapes.c24
-rw-r--r--src/text.c8
-rw-r--r--src/textures.c40
8 files changed, 129 insertions, 113 deletions
diff --git a/src/audio.c b/src/audio.c
index fdffae5..8ef7e2d 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -129,16 +129,16 @@ int laudioLoadWaveFromMemory( lua_State* L ) {
}
/*
-> isReady = RL.IsWaveReady( Wave wave )
+> isReady = RL.IsWaveValid( Wave wave )
-Checks if wave data is ready
+Checks if wave data is valid (data loaded and parameters)
- Success return bool
*/
-int laudioIsWaveReady( lua_State* L ) {
+int laudioIsWaveValid( lua_State* L ) {
Wave* wave = uluaGetWave( L, 1 );
- lua_pushboolean( L, IsWaveReady( *wave ) );
+ lua_pushboolean( L, IsWaveValid( *wave ) );
return 1;
}
@@ -174,16 +174,16 @@ int laudioLoadSoundAlias( lua_State* L ) {
}
/*
-> isReady = RL.IsSoundReady( Sound sound )
+> isReady = RL.IsSoundValid( Sound sound )
-Checks if a sound is ready
+Checks if a sound is valid (data loaded and buffers initialized)
- Success return bool
*/
-int laudioIsSoundReady( lua_State* L ) {
+int laudioIsSoundValid( lua_State* L ) {
Sound* sound = uluaGetSound( L, 1 );
- lua_pushboolean( L, IsSoundReady( *sound ) );
+ lua_pushboolean( L, IsSoundValid( *sound ) );
return 1;
}
@@ -497,16 +497,16 @@ int laudioLoadMusicStreamFromMemory( lua_State* L ) {
}
/*
-> isReady = RL.IsMusicReady( Music music )
+> isReady = RL.IsMusicValid( Music music )
-Checks if a music stream is ready
+Checks if a music stream is valid (context and buffers initialized)
- Success return bool
*/
-int laudioIsMusicReady( lua_State* L ) {
+int laudioIsMusicValid( lua_State* L ) {
Music* music = uluaGetMusic( L, 1 );
- lua_pushboolean( L, IsMusicReady( *music ) );
+ lua_pushboolean( L, IsMusicValid( *music ) );
return 1;
}
diff --git a/src/core.c b/src/core.c
index d37b1a4..3473251 100644
--- a/src/core.c
+++ b/src/core.c
@@ -892,16 +892,16 @@ int lcoreLoadShaderFromMemory( lua_State* L ) {
}
/*
-> isReady = RL.IsShaderReady( Shader shader )
+> isReady = RL.IsShaderValid( Shader shader )
-Check if a shader is ready
+Check if a shader is valid (loaded on GPU)
- Success return bool
*/
-int lcoreIsShaderReady( lua_State* L ) {
+int lcoreIsShaderValid( lua_State* L ) {
Shader* shader = uluaGetShader( L, 1 );
- lua_pushboolean( L, IsShaderReady( *shader ) );
+ lua_pushboolean( L, IsShaderValid( *shader ) );
return 1;
}
@@ -1116,47 +1116,34 @@ int lcoreUnloadShader( lua_State* L ) {
*/
/*
-> ray = RL.GetMouseRay( Vector2 mousePosition, Camera3D camera )
+> ray = RL.GetScreenToWorldRay( Vector2 mousePosition, Camera3D camera )
-Get a ray trace from mouse position
+Get a ray trace from screen position (i.e mouse)
- Success return Ray
*/
-int lcoreGetMouseRay( lua_State* L ) {
+int lcoreGetScreenToWorldRay( lua_State* L ) {
Vector2 mousePosition = uluaGetVector2( L, 1 );
Camera3D* camera = uluaGetCamera3D( L, 2 );
- uluaPushRay( L, GetMouseRay( mousePosition, *camera ) );
+ uluaPushRay( L, GetScreenToWorldRay( mousePosition, *camera ) );
return 1;
}
/*
-> matrix = RL.GetCameraMatrix( Camera3D camera )
-
-Get camera transform matrix (view matrix)
-
-- Success return Matrix
-*/
-int lcoreGetCameraMatrix( lua_State* L ) {
- Camera3D* camera = uluaGetCamera3D( L, 1 );
-
- uluaPushMatrix( L, GetCameraMatrix( *camera ) );
-
- return 1;
-}
-
-/*
-> matrix = RL.GetCameraMatrix2D( Camera2D camera )
+> ray = RL.GetScreenToWorldRayEx( Vector2 mousePosition, Camera3D camera, Vector2 size )
-Get camera 2d transform matrix
+Get a ray trace from screen position (i.e mouse) in a viewport
-- Success return Matrix
+- Success return Ray
*/
-int lcoreGetCameraMatrix2D( lua_State* L ) {
- Camera2D* camera = uluaGetCamera2D( L, 1 );
+int lcoreGetScreenToWorldRayEx( lua_State* L ) {
+ Vector2 mousePosition = uluaGetVector2( L, 1 );
+ Camera3D* camera = uluaGetCamera3D( L, 2 );
+ Vector2 size = uluaGetVector2( L, 3 );
- uluaPushMatrix( L, GetCameraMatrix2D( *camera ) );
+ uluaPushRay( L, GetScreenToWorldRayEx( mousePosition, *camera, (int)size.x, (int)size.y ) );
return 1;
}
@@ -1227,6 +1214,36 @@ int lcoreGetScreenToWorld2D( lua_State* L ) {
}
/*
+> matrix = RL.GetCameraMatrix( Camera3D camera )
+
+Get camera transform matrix (view matrix)
+
+- Success return Matrix
+*/
+int lcoreGetCameraMatrix( lua_State* L ) {
+ Camera3D* camera = uluaGetCamera3D( L, 1 );
+
+ uluaPushMatrix( L, GetCameraMatrix( *camera ) );
+
+ return 1;
+}
+
+/*
+> matrix = RL.GetCameraMatrix2D( Camera2D camera )
+
+Get camera 2d transform matrix
+
+- Success return Matrix
+*/
+int lcoreGetCameraMatrix2D( lua_State* L ) {
+ Camera2D* camera = uluaGetCamera2D( L, 1 );
+
+ uluaPushMatrix( L, GetCameraMatrix2D( *camera ) );
+
+ return 1;
+}
+
+/*
## Core - Timing-related functions
*/
@@ -2010,7 +2027,7 @@ Unload automation events list from file
int lcoreUnloadAutomationEventList( lua_State* L ) {
AutomationEventList* list = uluaGetAutomationEventList( L, 1 );
- UnloadAutomationEventList( list );
+ UnloadAutomationEventList( *list );
memset( list, 0, sizeof( AutomationEventList ) );
return 0;
diff --git a/src/lua_core.c b/src/lua_core.c
index 388dbe1..b7a2197 100644
--- a/src/lua_core.c
+++ b/src/lua_core.c
@@ -351,7 +351,7 @@ static void defineAutomationEvent() {
static int gcAutomationEventList( lua_State* L ) {
if ( state->gcUnload ) {
AutomationEventList* automationEventList = luaL_checkudata( L, 1, "AutomationEventList" );
- UnloadAutomationEventList( automationEventList );
+ UnloadAutomationEventList( *automationEventList );
}
return 0;
}
@@ -687,7 +687,6 @@ static void defineGlobals() {
assignGlobalInt( CUBEMAP_LAYOUT_LINE_HORIZONTAL, "CUBEMAP_LAYOUT_LINE_HORIZONTAL" ); // Layout is defined by a horizontal line with faces
assignGlobalInt( CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR, "CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR" ); // Layout is defined by a 3x4 cross with cubemap faces
assignGlobalInt( CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE, "CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE" ); // Layout is defined by a 4x3 cross with cubemap faces
- assignGlobalInt( CUBEMAP_LAYOUT_PANORAMA, "CUBEMAP_LAYOUT_PANORAMA" ); // Layout is defined by a panorama image (equirrectangular map)
/* Font type, defines generation method */
assignGlobalInt( FONT_DEFAULT, "FONT_DEFAULT" ); // Default font generation, anti-aliased
assignGlobalInt( FONT_BITMAP, "FONT_BITMAP" ); // Bitmap font generation, no anti-aliasing
@@ -1339,7 +1338,7 @@ void luaRegister() {
/* Shader management functions. */
assingGlobalFunction( "LoadShader", lcoreLoadShader );
assingGlobalFunction( "LoadShaderFromMemory", lcoreLoadShaderFromMemory );
- assingGlobalFunction( "IsShaderReady", lcoreIsShaderReady );
+ assingGlobalFunction( "IsShaderValid", lcoreIsShaderValid );
assingGlobalFunction( "GetShaderId", lcoreGetShaderId );
assingGlobalFunction( "GetShaderLocation", lcoreGetShaderLocation );
assingGlobalFunction( "GetShaderLocationAttrib", lcoreGetShaderLocationAttrib );
@@ -1351,13 +1350,14 @@ void luaRegister() {
assingGlobalFunction( "SetShaderValueV", lcoreSetShaderValueV );
assingGlobalFunction( "UnloadShader", lcoreUnloadShader );
/* Screen-space-related functions. */
- assingGlobalFunction( "GetMouseRay", lcoreGetMouseRay );
- assingGlobalFunction( "GetCameraMatrix", lcoreGetCameraMatrix );
- assingGlobalFunction( "GetCameraMatrix2D", lcoreGetCameraMatrix2D );
+ assingGlobalFunction( "GetScreenToWorldRay", lcoreGetScreenToWorldRay );
+ assingGlobalFunction( "GetScreenToWorldRayEx", lcoreGetScreenToWorldRayEx );
assingGlobalFunction( "GetWorldToScreen", lcoreGetWorldToScreen );
assingGlobalFunction( "GetWorldToScreenEx", lcoreGetWorldToScreenEx );
assingGlobalFunction( "GetWorldToScreen2D", lcoreGetWorldToScreen2D );
assingGlobalFunction( "GetScreenToWorld2D", lcoreGetScreenToWorld2D );
+ assingGlobalFunction( "GetCameraMatrix", lcoreGetCameraMatrix );
+ assingGlobalFunction( "GetCameraMatrix2D", lcoreGetCameraMatrix2D );
/* Timing-related functions. */
assingGlobalFunction( "SetTargetFPS", lcoreSetTargetFPS );
assingGlobalFunction( "GetFrameTime", lcoreGetFrameTime );
@@ -1553,6 +1553,7 @@ void luaRegister() {
assingGlobalFunction( "DrawRectangleLinesEx", lshapesDrawRectangleLinesEx );
assingGlobalFunction( "DrawRectangleRounded", lshapesDrawRectangleRounded );
assingGlobalFunction( "DrawRectangleRoundedLines", lshapesDrawRectangleRoundedLines );
+ assingGlobalFunction( "DrawRectangleRoundedLinesEx", lshapesDrawRectangleRoundedLinesEx );
assingGlobalFunction( "DrawTriangle", lshapesDrawTriangle );
assingGlobalFunction( "DrawTriangleLines", lshapesDrawTriangleLines );
assingGlobalFunction( "DrawTriangleFan", lshapesDrawTriangleFan );
@@ -1593,13 +1594,12 @@ void luaRegister() {
/* Image loading functions. */
assingGlobalFunction( "LoadImage", ltexturesLoadImage );
assingGlobalFunction( "LoadImageRaw", ltexturesLoadImageRaw );
- assingGlobalFunction( "LoadImageSvg", ltexturesLoadImageSvg );
assingGlobalFunction( "LoadImageAnim", ltexturesLoadImageAnim );
assingGlobalFunction( "LoadImageFromMemory", ltexturesLoadImageFromMemory );
assingGlobalFunction( "LoadImageFromData", ltexturesLoadImageFromData );
assingGlobalFunction( "LoadImageFromTexture", ltexturesLoadImageFromTexture );
assingGlobalFunction( "LoadImageFromScreen", ltexturesLoadImageFromScreen );
- assingGlobalFunction( "IsImageReady", ltextureIsImageReady );
+ assingGlobalFunction( "IsImageValid", ltextureIsImageValid );
assingGlobalFunction( "UnloadImage", ltextureUnloadImage );
assingGlobalFunction( "ExportImage", ltexturesExportImage );
assingGlobalFunction( "ExportImageToMemory", ltexturesExportImageToMemory );
@@ -1671,9 +1671,9 @@ void luaRegister() {
assingGlobalFunction( "LoadTextureFromData", ltexturesLoadTextureFromData );
assingGlobalFunction( "LoadRenderTexture", ltexturesLoadRenderTexture );
assingGlobalFunction( "LoadRenderTextureFromData", ltexturesLoadRenderTextureFromData );
- assingGlobalFunction( "IsTextureReady", ltexturesIsTextureReady );
+ assingGlobalFunction( "IsTextureValid", ltexturesIsTextureValid );
assingGlobalFunction( "UnloadTexture", ltextureUnloadTexture );
- assingGlobalFunction( "IsRenderTextureReady", ltexturesIsRenderTextureReady );
+ assingGlobalFunction( "IsRenderTextureValid", ltexturesIsRenderTextureValid );
assingGlobalFunction( "UnloadRenderTexture", ltextureUnloadRenderTexture );
assingGlobalFunction( "UpdateTexture", ltexturesUpdateTexture );
assingGlobalFunction( "UpdateTextureRec", ltexturesUpdateTextureRec );
@@ -1737,7 +1737,7 @@ void luaRegister() {
/* Model management functions. */
assingGlobalFunction( "LoadModel", lmodelsLoadModel );
assingGlobalFunction( "LoadModelFromMesh", lmodelsLoadModelFromMesh );
- assingGlobalFunction( "IsModelReady", lmodelsIsModelReady );
+ assingGlobalFunction( "IsModelValid", lmodelsIsModelValid );
assingGlobalFunction( "UnloadModel", lmodelsUnloadModel );
assingGlobalFunction( "GetModelBoundingBox", lmodelsGetModelBoundingBox );
assingGlobalFunction( "SetModelTransform", lmodelsSetModelTransform );
@@ -1791,7 +1791,7 @@ void luaRegister() {
assingGlobalFunction( "GetMaterialDefault", lmodelsGetMaterialDefault );
assingGlobalFunction( "LoadMaterialDefault", lmodelsLoadMaterialDefault );
assingGlobalFunction( "CreateMaterial", lmodelsCreateMaterial );
- assingGlobalFunction( "IsMaterialReady", lmodelsIsMaterialReady );
+ assingGlobalFunction( "IsMaterialValid", lmodelsIsMaterialValid );
assingGlobalFunction( "UnloadMaterial", lmodelsUnloadMaterial );
assingGlobalFunction( "SetMaterialTexture", lmodelsSetMaterialTexture );
assingGlobalFunction( "SetMaterialColor", lmodelsSetMaterialColor );
@@ -1837,7 +1837,7 @@ void luaRegister() {
assingGlobalFunction( "LoadFontFromMemory", ltextLoadFontFromMemory );
assingGlobalFunction( "LoadFontFromData", ltextLoadFontFromData );
assingGlobalFunction( "FontCopy", ltextFontCopy );
- assingGlobalFunction( "IsFontReady", ltextIsFontReady );
+ assingGlobalFunction( "IsFontValid", ltextIsFontValid );
assingGlobalFunction( "LoadFontData", ltextLoadFontData );
assingGlobalFunction( "GenImageFontAtlas", ltextGenImageFontAtlas );
assingGlobalFunction( "UnloadFont", ltextUnloadFont );
@@ -1903,10 +1903,10 @@ void luaRegister() {
assingGlobalFunction( "LoadSound", laudioLoadSound );
assingGlobalFunction( "LoadWave", laudioLoadWave );
assingGlobalFunction( "LoadWaveFromMemory", laudioLoadWaveFromMemory );
- assingGlobalFunction( "IsWaveReady", laudioIsWaveReady );
+ assingGlobalFunction( "IsWaveValid", laudioIsWaveValid );
assingGlobalFunction( "LoadSoundFromWave", laudioLoadSoundFromWave );
assingGlobalFunction( "LoadSoundAlias", laudioLoadSoundAlias );
- assingGlobalFunction( "IsSoundReady", laudioIsSoundReady );
+ assingGlobalFunction( "IsSoundValid", laudioIsSoundValid );
assingGlobalFunction( "UpdateSound", laudioUpdateSound );
assingGlobalFunction( "UnloadWave", laudioUnloadWave );
assingGlobalFunction( "UnloadSound", laudioUnloadSound );
@@ -1929,7 +1929,7 @@ void luaRegister() {
/* Music management functions. */
assingGlobalFunction( "LoadMusicStream", laudioLoadMusicStream );
assingGlobalFunction( "LoadMusicStreamFromMemory", laudioLoadMusicStreamFromMemory );
- assingGlobalFunction( "IsMusicReady", laudioIsMusicReady );
+ assingGlobalFunction( "IsMusicValid", laudioIsMusicValid );
assingGlobalFunction( "UnloadMusicStream", laudioUnloadMusicStream );
assingGlobalFunction( "PlayMusicStream", laudioPlayMusicStream );
assingGlobalFunction( "IsMusicStreamPlaying", laudioIsMusicStreamPlaying );
diff --git a/src/models.c b/src/models.c
index c2232d0..1271713 100644
--- a/src/models.c
+++ b/src/models.c
@@ -588,16 +588,16 @@ int lmodelsLoadModelFromMesh( lua_State* L ) {
}
/*
-> isReady = RL.IsModelReady( Model model )
+> isReady = RL.IsModelValid( Model model )
-Check if a model is ready
+Check if a model is valid (loaded in GPU, VAO/VBOs)
- Success return bool
*/
-int lmodelsIsModelReady( lua_State* L ) {
+int lmodelsIsModelValid( lua_State* L ) {
Model* model = uluaGetModel( L, 1 );
- lua_pushboolean( L, IsModelReady( *model ) );
+ lua_pushboolean( L, IsModelValid( *model ) );
return 1;
}
@@ -1936,16 +1936,16 @@ int lmodelsCreateMaterial( lua_State* L ) {
}
/*
-> isReady = RL.IsMaterialReady( Material material )
+> isReady = RL.IsMaterialValid( Material material )
-Check if a material is ready
+Check if a material is valid (shader assigned, map textures loaded in GPU)
- Success return bool
*/
-int lmodelsIsMaterialReady( lua_State* L ) {
+int lmodelsIsMaterialValid( lua_State* L ) {
Material* material = uluaGetMaterial( L, 1 );
- lua_pushboolean( L, IsMaterialReady( *material ) );
+ lua_pushboolean( L, IsMaterialValid( *material ) );
return 1;
}
diff --git a/src/rlgl.c b/src/rlgl.c
index 414666c..995a93a 100644
--- a/src/rlgl.c
+++ b/src/rlgl.c
@@ -1216,9 +1216,9 @@ int lrlglUnloadVertexBuffer( lua_State* L ) {
}
/*
-> RL.rlSetVertexAttribute( int index, int compSize, int type, bool normalized, int stride, buffer pointer )
+> RL.rlSetVertexAttribute( int index, int compSize, int type, bool normalized, int stride, int offset )
-Set vertex attribute.
+Set vertex attribute data configuration
*/
int lrlglSetVertexAttribute( lua_State* L ) {
int index = luaL_checkinteger( L, 1 );
@@ -1226,9 +1226,9 @@ int lrlglSetVertexAttribute( lua_State* L ) {
int type = luaL_checkinteger( L, 3 );
bool normalized = uluaGetBoolean( L, 4 );
int stride = luaL_checkinteger( L, 5 );
- Buffer* pointer = uluaGetBuffer( L, 6 );
+ int offset = luaL_checkinteger( L, 6 );
- rlSetVertexAttribute( index, compSize, type, normalized, stride, pointer->data );
+ rlSetVertexAttribute( index, compSize, type, normalized, stride, offset );
return 0;
}
@@ -1371,9 +1371,9 @@ int lrlglLoadTextureDepth( lua_State* L ) {
}
/*
-> id = RL.rlLoadTextureCubemap( Buffer data, int size, int format )
+> id = RL.rlLoadTextureCubemap( Buffer data, int size, int format, int mipmapCount )
-Load texture cubemap
+Load texture cubemap data
- Success return int
*/
@@ -1381,8 +1381,9 @@ int lrlglLoadTextureCubemap( lua_State* L ) {
Buffer* data = uluaGetBuffer( L, 1 );
int size = luaL_checkinteger( L, 2 );
int format = luaL_checkinteger( L, 3 );
+ int mipmapCount = luaL_checkinteger( L, 4 );
- lua_pushinteger( L, rlLoadTextureCubemap( data->data, size, format ) );
+ lua_pushinteger( L, rlLoadTextureCubemap( data->data, size, format, mipmapCount ) );
return 1;
}
@@ -1523,16 +1524,14 @@ int lrlglReadScreenPixels( lua_State* L ) {
*/
/*
-> fboId = RL.rlLoadFramebuffer( Vector2 size )
+> fboId = RL.rlLoadFramebuffer()
Load an empty framebuffer
- Success return int
*/
int lrlglLoadFramebuffer( lua_State* L ) {
- Vector2 size = uluaGetVector2( L, 1 );
-
- lua_pushinteger( L, rlLoadFramebuffer( size.x, size.y ) );
+ lua_pushinteger( L, rlLoadFramebuffer() );
return 1;
}
diff --git a/src/shapes.c b/src/shapes.c
index b2bcfaf..2efa78a 100644
--- a/src/shapes.c
+++ b/src/shapes.c
@@ -381,18 +381,34 @@ int lshapesDrawRectangleRounded( lua_State* L ) {
}
/*
-> RL.DrawRectangleRoundedLines( Rectangle rec, float roundness, int segments, int lineThick, Color color )
+> RL.DrawRectangleRoundedLines( Rectangle rec, float roundness, int segments, Color color )
-Draw rectangle with rounded edges outline
+Draw rectangle lines with rounded edges
*/
int lshapesDrawRectangleRoundedLines( lua_State* L ) {
Rectangle rect = uluaGetRectangle( L, 1 );
float roundness = luaL_checknumber( L, 2 );
int segments = luaL_checkinteger( L, 3 );
- int lineThick = luaL_checkinteger( L, 4 );
+ Color color = uluaGetColor( L, 4 );
+
+ DrawRectangleRoundedLines( rect, roundness, segments, color );
+
+ return 0;
+}
+
+/*
+> RL.DrawRectangleRoundedLinesEx( Rectangle rec, float roundness, int segments, float lineThick, Color color )
+
+Draw rectangle with rounded edges outline
+*/
+int lshapesDrawRectangleRoundedLinesEx( lua_State* L ) {
+ Rectangle rect = uluaGetRectangle( L, 1 );
+ float roundness = luaL_checknumber( L, 2 );
+ int segments = luaL_checkinteger( L, 3 );
+ float lineThick = luaL_checknumber( L, 4 );
Color color = uluaGetColor( L, 5 );
- DrawRectangleRoundedLines( rect, roundness, segments, lineThick, color );
+ DrawRectangleRoundedLinesEx( rect, roundness, segments, lineThick, color );
return 0;
}
diff --git a/src/text.c b/src/text.c
index 309f6da..9b6fe95 100644
--- a/src/text.c
+++ b/src/text.c
@@ -295,16 +295,16 @@ int ltextFontCopy( lua_State* L ) {
}
/*
-> isReady = RL.IsFontReady( Font font )
+> isReady = RL.IsFontValid( Font font )
-Check if a font is ready
+Check if a font is valid (font data loaded, WARNING: GPU texture not checked)
- Success return bool
*/
-int ltextIsFontReady( lua_State* L ) {
+int ltextIsFontValid( lua_State* L ) {
Font* font = uluaGetFont( L, 1 );
- lua_pushboolean( L, IsFontReady( *font ) );
+ lua_pushboolean( L, IsFontValid( *font ) );
return 1;
}
diff --git a/src/textures.c b/src/textures.c
index 427a06e..d571a32 100644
--- a/src/textures.c
+++ b/src/textures.c
@@ -54,22 +54,6 @@ int ltexturesLoadImageRaw( lua_State* L ) {
}
/*
-> image = RL.LoadImageSvg( string fileNameOrString, Vector2 size )
-
-Load image from SVG file data or string with specified size
-
-- Success return Image
-*/
-int ltexturesLoadImageSvg( lua_State* L ) {
- const char* fileNameOrString = luaL_checkstring( L, 1 );
- Vector2 size = uluaGetVector2( L, 2 );
-
- uluaPushImage( L, LoadImageSvg( fileNameOrString, (int)size.x, (int)size.y ) );
-
- return 1;
-}
-
-/*
> image, frameCount = RL.LoadImageAnim( string fileName )
Load image sequence from file (frames appended to image.data). All frames are returned in RGBA format
@@ -165,16 +149,16 @@ int ltexturesLoadImageFromScreen( lua_State* L ) {
}
/*
-> isReady = RL.IsImageReady( Image image )
+> isReady = RL.IsImageValid( Image image )
-Check if an image is ready
+Check if an image is valid (data and parameters)
- Success return bool
*/
-int ltextureIsImageReady( lua_State* L ) {
+int ltextureIsImageValid( lua_State* L ) {
Image* image = uluaGetImage( L, 1 );
- lua_pushboolean( L, IsImageReady( *image ) );
+ lua_pushboolean( L, IsImageValid( *image ) );
return 1;
}
@@ -1274,16 +1258,16 @@ int ltexturesLoadRenderTextureFromData( lua_State* L ) {
}
/*
-> isReady = RL.IsTextureReady( Texture texture )
+> isReady = RL.IsTextureValid( Texture texture )
-Check if a texture is ready
+Check if a texture is valid (loaded in GPU)
- Success return bool
*/
-int ltexturesIsTextureReady( lua_State* L ) {
+int ltexturesIsTextureValid( lua_State* L ) {
Texture* texture = uluaGetTexture( L, 1 );
- lua_pushboolean( L, IsTextureReady( *texture ) );
+ lua_pushboolean( L, IsTextureValid( *texture ) );
return 1;
}
@@ -1303,16 +1287,16 @@ int ltextureUnloadTexture( lua_State* L ) {
}
/*
-> isReady = RL.IsRenderTextureReady( RenderTexture target )
+> isReady = RL.IsRenderTextureValid( RenderTexture target )
-Check if a render texture is ready
+Check if a render texture is valid (loaded in GPU)
- Success return bool
*/
-int ltexturesIsRenderTextureReady( lua_State* L ) {
+int ltexturesIsRenderTextureValid( lua_State* L ) {
RenderTexture* target = uluaGetRenderTexture( L, 1 );
- lua_pushboolean( L, IsRenderTextureReady( *target ) );
+ lua_pushboolean( L, IsRenderTextureValid( *target ) );
return 1;
}