From 262a663355ae6e5902eeb3dad5aaa8608657727f Mon Sep 17 00:00:00 2001 From: TSnake41 Date: Thu, 4 Nov 2021 20:48:32 +0100 Subject: [PATCH] raylua v4.0a --- Saphirefile.lua | 27 +++++++++++++++++++-------- raylib | 2 +- src/raylua.lua | 2 +- tools/api.h | 1 - 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/Saphirefile.lua b/Saphirefile.lua index 08ec00d..ce74ff8 100644 --- a/Saphirefile.lua +++ b/Saphirefile.lua @@ -25,26 +25,29 @@ local ar = os.getenv "AR" or "ar" local windres = os.getenv "WINDRES" or "windres" -- TODO: Use current lua interpreter -local lua = os.getenv "LUA" or "luajit\\src\\luajit" +local lua = os.getenv "LUA" local needs_luajit_built = not (os.getenv "LUA") local cflags = os.getenv "CFLAGS" or "-O2 -s" local ldflags = os.getenv "LDFLAGS" or "-O2 -s -lm" local modules = "raymath rlgl easings gestures physac raygui" -local graphics = os.getenv "GRAPHICS" or "GRAPHICS_API_OPENGL_33" +local graphics = os.getenv "GRAPHICS" or "GRAPHICS_API_OPENGL_43" -cflags = cflags .. " -Iluajit/src -Iraygui/src -Iraylib/src" -ldflags = ldflags .. " luajit/src/libluajit.a raylib/src/libraylib.a luajit/src/libluajit.a" +cflags = cflags .. " -Iluajit/src -Iraygui/src -Iraylib/src".. " -D" .. graphics -cflags = cflags .. " -D" .. graphics - -local exe_ldflags = "" +local raylua_so_path = "raylua.so" -- assume unix-like by default +local so_ldflags = ldflags if los.type() == "linux" then ldflags = ldflags .. " -ldl -pthread" + so_ldflags = ldflags .. " -llua5.1" + lua = lua or "luajit/src/luajit" elseif los.type() == "win32" then ldflags = ldflags .. " -lopengl32 -lgdi32 -lwinmm -static " + so_ldflags = ldflags .. " -llua5.1.dll" + raylua_so_path = "raylua.dll" + lua = lua or "luajit\\src\\luajit" end local libluajit @@ -143,4 +146,12 @@ local raylua_e = c.link("raylua_e", false, "raylua_e", cc -) \ No newline at end of file +) + +local raylua_so = c.link(raylua_so_path, + saphire.merge(raylua_obj, { libraylib }), + so_ldflags, + true, + raylua_so_path, + cc +) diff --git a/raylib b/raylib index 99f6707..0851960 160000 --- a/raylib +++ b/raylib @@ -1 +1 @@ -Subproject commit 99f6707e2c80be2ac4c169fd6986ff2fd8d181a7 +Subproject commit 0851960397f02a477d80eda2239f90fae14dec64 diff --git a/src/raylua.lua b/src/raylua.lua index 0ce10a7..9ab9694 100644 --- a/src/raylua.lua +++ b/src/raylua.lua @@ -16,7 +16,7 @@ local load = loadstring -raylua.version = "v4.0-dev" +raylua.version = "v4.0a" function raylua.repl() print("> raylua " .. raylua.version .. " <") diff --git a/tools/api.h b/tools/api.h index a18b002..ea9470c 100644 --- a/tools/api.h +++ b/tools/api.h @@ -130,7 +130,6 @@ void SetExitKey(int key) int GetKeyPressed(void) int GetCharPressed(void) bool IsGamepadAvailable(int gamepad) -bool IsGamepadName(int gamepad, const char *name) const char *GetGamepadName(int gamepad) bool IsGamepadButtonPressed(int gamepad, int button) bool IsGamepadButtonDown(int gamepad, int button)