mirror of https://github.com/bjornbytes/lovr.git
boot.lua: Improve errors when loading modules fails;
Remove hardcoded list of modules as well.
This commit is contained in:
parent
ba60e99890
commit
5c3280ba2a
|
@ -88,11 +88,14 @@ function lovr.boot()
|
|||
lovr._setConf(conf)
|
||||
lovr.filesystem.setIdentity(conf.identity)
|
||||
|
||||
local modules = { 'audio', 'data', 'event', 'graphics', 'headset', 'math', 'physics', 'thread', 'timer' }
|
||||
for _, module in ipairs(modules) do
|
||||
for module in pairs(conf.modules) do
|
||||
if conf.modules[module] then
|
||||
local ok, result = pcall(require, 'lovr.' .. module)
|
||||
lovr[module] = ok and result
|
||||
if not ok then
|
||||
print(string.format('Warning: Could not load module %q: %s', module, result))
|
||||
else
|
||||
lovr[module] = result
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue