aboutsummaryrefslogtreecommitdiff
path: root/src/client/lua_api/video/smaterial.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/lua_api/video/smaterial.cpp')
-rw-r--r--src/client/lua_api/video/smaterial.cpp14
1 files changed, 14 insertions, 0 deletions
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},
};