mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-25 09:30:03 +00:00
Return static function
This commit is contained in:
parent
0a1a7c1955
commit
db72d255b0
1 changed files with 13 additions and 9 deletions
|
@ -18,16 +18,20 @@ do
|
|||
local w
|
||||
local dt
|
||||
local systemsNames
|
||||
local system
|
||||
|
||||
local function run(system)
|
||||
local function profile()
|
||||
local name = systemsNames[system]
|
||||
|
||||
return function()
|
||||
debug.profilebegin(name)
|
||||
debug.setmemorycategory(name)
|
||||
system(w, dt)
|
||||
debug.profileend()
|
||||
end
|
||||
|
||||
local function run(sys)
|
||||
system = sys
|
||||
return profile
|
||||
end
|
||||
|
||||
local function loop(sinceLastFrame)
|
||||
|
@ -55,10 +59,10 @@ do
|
|||
.. debug.info(system, "n")
|
||||
.. " has been ejected"
|
||||
)
|
||||
continue
|
||||
end
|
||||
else
|
||||
LOOP_ERROR(why)
|
||||
end
|
||||
end
|
||||
|
||||
debug.profileend()
|
||||
debug.resetmemorycategory()
|
||||
|
|
Loading…
Reference in a new issue