From 2c711138d76caf02b67d94f2584792e2e3b718c8 Mon Sep 17 00:00:00 2001 From: George Sokianos Date: Wed, 22 Dec 2021 19:10:33 +0000 Subject: [PATCH] Removed the AMIGAOS4 global variable and now I am using the PLATFORM one to determine the running platform --- data/core/keymap.lua | 6 ++++-- src/main.c | 6 ++---- 2 files changed, 6 insertions(+), 6 deletions(-) mode change 100755 => 100644 data/core/keymap.lua diff --git a/data/core/keymap.lua b/data/core/keymap.lua old mode 100755 new mode 100644 index 5e09775e..2e1372fb --- a/data/core/keymap.lua +++ b/data/core/keymap.lua @@ -6,8 +6,10 @@ keymap.map = {} keymap.reverse_map = {} local macos = rawget(_G, "MACOS_RESOURCES") -local os4 = rawget(_G, "AMIGAOS4") - +local os4 = false +if PLATFORM == "AmigaOS 4" then + os4 = true +end -- Thanks to mathewmariani, taken from his lite-macos github repository. local modkeys_os = require("core.modkeys-" .. (macos and "macos" or os4 and "os4" or "generic")) local modkey_map = modkeys_os.map diff --git a/src/main.c b/src/main.c index 8489ba52..3594a711 100644 --- a/src/main.c +++ b/src/main.c @@ -168,10 +168,6 @@ init_lua: enable_momentum_scroll(); #endif -#ifdef __amigaos4__ - lua_setglobal(L, "AMIGAOS4"); -#endif - const char *init_lite_code = \ "local core\n" "xpcall(function()\n" @@ -210,11 +206,13 @@ init_lua: lua_pcall(L, 0, 1, 0); if (lua_toboolean(L, -1)) { lua_close(L); + rencache_invalidate(); goto init_lua; } lua_close(L); ren_free_window_resources(); + SDL_Quit(); return EXIT_SUCCESS; }