[Scummvm-cvs-logs] SF.net SVN: scummvm:[39003] scummvm/trunk/engines

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Mar 1 05:42:46 CET 2009


Revision: 39003
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39003&view=rev
Author:   fingolfin
Date:     2009-03-01 04:42:46 +0000 (Sun, 01 Mar 2009)

Log Message:
-----------
Engines: Fused several init&go methods into a single run method

Modified Paths:
--------------
    scummvm/trunk/engines/cine/cine.cpp
    scummvm/trunk/engines/cine/cine.h
    scummvm/trunk/engines/cruise/cruise.cpp
    scummvm/trunk/engines/cruise/cruise.h
    scummvm/trunk/engines/drascula/drascula.cpp
    scummvm/trunk/engines/drascula/drascula.h
    scummvm/trunk/engines/gob/gob.cpp
    scummvm/trunk/engines/gob/gob.h
    scummvm/trunk/engines/igor/igor.cpp
    scummvm/trunk/engines/igor/igor.h
    scummvm/trunk/engines/m4/m4.cpp
    scummvm/trunk/engines/m4/m4.h
    scummvm/trunk/engines/made/made.cpp
    scummvm/trunk/engines/made/made.h
    scummvm/trunk/engines/queen/queen.cpp
    scummvm/trunk/engines/queen/queen.h
    scummvm/trunk/engines/saga/saga.cpp
    scummvm/trunk/engines/saga/saga.h
    scummvm/trunk/engines/sci/sci.cpp
    scummvm/trunk/engines/sci/sci.h
    scummvm/trunk/engines/sword2/sword2.cpp
    scummvm/trunk/engines/sword2/sword2.h
    scummvm/trunk/engines/tinsel/tinsel.cpp
    scummvm/trunk/engines/tinsel/tinsel.h
    scummvm/trunk/engines/touche/touche.cpp
    scummvm/trunk/engines/touche/touche.h
    scummvm/trunk/engines/tucker/tucker.cpp
    scummvm/trunk/engines/tucker/tucker.h

Modified: scummvm/trunk/engines/cine/cine.cpp
===================================================================
--- scummvm/trunk/engines/cine/cine.cpp	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/cine/cine.cpp	2009-03-01 04:42:46 UTC (rev 39003)
@@ -74,7 +74,7 @@
 	Common::clearAllDebugChannels();
 }
 
-Common::Error CineEngine::init() {
+Common::Error CineEngine::run() {
 	// Initialize backend
 	initGraphics(320, 200, false);
 
@@ -88,10 +88,6 @@
 
 	initialize();
 
-	return Common::kNoError;
-}
-
-Common::Error CineEngine::go() {
 	CursorMan.showMouse(true);
 	mainLoop(1);
 

Modified: scummvm/trunk/engines/cine/cine.h
===================================================================
--- scummvm/trunk/engines/cine/cine.h	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/cine/cine.h	2009-03-01 04:42:46 UTC (rev 39003)
@@ -71,15 +71,7 @@
 
 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();

Modified: scummvm/trunk/engines/cruise/cruise.cpp
===================================================================
--- scummvm/trunk/engines/cruise/cruise.cpp	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/cruise/cruise.cpp	2009-03-01 04:42:46 UTC (rev 39003)
@@ -71,7 +71,7 @@
 	freeSystem();
 }
 
-Common::Error CruiseEngine::init() {
+Common::Error CruiseEngine::run() {
 	// Initialize backend
 	initGraphics(320, 200, false);
 
@@ -80,10 +80,6 @@
 
 	initialize();
 
-	return Common::kNoError;
-}
-
-Common::Error CruiseEngine::go() {
 	Cruise::changeCursor(Cruise::CURSOR_NORMAL);
 	CursorMan.showMouse(true);
 

Modified: scummvm/trunk/engines/cruise/cruise.h
===================================================================
--- scummvm/trunk/engines/cruise/cruise.h	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/cruise/cruise.h	2009-03-01 04:42:46 UTC (rev 39003)
@@ -61,15 +61,7 @@
 
 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();
 

Modified: scummvm/trunk/engines/drascula/drascula.cpp
===================================================================
--- scummvm/trunk/engines/drascula/drascula.cpp	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/drascula/drascula.cpp	2009-03-01 04:42:46 UTC (rev 39003)
@@ -54,10 +54,43 @@
 
 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 @@
 	freeTexts(_textd1);
 }
 
-Common::Error DrasculaEngine::init() {
+Common::Error DrasculaEngine::run() {
 	// Initialize backend
 	initGraphics(320, 200, false);
 
@@ -131,53 +164,16 @@
 		_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;
 

Modified: scummvm/trunk/engines/drascula/drascula.h
===================================================================
--- scummvm/trunk/engines/drascula/drascula.h	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/drascula/drascula.h	2009-03-01 04:42:46 UTC (rev 39003)
@@ -276,15 +276,7 @@
 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);

Modified: scummvm/trunk/engines/gob/gob.cpp
===================================================================
--- scummvm/trunk/engines/gob/gob.cpp	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/gob/gob.cpp	2009-03-01 04:42:46 UTC (rev 39003)
@@ -110,12 +110,6 @@
 	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 @@
 	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 @@
 	}
 	_global->_languageWanted = _global->_language;
 
+	_init->initGame(0);
+
 	return Common::kNoError;
 }
 

Modified: scummvm/trunk/engines/gob/gob.h
===================================================================
--- scummvm/trunk/engines/gob/gob.h	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/gob/gob.h	2009-03-01 04:42:46 UTC (rev 39003)
@@ -191,15 +191,7 @@
 	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);
 

