From 335321e3aa238069df88cf06c98119ef4ef348d3 Mon Sep 17 00:00:00 2001 From: jussi Date: Fri, 19 May 2023 13:46:24 +0300 Subject: Material getter and get/set for parameters. --- src/lua_core.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/lua_core.c') diff --git a/src/lua_core.c b/src/lua_core.c index 5b51114..a65c95a 100644 --- a/src/lua_core.c +++ b/src/lua_core.c @@ -17,21 +17,18 @@ static void assignGlobalInt( int value, const char *name ) { lua_State *L = state->luaState; lua_pushinteger( L, value ); - // lua_setglobal( L, name ); lua_setfield( L, -2, name ); } static void assignGlobalFloat( float value, const char *name ) { lua_State *L = state->luaState; lua_pushnumber( L, value ); - // lua_setglobal( L, name ); lua_setfield( L, -2, name ); } static void assignGlobalColor( Color color, const char *name ) { lua_State *L = state->luaState; uluaPushColor( L, color ); - // lua_setglobal( L, name ); lua_setfield( L, -2, name ); } @@ -368,7 +365,7 @@ void defineGlobals() { assignGlobalInt( NPATCH_NINE_PATCH, "NPATCH_NINE_PATCH" ); assignGlobalInt( NPATCH_THREE_PATCH_VERTICAL, "NPATCH_THREE_PATCH_VERTICAL" ); assignGlobalInt( NPATCH_THREE_PATCH_HORIZONTAL, "NPATCH_THREE_PATCH_HORIZONTAL" ); - /* TextureModes */ + /* TextureTypes */ assignGlobalInt( TEXTURE_TYPE_TEXTURE, "TEXTURE_TYPE_TEXTURE" ); assignGlobalInt( TEXTURE_TYPE_RENDER_TEXTURE, "TEXTURE_TYPE_RENDER_TEXTURE" ); /* Colors */ @@ -1088,6 +1085,12 @@ void luaRegister() { assingGlobalFunction( "SetMaterialColor", lmodelsSetMaterialColor ); assingGlobalFunction( "SetMaterialValue", lmodelsSetMaterialValue ); assingGlobalFunction( "SetMaterialShader", lmodelsSetMaterialShader ); + assingGlobalFunction( "SetMaterialParams", lmodelsSetMaterialParams ); + assingGlobalFunction( "GetMaterialTexture", lmodelsGetMaterialTexture ); + assingGlobalFunction( "GetMaterialColor", lmodelsGetMaterialColor ); + assingGlobalFunction( "GetMaterialValue", lmodelsGetMaterialValue ); + assingGlobalFunction( "GetMaterialShader", lmodelsGetMaterialShader ); + assingGlobalFunction( "GetMaterialParams", lmodelsGetMaterialParams ); /* Model. */ assingGlobalFunction( "LoadModel", lmodelsLoadModel ); assingGlobalFunction( "LoadModelFromMesh", lmodelsLoadModelFromMesh ); -- cgit v1.2.3