ALL: Synced with ScummVM - rev 0b777c23a9
This commit is contained in:
parent
b557bb7f60
commit
aea3bae26d
81 changed files with 2024 additions and 1418 deletions
|
@ -29,7 +29,12 @@
|
|||
|
||||
#include "common/textconsole.h"
|
||||
|
||||
static volatile bool timerInstalled = false;
|
||||
|
||||
static Uint32 timer_handler(Uint32 interval, void *param) {
|
||||
if (!timerInstalled)
|
||||
return interval;
|
||||
|
||||
((DefaultTimerManager *)param)->handler();
|
||||
return interval;
|
||||
}
|
||||
|
@ -40,11 +45,14 @@ SdlTimerManager::SdlTimerManager() {
|
|||
error("Could not initialize SDL: %s", SDL_GetError());
|
||||
}
|
||||
|
||||
timerInstalled = true;
|
||||
|
||||
// Creates the timer callback
|
||||
_timerID = SDL_AddTimer(10, &timer_handler, this);
|
||||
}
|
||||
|
||||
SdlTimerManager::~SdlTimerManager() {
|
||||
timerInstalled = false;
|
||||
// Removes the timer callback
|
||||
SDL_RemoveTimer(_timerID);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue