Skip to content

Commit

Permalink
Import Lua functions from binaries; Linux support
Browse files Browse the repository at this point in the history
  • Loading branch information
tederis committed Oct 22, 2023
1 parent 5678da5 commit 3c9c19a
Show file tree
Hide file tree
Showing 19 changed files with 1,292 additions and 1,413 deletions.
14 changes: 6 additions & 8 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ workspace "mta-navigation"

language "C++"
staticruntime "off"
characterset "MBCS"

defines {
"_CRT_SECURE_NO_WARNINGS",
Expand All @@ -32,6 +33,7 @@ workspace "mta-navigation"
filter "system:linux"
cppdialect "C++2a"
links "pthread"
defaultplatform "x64"
filter "system:windows"
cppdialect "C++20"
largeaddressaware "on"
Expand Down Expand Up @@ -135,14 +137,9 @@ workspace "mta-navigation"
defines "EXPORT_NATIVE_API"

filter { "options:navapi=lua" }
links "module-sdk"
includedirs "vendor/lua"
defines "EXPORT_LUA_API"

filter {"system:windows", "platforms:x86", "options:navapi=lua" }
links "vendor/lua/lib/lua5.1.lib"
filter {"system:windows", "platforms:x64", "options:navapi=lua" }
links "vendor/lua/lib/lua5.1_64.lib"
links { "module-sdk", "Lua" }
includedirs "vendor/lua/src"
defines "EXPORT_LUA_API"

filter "configurations:Debug"
defines { "DEBUG" }
Expand All @@ -158,6 +155,7 @@ workspace "mta-navigation"
include "vendor/pugixml"

if _OPTIONS["navapi"] == "lua" then
include "vendor/lua"
include "vendor/module-sdk"
end

7 changes: 6 additions & 1 deletion source/module/Module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ MTAEXPORT bool InitModule(ILuaModuleManager10* pManager, char* szModuleName, cha
strncpy(szAuthor, MODULE_AUTHOR, MAX_INFO_LENGTH);
(*fVersion) = MODULE_VERSION;

Navigation::GetInstance().Initialize();
VluaL_init();

Navigation::GetInstance().Initialize();

return true;
}
Expand Down Expand Up @@ -49,6 +51,9 @@ MTAEXPORT bool DoPulse(void)
MTAEXPORT bool ShutdownModule(void)
{
Navigation::GetInstance().Shutdown();

VluaL_close();

return true;
}

Expand Down
6 changes: 0 additions & 6 deletions vendor/lua/LICENSE.txt

This file was deleted.

173 changes: 0 additions & 173 deletions vendor/lua/lauxlib.h

This file was deleted.

Binary file removed vendor/lua/lib/lua5.1.lib
Binary file not shown.
Binary file removed vendor/lua/lib/lua5.1_64.lib
Binary file not shown.
Loading

0 comments on commit 3c9c19a

Please sign in to comment.