|
54 | 54 | --version check
|
55 | 55 | if love._version_major ~= 11 then error("You have an outdated version of Love2d! Get 11.4 and retry.") end
|
56 | 56 |
|
57 |
| -function preload(module, path) |
58 |
| - local full_path = module .. "/" .. path |
59 |
| - -- read from .love |
60 |
| - local data = love.filesystem.read("libs/" .. full_path) |
61 |
| - -- write to save directory |
62 |
| - love.filesystem.setIdentity("mari0_libs") |
63 |
| - if not love.filesystem.getInfo(module) then |
64 |
| - love.filesystem.createDirectory(module) |
65 |
| - end |
66 |
| - love.filesystem.write(full_path, data) |
67 |
| - -- preload module |
68 |
| - package.preload[module] = package.loadlib(love.filesystem.getSaveDirectory() .. "/" .. full_path, "luaopen_" .. module) |
69 |
| - love.filesystem.setIdentity("mari0") |
70 |
| -end |
71 |
| - |
72 |
| --- preload https module from bundled libs folder |
73 |
| --- to be removed in LÖVE 12.0 |
74 |
| -local system_os = love.system.getOS() |
75 |
| -if system_os == "Windows" and jit.arch == "x64" then |
76 |
| - preload("https", "win64.dll") |
77 |
| -elseif system_os == "Windows" and jit.arch == "x86" then |
78 |
| - preload("https", "win32.dll") |
79 |
| -elseif system_os == "Linux" then |
80 |
| - preload("https", "linux.so") |
81 |
| -elseif system_os == "OS X" then |
82 |
| - preload("https", "osx.so") |
83 |
| -end |
84 |
| - |
85 |
| -local https_status, https = pcall(require, "https") |
86 |
| -if not https_status then |
87 |
| - https = nil |
88 |
| -end |
| 57 | +require("utils") |
| 58 | +hardloadhttps() |
89 | 59 |
|
90 | 60 | local debugconsole = false --debug
|
91 | 61 | if debugconsole then debuginputon = true; debuginput = "print()"; print("DEBUG ON") end
|
|
0 commit comments