- Added turbo option, to allow waiting for events and use less CPU
This commit is contained in:
12
lua.cpp
12
lua.cpp
@@ -782,6 +782,16 @@ extern "C" {
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int cpp_turbo(lua_State *L) {
|
||||
if (lua_gettop(L) >= 1) {
|
||||
setturbo(lua_toboolean(L, 1));
|
||||
return 0;
|
||||
} else {
|
||||
setturbo(true);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static int cpp_exit(lua_State *L) {
|
||||
exit();
|
||||
return 0;
|
||||
@@ -904,6 +914,8 @@ void push_lua_funcs() {
|
||||
lua_pushcfunction(L,cpp_setconf); lua_setglobal(L, "setconf");
|
||||
lua_pushcfunction(L,cpp_configfolder); lua_setglobal(L, "configfolder");
|
||||
|
||||
lua_pushcfunction(L,cpp_turbo); lua_setglobal(L, "turbo");
|
||||
|
||||
lua_pushcfunction(L,cpp_exit); lua_setglobal(L, "quit");
|
||||
|
||||
lua_pushinteger(L, 0); lua_setglobal(L, "KEY_UNKNOWN");
|
||||
|
||||
Reference in New Issue
Block a user