diff options
-rw-r--r-- | engines/engine.h | 9 | ||||
-rw-r--r-- | engines/saga/interface.cpp | 10 | ||||
-rw-r--r-- | engines/saga/music.cpp | 8 | ||||
-rw-r--r-- | engines/saga/puzzle.cpp | 26 | ||||
-rw-r--r-- | engines/saga/render.cpp | 4 | ||||
-rw-r--r-- | engines/scumm/imuse_digi/dimuse.cpp | 4 | ||||
-rw-r--r-- | engines/scumm/sound.cpp | 6 |
7 files changed, 33 insertions, 34 deletions
diff --git a/engines/engine.h b/engines/engine.h index e859cf090b..0a84a122da 100644 --- a/engines/engine.h +++ b/engines/engine.h @@ -71,9 +71,9 @@ class Engine { public: OSystem *_system; Audio::Mixer *_mixer; - Common::TimerManager * _timer; protected: + Common::TimerManager *_timer; Common::EventManager *_eventMan; Common::SaveFileManager *_saveFileMan; @@ -250,10 +250,9 @@ public: */ void openMainMenuDialog(); - - Common::TimerManager *getTimerManager() { return _timer; } - Common::EventManager *getEventManager() { return _eventMan; } - Common::SaveFileManager *getSaveFileManager() { return _saveFileMan; } + inline Common::TimerManager *getTimerManager() { return _timer; } + inline Common::EventManager *getEventManager() { return _eventMan; } + inline Common::SaveFileManager *getSaveFileManager() { return _saveFileMan; } public: diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp index 40d20e55a5..842cacd685 100644 --- a/engines/saga/interface.cpp +++ b/engines/saga/interface.cpp @@ -327,7 +327,7 @@ Interface::Interface(SagaEngine *vm) : _vm(vm) { _disableAbortSpeeches = false; // set save game reminder alarm - _vm->_timer->installTimerProc(&saveReminderCallback, TIMETOSAVE, this); + _vm->getTimerManager()->installTimerProc(&saveReminderCallback, TIMETOSAVE, this); } Interface::~Interface(void) { @@ -360,8 +360,8 @@ void Interface::updateSaveReminder() { if (_active && _panelMode == kPanelMain) { _saveReminderState = _saveReminderState % _vm->getDisplayInfo().saveReminderNumSprites + 1; drawStatusBar(); - _vm->_timer->removeTimerProc(&saveReminderCallback); - _vm->_timer->installTimerProc(&saveReminderCallback, ((_vm->getGameId() == GID_ITE) ? TIMETOBLINK_ITE : TIMETOBLINK_IHNM), this); + _vm->getTimerManager()->removeTimerProc(&saveReminderCallback); + _vm->getTimerManager()->installTimerProc(&saveReminderCallback, ((_vm->getGameId() == GID_ITE) ? TIMETOBLINK_ITE : TIMETOBLINK_IHNM), this); } } @@ -1393,8 +1393,8 @@ void Interface::setSave(PanelButton *panelButton) { fileName = _vm->calcSaveFileName(_vm->getSaveFile(_optionSaveFileTitleNumber)->slotNumber); _vm->save(fileName, _textInputString); } - _vm->_timer->removeTimerProc(&saveReminderCallback); - _vm->_timer->installTimerProc(&saveReminderCallback, TIMETOSAVE, this); + _vm->getTimerManager()->removeTimerProc(&saveReminderCallback); + _vm->getTimerManager()->installTimerProc(&saveReminderCallback, TIMETOSAVE, this); setSaveReminderState(1); _textInput = false; diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp index 3124deba57..167861e7f2 100644 --- a/engines/saga/music.cpp +++ b/engines/saga/music.cpp @@ -372,7 +372,7 @@ Music::Music(SagaEngine *vm, Audio::Mixer *mixer, MidiDriver *driver) : _vm(vm), } Music::~Music() { - _vm->_timer->removeTimerProc(&musicVolumeGaugeCallback); + _vm->getTimerManager()->removeTimerProc(&musicVolumeGaugeCallback); _mixer->stopHandle(_musicHandle); delete _player; xmidiParser->setMidiDriver(NULL); @@ -406,7 +406,7 @@ void Music::musicVolumeGauge() { _player->setVolume(volume); if (_currentVolumePercent == 100) { - _vm->_timer->removeTimerProc(&musicVolumeGaugeCallback); + _vm->getTimerManager()->removeTimerProc(&musicVolumeGaugeCallback); _currentVolume = _targetVolume; } } @@ -421,12 +421,12 @@ void Music::setVolume(int volume, int time) { if (time == 1) { _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, volume); _player->setVolume(volume); - _vm->_timer->removeTimerProc(&musicVolumeGaugeCallback); + _vm->getTimerManager()->removeTimerProc(&musicVolumeGaugeCallback); _currentVolume = volume; return; } - _vm->_timer->installTimerProc(&musicVolumeGaugeCallback, time * 100L, this); + _vm->getTimerManager()->installTimerProc(&musicVolumeGaugeCallback, time * 100L, this); } bool Music::isPlaying() { diff --git a/engines/saga/puzzle.cpp b/engines/saga/puzzle.cpp index 7ae0c66648..4107b4c8d9 100644 --- a/engines/saga/puzzle.cpp +++ b/engines/saga/puzzle.cpp @@ -143,7 +143,7 @@ void Puzzle::initPieceInfo(int i, int16 curX, int16 curY, byte offX, byte offY, void Puzzle::execute(void) { _active = true; - _vm->_timer->installTimerProc(&hintTimerCallback, kPuzzleHintTime, this); + _vm->getTimerManager()->installTimerProc(&hintTimerCallback, kPuzzleHintTime, this); initPieces(); @@ -158,7 +158,7 @@ void Puzzle::execute(void) { void Puzzle::exitPuzzle(void) { _active = false; - _vm->_timer->removeTimerProc(&hintTimerCallback); + _vm->getTimerManager()->removeTimerProc(&hintTimerCallback); _vm->_scene->changeScene(ITE_SCENE_LODGE, 0, kTransitionNoFade); _vm->_interface->setMode(kPanelMain); @@ -405,17 +405,17 @@ void Puzzle::solicitHint(void) { _vm->_actor->setSpeechColor(1, kITEColorBlack); - _vm->_timer->removeTimerProc(&hintTimerCallback); + _vm->getTimerManager()->removeTimerProc(&hintTimerCallback); switch (_hintRqState) { case kRQSpeaking: if (_vm->_actor->isSpeaking()) { - _vm->_timer->installTimerProc(&hintTimerCallback, 50000, this); + _vm->getTimerManager()->installTimerProc(&hintTimerCallback, 50000, this); break; } _hintRqState = _hintNextRqState; - _vm->_timer->installTimerProc(&hintTimerCallback, 333333, this); + _vm->getTimerManager()->installTimerProc(&hintTimerCallback, 333333, this); break; case kRQNoHint: @@ -438,11 +438,11 @@ void Puzzle::solicitHint(void) { // Roll to see if Sakka scolds if (_vm->_rnd.getRandomNumber(1)) { _hintRqState = kRQSakkaDenies; - _vm->_timer->installTimerProc(&hintTimerCallback, 200000, this); + _vm->getTimerManager()->installTimerProc(&hintTimerCallback, 200000, this); } else { _hintRqState = kRQSpeaking; _hintNextRqState = kRQHintRequested; - _vm->_timer->installTimerProc(&hintTimerCallback, 50000, this); + _vm->getTimerManager()->installTimerProc(&hintTimerCallback, 50000, this); } break; @@ -455,7 +455,7 @@ void Puzzle::solicitHint(void) { _hintRqState = kRQSpeaking; _hintNextRqState = kRQHintRequestedStage2; - _vm->_timer->installTimerProc(&hintTimerCallback, 50000, this); + _vm->getTimerManager()->installTimerProc(&hintTimerCallback, 50000, this); _vm->_interface->converseClear(); _vm->_interface->converseAddText(optionsStr[_lang][kROAccept], 0, 1, 0, 0 ); @@ -482,7 +482,7 @@ void Puzzle::solicitHint(void) { _vm->_interface->converseAddText(optionsStr[_lang][kROLater], 0, 0, 0, 0); _vm->_interface->converseDisplayText(); - _vm->_timer->installTimerProc(&hintTimerCallback, kPuzzleHintTime, this); + _vm->getTimerManager()->installTimerProc(&hintTimerCallback, kPuzzleHintTime, this); _hintRqState = kRQSkipEverything; break; @@ -505,8 +505,8 @@ void Puzzle::handleReply(int reply) { case 2: // Decline the hint _vm->_actor->abortSpeech(); _hintRqState = kRQNoHint; - _vm->_timer->removeTimerProc(&hintTimerCallback); - _vm->_timer->installTimerProc(&hintTimerCallback, kPuzzleHintTime * 2, this); + _vm->getTimerManager()->removeTimerProc(&hintTimerCallback); + _vm->getTimerManager()->installTimerProc(&hintTimerCallback, kPuzzleHintTime * 2, this); clearHint(); break; } @@ -568,8 +568,8 @@ void Puzzle::giveHint(void) { _vm->_interface->converseAddText(optionsStr[_lang][kROLater], 0, 0, 0, 0); _vm->_interface->converseDisplayText(); - _vm->_timer->removeTimerProc(&hintTimerCallback); - _vm->_timer->installTimerProc(&hintTimerCallback, kPuzzleHintTime, this); + _vm->getTimerManager()->removeTimerProc(&hintTimerCallback); + _vm->getTimerManager()->installTimerProc(&hintTimerCallback, kPuzzleHintTime, this); } void Puzzle::clearHint(void) { diff --git a/engines/saga/render.cpp b/engines/saga/render.cpp index 9c35c3bca4..688eed226e 100644 --- a/engines/saga/render.cpp +++ b/engines/saga/render.cpp @@ -52,7 +52,7 @@ Render::Render(SagaEngine *vm, OSystem *system) { #ifdef SAGA_DEBUG // Initialize FPS timer callback - _vm->_timer->installTimerProc(&fpsTimerCallback, 1000000, this); + _vm->getTimerManager()->installTimerProc(&fpsTimerCallback, 1000000, this); #endif _backGroundSurface.create(_vm->getDisplayInfo().width, _vm->getDisplayInfo().height, 1); @@ -64,7 +64,7 @@ Render::Render(SagaEngine *vm, OSystem *system) { Render::~Render(void) { #ifdef SAGA_DEBUG - _vm->_timer->removeTimerProc(&fpsTimerCallback); + _vm->getTimerManager()->removeTimerProc(&fpsTimerCallback); #endif _backGroundSurface.free(); diff --git a/engines/scumm/imuse_digi/dimuse.cpp b/engines/scumm/imuse_digi/dimuse.cpp index d3359fa33e..2d9ce251a4 100644 --- a/engines/scumm/imuse_digi/dimuse.cpp +++ b/engines/scumm/imuse_digi/dimuse.cpp @@ -60,14 +60,14 @@ IMuseDigital::IMuseDigital(ScummEngine_v7 *scumm, Audio::Mixer *mixer, int fps) memset(_track[l], 0, sizeof(Track)); _track[l]->trackId = l; } - _vm->_timer->installTimerProc(timer_handler, 1000000 / _callbackFps, this); + _vm->getTimerManager()->installTimerProc(timer_handler, 1000000 / _callbackFps, this); _audioNames = NULL; _numAudioNames = 0; } IMuseDigital::~IMuseDigital() { - _vm->_timer->removeTimerProc(timer_handler); + _vm->getTimerManager()->removeTimerProc(timer_handler); stopAllSounds(); for (int l = 0; l < MAX_DIGITAL_TRACKS + MAX_DIGITAL_FADETRACKS; l++) { delete _track[l]; diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp index 7500b16c87..2807b086d3 100644 --- a/engines/scumm/sound.cpp +++ b/engines/scumm/sound.cpp @@ -1054,12 +1054,12 @@ void Sound::startCDTimer() { // it too high, and there will be a nasty "hiccup" just as Chaos // appears. - _vm->_timer->removeTimerProc(&cd_timer_handler); - _vm->_timer->installTimerProc(&cd_timer_handler, 100700, _vm); + _vm->getTimerManager()->removeTimerProc(&cd_timer_handler); + _vm->getTimerManager()->installTimerProc(&cd_timer_handler, 100700, _vm); } void Sound::stopCDTimer() { - _vm->_timer->removeTimerProc(&cd_timer_handler); + _vm->getTimerManager()->removeTimerProc(&cd_timer_handler); } void Sound::playCDTrack(int track, int numLoops, int startFrame, int duration) { |