Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch/haron startup fixes #191

Merged
merged 6 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions engine/lib/phx/script/ffi_ext/Engine.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
local libphx = require('libphx').lib

function onDef_Engine_t(t, mt)
mt.__index.getVersion = function(...)
return ffi.string(...)
end
end
16 changes: 11 additions & 5 deletions engine/lib/phx/script/ffi_gen/Engine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,17 @@ function Loader.defineType()
local t = ffi.typeof('Engine')
local mt = {
__index = {
window = libphx.Engine_Window,
input = libphx.Engine_Input,
hmGui = libphx.Engine_HmGui,
getTime = libphx.Engine_GetTime,
exit = libphx.Engine_Exit,
window = libphx.Engine_Window,
input = libphx.Engine_Input,
hmGui = libphx.Engine_HmGui,
free = libphx.Engine_Free,
abort = libphx.Engine_Abort,
getBits = libphx.Engine_GetBits,
getTime = libphx.Engine_GetTime,
getVersion = libphx.Engine_GetVersion,
exit = libphx.Engine_Exit,
terminate = libphx.Engine_Terminate,
update = libphx.Engine_Update,
},
}

Expand Down
4 changes: 2 additions & 2 deletions script/Main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ function InitSystem()
GlobalRestrict.On()

dofile('./script/Config/Version.lua')
if Config.gameVersion ~= "0.0.0" and Config.gameVersion ~= ffi.string(Engine.GetVersion()) then
Log.Error("Engine and script version mismatch. Engine: %s. Script: %s.", ffi.string(Engine.GetVersion()), Config.gameVersion)
if Config.gameVersion ~= "0.0.0" and Config.gameVersion ~= Engine.GetVersion() then
Log.Error("Engine and script version mismatch. Engine: %s. Script: %s.", Engine.GetVersion(), Config.gameVersion)
end

dofile('./script/Config/App.lua')
Expand Down