diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cine/cine.cpp | 6 | ||||
-rw-r--r-- | engines/cine/cine.h | 10 | ||||
-rw-r--r-- | engines/cruise/cruise.cpp | 6 | ||||
-rw-r--r-- | engines/cruise/cruise.h | 10 | ||||
-rw-r--r-- | engines/drascula/drascula.cpp | 84 | ||||
-rw-r--r-- | engines/drascula/drascula.h | 10 | ||||
-rw-r--r-- | engines/gob/gob.cpp | 10 | ||||
-rw-r--r-- | engines/gob/gob.h | 10 | ||||
-rw-r--r-- | engines/igor/igor.cpp | 12 | ||||
-rw-r--r-- | engines/igor/igor.h | 11 | ||||
-rw-r--r-- | engines/m4/m4.cpp | 14 | ||||
-rw-r--r-- | engines/m4/m4.h | 10 | ||||
-rw-r--r-- | engines/made/made.cpp | 12 | ||||
-rw-r--r-- | engines/made/made.h | 10 | ||||
-rw-r--r-- | engines/queen/queen.cpp | 55 | ||||
-rw-r--r-- | engines/queen/queen.h | 10 | ||||
-rw-r--r-- | engines/saga/saga.cpp | 6 | ||||
-rw-r--r-- | engines/saga/saga.h | 10 | ||||
-rw-r--r-- | engines/sci/sci.cpp | 7 | ||||
-rw-r--r-- | engines/sci/sci.h | 14 | ||||
-rw-r--r-- | engines/sword2/sword2.cpp | 6 | ||||
-rw-r--r-- | engines/sword2/sword2.h | 10 | ||||
-rw-r--r-- | engines/tinsel/tinsel.cpp | 44 | ||||
-rw-r--r-- | engines/tinsel/tinsel.h | 10 | ||||
-rw-r--r-- | engines/touche/touche.cpp | 5 | ||||
-rw-r--r-- | engines/touche/touche.h | 10 | ||||
-rw-r--r-- | engines/tucker/tucker.cpp | 11 | ||||
-rw-r--r-- | engines/tucker/tucker.h | 10 |
28 files changed, 128 insertions, 295 deletions
diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp index 21e83b8b8a..fde1fb6621 100644 --- a/engines/cine/cine.cpp +++ b/engines/cine/cine.cpp @@ -74,7 +74,7 @@ CineEngine::~CineEngine() { Common::clearAllDebugChannels(); } -Common::Error CineEngine::init() { +Common::Error CineEngine::run() { // Initialize backend initGraphics(320, 200, false); @@ -88,10 +88,6 @@ Common::Error CineEngine::init() { initialize(); - return Common::kNoError; -} - -Common::Error CineEngine::go() { CursorMan.showMouse(true); mainLoop(1); diff --git a/engines/cine/cine.h b/engines/cine/cine.h index 4800604791..bf56e9189b 100644 --- a/engines/cine/cine.h +++ b/engines/cine/cine.h @@ -71,15 +71,7 @@ class CineEngine : public Engine { protected: // Engine APIs - Common::Error init(); - Common::Error go(); - virtual Common::Error run() { - Common::Error err; - err = init(); - if (err != Common::kNoError) - return err; - return go(); - } + virtual Common::Error run(); virtual bool hasFeature(EngineFeature f) const; void shutdown(); diff --git a/engines/cruise/cruise.cpp b/engines/cruise/cruise.cpp index 187ec2bda1..28cf97ff70 100644 --- a/engines/cruise/cruise.cpp +++ b/engines/cruise/cruise.cpp @@ -71,7 +71,7 @@ CruiseEngine::~CruiseEngine() { freeSystem(); } -Common::Error CruiseEngine::init() { +Common::Error CruiseEngine::run() { // Initialize backend initGraphics(320, 200, false); @@ -80,10 +80,6 @@ Common::Error CruiseEngine::init() { initialize(); - return Common::kNoError; -} - -Common::Error CruiseEngine::go() { Cruise::changeCursor(Cruise::CURSOR_NORMAL); CursorMan.showMouse(true); diff --git a/engines/cruise/cruise.h b/engines/cruise/cruise.h index 1d43fb4139..13b6a8018f 100644 --- a/engines/cruise/cruise.h +++ b/engines/cruise/cruise.h @@ -61,15 +61,7 @@ private: protected: // Engine APIs - Common::Error init(); - Common::Error go(); - virtual Common::Error run() { - Common::Error err; - err = init(); - if (err != Common::kNoError) - return err; - return go(); - } + virtual Common::Error run(); void shutdown(); diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index 2016860f87..e40b8d53f6 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -54,9 +54,42 @@ static const GameSettings drasculaSettings[] = { DrasculaEngine::DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) { - // Setup mixer - _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume")); - _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume")); + _charMap = 0; + _itemLocations = 0; + _polX = 0; + _polY = 0; + _verbBarX = 0; + _x1d_menu = 0; + _y1d_menu = 0; + _frameX = 0; + _candleX = 0; + _candleY = 0; + _pianistX = 0; + _drunkX = 0; + _roomPreUpdates = 0; + _roomUpdates = 0; + _roomActions = 0; + _text = 0; + _textd = 0; + _textb = 0; + _textbj = 0; + _texte = 0; + _texti = 0; + _textl = 0; + _textp = 0; + _textt = 0; + _textvb = 0; + _textsys = 0; + _texthis = 0; + _textverbs = 0; + _textmisc = 0; + _textd1 = 0; + + _color = 0; + blinking = 0; + leftMouseButton = 0; + rightMouseButton = 0; + *textName = 0; _rnd = new Common::RandomSource(); syst->getEventManager()->registerRandomSource(*_rnd, "drascula"); @@ -106,7 +139,7 @@ DrasculaEngine::~DrasculaEngine() { freeTexts(_textd1); } -Common::Error DrasculaEngine::init() { +Common::Error DrasculaEngine::run() { // Initialize backend initGraphics(320, 200, false); @@ -131,53 +164,16 @@ Common::Error DrasculaEngine::init() { _lang = kEnglish; } - _charMap = 0; - _itemLocations = 0; - _polX = 0; - _polY = 0; - _verbBarX = 0; - _x1d_menu = 0; - _y1d_menu = 0; - _frameX = 0; - _candleX = 0; - _candleY = 0; - _pianistX = 0; - _drunkX = 0; - _roomPreUpdates = 0; - _roomUpdates = 0; - _roomActions = 0; - _text = 0; - _textd = 0; - _textb = 0; - _textbj = 0; - _texte = 0; - _texti = 0; - _textl = 0; - _textp = 0; - _textt = 0; - _textvb = 0; - _textsys = 0; - _texthis = 0; - _textverbs = 0; - _textmisc = 0; - _textd1 = 0; - - _color = 0; - blinking = 0; - leftMouseButton = 0; - rightMouseButton = 0; - *textName = 0; - if (!loadDrasculaDat()) return Common::kUnknownError; setupRoomsTable(); loadArchives(); - return Common::kNoError; -} + // Setup mixer + _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume")); + _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume")); -Common::Error DrasculaEngine::go() { currentChapter = 1; // values from 1 to 6 will start each part of game loadedDifferentChapter = 0; diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h index 1cc8a50e15..4ef54d136d 100644 --- a/engines/drascula/drascula.h +++ b/engines/drascula/drascula.h @@ -276,15 +276,7 @@ static const int interf_y[] ={ 51, 51, 51, 51, 83, 83, 83 }; class DrasculaEngine : public ::Engine { protected: // Engine APIs - Common::Error init(); - Common::Error go(); - virtual Common::Error run() { - Common::Error err; - err = init(); - if (err != Common::kNoError) - return err; - return go(); - } + virtual Common::Error run(); public: DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gameDesc); diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp index dc11d29f55..51b7d30fbe 100644 --- a/engines/gob/gob.cpp +++ b/engines/gob/gob.cpp @@ -110,12 +110,6 @@ GobEngine::~GobEngine() { delete[] _startTot0; } -Common::Error GobEngine::go() { - _init->initGame(0); - - return Common::kNoError; -} - const char *GobEngine::getLangDesc(int16 language) const { if ((language < 0) || (language > 10)) language = 2; @@ -177,7 +171,7 @@ bool GobEngine::hasAdlib() const { return (_features & kFeaturesAdlib) != 0; } -Common::Error GobEngine::init() { +Common::Error GobEngine::run() { if (!initGameParts()) { GUIErrorMessage("GobEngine::init(): Unknown version of game engine"); return Common::kUnknownError; @@ -255,6 +249,8 @@ Common::Error GobEngine::init() { } _global->_languageWanted = _global->_language; + _init->initGame(0); + return Common::kNoError; } diff --git a/engines/gob/gob.h b/engines/gob/gob.h index 9a00e8b8fe..6500c7f2a7 100644 --- a/engines/gob/gob.h +++ b/engines/gob/gob.h @@ -191,15 +191,7 @@ private: uint32 _pauseStart; // Engine APIs - Common::Error init(); - Common::Error go(); - virtual Common::Error run() { - Common::Error err; - err = init(); - if (err != Common::kNoError) - return err; - return go(); - } + virtual Common::Error run(); virtual bool hasFeature(EngineFeature f) const; virtual void pauseEngineIntern(bool pause); diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp index 8144cc670b..0581f6ddc3 100644 --- a/engines/igor/igor.cpp +++ b/engines/igor/igor.cpp @@ -88,13 +88,6 @@ IgorEngine::~IgorEngine() { delete _midiPlayer; } -Common::Error IgorEngine::init() { - initGraphics(320, 200, false); - - _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume")); - return Common::kNoError; -} - void IgorEngine::restart() { _screenVGAVOffset = 0; @@ -166,7 +159,10 @@ void IgorEngine::restart() { _gameTicks = 0; } -Common::Error IgorEngine::go() { +Common::Error IgorEngine::run() { + initGraphics(320, 200, false); + _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume")); + restart(); setupDefaultPalette(); _currentPart = ConfMan.getInt("boot_param"); diff --git a/engines/igor/igor.h b/engines/igor/igor.h index 41123634fe..6d2c464efb 100644 --- a/engines/igor/igor.h +++ b/engines/igor/igor.h @@ -312,15 +312,8 @@ public: IgorEngine(OSystem *system, const DetectedGameVersion *dgv); virtual ~IgorEngine(); - Common::Error init(); - Common::Error go(); - virtual Common::Error run() { - Common::Error err; - err = init(); - if (err != Common::kNoError) - return err; - return go(); - } + // Engine APIs + virtual Common::Error run(); void handleOptionsMenu_paintSave(); bool handleOptionsMenu_handleKeyDownSave(int key); diff --git a/engines/m4/m4.cpp b/engines/m4/m4.cpp index 0c1256bce4..37f6599037 100644 --- a/engines/m4/m4.cpp +++ b/engines/m4/m4.cpp @@ -141,7 +141,7 @@ M4Engine::~M4Engine() { delete _resourceManager; } -Common::Error M4Engine::init() { +Common::Error M4Engine::run() { // Initialize backend if (isM4()) initGraphics(640, 480, true); @@ -194,7 +194,10 @@ Common::Error M4Engine::init() { _random = new Common::RandomSource(); g_system->getEventManager()->registerRandomSource(*_random, "m4"); - return Common::kNoError; + if (isM4()) + return goM4(); + else + return goMADS(); } void M4Engine::eventHandler() { @@ -269,13 +272,6 @@ void M4Engine::loadMenu(MenuType menuType, bool loadSaveFromHotkey, bool calledF _viewManager->moveToFront(view); } -Common::Error M4Engine::go() { - if (isM4()) - return goM4(); - else - return goMADS(); -} - Common::Error M4Engine::goMADS() { _palette->setMadsSystemPalette(); diff --git a/engines/m4/m4.h b/engines/m4/m4.h index acf6b5a93b..7378dbf755 100644 --- a/engines/m4/m4.h +++ b/engines/m4/m4.h @@ -112,15 +112,7 @@ private: protected: // Engine APIs - Common::Error init(); - Common::Error go(); - virtual Common::Error run() { - Common::Error err; - err = init(); - if (err != Common::kNoError) - return err; - return go(); - } + virtual Common::Error run(); void shutdown(); diff --git a/engines/made/made.cpp b/engines/made/made.cpp index 892e8b1638..10e8c5d7e9 100644 --- a/engines/made/made.cpp +++ b/engines/made/made.cpp @@ -135,13 +135,6 @@ MadeEngine::~MadeEngine() { delete _music; } -Common::Error MadeEngine::init() { - // Initialize backend - initGraphics(320, 200, false); - - return Common::kNoError; -} - void MadeEngine::syncSoundSettings() { _music->setVolume(ConfMan.getInt("music_volume")); _mixer->setVolumeForSoundType(Audio::Mixer::kPlainSoundType, ConfMan.getInt("sfx_volume")); @@ -247,7 +240,10 @@ void MadeEngine::handleEvents() { } -Common::Error MadeEngine::go() { +Common::Error MadeEngine::run() { + + // Initialize backend + initGraphics(320, 200, false); resetAllTimers(); diff --git a/engines/made/made.h b/engines/made/made.h index e8ea30e0c6..be369053cb 100644 --- a/engines/made/made.h +++ b/engines/made/made.h @@ -80,15 +80,7 @@ class MadeEngine : public ::Engine { protected: // Engine APIs - Common::Error init(); - Common::Error go(); - virtual Common::Error run() { - Common::Error err; - err = init(); - if (err != Common::kNoError) - return err; - return go(); - } + virtual Common::Error run(); public: MadeEngine(OSystem *syst, const MadeGameDescription *gameDesc); diff --git a/engines/queen/queen.cpp b/engines/queen/queen.cpp index b8523a9a53..802a432546 100644 --- a/engines/queen/queen.cpp +++ b/engines/queen/queen.cpp @@ -444,35 +444,7 @@ GUI::Debugger *QueenEngine::getDebugger() { return _debugger; } -Common::Error QueenEngine::go() { - _logic->start(); - if (ConfMan.hasKey("save_slot") && canLoadOrSave()) { - loadGameState(ConfMan.getInt("save_slot")); - } - _lastSaveTime = _lastUpdateTime = _system->getMillis(); - - while (!shouldQuit()) { - if (_logic->newRoom() > 0) { - _logic->update(); - _logic->oldRoom(_logic->currentRoom()); - _logic->currentRoom(_logic->newRoom()); - _logic->changeRoom(); - _display->fullscreen(false); - if (_logic->currentRoom() == _logic->newRoom()) { - _logic->newRoom(0); - } - } else if (_logic->joeWalk() == JWM_EXECUTE) { - _logic->joeWalk(JWM_NORMAL); - _command->executeCurrentAction(); - } else { - _logic->joeWalk(JWM_NORMAL); - update(true); - } - } - return Common::kNoError; -} - -Common::Error QueenEngine::init() { +Common::Error QueenEngine::run() { initGraphics(GAME_SCREEN_WIDTH, GAME_SCREEN_HEIGHT, false); _resource = new Resource(); @@ -501,6 +473,31 @@ Common::Error QueenEngine::init() { registerDefaultSettings(); readOptionSettings(); + _logic->start(); + if (ConfMan.hasKey("save_slot") && canLoadOrSave()) { + loadGameState(ConfMan.getInt("save_slot")); + } + _lastSaveTime = _lastUpdateTime = _system->getMillis(); + + while (!shouldQuit()) { + if (_logic->newRoom() > 0) { + _logic->update(); + _logic->oldRoom(_logic->currentRoom()); + _logic->currentRoom(_logic->newRoom()); + _logic->changeRoom(); + _display->fullscreen(false); + if (_logic->currentRoom() == _logic->newRoom()) { + _logic->newRoom(0); + } + } else if (_logic->joeWalk() == JWM_EXECUTE) { + _logic->joeWalk(JWM_NORMAL); + _command->executeCurrentAction(); + } else { + _logic->joeWalk(JWM_NORMAL); + update(true); + } + } + return Common::kNoError; } diff --git a/engines/queen/queen.h b/engines/queen/queen.h index 4bde519ea8..a3457b2e2f 100644 --- a/engines/queen/queen.h +++ b/engines/queen/queen.h @@ -129,15 +129,7 @@ public: protected: // Engine APIs - Common::Error init(); - Common::Error go(); - virtual Common::Error run() { - Common::Error err; - err = init(); - if (err != Common::kNoError) - return err; - return go(); - } + virtual Common::Error run(); virtual GUI::Debugger *getDebugger(); virtual bool hasFeature(EngineFeature f) const; virtual void syncSoundSettings(); diff --git a/engines/saga/saga.cpp b/engines/saga/saga.cpp index 772620e710..1fede4b662 100644 --- a/engines/saga/saga.cpp +++ b/engines/saga/saga.cpp @@ -147,7 +147,7 @@ SagaEngine::~SagaEngine() { delete _resource; } -Common::Error SagaEngine::init() { +Common::Error SagaEngine::run() { // Assign default values to the config manager, in case settings are missing ConfMan.registerDefault("talkspeed", "255"); ConfMan.registerDefault("subtitles", "true"); @@ -279,10 +279,6 @@ Common::Error SagaEngine::init() { _system->setFeatureState(OSystem::kFeatureAutoComputeDirtyRects, true); #endif - return Common::kNoError; -} - -Common::Error SagaEngine::go() { int msec = 0; _previousTicks = _system->getMillis(); diff --git a/engines/saga/saga.h b/engines/saga/saga.h index 1e3a17bacf..dca5c38698 100644 --- a/engines/saga/saga.h +++ b/engines/saga/saga.h @@ -443,15 +443,7 @@ class SagaEngine : public Engine { public: // Engine APIs - Common::Error init(); - Common::Error go(); - virtual Common::Error run() { - Common::Error err; - err = init(); - if (err != Common::kNoError) - return err; - return go(); - } + virtual Common::Error run(); bool hasFeature(EngineFeature f) const; void syncSoundSettings(); void pauseEngineIntern(bool pause); diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index ff3c8c4e79..487e3378de 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -170,7 +170,7 @@ SciEngine::~SciEngine() { delete _console; } -Common::Error SciEngine::init() { +Common::Error SciEngine::run() { initGraphics(320, 200, false); // Create debugger console. It requires GFX to be initialized @@ -178,11 +178,6 @@ Common::Error SciEngine::init() { // Additional setup. printf("SciEngine::init\n"); - return Common::kNoError; -} - -Common::Error SciEngine::go() { - // Your main even loop should be (invoked from) here. /* bool end = false; Common::EventManager *em = _system->getEventManager(); diff --git a/engines/sci/sci.h b/engines/sci/sci.h index 0f10df0c16..480ec66ee8 100644 --- a/engines/sci/sci.h +++ b/engines/sci/sci.h @@ -76,17 +76,9 @@ public: SciEngine(OSystem *syst, const SciGameDescription *desc); ~SciEngine(); - Common::Error init(); - Common::Error go(); - virtual Common::Error run() { - Common::Error err; - err = init(); - if (err != Common::kNoError) - return err; - return go(); - } - - GUI::Debugger *getDebugger() { return _console; } + // Engine APIs + virtual Common::Error run(); + virtual GUI::Debugger *getDebugger() { return _console; } const char* getGameID() const; int getResourceVersion() const; diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp index 71a949fe88..349646ff21 100644 --- a/engines/sword2/sword2.cpp +++ b/engines/sword2/sword2.cpp @@ -361,7 +361,7 @@ void Sword2Engine::setupPersistentResources() { _resman->openResource(CUR_PLAYER_ID); } -Common::Error Sword2Engine::init() { +Common::Error Sword2Engine::run() { // Get some falling RAM and put it in your pocket, never let it slip // away @@ -445,10 +445,6 @@ Common::Error Sword2Engine::init() { _screen->initialiseRenderCycle(); - return Common::kNoError; -} - -Common::Error Sword2Engine::go() { while (1) { if (_debugger->isAttached()) _debugger->onFrame(); diff --git a/engines/sword2/sword2.h b/engines/sword2/sword2.h index 946dc3df53..db1c075951 100644 --- a/engines/sword2/sword2.h +++ b/engines/sword2/sword2.h @@ -124,15 +124,7 @@ private: protected: // Engine APIs - Common::Error init(); - Common::Error go(); - virtual Common::Error run() { - Common::Error err; - err = init(); - if (err != Common::kNoError) - return err; - return go(); - } + virtual Common::Error run(); virtual GUI::Debugger *getDebugger(); virtual bool hasFeature(EngineFeature f) const; virtual void syncSoundSettings(); diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp index b5a745cf81..80c71a70c5 100644 --- a/engines/tinsel/tinsel.cpp +++ b/engines/tinsel/tinsel.cpp @@ -916,7 +916,24 @@ TinselEngine::~TinselEngine() { delete _scheduler; } -Common::Error TinselEngine::init() { +void TinselEngine::syncSoundSettings() { + // Sync the engine with the config manager + int soundVolumeMusic = ConfMan.getInt("music_volume"); + int soundVolumeSFX = ConfMan.getInt("sfx_volume"); + int soundVolumeSpeech = ConfMan.getInt("speech_volume"); + + _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, soundVolumeMusic); + _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, soundVolumeSFX); + _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, soundVolumeSpeech); +} + +Common::String TinselEngine::getSavegameFilename(int16 saveNum) const { + char filename[256]; + snprintf(filename, 256, "%s.%03d", getTargetName().c_str(), saveNum); + return filename; +} + +Common::Error TinselEngine::run() { // Initialize backend if (getGameID() == GID_DW2) { #ifndef DW2_EXACT_SIZE @@ -971,29 +988,6 @@ Common::Error TinselEngine::init() { // Actors, globals and inventory icons LoadBasicChunks(); - return Common::kNoError; -} - -void TinselEngine::syncSoundSettings() { - // Sync the engine with the config manager - int soundVolumeMusic = ConfMan.getInt("music_volume"); - int soundVolumeSFX = ConfMan.getInt("sfx_volume"); - int soundVolumeSpeech = ConfMan.getInt("speech_volume"); - - _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, soundVolumeMusic); - _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, soundVolumeSFX); - _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, soundVolumeSpeech); -} - -Common::String TinselEngine::getSavegameFilename(int16 saveNum) const { - char filename[256]; - snprintf(filename, 256, "%s.%03d", getTargetName().c_str(), saveNum); - return filename; -} - -Common::Error TinselEngine::go() { - uint32 timerVal = 0; - // Continuous game processes CreateConstProcesses(); @@ -1013,7 +1007,7 @@ Common::Error TinselEngine::go() { } // Foreground loop - + uint32 timerVal = 0; while (!shouldQuit()) { assert(_console); if (_console->isAttached()) diff --git a/engines/tinsel/tinsel.h b/engines/tinsel/tinsel.h index 571f068455..d95b43564c 100644 --- a/engines/tinsel/tinsel.h +++ b/engines/tinsel/tinsel.h @@ -141,15 +141,7 @@ class TinselEngine : public Engine { protected: // Engine APIs - Common::Error init(); - Common::Error go(); - virtual Common::Error run() { - Common::Error err; - err = init(); - if (err != Common::kNoError) - return err; - return go(); - } + virtual Common::Error run(); virtual bool hasFeature(EngineFeature f) const; Common::Error loadGameState(int slot); #if 0 diff --git a/engines/touche/touche.cpp b/engines/touche/touche.cpp index cdb9bf1fed..5d79e0fb9a 100644 --- a/engines/touche/touche.cpp +++ b/engines/touche/touche.cpp @@ -81,7 +81,7 @@ ToucheEngine::~ToucheEngine() { delete _midiPlayer; } -Common::Error ToucheEngine::init() { +Common::Error ToucheEngine::run() { initGraphics(kScreenWidth, kScreenHeight, true); Graphics::setupFont(_language); @@ -93,10 +93,7 @@ Common::Error ToucheEngine::init() { _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume")); _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume")); _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume")); - return Common::kNoError; -} -Common::Error ToucheEngine::go() { res_openDataFile(); res_allocateTables(); res_loadSpriteImage(18, _menuKitData); diff --git a/engines/touche/touche.h b/engines/touche/touche.h index eb42000872..3e85dde58d 100644 --- a/engines/touche/touche.h +++ b/engines/touche/touche.h @@ -370,15 +370,7 @@ public: virtual ~ToucheEngine(); // Engine APIs - Common::Error init(); - Common::Error go(); - virtual Common::Error run() { - Common::Error err; - err = init(); - if (err != Common::kNoError) - return err; - return go(); - } + virtual Common::Error run(); virtual bool hasFeature(EngineFeature f) const; virtual void syncSoundSettings(); diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp index fbde4a5ca8..420b988976 100644 --- a/engines/tucker/tucker.cpp +++ b/engines/tucker/tucker.cpp @@ -41,12 +41,6 @@ TuckerEngine::TuckerEngine(OSystem *system, Common::Language language, uint32 fl TuckerEngine::~TuckerEngine() { } -Common::Error TuckerEngine::init() { - initGraphics(kScreenWidth, kScreenHeight, false); - syncSoundSettings(); - return Common::kNoError; -} - bool TuckerEngine::hasFeature(EngineFeature f) const { switch (f) { case kSupportsRTL: @@ -58,7 +52,10 @@ bool TuckerEngine::hasFeature(EngineFeature f) const { } } -Common::Error TuckerEngine::go() { +Common::Error TuckerEngine::run() { + initGraphics(kScreenWidth, kScreenHeight, false); + syncSoundSettings(); + handleIntroSequence(); if ((_gameFlags & kGameFlagIntroOnly) == 0 && !shouldQuit()) { mainLoop(); diff --git a/engines/tucker/tucker.h b/engines/tucker/tucker.h index b330b21532..8784eba12e 100644 --- a/engines/tucker/tucker.h +++ b/engines/tucker/tucker.h @@ -240,15 +240,7 @@ public: TuckerEngine(OSystem *system, Common::Language language, uint32 flags); virtual ~TuckerEngine(); - Common::Error init(); - Common::Error go(); - virtual Common::Error run() { - Common::Error err; - err = init(); - if (err != Common::kNoError) - return err; - return go(); - } + virtual Common::Error run(); virtual bool hasFeature(EngineFeature f) const; virtual void syncSoundSettings(); |