summaryrefslogtreecommitdiff
path: root/src/cat/LuaScriptInterface.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-09-29 10:45:41 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-09-29 10:45:41 (GMT)
commitf96cb74a08c669b34add4ee8ae75044f51a5c24b (patch)
treed670735dd1cd636c2a33f1b33f1bfda938b59a9b /src/cat/LuaScriptInterface.cpp
parent9a42e47eb0369ddabe752c37b98ed3662a983694 (diff)
downloadpowder-f96cb74a08c669b34add4ee8ae75044f51a5c24b.zip
powder-f96cb74a08c669b34add4ee8ae75044f51a5c24b.tar.gz
ren.decorations() to enable/disable/get decorations (Lua API)
Diffstat (limited to 'src/cat/LuaScriptInterface.cpp')
-rw-r--r--src/cat/LuaScriptInterface.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/cat/LuaScriptInterface.cpp b/src/cat/LuaScriptInterface.cpp
index d2e90e1..625c684 100644
--- a/src/cat/LuaScriptInterface.cpp
+++ b/src/cat/LuaScriptInterface.cpp
@@ -472,6 +472,7 @@ void LuaScriptInterface::initRendererAPI()
{"displayModes", renderer_displayModes},
{"colourMode", renderer_colourMode},
{"colorMode", renderer_colourMode}, //Duplicate of above to make americans happy
+ {"decorations", renderer_decorations},
{NULL, NULL}
};
luaL_register(l, "renderer", rendererAPIMethods);
@@ -605,7 +606,6 @@ int LuaScriptInterface::renderer_colourMode(lua_State * l)
{
luaL_checktype(l, 1, LUA_TNUMBER);
luacon_ren->SetColourMode(lua_tointeger(l, 1));
- lua_pop(l, 1);
return 0;
}
else
@@ -613,7 +613,21 @@ int LuaScriptInterface::renderer_colourMode(lua_State * l)
lua_pushinteger(l, luacon_ren->GetColourMode());
return 1;
}
- return luaL_error(l, "Not implemented");
+}
+
+int LuaScriptInterface::renderer_decorations(lua_State * l)
+{
+ int args = lua_gettop(l);
+ if(args)
+ {
+ luacon_ren->decorations_enable = lua_toboolean(l, 1);
+ return 0;
+ }
+ else
+ {
+ lua_pushboolean(l, luacon_ren->decorations_enable);
+ return 1;
+ }
}
void LuaScriptInterface::initElementsAPI()