From adfda73e1810973a40b7bedd9a8edc3e7ab89e3c Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 19 May 2018 12:05:57 +0800 Subject: =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AD=90=E7=B3=BB=E7=BB=9F=E5=9F=BA?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/script/graphics/luaopen_graphics.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/script/graphics/luaopen_graphics.cpp') 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; -- cgit v1.1-26-g67d0