New object types for Image, Texture, RenderTexture, Camera2D, Camera3D and Shader.

This commit is contained in:
jussi
2023-10-27 22:53:56 +03:00
parent 4cb4edcaf0
commit 7ef87c8e2f
20 changed files with 967 additions and 2904 deletions

View File

@@ -114,22 +114,12 @@ Load font from Image ( XNA style )
- Success return int
*/
int ltextLoadFontFromImage( lua_State *L ) {
if ( !lua_isnumber( L, 1 ) || !lua_istable( L, 2 ) || !lua_isnumber( L, 3 ) ) {
TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.LoadFontFromImage( Image image, Color key, int firstChar )" );
lua_pushinteger( L, -1 );
return 1;
}
size_t imageId = lua_tointeger( L, 1 );
Image *image = luaL_checkudata( L, 1, "Image" );
Color key = uluaGetColorIndex( L, 2 );
int firstChar = lua_tointeger( L, 3 );
if ( !validImage( imageId ) ) {
lua_pushboolean( L, false );
return 1;
}
int i = newFont();
*state->fonts[i] = LoadFontFromImage( *state->images[ imageId ], key, firstChar );
*state->fonts[i] = LoadFontFromImage( *image, key, firstChar );
lua_pushinteger( L, i );
return 1;