Skip to content

Commit

Permalink
add this back
Browse files Browse the repository at this point in the history
  • Loading branch information
GuglioIsStupid committed Nov 25, 2024
1 parent 0387b09 commit 7968e60
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions src/Engine/PrebuiltDLL/init.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
--[[ local path = ... .. "."
local path = ... .. "."
-- replace all . with /
path = string.gsub(path, "%.", "/")
local os = love.system.getOS()
Expand All @@ -13,8 +13,8 @@ if os == "Windows" then
-- copy all files in ./Win64 to DLL/
local files = love.filesystem.getDirectoryItems(path .. "Win64")
for _, file in ipairs(files) do
if not love.filesystem.getInfo(file) then
love.filesystem.write(file, love.filesystem.read(path .. "Win64/" .. file))
if not love.filesystem.getInfo("DLL/" .. file) then
love.filesystem.write("DLL/" .. file, love.filesystem.read(path .. "Win64/" .. file))
end
end
else
Expand All @@ -25,8 +25,8 @@ elseif os == "OS X" then
-- copy all files in ./Mac64 to DLL/
local files = love.filesystem.getDirectoryItems(path .. "Mac64")
for _, file in ipairs(files) do
if not love.filesystem.getInfo(file) then
love.filesystem.write(file, love.filesystem.read(path .. "Mac64/" .. file))
if not love.filesystem.getInfo("DLL/" .. file) then
love.filesystem.write("DLL/" .. file, love.filesystem.read(path .. "Mac64/" .. file))
end
end
else
Expand All @@ -37,21 +37,34 @@ elseif os == "Linux" then
-- copy all files in ./Linux64 to DLL/
local files = love.filesystem.getDirectoryItems(path .. "Linux64")
for _, file in ipairs(files) do
if not love.filesystem.getInfo(file) then
love.filesystem.write(file, love.filesystem.read(path .. "Linux64/" .. file))
if not love.filesystem.getInfo("DLL/" .. file) then
love.filesystem.write("DLL/" .. file, love.filesystem.read(path .. "Linux64/" .. file))
end
end
else
debug.warn("UNSUPPORTED ARCHITECTURE! " .. arch)
end
else
debug.warn("UNSUPPORTED OS! " .. os)
end ]]
end

local savepath = love.filesystem.getSaveDirectory()
if os == "Windows" then
package.cpath = package.cpath .. ";" .. savepath .. "/DLL/?.dll"
elseif os == "OS X" then
package.cpath = package.cpath .. ";" .. savepath .. "/DLL/?.dylib"
elseif os == "Linux" then
package.cpath = package.cpath .. ";" .. savepath .. "/DLL/?.so"
end
--package.cpath = package.cpath .. ";" .. savepath .. "/DLL/?.dll"

tryExcept(function()
DLL_Video = require("video")
end)

tryExcept(function()
if os ~= "Windows" then
return
end
DLL_Https = require("https")
end)

0 comments on commit 7968e60

Please sign in to comment.