- [NEW] sys.debug() returns true if we are on a debug version of mini. false otherwise.
This commit is contained in:
10
lua.cpp
10
lua.cpp
@@ -788,6 +788,15 @@ extern "C" {
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int cpp_sys_debug(lua_State *L) {
|
||||
#ifdef DEBUG
|
||||
lua_pushboolean(L, true);
|
||||
#else
|
||||
lua_pushboolean(L, false);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int cpp_sys_clipboard(lua_State *L) {
|
||||
if (lua_gettop(L) == 0) {
|
||||
lua_pushstring(L, SDL_GetClipboardText());
|
||||
@@ -1081,6 +1090,7 @@ void push_lua_funcs() {
|
||||
lua_pushcfunction(L,cpp_sys_dir); lua_setfield(L, -2, "dir");
|
||||
lua_pushcfunction(L,cpp_sys_exit); lua_setfield(L, -2, "quit");
|
||||
lua_pushcfunction(L,cpp_sys_fps); lua_setfield(L, -2, "fps");
|
||||
lua_pushcfunction(L,cpp_sys_debug); lua_setfield(L, -2, "debug");
|
||||
lua_pushcfunction(L,cpp_sys_clipboard); lua_setfield(L, -2, "clipboard");
|
||||
|
||||
lua_pushinteger(L, 0); lua_setfield(L, -2, "UPDATE_ALWAYS");
|
||||
|
||||
Reference in New Issue
Block a user