From 7ef87c8e2f7824a8abfe715aef23b4a6d2e4db78 Mon Sep 17 00:00:00 2001 From: jussi Date: Fri, 27 Oct 2023 22:53:56 +0300 Subject: New object types for Image, Texture, RenderTexture, Camera2D, Camera3D and Shader. --- src/shapes.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'src/shapes.c') 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; } /* -- cgit v1.2.3