rework on graphics.cpp, implement some GFX with lua

This commit is contained in:
Eduardo Bart
2011-08-14 14:45:25 -03:00
parent 2abe962aa9
commit afc197f2dc
28 changed files with 250 additions and 128 deletions

View File

@@ -14,6 +14,7 @@ Module
require 'util'
require 'widget'
require 'messagebox'
require 'dispatcher'
rootWidget = getRootWidget()
return true

View File

@@ -0,0 +1,28 @@
local eventId = 1
local events = { }
local orig = { scheduleEvent = scheduleEvent,
addEvent = addEvent }
-- fix original scheduleEvent
function scheduleEvent(func, delay)
eventId = eventId + 1
local id = eventId + 1
local function proxyFunc()
func()
table[id] = nil
end
table[id] = proxyFunc
orig.scheduleEvent(proxyFunc, delay)
end
-- fix original addEvent
function addEvent(func)
eventId = eventId + 1
local id = eventId + 1
local function proxyFunc()
func()
table[id] = nil
end
table[id] = proxyFunc
orig.addEvent(proxyFunc)
end