Skip to content
Snippets Groups Projects
Commit 4b6e2668 authored by dg's avatar dg
Browse files

bye bye lanes

git-svn-id: http://svn.net-core.org/repos/t-engine4@6580 51575b47-30f0-44d4-a5cc-537603b46e54
parent d375021c
No related branches found
No related tags found
No related merge requests found
......@@ -46,8 +46,6 @@ function _M:init(keyhandler)
self.__savefile_version_tokens = {}
self.__threads = {}
self:defaultMouseCursor()
end
......@@ -86,7 +84,6 @@ function _M:loaded()
self.mouse = engine.Mouse.new()
self.mouse:setCurrent()
self.__threads = self.__threads or {}
self.__coroutines = self.__coroutines or {}
self:setGamma(config.settings.gamma_correction / 100)
......@@ -553,32 +550,6 @@ function _M:cancelCoroutine(id)
end
end
--- Save a thread into the thread pool
-- Threads will be auto joined when the module exits or when it can
-- ALL THREADS registered *MUST* return true when they exit
function _M:registerThread(th, linda)
error("Threads unsuported yet")
print("[THREAD] registering", th, linda, #self.__threads+1)
self.__threads[#self.__threads+1] = {th=th, linda=linda}
return #self.__threads
end
--- Try to join all registered threads
-- @param timeout the time in seconds to wait for each thread
function _M:joinThreads(timeout)
for i = #self.__threads, 1, -1 do
error("Threads unsuported yet")
local th = self.__threads[i].th
print("[THREAD] Thread join", i, th)
local v, err = th:join(timeout)
if err then print("[THREAD] error", th) error(err) end
if v then
print("[THREAD] Thread result", i, th, "=>", v)
table.remove(self.__threads, i)
end
end
end
--- Take a screenshot of the game
-- @param for_savefile The screenshot will be used for savefile display
function _M:takeScreenshot(for_savefile)
......
......@@ -86,11 +86,6 @@ function _M:tick()
self.turn = self.turn + 1
self:onTurn()
-- Try to join threads if any, every hundred turns
if self.turn % 100 == 0 then
self:joinThreads(0)
end
end
--- Run tick on a level
......
......@@ -1873,9 +1873,6 @@ function util.showMainMenu(no_reboot, reboot_engine, reboot_engine_version, rebo
profile:saveGenericProfile("modules_played", {name=game.__mod_info.short_name, time_played={"inc", os.time() - game.__session_time_played_start}})
end
-- Join threads
if game and type(game) == "table" then game:joinThreads(30) end
if no_reboot then
local Module = require("engine.Module")
local ms = Module:listModules(true)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment