aboutsummaryrefslogtreecommitdiff
path: root/backends/timer
diff options
context:
space:
mode:
authorAlejandro Marzini2010-07-03 00:13:45 +0000
committerAlejandro Marzini2010-07-03 00:13:45 +0000
commitfda9416cc8b64fa7371b7a9989def9cc318efc7e (patch)
tree2cdb4c6714e0cb8bbcd6ea03c5b467b6ade50e4b /backends/timer
parentf9c3a4547cbf1b1942402d618fa403a7fb1cb656 (diff)
downloadscummvm-rg350-fda9416cc8b64fa7371b7a9989def9cc318efc7e.tar.gz
scummvm-rg350-fda9416cc8b64fa7371b7a9989def9cc318efc7e.tar.bz2
scummvm-rg350-fda9416cc8b64fa7371b7a9989def9cc318efc7e.zip
Cleanup and documentation.
svn-id: r50609
Diffstat (limited to 'backends/timer')
-rw-r--r--backends/timer/default/default-timer.h3
-rw-r--r--backends/timer/sdl/sdl-timer.cpp3
-rw-r--r--backends/timer/sdl/sdl-timer.h6
3 files changed, 10 insertions, 2 deletions
diff --git a/backends/timer/default/default-timer.h b/backends/timer/default/default-timer.h
index e7ac3d122f..778c69b32d 100644
--- a/backends/timer/default/default-timer.h
+++ b/backends/timer/default/default-timer.h
@@ -40,7 +40,8 @@ private:
public:
DefaultTimerManager();
- ~DefaultTimerManager();
+ virtual ~DefaultTimerManager();
+
bool installTimerProc(TimerProc proc, int32 interval, void *refCon);
void removeTimerProc(TimerProc proc);
diff --git a/backends/timer/sdl/sdl-timer.cpp b/backends/timer/sdl/sdl-timer.cpp
index 0fbe12589e..94932d61ba 100644
--- a/backends/timer/sdl/sdl-timer.cpp
+++ b/backends/timer/sdl/sdl-timer.cpp
@@ -34,14 +34,17 @@ static Uint32 timer_handler(Uint32 interval, void *param) {
}
SdlTimerManager::SdlTimerManager() {
+ // Initializes the SDL timer subsystem
if (SDL_InitSubSystem(SDL_INIT_TIMER) == -1) {
error("Could not initialize SDL: %s", SDL_GetError());
}
+ // Creates the timer callback
_timerID = SDL_AddTimer(10, &timer_handler, this);
}
SdlTimerManager::~SdlTimerManager() {
+ // Removes the timer callback
SDL_RemoveTimer(_timerID);
}
diff --git a/backends/timer/sdl/sdl-timer.h b/backends/timer/sdl/sdl-timer.h
index 19629151ca..5995aed4b0 100644
--- a/backends/timer/sdl/sdl-timer.h
+++ b/backends/timer/sdl/sdl-timer.h
@@ -34,10 +34,14 @@
#include <SDL.h>
#endif
+/**
+ * SDL timer manager. Setups the timer callback for
+ * DefaultTimerManager.
+ */
class SdlTimerManager : public DefaultTimerManager {
public:
SdlTimerManager();
- ~SdlTimerManager();
+ virtual ~SdlTimerManager();
protected:
SDL_TimerID _timerID;