diff options
author | Max Horn | 2003-09-27 16:54:11 +0000 |
---|---|---|
committer | Max Horn | 2003-09-27 16:54:11 +0000 |
commit | 49d2a22b428864ccf2298b67841d4cb3cf33b659 (patch) | |
tree | 11f1ebd799bec7e853bc71671fa045fe9467774c /common | |
parent | e19e7c879a1fc88458a3e26715875e60512d755b (diff) | |
download | scummvm-rg350-49d2a22b428864ccf2298b67841d4cb3cf33b659.tar.gz scummvm-rg350-49d2a22b428864ccf2298b67841d4cb3cf33b659.tar.bz2 scummvm-rg350-49d2a22b428864ccf2298b67841d4cb3cf33b659.zip |
OSystem changes: removed create_thread() method (not needed anymore; 'pure' threads aren't very portable anyway, better we only use timers); introduced OSystem::TimerProc type
svn-id: r10430
Diffstat (limited to 'common')
-rw-r--r-- | common/system.h | 23 | ||||
-rw-r--r-- | common/timer.cpp | 2 |
2 files changed, 8 insertions, 17 deletions
diff --git a/common/system.h b/common/system.h index e59bbe4632..4da287e980 100644 --- a/common/system.h +++ b/common/system.h @@ -33,15 +33,14 @@ * and use it to interact with the system. * * In particular, a backend provides a video surface for ScummVM to draw in; - * methods to create threads and timers, to handle user input events, + * methods to create timers, to handle user input events, * control audio CD playback, and sound output. */ class OSystem { public: typedef struct Mutex *MutexRef; - typedef int ThreadProc(void *param); - typedef void SoundProc(void *param, byte *buf, int len); - //typedef int TimerProc(int interval); + typedef void (*SoundProc)(void *param, byte *buf, int len); + typedef int (*TimerProc)(int interval); /** * The types of events backends can generate. @@ -213,7 +212,7 @@ public: - /** @name Events and Threads */ + /** @name Events and Time */ //@{ /** Get the number of milliseconds since the program was started. */ @@ -222,16 +221,8 @@ public: /** Delay/sleep for the specified amount of milliseconds. */ virtual void delay_msecs(uint msecs) = 0; - /** - * Create a thread with the given entry procedure. - * @param proc the thread main procedure - * @param param an arbitrary parameter which is stored and passed to proc - * @return - */ - virtual void create_thread(ThreadProc *proc, void *param) = 0; - - /** Add a new callback timer. */ - virtual void set_timer(int timer, int (*callback)(int)) = 0; + /** Set the timer callback. */ + virtual void set_timer(TimerProc callback, int interval) = 0; /** * Get the next event in the event queue. @@ -253,7 +244,7 @@ public: * @param param an arbitrary parameter which is stored and passed to proc. * @param format the sample type format. */ - virtual bool set_sound_proc(SoundProc *proc, void *param, SoundFormat format) = 0; + virtual bool set_sound_proc(SoundProc proc, void *param, SoundFormat format) = 0; /** * Remove any audio callback previously set via set_sound_proc, thus effectively diff --git a/common/timer.cpp b/common/timer.cpp index 243eba2872..e8d6e24c4e 100644 --- a/common/timer.cpp +++ b/common/timer.cpp @@ -46,7 +46,7 @@ Timer::Timer(OSystem *system) : _thisTime = _system->get_msecs(); // Set the timer last, after everything has been initialised - _system->set_timer(10, &timer_handler); + _system->set_timer(&timer_handler, 10); } |