timer update

This commit is contained in:
p.kosyh 2010-01-21 08:17:05 +00:00
parent b2a5cf808e
commit a731ee538c
2 changed files with 9 additions and 6 deletions

View file

@ -2173,7 +2173,7 @@ int game_loop(void)
while ((rc = input(&ev, 1)) == AGAIN);
if (rc == -1) {/* close */
break;
} else if (curgame_dir && (ev.type == KEY_DOWN || ev.type == KEY_UP)
} else if (curgame_dir && (ev.type == KEY_DOWN || ev.type == KEY_UP)
&& !game_input((ev.type == KEY_DOWN), ev.sym)) {
; /* all is done in game_input */
} else if (((ev.type == KEY_DOWN) || (ev.type == KEY_UP)) &&

View file

@ -6,11 +6,14 @@ stead = {
io = io,
call_top = 0,
cctx = { txt = nil, self = nil },
timer = function(s)
return false
timer = function()
if type(timer) == 'table' and type(timer.callback) == 'function' then
return timer:callback();
end
return
end,
input = function(s)
return false
input = function(pressed, event)
return
end,
}
@ -1816,7 +1819,7 @@ function delete(v)
allocator:delete(v);
end
timer = obj {
timer = obj { -- timer calls stead.timer callback
nam = 'timer',
ini = function(s)
if s._timer ~= nil and s._timer ~= 0 then