poke1024 / tove2d

Animated vector graphics for LÖVE.
Other
171 stars 8 forks source link

Tove loading on windows 10 #35

Open deb75 opened 3 years ago

deb75 commented 3 years ago

Hello,

I successfully installed tove in one of my love2d project.

Usually, I put all third party libraries into myproject/lib/ext.

However, this does not work because it seems the path to dll is hardcoded in init.lua at line 586

libPath = love.filesystem.getSource() .. "/tove/" .. libName[love.system.getOS()]

Would it be possible to change this behavior ? As an example, it should be possible to grab the directory in which is located init.lua and use it to replace love.filesystem.getSource() .. "/tove/ ? That said, I do not know how to do that.

Regards

poke1024 commented 3 years ago

I need to think about this and currently I have no time to work on this. Thanks for the use case though, this seems a sensible requirement to configure this path.

deb75 commented 3 years ago

Thanks for your answeer.

Anyway, the fix is easy, I just replaced /tove/ by /lib/ext/tove.

A way to configure this path would be to pass it when invoking require "tove" as this statement begins to load the init.lua in the tove directory where ever this one is in the package.path

I have just tested, if you call the module like this :

local tove = require "lib.ext.tove"

then, put this in the init.lua :

local path = ...

then path variable contains lib.ext.tove which can be expanded as /lib/ext/tove

I can test it and make a pull request if you wish