aboutsummaryrefslogtreecommitdiff
path: root/src/script/graphics/luaopen_graphics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/graphics/luaopen_graphics.cpp')
-rw-r--r--src/script/graphics/luaopen_graphics.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/script/graphics/luaopen_graphics.cpp b/src/script/graphics/luaopen_graphics.cpp
index 6e78e36..948e28a 100644
--- a/src/script/graphics/luaopen_graphics.cpp
+++ b/src/script/graphics/luaopen_graphics.cpp
@@ -30,15 +30,12 @@ namespace lua
static int l_init(lua_State* L)
{
Window* wnd = Window::get();
- Window::Setting setting;
+ WindowSetting setting;
setting.width = luax_getfield_integer(L, 1, "width");
setting.height = luax_getfield_integer(L, 1, "height");
setting.title = luax_getfield_string(L, 1, "title");
setting.vsync = luax_getfield_bool(L, 1, "vsync");
- wnd->init(setting);
-
- // init success
- luax_pushboolean(L, true);
+ luax_pushboolean(L, wnd->init(&setting));
return 1;
}
@@ -357,8 +354,8 @@ namespace lua
int tn = luax_tableidxlen(L, 3);
if (tn != n * 2)
{
- static char emsg[] =
- "number of polygon vertices doesn't match "
+ static char* emsg = \
+ "number of polygon vertices doesn't match " \
"provided n, expect %d numbers but get %d";
luax_error(L, emsg, n * 2, tn);
return 1;