Modified: scummvm/trunk/engines/igor/igor.cpp
===================================================================
--- scummvm/trunk/engines/igor/igor.cpp	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/igor/igor.cpp	2009-03-01 04:42:46 UTC (rev 39003)
@@ -88,13 +88,6 @@
 	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 @@
 	_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");

Modified: scummvm/trunk/engines/igor/igor.h
===================================================================
--- scummvm/trunk/engines/igor/igor.h	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/igor/igor.h	2009-03-01 04:42:46 UTC (rev 39003)
@@ -312,15 +312,8 @@
 	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);

Modified: scummvm/trunk/engines/m4/m4.cpp
===================================================================
--- scummvm/trunk/engines/m4/m4.cpp	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/m4/m4.cpp	2009-03-01 04:42:46 UTC (rev 39003)
@@ -141,7 +141,7 @@
 	delete _resourceManager;
 }
 
-Common::Error M4Engine::init() {
+Common::Error M4Engine::run() {
 	// Initialize backend
 	if (isM4())
 		initGraphics(640, 480, true);
@@ -194,7 +194,10 @@
 	_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 @@
 	_viewManager->moveToFront(view);
 }
 
-Common::Error M4Engine::go() {
-	if (isM4())
-		return goM4();
-	else
-		return goMADS();
-}
-
 Common::Error M4Engine::goMADS() {
 	_palette->setMadsSystemPalette();
 

Modified: scummvm/trunk/engines/m4/m4.h
===================================================================
--- scummvm/trunk/engines/m4/m4.h	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/m4/m4.h	2009-03-01 04:42:46 UTC (rev 39003)
@@ -112,15 +112,7 @@
 
 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();
 

Modified: scummvm/trunk/engines/made/made.cpp
===================================================================
--- scummvm/trunk/engines/made/made.cpp	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/made/made.cpp	2009-03-01 04:42:46 UTC (rev 39003)
@@ -135,13 +135,6 @@
 	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,8 +240,11 @@
 
 }
 
-Common::Error MadeEngine::go() {
+Common::Error MadeEngine::run() {
 
+	// Initialize backend
+	initGraphics(320, 200, false);
+
 	resetAllTimers();
 
 	if (getGameID() == GID_RTZ) {

Modified: scummvm/trunk/engines/made/made.h
===================================================================
--- scummvm/trunk/engines/made/made.h	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/made/made.h	2009-03-01 04:42:46 UTC (rev 39003)
@@ -80,15 +80,7 @@
 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);

Modified: scummvm/trunk/engines/queen/queen.cpp
===================================================================
--- scummvm/trunk/engines/queen/queen.cpp	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/queen/queen.cpp	2009-03-01 04:42:46 UTC (rev 39003)
@@ -444,35 +444,7 @@
 	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 @@
 	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;
 }
 

Modified: scummvm/trunk/engines/queen/queen.h
===================================================================
--- scummvm/trunk/engines/queen/queen.h	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/queen/queen.h	2009-03-01 04:42:46 UTC (rev 39003)
@@ -129,15 +129,7 @@
 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();

Modified: scummvm/trunk/engines/saga/saga.cpp
===================================================================
--- scummvm/trunk/engines/saga/saga.cpp	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/saga/saga.cpp	2009-03-01 04:42:46 UTC (rev 39003)
@@ -147,7 +147,7 @@
 	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 @@
 		_system->setFeatureState(OSystem::kFeatureAutoComputeDirtyRects, true);
 #endif
 
-	return Common::kNoError;
-}
-
-Common::Error SagaEngine::go() {
 	int msec = 0;
 
 	_previousTicks = _system->getMillis();

Modified: scummvm/trunk/engines/saga/saga.h
===================================================================
--- scummvm/trunk/engines/saga/saga.h	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/saga/saga.h	2009-03-01 04:42:46 UTC (rev 39003)
@@ -443,15 +443,7 @@
 
 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);

Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/sci/sci.cpp	2009-03-01 04:42:46 UTC (rev 39003)
@@ -170,7 +170,7 @@
 	delete _console;
 }
 
