diff options
author | Max Horn | 2003-05-29 22:34:35 +0000 |
---|---|---|
committer | Max Horn | 2003-05-29 22:34:35 +0000 |
commit | e08d4f072e0939e97b3e6b7e1b2dd7cbaf51d939 (patch) | |
tree | 7cfaf7553bc2f0bb3a7f0ac092cf85a287288879 /common/timer.cpp | |
parent | 54b8fd8ce1488c82a8e123586dfce9000e3ba6c7 (diff) | |
download | scummvm-rg350-e08d4f072e0939e97b3e6b7e1b2dd7cbaf51d939.tar.gz scummvm-rg350-e08d4f072e0939e97b3e6b7e1b2dd7cbaf51d939.tar.bz2 scummvm-rg350-e08d4f072e0939e97b3e6b7e1b2dd7cbaf51d939.zip |
more OSystem docs & cleanup
svn-id: r8118
Diffstat (limited to 'common/timer.cpp')
-rw-r--r-- | common/timer.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/common/timer.cpp b/common/timer.cpp index b2b3cbf1bf..906f621c91 100644 --- a/common/timer.cpp +++ b/common/timer.cpp @@ -24,26 +24,28 @@ #include "scummsys.h" #include "timer.h" -static Engine * eng; +static Timer *g_timer = NULL; Timer::Timer(Engine * engine) { memset(this,0,sizeof(Timer)); //palmos _initialized = false; _timerRunning = false; - eng = _engine = engine; + _engine = engine; + g_timer = this; } Timer::~Timer() { release(); } -static int timer_handler (int t) { - eng->_timer->handler(&t); - return t; +int Timer::timer_handler(int t) { + if (g_timer) + return g_timer->handler(t); + return 0; } -int Timer::handler(int * t) { +int Timer::handler(int t) { uint32 interval, l; if (_timerRunning) { @@ -62,16 +64,16 @@ int Timer::handler(int * t) { } } - return *t; + return t; } bool Timer::init() { int32 l; if (_engine->_system == NULL) { - printf("Timer: OSystem not initialized !\n"); - return false; -} + warning("Timer: OSystem not initialized!"); + return false; + } if (_initialized == true) return true; @@ -112,7 +114,7 @@ bool Timer::installProcedure (TimerProc procedure, int32 interval) { bool found = false; if (_initialized == false) { - printf ("Timer: is not initialized !"); + warning("Timer: is not initialized!"); return false; } @@ -129,7 +131,7 @@ bool Timer::installProcedure (TimerProc procedure, int32 interval) { _timerRunning = true; if (!found) { - printf ("Can't find free slot !"); + warning("Can't find free slot!"); return false; } @@ -140,7 +142,7 @@ void Timer::releaseProcedure (TimerProc procedure) { int32 l; if (_initialized == false) { - printf ("Timer: is not initialized !"); + warning("Timer: is not initialized!"); return; } |