diff options
| author | Cameron Cawley | 2019-11-27 22:29:38 +0000 |
|---|---|---|
| committer | Filippos Karapetis | 2019-12-10 08:35:13 +0200 |
| commit | 099ef8db300fc776539694c766dcb58a4a948952 (patch) | |
| tree | e48def42571181f7488bb539da3dfd5e312e2b12 /backends/timer/psp/timer.h | |
| parent | 9dcfe2c09ece2248986af4547e878a07d8ba950f (diff) | |
| download | scummvm-rg350-099ef8db300fc776539694c766dcb58a4a948952.tar.gz scummvm-rg350-099ef8db300fc776539694c766dcb58a4a948952.tar.bz2 scummvm-rg350-099ef8db300fc776539694c766dcb58a4a948952.zip | |
PSP: Make the PspTimer class a subclass of DefaultTimerManager
Diffstat (limited to 'backends/timer/psp/timer.h')
| -rw-r--r-- | backends/timer/psp/timer.h | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/backends/timer/psp/timer.h b/backends/timer/psp/timer.h index 45b32e0e14..a7871009c4 100644 --- a/backends/timer/psp/timer.h +++ b/backends/timer/psp/timer.h @@ -23,19 +23,16 @@ #ifndef PSP_TIMER_H #define PSP_TIMER_H -class PspTimer { +#include "backends/timer/default/default-timer.h" + +class PspTimerManager : public DefaultTimerManager { public: - typedef void (* CallbackFunc)(void); - PspTimer() : _callback(0), _interval(0), _threadId(-1), _init(false) {} - void stop() { _init = false; } - bool start(); - ~PspTimer() { stop(); } - void setCallback(CallbackFunc cb) { _callback = cb; } - void setIntervalMs(uint32 interval) { _interval = interval * 1000; } + PspTimerManager(uint32 interval = 10); + ~PspTimerManager() { _init = false; } + static int thread(SceSize, void *__this); // static thread to use as bridge void timerThread(); private: - CallbackFunc _callback; // pointer to timer callback uint32 _interval; int _threadId; bool _init; |