-Common::Error SciEngine::init() {
+Common::Error SciEngine::run() {
 	initGraphics(320, 200, false);
 
 	// Create debugger console. It requires GFX to be initialized
@@ -178,12 +178,7 @@
 
 	// 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();
 	while (!end) {

Modified: scummvm/trunk/engines/sci/sci.h
===================================================================
--- scummvm/trunk/engines/sci/sci.h	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/sci/sci.h	2009-03-01 04:42:46 UTC (rev 39003)
@@ -76,18 +76,10 @@
 	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();
-	}
+	// Engine APIs
+	virtual Common::Error run();
+	virtual GUI::Debugger *getDebugger() { return _console; }
 
-	GUI::Debugger *getDebugger() { return _console; }
-
 	const char* getGameID() const;
 	int getResourceVersion() const;
 	int getVersion() const;

Modified: scummvm/trunk/engines/sword2/sword2.cpp
===================================================================
--- scummvm/trunk/engines/sword2/sword2.cpp	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/sword2/sword2.cpp	2009-03-01 04:42:46 UTC (rev 39003)
@@ -361,7 +361,7 @@
 	_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 @@
 
 	_screen->initialiseRenderCycle();
 
-	return Common::kNoError;
-}
-
-Common::Error Sword2Engine::go() {
 	while (1) {
 		if (_debugger->isAttached())
 			_debugger->onFrame();

Modified: scummvm/trunk/engines/sword2/sword2.h
===================================================================
--- scummvm/trunk/engines/sword2/sword2.h	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/sword2/sword2.h	2009-03-01 04:42:46 UTC (rev 39003)
@@ -124,15 +124,7 @@
 
 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();

Modified: scummvm/trunk/engines/tinsel/tinsel.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/tinsel.cpp	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/tinsel/tinsel.cpp	2009-03-01 04:42:46 UTC (rev 39003)
@@ -916,7 +916,24 @@
 	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 @@
 	// 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 @@
 	}
 
 	// Foreground loop
-
+	uint32 timerVal = 0;
 	while (!shouldQuit()) {
 		assert(_console);
 		if (_console->isAttached())

Modified: scummvm/trunk/engines/tinsel/tinsel.h
===================================================================
--- scummvm/trunk/engines/tinsel/tinsel.h	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/tinsel/tinsel.h	2009-03-01 04:42:46 UTC (rev 39003)
@@ -141,15 +141,7 @@
 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

Modified: scummvm/trunk/engines/touche/touche.cpp
===================================================================
--- scummvm/trunk/engines/touche/touche.cpp	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/touche/touche.cpp	2009-03-01 04:42:46 UTC (rev 39003)
@@ -81,7 +81,7 @@
 	delete _midiPlayer;
 }
 
-Common::Error ToucheEngine::init() {
+Common::Error ToucheEngine::run() {
 	initGraphics(kScreenWidth, kScreenHeight, true);
 
 	Graphics::setupFont(_language);
@@ -93,10 +93,7 @@
 	_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);

Modified: scummvm/trunk/engines/touche/touche.h
===================================================================
--- scummvm/trunk/engines/touche/touche.h	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/touche/touche.h	2009-03-01 04:42:46 UTC (rev 39003)
@@ -370,15 +370,7 @@
 	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();
 

Modified: scummvm/trunk/engines/tucker/tucker.cpp
===================================================================
--- scummvm/trunk/engines/tucker/tucker.cpp	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/tucker/tucker.cpp	2009-03-01 04:42:46 UTC (rev 39003)
@@ -41,12 +41,6 @@
 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 @@
 	}
 }
 
-Common::Error TuckerEngine::go() {
+Common::Error TuckerEngine::run() {
+	initGraphics(kScreenWidth, kScreenHeight, false);
+	syncSoundSettings();
+
 	handleIntroSequence();
 	if ((_gameFlags & kGameFlagIntroOnly) == 0 && !shouldQuit()) {
 		mainLoop();

Modified: scummvm/trunk/engines/tucker/tucker.h
===================================================================
--- scummvm/trunk/engines/tucker/tucker.h	2009-03-01 04:30:55 UTC (rev 39002)
+++ scummvm/trunk/engines/tucker/tucker.h	2009-03-01 04:42:46 UTC (rev 39003)
@@ -240,15 +240,7 @@
 	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();
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list