Skip to content

Commit

Permalink
More robust building of tove ffi lib path
Browse files Browse the repository at this point in the history
We now always look under „game-source/tove/tove.lib“

Should fix #21
  • Loading branch information
poke1024 committed Aug 16, 2019
1 parent dab29f7 commit eeed4a7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lua/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

--!! include "license.lua"

local basepath = (...) .. "/"
local ffi = require 'ffi'

ffi.cdef [[
Expand All @@ -30,7 +29,11 @@ tove.init = function(path)
["Linux"] = "libTove.so"
}

local lib = ffi.load(basepath .. libName[love.system.getOS()])
-- we expect tove2d's lib to live inside a folder called "tove" in the game's main
-- source folder. should fix https://github.com/poke1024/tove2d/issues/21

libPath = love.filesystem.getSource() .. "/tove/" .. libName[love.system.getOS()]
local lib = ffi.load(libPath)
tove.lib = lib
tove.getVersion = function()
return ffi.string(lib.GetVersion())
Expand Down

0 comments on commit eeed4a7

Please sign in to comment.