diff --git a/includes/luaconsole.h b/includes/luaconsole.h index b80dead51..a9eb63f90 100644 --- a/includes/luaconsole.h +++ b/includes/luaconsole.h @@ -74,4 +74,5 @@ int luatpt_setfire(lua_State* l); int luatpt_setdebug(lua_State* l); int luatpt_setfpscap(lua_State* l); int luatpt_getscript(lua_State* l); +int luatpt_setwindowsize(lua_State* l); #endif diff --git a/src/luaconsole.c b/src/luaconsole.c index bac4182d8..f9ce8536a 100644 --- a/src/luaconsole.c +++ b/src/luaconsole.c @@ -62,6 +62,7 @@ void luacon_open(){ {"setdebug", &luatpt_setdebug}, {"setfpscap",&luatpt_setfpscap}, {"getscript",&luatpt_getscript}, + {"setwindowsize",&luatpt_setwindowsize}, {NULL,NULL} }; @@ -1157,4 +1158,15 @@ fin: if(lastError) return luaL_error(l, lastError); return 0; } + +int luatpt_setwindowsize(lua_State* l) +{ + int result, scale = luaL_optint(l,1,1), kiosk = luaL_optint(l,2,0); + if (scale!=2) scale = 1; + if (kiosk!=1) kiosk = 0; + result = set_scale(scale, kiosk); + lua_pushnumber(l, result); + return 1; +} + #endif diff --git a/src/main.c b/src/main.c index 1ca9b6cb3..34bc99d72 100644 --- a/src/main.c +++ b/src/main.c @@ -1718,14 +1718,18 @@ int main(int argc, char *argv[]) } - save_presets(0); - make_kernel(); prepare_alpha(CELL, 1.0f); stamp_init(); - if (!sdl_open()) exit(1); + if (!sdl_open()) + { + sdl_scale = 1; + kiosk_enable = 0; + if (!sdl_open()) exit(1); + } + save_presets(0); http_init(http_proxy_string[0] ? http_proxy_string : NULL); if (cpu_check())