diff options
| author | jussi | 2023-06-01 20:35:06 +0300 |
|---|---|---|
| committer | jussi | 2023-06-01 20:35:06 +0300 |
| commit | 8008ebf1b041e837eecf54c3904156309508a2a8 (patch) | |
| tree | db5a570dcfb6dd2f9547d00763223eb7855050cc /src/shapes.c | |
| parent | 4e09bc7d617dc2b784d39aa54baeaae905bfa09b (diff) | |
| download | reilua-enhanced-8008ebf1b041e837eecf54c3904156309508a2a8.tar.gz reilua-enhanced-8008ebf1b041e837eecf54c3904156309508a2a8.tar.bz2 reilua-enhanced-8008ebf1b041e837eecf54c3904156309508a2a8.zip | |
New rlgl functions and texture can be given as table.
Diffstat (limited to 'src/shapes.c')
| -rw-r--r-- | src/shapes.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/shapes.c b/src/shapes.c index 3a06bac..36ac646 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -18,19 +18,15 @@ defining a font char white rectangle would allow drawing everything in a single - Success return true */ int lshapesSetShapesTexture( lua_State *L ) { - if ( !lua_isnumber( L, 1 ) || !lua_isnumber( L, 2 ) ) { + if ( !isValidTexture( L, 1 ) || !lua_isnumber( L, 2 ) ) { TraceLog( LOG_WARNING, "%s", "Bad call of function. RL.SetShapesTexture( Texture2D texture, Rectangle source )" ); lua_pushboolean( L, false ); return 1; } - size_t texId = lua_tointeger( L, 1 ); + Texture texture = uluaGetTexture( L, 1 ); Rectangle source = uluaGetRectangleIndex( L, 2 ); - if ( !validTexture( texId, TEXTURE_TYPE_ALL ) ) { - lua_pushboolean( L, false ); - return 1; - } - SetShapesTexture( *texturesGetSourceTexture( texId ), source ); + SetShapesTexture( texture, source ); lua_pushboolean( L, true ); return 1; |
