dofile("config/default.lua") 	   --game config init
require( "loader" )

LoadFont("Font.fif", "default")
LoadFont("font-dialogue.fif", "small")

NewGlobalThread = NewThread

threads = {}
thread_id = 1

function NewThread( thread )
	local nid = thread_id
	local ret = NewGlobalThread( function(...) thread(unpack(arg)) threads[nid] = nil end, true )
	threads[nid] = ret
	thread_id = thread_id+1
	return ret
end

function StopThreads()
	for key,value in pairs(threads) do
		if value then
			StopThread( value )
		end
	end
	threads = {}
end

CONFIG.window_width = 600;
CONFIG.window_height = 800;
CONFIG.scr_width = 600;
CONFIG.scr_height = 800;
CONFIG.backcolor_r = 0
CONFIG.backcolor_g = 0
CONFIG.backcolor_b = 0
LoadConfig()

Loader.start( "menu" )


