diff options
| author | jussi | 2023-10-27 22:53:56 +0300 |
|---|---|---|
| committer | jussi | 2023-10-27 22:53:56 +0300 |
| commit | 7ef87c8e2f7824a8abfe715aef23b4a6d2e4db78 (patch) | |
| tree | a1a669e8af511c79657cbad1de69419c86212127 /src/shapes.c | |
| parent | 4cb4edcaf0d8b08d888a60d1a5d36f6e3690a4df (diff) | |
| download | reilua-enhanced-7ef87c8e2f7824a8abfe715aef23b4a6d2e4db78.tar.gz reilua-enhanced-7ef87c8e2f7824a8abfe715aef23b4a6d2e4db78.tar.bz2 reilua-enhanced-7ef87c8e2f7824a8abfe715aef23b4a6d2e4db78.zip | |
New object types for Image, Texture, RenderTexture, Camera2D, Camera3D and Shader.
Diffstat (limited to 'src/shapes.c')
| -rw-r--r-- | src/shapes.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/shapes.c b/src/shapes.c index b384271..876520a 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -9,28 +9,19 @@ */ /* -> success = RL.SetShapesTexture( Texture2D texture, Rectangle source ) +> RL.SetShapesTexture( Texture texture, Rectangle source ) Set texture and rectangle to be used on shapes drawing NOTE: It can be useful when using basic shapes and one single font, defining a font char white rectangle would allow drawing everything in a single draw call - -- Failure return false -- Success return true */ int lshapesSetShapesTexture( lua_State *L ) { - if ( !isValidTexture( L, 1, true ) || !lua_isnumber( L, 2 ) ) { - TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.SetShapesTexture( Texture2D texture, Rectangle source )" ); - lua_pushboolean( L, false ); - return 1; - } - Texture texture = uluaGetTexture( L, 1 ); + Texture *texture = luaL_checkudata( L, 1, "Texture" ); Rectangle source = uluaGetRectangleIndex( L, 2 ); - SetShapesTexture( texture, source ); - lua_pushboolean( L, true ); + SetShapesTexture( *texture, source ); - return 1; + return 0; } /* |
