mirror of https://github.com/bjornbytes/lovr.git
Minor boot.lua refactors;
This commit is contained in:
parent
703e9d3c36
commit
a1309cfe87
|
@ -1,8 +1,6 @@
|
|||
lovr = require 'lovr'
|
||||
local lovr = lovr
|
||||
|
||||
-- Note: Cannot be overloaded
|
||||
function lovr.boot()
|
||||
local conf = {
|
||||
version = '0.17.0',
|
||||
identity = 'default',
|
||||
|
@ -52,6 +50,7 @@ function lovr.boot()
|
|||
}
|
||||
}
|
||||
|
||||
function lovr.boot()
|
||||
lovr.filesystem = require('lovr.filesystem')
|
||||
local main = arg[0] and arg[0]:match('[^\\/]-%.lua$') or 'main.lua'
|
||||
local hasConf, hasMain = lovr.filesystem.isFile('conf.lua'), lovr.filesystem.isFile(main)
|
||||
|
@ -233,7 +232,7 @@ function lovr.log(message, level, tag)
|
|||
print(message)
|
||||
end
|
||||
|
||||
return function()
|
||||
return coroutine.create(function()
|
||||
local errored = false
|
||||
|
||||
local function onerror(...)
|
||||
|
@ -266,4 +265,4 @@ return function()
|
|||
|
||||
coroutine.yield()
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
|
|
@ -111,10 +111,7 @@ int main(int argc, char** argv) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
lua_State* T = lua_newthread(L);
|
||||
lua_pushvalue(L, -2);
|
||||
lua_xmove(L, T, 1);
|
||||
|
||||
lua_State* T = lua_tothread(L, -1);
|
||||
lovrSetErrorCallback(luax_vthrow, T);
|
||||
lovrSetLogCallback(luax_vlog, T);
|
||||
|
||||
|
|
Loading…
Reference in New Issue