From 0d2de2ba9c616862d7881f089382db772d034f89 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sun, 27 Oct 2019 17:25:16 -0400 Subject: Various updates --- src/client/lua_api/video/smaterial.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/client/lua_api/video/smaterial.cpp') diff --git a/src/client/lua_api/video/smaterial.cpp b/src/client/lua_api/video/smaterial.cpp index 2ef7053..510748c 100644 --- a/src/client/lua_api/video/smaterial.cpp +++ b/src/client/lua_api/video/smaterial.cpp @@ -38,8 +38,22 @@ int setTexture(lua_State* L){ return 0; } +//{Material},flag,state +int setFlag(lua_State* L){ + int b = lua_toboolean(L,-1);//{material},flag,state + lua_pop(L,1);//{material},flag + int flag = lua_tonumber(L,-1);//{material},flag + lua_pop(L,1);//{material} + lua_getfield(L,-1,"smaterial");//{material},ud_material + SMaterial* mat = (SMaterial*)lua_touserdata(L,-1); + lua_pop(L,2); + mat->setFlag((E_MATERIAL_FLAG)flag,b == 1 ? true : false); + return 0; +} + static const luaL_reg smaterial_m[] = { {"setTexture", setTexture}, + {"setFlag", setFlag}, {0,0}, }; -- cgit v1.2.3-70-g09d2