From e514d9780afa2703c6293c782e1f50712ad764fa Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Sat, 21 Feb 2009 15:40:14 +0000 Subject: use OSystem::getMillis() for last_wait_time and get rid of game_start_time svn-id: r38701 --- engines/sci/engine/kgraphics.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'engines/sci/engine/kgraphics.cpp') diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 55ecad6529..ef90bc3231 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -23,6 +23,8 @@ * */ +#include "common/system.h" + #include "sci/include/sciresource.h" #include "sci/include/engine.h" #include "sci/include/gfx_widgets.h" @@ -645,14 +647,12 @@ reg_t kTextSize(EngineState *s, int funct_nr, int argc, reg_t *argv) { int debug_sleeptime_factor = 1; reg_t kWait(EngineState *s, int funct_nr, int argc, reg_t *argv) { - GTimeVal time; + uint32 time; int sleep_time = UKPV(0); - sci_get_current_time(&time); - - s->r_acc = make_reg(0, ((time.tv_usec - s->last_wait_time.tv_usec) * 60 / 1000000) + (time.tv_sec - s->last_wait_time.tv_sec) * 60); - - memcpy(&(s->last_wait_time), &time, sizeof(GTimeVal)); + time = g_system->getMillis(); + s->r_acc = make_reg(0, ((time - s->last_wait_time) / 1000) * 60); + s->last_wait_time = time; // Reset optimization flags: Game is playing along nicely anyway s->kernel_opt_flags &= ~(KERNEL_OPT_FLAG_GOT_EVENT | KERNEL_OPT_FLAG_GOT_2NDEVENT); -- cgit v1.2.3