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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Tue Nov 4 17:11:40 CET 2008


Revision: 34896
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34896&view=rev
Author:   fingolfin
Date:     2008-11-04 16:11:40 +0000 (Tue, 04 Nov 2008)

Log Message:
-----------
Fixed the EngineFeature vs. MetaEngineFeature mess, clarified some EngineFeature comments

Modified Paths:
--------------
    scummvm/trunk/engines/agi/agi.h
    scummvm/trunk/engines/agi/detection.cpp
    scummvm/trunk/engines/agos/agos.h
    scummvm/trunk/engines/agos/detection.cpp
    scummvm/trunk/engines/cine/cine.h
    scummvm/trunk/engines/cine/detection.cpp
    scummvm/trunk/engines/dialogs.cpp
    scummvm/trunk/engines/engine.cpp
    scummvm/trunk/engines/engine.h
    scummvm/trunk/engines/gob/detection.cpp
    scummvm/trunk/engines/gob/gob.h
    scummvm/trunk/engines/kyra/detection.cpp
    scummvm/trunk/engines/kyra/kyra_v1.h
    scummvm/trunk/engines/lure/detection.cpp
    scummvm/trunk/engines/lure/lure.h
    scummvm/trunk/engines/metaengine.h
    scummvm/trunk/engines/parallaction/detection.cpp
    scummvm/trunk/engines/parallaction/parallaction.h
    scummvm/trunk/engines/queen/queen.cpp
    scummvm/trunk/engines/queen/queen.h
    scummvm/trunk/engines/saga/detection.cpp
    scummvm/trunk/engines/saga/saga.h
    scummvm/trunk/engines/scumm/detection.cpp
    scummvm/trunk/engines/scumm/scumm.h
    scummvm/trunk/engines/sky/sky.cpp
    scummvm/trunk/engines/sky/sky.h
    scummvm/trunk/engines/sword1/sword1.cpp
    scummvm/trunk/engines/sword1/sword1.h
    scummvm/trunk/engines/sword2/sword2.cpp
    scummvm/trunk/engines/sword2/sword2.h
    scummvm/trunk/engines/touche/detection.cpp
    scummvm/trunk/engines/touche/touche.h

Modified: scummvm/trunk/engines/agi/agi.h
===================================================================
--- scummvm/trunk/engines/agi/agi.h	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/agi/agi.h	2008-11-04 16:11:40 UTC (rev 34896)
@@ -696,7 +696,8 @@
 class AgiBase : public ::Engine {
 protected:
 	// Engine API
-	int init();
+	virtual int init();
+	virtual bool hasFeature(EngineFeature f) const;
 
 	virtual void initialize() = 0;
 
@@ -743,7 +744,10 @@
 	int _gameId;
 
 protected:
-	int go();
+	// Engine APIs
+	virtual int go();
+	virtual void syncSoundSettings();
+
 	void initialize();
 
 	uint32 _lastSaveTime;
@@ -755,7 +759,6 @@
 		return _gameId;
 	}
 
-	virtual void syncSoundSettings();
 
 private:
 

Modified: scummvm/trunk/engines/agi/detection.cpp
===================================================================
--- scummvm/trunk/engines/agi/detection.cpp	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/agi/detection.cpp	2008-11-04 16:11:40 UTC (rev 34896)
@@ -2132,13 +2132,16 @@
 
 bool AgiMetaEngine::hasFeature(MetaEngineFeature f) const {
 	return
-		(f == kSupportsRTL) ||
 		(f == kSupportsListSaves) ||
 		(f == kSupportsLoadingDuringStartup) ||
 		(f == kSupportsDeleteSave);
 }
 
+bool AgiBase::hasFeature(EngineFeature f) const {
+	return (f == kSupportsRTL);
+}
 
+
 bool AgiMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const {
 	const Agi::AGIGameDescription *gd = (const Agi::AGIGameDescription *)desc;
 	bool res = true;

Modified: scummvm/trunk/engines/agos/agos.h
===================================================================
--- scummvm/trunk/engines/agos/agos.h	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/agos/agos.h	2008-11-04 16:11:40 UTC (rev 34896)
@@ -163,7 +163,13 @@
 	friend class Debugger;
 	friend class MoviePlayer;
 
-	GUI::Debugger *getDebugger();
+	// Engine APIs
+	virtual int init();
+	virtual int go();
+	virtual GUI::Debugger *getDebugger();
+	virtual bool hasFeature(EngineFeature f) const;
+	virtual void syncSoundSettings();
+	virtual void pauseEngineIntern(bool pause);
 
 public:
 	virtual void setupOpcodes();
@@ -588,7 +594,6 @@
 
 	void loadSoundFile(const char *filename);
 
-	virtual void syncSoundSettings();
 
 	int getUserFlag(Item *item, int a);
 	int getUserFlag1(Item *item, int a);
@@ -1147,9 +1152,6 @@
 	void loadVGAVideoFile(uint16 id, uint8 type);
 	bool loadVGASoundFile(uint16 id, uint8 type);
 
-	int init();
-	int go();
-
 	void openGameFile();
 	void readGameFile(void *dst, uint32 offs, uint32 size);
 
@@ -1210,7 +1212,6 @@
 	void checkTimerCallback();
 	void delay(uint delay);
 	void pause();
-	virtual void pauseEngineIntern(bool pause);
 
 	void waitForMark(uint i);
 	void scrollScreen();

Modified: scummvm/trunk/engines/agos/detection.cpp
===================================================================
--- scummvm/trunk/engines/agos/detection.cpp	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/agos/detection.cpp	2008-11-04 16:11:40 UTC (rev 34896)
@@ -118,10 +118,14 @@
 
 bool AgosMetaEngine::hasFeature(MetaEngineFeature f) const {
 	return
-		(f == kSupportsRTL) ||
 		(f == kSupportsListSaves);
 }
 
+bool AGOS::AGOSEngine::hasFeature(EngineFeature f) const {
+	return
+		(f == kSupportsRTL);
+}
+
 bool AgosMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const {
 	const AGOS::AGOSGameDescription *gd = (const AGOS::AGOSGameDescription *)desc;
 	bool res = true;

Modified: scummvm/trunk/engines/cine/cine.h
===================================================================
--- scummvm/trunk/engines/cine/cine.h	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/cine/cine.h	2008-11-04 16:11:40 UTC (rev 34896)
@@ -70,8 +70,11 @@
 class CineEngine : public Engine {
 
 protected:
-	int init();
-	int go();
+	// Engine APIs
+	virtual int init();
+	virtual int go();
+	virtual bool hasFeature(EngineFeature f) const;
+
 	void shutdown();
 
 	bool initGame();

Modified: scummvm/trunk/engines/cine/detection.cpp
===================================================================
--- scummvm/trunk/engines/cine/detection.cpp	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/cine/detection.cpp	2008-11-04 16:11:40 UTC (rev 34896)
@@ -540,11 +540,15 @@
 
 bool CineMetaEngine::hasFeature(MetaEngineFeature f) const {
 	return
-		(f == kSupportsRTL) ||
 		(f == kSupportsListSaves) ||
 		(f == kSupportsLoadingDuringStartup);
 }
 
+bool Cine::CineEngine::hasFeature(EngineFeature f) const {
+	return
+		(f == kSupportsRTL);
+}
+
 bool CineMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const {
 	const Cine::CINEGameDescription *gd = (const Cine::CINEGameDescription *)desc;
 	if (gd) {

Modified: scummvm/trunk/engines/dialogs.cpp
===================================================================
--- scummvm/trunk/engines/dialogs.cpp	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/dialogs.cpp	2008-11-04 16:11:40 UTC (rev 34896)
@@ -99,13 +99,11 @@
 
 	_loadButton = new GUI::ButtonWidget(this, "GlobalMenu.Load", "Load", kLoadCmd, 'L');
 	// TODO: setEnabled -> setVisible
-	_loadButton->setEnabled(_engine->hasFeature(Engine::kSupportsListSaves) && 
-							_engine->hasFeature(Engine::kSupportsLoadingDuringRuntime));
+	_loadButton->setEnabled(_engine->hasFeature(Engine::kSupportsLoadingDuringRuntime));
  
 	_saveButton = new GUI::ButtonWidget(this, "GlobalMenu.Save", "Save", kSaveCmd, 'S');
 	// TODO: setEnabled -> setVisible
-	_saveButton->setEnabled(_engine->hasFeature(Engine::kSupportsListSaves) && 
-							_engine->hasFeature(Engine::kSupportsSavingDuringRuntime));
+	_saveButton->setEnabled(_engine->hasFeature(Engine::kSupportsSavingDuringRuntime));
 
 	new GUI::ButtonWidget(this, "GlobalMenu.Options", "Options", kOptionsCmd, 'O');
 
@@ -197,12 +195,10 @@
 }
 
 void MainMenuDialog::reflowLayout() {
-	if (_engine->hasFeature(Engine::kSupportsListSaves)) {
-		if (_engine->hasFeature(Engine::kSupportsLoadingDuringRuntime)) 
-			_loadButton->setEnabled(_engine->canLoadGameStateCurrently());
-		if (_engine->hasFeature(Engine::kSupportsSavingDuringRuntime))
-			_saveButton->setEnabled(_engine->canSaveGameStateCurrently());
-	}
+	if (_engine->hasFeature(Engine::kSupportsLoadingDuringRuntime)) 
+		_loadButton->setEnabled(_engine->canLoadGameStateCurrently());
+	if (_engine->hasFeature(Engine::kSupportsSavingDuringRuntime))
+		_saveButton->setEnabled(_engine->canSaveGameStateCurrently());
 
 #ifndef DISABLE_FANCY_THEMES
 	if (g_gui.xmlEval()->getVar("Globals.ShowGlobalMenuLogo", 0) == 1 && g_gui.theme()->supportsImages()) {

Modified: scummvm/trunk/engines/engine.cpp
===================================================================
--- scummvm/trunk/engines/engine.cpp	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/engine.cpp	2008-11-04 16:11:40 UTC (rev 34896)
@@ -286,27 +286,14 @@
 	return (_eventMan->shouldQuit() || _eventMan->shouldRTL());
 }
 
-bool Engine::hasFeature(EngineFeature f) {
-	// TODO: Get rid of this hack!!!
-	if (f != kSupportsRTL && f != kSupportsListSaves &&
-		f != kSupportsLoadingDuringRuntime &&
-		f != kSupportsSavingDuringRuntime)
-		return false;
+/*
+EnginePlugin *Engine::getMetaEnginePlugin() const {
 
 	const EnginePlugin *plugin = 0;
 	Common::String gameid = ConfMan.get("gameid");
 	gameid.toLowercase();
 	EngineMan.findGame(gameid, &plugin);
-	assert(plugin);
-	if (f == kSupportsRTL)
-		return (*plugin)->hasFeature(MetaEngine::kSupportsRTL);
-	else if (f == kSupportsListSaves)
-		return (*plugin)->hasFeature(MetaEngine::kSupportsListSaves);
-	else if (f == kSupportsLoadingDuringRuntime)
-		return (*plugin)->hasFeature(MetaEngine::kSupportsLoadingDuringRuntime);
-	else if (f == kSupportsSavingDuringRuntime)
-		return (*plugin)->hasFeature(MetaEngine::kSupportsSavingDuringRuntime);
-	else
-		return false;
+	return plugin;
 }
 
+*/

Modified: scummvm/trunk/engines/engine.h
===================================================================
--- scummvm/trunk/engines/engine.h	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/engine.h	2008-11-04 16:11:40 UTC (rev 34896)
@@ -83,6 +83,39 @@
 
 public:
 
+
+	/**
+	 * A feature in this context means an ability of the engine which can be
+	 * either available or not.
+	 * @see Engine::hasFeature()
+	 */
+	enum EngineFeature {
+		/**
+		 * 'Return to launcher' feature is supported, i.e., EVENT_RTL is handled
+		 * either directly, or indirectly (that is, the engine calls and honors
+		 * the result of the Engine::shouldQuit() method appropriately).
+		 */
+		kSupportsRTL,
+		
+		/** 
+		 * Loading savestates during runtime is supported, that is, this engine
+		 * implements loadGameState() and canLoadGameStateCurrently().
+		 * If this feature is supported, then the corresponding MetaEngine *must*
+		 * support the kSupportsListSaves feature.
+		 */
+		kSupportsLoadingDuringRuntime,
+
+		/** 
+		 * Loading savestates during runtime is supported, that is, this engine
+		 * implements saveGameState() and canSaveGameStateCurrently().
+		 * If this feature is supported, then the corresponding MetaEngine *must*
+		 * support the kSupportsListSaves feature.
+		 */
+		kSupportsSavingDuringRuntime
+	};
+
+
+
 	/** @name Overloadable methods
 	 *
 	 *  All Engine subclasses should consider overloading some or all of the following methods.
@@ -118,6 +151,13 @@
 	virtual GUI::Debugger *getDebugger() { return 0; }
 
 	/**
+	 * Determine whether the engine supports the specified feature.
+	 */
+	virtual bool hasFeature(EngineFeature f) const { return false; }
+	
+//	virtual EnginePlugin *getMetaEnginePlugin() const;
+
+	/**
 	 * Notify the engine that the sound settings in the config manager may have
 	 * changed and that it hence should adjust any internal volume etc. values
 	 * accordingly.
@@ -199,42 +239,6 @@
 	 */
 	void openMainMenuDialog();
 
-
-	/**
-	 * A feature in this context means an ability of the engine which can be
-	 * either available or not.
-	 */
-	enum EngineFeature {
-		/**
-		 * 'Return to launcher' feature is supported, i.e., EVENT_RTL is handled.
-		 */
-		kSupportsRTL = 0,
-		
-		/**
-		 * Listing all Save States for a given target is supported, i.e.,
-		 * the listSaves() method is implemented.
-		 * Used for --list-saves support, as well as the GMM load dialog.
-		 */
-		kSupportsListSaves = 1,
-
-		/** 
-		 * Loading from the in-game common ScummVM options dialog is supported
-		 */
-		kSupportsLoadingDuringRuntime = 8,
-
-		/** 
-		 * Saving from the in-game common ScummVM options dialog is supported
-		 */
-		kSupportsSavingDuringRuntime = 9
-	};
-
-	/**
-	 * Determine whether the engine supports the specified feature.
-	 *
-	 * @todo  Let this return false by default, or even turn it into a pure virtual method.
-	 */
-	bool hasFeature(EngineFeature f);
-
 public:
 
 	/** On some systems, check if the game appears to be run from CD. */

Modified: scummvm/trunk/engines/gob/detection.cpp
===================================================================
--- scummvm/trunk/engines/gob/detection.cpp	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/gob/detection.cpp	2008-11-04 16:11:40 UTC (rev 34896)
@@ -2134,10 +2134,13 @@
 };
 
 bool GobMetaEngine::hasFeature(MetaEngineFeature f) const {
+	return false;
+}
+
+bool Gob::GobEngine::hasFeature(EngineFeature f) const {
 	return
 		(f == kSupportsRTL);
 }
-
 bool GobMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const {
 	const Gob::GOBGameDescription *gd = (const Gob::GOBGameDescription *)desc;
 	if (gd) {

Modified: scummvm/trunk/engines/gob/gob.h
===================================================================
--- scummvm/trunk/engines/gob/gob.h	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/gob/gob.h	2008-11-04 16:11:40 UTC (rev 34896)
@@ -190,10 +190,12 @@
 
 	uint32 _pauseStart;
 
-	int go();
-	int init();
+	// Engine APIs
+	virtual int init();
+	virtual int go();
+	virtual bool hasFeature(EngineFeature f) const;
+	virtual void pauseEngineIntern(bool pause);
 
-	void pauseEngineIntern(bool pause);
 	bool initGameParts();
 	void deinitGameParts();
 

Modified: scummvm/trunk/engines/kyra/detection.cpp
===================================================================
--- scummvm/trunk/engines/kyra/detection.cpp	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/kyra/detection.cpp	2008-11-04 16:11:40 UTC (rev 34896)
@@ -1073,12 +1073,16 @@
 
 bool KyraMetaEngine::hasFeature(MetaEngineFeature f) const {
 	return
-		(f == kSupportsRTL) ||
 		(f == kSupportsListSaves) ||
 		(f == kSupportsLoadingDuringStartup) ||
 		(f == kSupportsDeleteSave) ||
 	   	(f == kSavesSupportMetaInfo) ||
-		(f == kSavesSupportThumbnail) ||
+		(f == kSavesSupportThumbnail);
+}
+
+bool Kyra::KyraEngine_v1::hasFeature(EngineFeature f) const {
+	return
+		(f == kSupportsRTL) ||
 		(f == kSupportsLoadingDuringRuntime);
 }
 

Modified: scummvm/trunk/engines/kyra/kyra_v1.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v1.h	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/kyra/kyra_v1.h	2008-11-04 16:11:40 UTC (rev 34896)
@@ -114,10 +114,7 @@
 	KyraEngine_v1(OSystem *system, const GameFlags &flags);
 	virtual ~KyraEngine_v1();
 
-	::GUI::Debugger *getDebugger();
 
-	virtual void pauseEngineIntern(bool pause);
-
 	uint8 game() const { return _flags.gameID; }
 	const GameFlags &gameFlags() const { return _flags; }
 
@@ -170,8 +167,11 @@
 	virtual void delayWithTicks(int ticks);
 
 protected:
-	virtual int go() = 0;
+	// Engine APIs
 	virtual int init();
+	virtual ::GUI::Debugger *getDebugger();
+	virtual bool hasFeature(EngineFeature f) const;
+	virtual void pauseEngineIntern(bool pause);
 
 	// intern
 	Resource *_res;

Modified: scummvm/trunk/engines/lure/detection.cpp
===================================================================
--- scummvm/trunk/engines/lure/detection.cpp	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/lure/detection.cpp	2008-11-04 16:11:40 UTC (rev 34896)
@@ -193,12 +193,16 @@
 
 bool LureMetaEngine::hasFeature(MetaEngineFeature f) const {
 	return
-		(f == kSupportsRTL) ||
 		(f == kSupportsListSaves) ||
 		(f == kSupportsLoadingDuringStartup) ||
 		(f == kSupportsDeleteSave);
 }
 
+bool Lure::LureEngine::hasFeature(EngineFeature f) const {
+	return
+		(f == kSupportsRTL);
+}
+
 bool LureMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const {
 	const Lure::LureGameDescription *gd = (const Lure::LureGameDescription *)desc;
 	if (gd) {

Modified: scummvm/trunk/engines/lure/lure.h
===================================================================
--- scummvm/trunk/engines/lure/lure.h	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/lure/lure.h	2008-11-04 16:11:40 UTC (rev 34896)
@@ -69,10 +69,12 @@
 	~LureEngine();
 	static LureEngine &getReference();
 
+	// Engine APIs
 	virtual int init();
 	virtual int go();
+	virtual bool hasFeature(EngineFeature f) const;
+	virtual void syncSoundSettings();
 	virtual void pauseEngineIntern(bool pause);
-	virtual void syncSoundSettings();
 
 	Disk &disk() { return *_disk; }
 

Modified: scummvm/trunk/engines/metaengine.h
===================================================================
--- scummvm/trunk/engines/metaengine.h	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/metaengine.h	2008-11-04 16:11:40 UTC (rev 34896)
@@ -134,11 +134,6 @@
 	 */
 	enum MetaEngineFeature {
 		/**
-		 * 'Return to launcher' feature is supported, i.e., EVENT_RTL is handled.
-		 */
-		kSupportsRTL,
-
-		/**
 		 * Listing all Save States for a given target is supported, i.e.,
 		 * the listSaves() method is implemented.
 		 * Used for --list-saves support, as well as the GMM load dialog.
@@ -183,19 +178,9 @@
 		 * the game till the save.
 		 * This flag may only be set when 'kSavesSupportMetaInfo' is set.
 		 */
-		kSavesSupportPlayTime,
-		
-		/** 
-		 * Features loading from the Common ScummVM options dialog in-game.
-		 */
-		kSupportsLoadingDuringRuntime,
+		kSavesSupportPlayTime
+	};
 
-		/** 
-		 * Features saving from the Common ScummVM options dialog in-game.
-		 */
-		kSupportsSavingDuringRuntime
-	};	
-
 	/**
 	 * Determine whether the engine supports the specified MetaEngine feature.
 	 * Used by e.g. the launcher to determine whether to enable the "Load" button.

Modified: scummvm/trunk/engines/parallaction/detection.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/detection.cpp	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/parallaction/detection.cpp	2008-11-04 16:11:40 UTC (rev 34896)
@@ -252,12 +252,16 @@
 
 bool ParallactionMetaEngine::hasFeature(MetaEngineFeature f) const {
 	return
-		(f == kSupportsRTL) ||
 		(f == kSupportsListSaves) ||
 		(f == kSupportsLoadingDuringStartup) ||
 		(f == kSupportsDeleteSave);
 }
 
+bool Parallaction::Parallaction::hasFeature(EngineFeature f) const {
+	return
+		(f == kSupportsRTL);
+}
+
 bool ParallactionMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const {
 	const Parallaction::PARALLACTIONGameDescription *gd = (const Parallaction::PARALLACTIONGameDescription *)desc;
 	bool res = true;

Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/parallaction/parallaction.h	2008-11-04 16:11:40 UTC (rev 34896)
@@ -227,7 +227,9 @@
 	Parallaction(OSystem *syst, const PARALLACTIONGameDescription *gameDesc);
 	~Parallaction();
 
-	int init();
+	// Engine APIs
+	virtual int init();
+	virtual bool hasFeature(EngineFeature f) const;
 
 	// info
 	int32			_screenWidth;
@@ -360,8 +362,9 @@
 	Parallaction_ns(OSystem* syst, const PARALLACTIONGameDescription *gameDesc) : Parallaction(syst, gameDesc) { }
 	~Parallaction_ns();
 
-	int init();
-	int go();
+	// Engine APIs
+	virtual int init();
+	virtual int go();
 
 public:
 	virtual void 	parseLocation(const char *filename);

Modified: scummvm/trunk/engines/queen/queen.cpp
===================================================================
--- scummvm/trunk/engines/queen/queen.cpp	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/queen/queen.cpp	2008-11-04 16:11:40 UTC (rev 34896)
@@ -23,8 +23,6 @@
  *
  */
 
-
-
 #include "base/plugins.h"
 
 #include "common/config-manager.h"
@@ -80,12 +78,16 @@
 
 bool QueenMetaEngine::hasFeature(MetaEngineFeature f) const {
 	return
-		(f == kSupportsRTL) ||
 		(f == kSupportsListSaves) ||
 		(f == kSupportsLoadingDuringStartup) ||
 		(f == kSupportsDeleteSave);
 }
 
+bool Queen::QueenEngine::hasFeature(EngineFeature f) const {
+	return
+		(f == kSupportsRTL);
+}
+
 GameList QueenMetaEngine::getSupportedGames() const {
 	GameList games;
 	games.push_back(queenGameDescriptor);

Modified: scummvm/trunk/engines/queen/queen.h
===================================================================
--- scummvm/trunk/engines/queen/queen.h	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/queen/queen.h	2008-11-04 16:11:40 UTC (rev 34896)
@@ -97,7 +97,6 @@
 	void checkOptionSettings();
 	void readOptionSettings();
 	void writeOptionSettings();
-	virtual void syncSoundSettings();
 
 	int talkSpeed() const { return _talkSpeed; }
 	void talkSpeed(int speed) { _talkSpeed = speed; }
@@ -129,12 +128,14 @@
 
 protected:
 
-	GUI::Debugger *getDebugger();
+	// Engine APIs
+	virtual int init();
+	virtual int go();
+	virtual GUI::Debugger *getDebugger();
+	virtual bool hasFeature(EngineFeature f) const;
+	virtual void syncSoundSettings();
 
-	int go();
-	int init();
 
-
 	int _talkSpeed;
 	bool _subtitles;
 	uint32 _lastSaveTime;

Modified: scummvm/trunk/engines/saga/detection.cpp
===================================================================
--- scummvm/trunk/engines/saga/detection.cpp	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/saga/detection.cpp	2008-11-04 16:11:40 UTC (rev 34896)
@@ -156,10 +156,14 @@
 
 bool SagaMetaEngine::hasFeature(MetaEngineFeature f) const {
 	return
-		(f == kSupportsRTL) ||
 		(f == kSupportsListSaves) ||
 		(f == kSupportsLoadingDuringStartup) ||
-		(f == kSupportsDeleteSave) ||
+		(f == kSupportsDeleteSave);
+}
+
+bool Saga::SagaEngine::hasFeature(EngineFeature f) const {
+	return
+		(f == kSupportsRTL) ||
 		(f == kSupportsLoadingDuringRuntime) ||
 		(f == kSupportsSavingDuringRuntime);
 }

Modified: scummvm/trunk/engines/saga/saga.h
===================================================================
--- scummvm/trunk/engines/saga/saga.h	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/saga/saga.h	2008-11-04 16:11:40 UTC (rev 34896)
@@ -486,10 +486,14 @@
 class SagaEngine : public Engine {
 	friend class Scene;
 
-protected:
-	int go();
-	int init();
 public:
+	// Engine APIs
+	virtual int init();
+	virtual int go();
+	virtual bool hasFeature(EngineFeature f) const;
+	virtual void syncSoundSettings();
+
+public:
 	SagaEngine(OSystem *syst, const SAGAGameDescription *gameDesc);
 	virtual ~SagaEngine();
 
@@ -512,8 +516,6 @@
 		return isSaveListFull() ? _saveFilesCount : _saveFilesCount + 1;
 	}
 
-	virtual void syncSoundSettings();
-	
 	int16 _framesEsc;
 
 	uint32 _globalFlags;

Modified: scummvm/trunk/engines/scumm/detection.cpp
===================================================================
--- scummvm/trunk/engines/scumm/detection.cpp	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/scumm/detection.cpp	2008-11-04 16:11:40 UTC (rev 34896)
@@ -691,7 +691,6 @@
 
 bool ScummMetaEngine::hasFeature(MetaEngineFeature f) const {
 	return
-		(f == kSupportsRTL) ||
 		(f == kSupportsListSaves) ||
 		(f == kSupportsLoadingDuringStartup) ||
 		(f == kSupportsDeleteSave) ||
@@ -701,6 +700,10 @@
 		(f == kSavesSupportPlayTime);
 }
 
+bool ScummEngine::hasFeature(EngineFeature f) const {
+	return	(f == kSupportsRTL);
+}
+
 GameList ScummMetaEngine::getSupportedGames() const {
 	return GameList(gameDescriptions);
 }

Modified: scummvm/trunk/engines/scumm/scumm.h
===================================================================
--- scummvm/trunk/engines/scumm/scumm.h	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/scumm/scumm.h	2008-11-04 16:11:40 UTC (rev 34896)
@@ -447,6 +447,8 @@
 	virtual int go();
 	virtual void errorString(const char *buf_input, char *buf_output);
 	virtual GUI::Debugger *getDebugger();
+	virtual bool hasFeature(EngineFeature f) const;
+	virtual void syncSoundSettings();
 	virtual void pauseEngineIntern(bool pause);
 
 protected:
@@ -462,7 +464,6 @@
 	virtual void loadLanguageBundle() {}
 	void loadCJKFont();
 	void setupMusic(int midi);
-	virtual void syncSoundSettings();
 	void setTalkDelay(int talkdelay);
 	int getTalkDelay();
 

Modified: scummvm/trunk/engines/sky/sky.cpp
===================================================================
--- scummvm/trunk/engines/sky/sky.cpp	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/sky/sky.cpp	2008-11-04 16:11:40 UTC (rev 34896)
@@ -130,11 +130,15 @@
 
 bool SkyMetaEngine::hasFeature(MetaEngineFeature f) const {
 	return
-		(f == kSupportsRTL) ||
 		(f == kSupportsListSaves) ||
 		(f == kSupportsLoadingDuringStartup);
 }
 
+bool Sky::SkyEngine::hasFeature(EngineFeature f) const {
+	return
+		(f == kSupportsRTL);
+}
+
 GameList SkyMetaEngine::getSupportedGames() const {
 	GameList games;
 	games.push_back(skySetting);

Modified: scummvm/trunk/engines/sky/sky.h
===================================================================
--- scummvm/trunk/engines/sky/sky.h	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/sky/sky.h	2008-11-04 16:11:40 UTC (rev 34896)
@@ -58,7 +58,6 @@
 class SkyCompact;
 
 class SkyEngine : public Engine {
-	GUI::Debugger *getDebugger();
 protected:
 	Common::KeyState _keyPressed;
 	bool _floppyIntro;
@@ -89,15 +88,19 @@
 	static SystemVars _systemVars;
 
 protected:
+	// Engine APIs
+	virtual int init();
+	virtual int go();
+	virtual GUI::Debugger *getDebugger();
+	virtual bool hasFeature(EngineFeature f) const;
+
 	byte _fastMode;
 
 	void delay(int32 amount);
-	int go();
 	void handleKey(void);
 
 	uint32 _lastSaveTime;
 
-	int init();
 	void initItemList();
 
 	void initVirgin();

Modified: scummvm/trunk/engines/sword1/sword1.cpp
===================================================================
--- scummvm/trunk/engines/sword1/sword1.cpp	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/sword1/sword1.cpp	2008-11-04 16:11:40 UTC (rev 34896)
@@ -106,11 +106,15 @@
 
 bool SwordMetaEngine::hasFeature(MetaEngineFeature f) const {
 	return
-		(f == kSupportsRTL) ||
 		(f == kSupportsListSaves) ||
 		(f == kSupportsLoadingDuringStartup);
 }
 
+bool Sword1::SwordEngine::hasFeature(EngineFeature f) const {
+	return
+		(f == kSupportsRTL);
+}
+
 GameList SwordMetaEngine::getSupportedGames() const {
 	GameList games;
 	games.push_back(sword1FullSettings);

Modified: scummvm/trunk/engines/sword1/sword1.h
===================================================================
--- scummvm/trunk/engines/sword1/sword1.h	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/sword1/sword1.h	2008-11-04 16:11:40 UTC (rev 34896)
@@ -77,12 +77,15 @@
 	virtual ~SwordEngine();
 	static SystemVars _systemVars;
 	void reinitialize(void);
-	virtual void syncSoundSettings();
 
 	uint32 _features;
 protected:
-	int go();
-	int init();
+	// Engine APIs
+	virtual int init();
+	virtual int go();
+	virtual bool hasFeature(EngineFeature f) const;
+	virtual void syncSoundSettings();
+
 private:
 	void delay(int32 amount);
 

Modified: scummvm/trunk/engines/sword2/sword2.cpp
===================================================================
--- scummvm/trunk/engines/sword2/sword2.cpp	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/sword2/sword2.cpp	2008-11-04 16:11:40 UTC (rev 34896)
@@ -92,12 +92,16 @@
 
 bool Sword2MetaEngine::hasFeature(MetaEngineFeature f) const {
 	return
-		(f == kSupportsRTL) ||
 		(f == kSupportsListSaves) ||
 		(f == kSupportsLoadingDuringStartup) ||
 		(f == kSupportsDeleteSave);
 }
 
+bool Sword2::Sword2Engine::hasFeature(EngineFeature f) const {
+	return
+		(f == kSupportsRTL);
+}
+
 GameList Sword2MetaEngine::getSupportedGames() const {
 	const Sword2::GameSettings *g = Sword2::sword2_settings;
 	GameList games;

Modified: scummvm/trunk/engines/sword2/sword2.h
===================================================================
--- scummvm/trunk/engines/sword2/sword2.h	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/sword2/sword2.h	2008-11-04 16:11:40 UTC (rev 34896)
@@ -113,8 +113,6 @@
 
 	uint32 calcChecksum(byte *buffer, uint32 size);
 
-	virtual void pauseEngineIntern(bool pause);
-
 	uint32 _totalStartups;
 	uint32 _totalScreenManagers;
 	uint32 _startRes;
@@ -127,9 +125,14 @@
 public:
 	Sword2Engine(OSystem *syst);
 	~Sword2Engine();
-	int go();
-	int init();
 
+	// Engine APIs
+	virtual int init();
+	virtual int go();
+	virtual GUI::Debugger *getDebugger();
+	virtual bool hasFeature(EngineFeature f) const;
+	virtual void pauseEngineIntern(bool pause);
+
 	int getFramesPerSecond();
 
 	void registerDefaultSettings();
@@ -212,7 +215,6 @@
 
 	void sleepUntil(uint32 time);
 
-	GUI::Debugger *getDebugger();
 	void initialiseFontResourceFlags();
 	void initialiseFontResourceFlags(uint8 language);
 

Modified: scummvm/trunk/engines/touche/detection.cpp
===================================================================
--- scummvm/trunk/engines/touche/detection.cpp	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/touche/detection.cpp	2008-11-04 16:11:40 UTC (rev 34896)
@@ -145,12 +145,16 @@
 
 bool ToucheMetaEngine::hasFeature(MetaEngineFeature f) const {
 	return
-		(f == kSupportsRTL) ||
 		(f == kSupportsListSaves) ||
 		(f == kSupportsLoadingDuringStartup) ||
 		(f == kSupportsDeleteSave);
 }
 
+bool Touche::ToucheEngine::hasFeature(EngineFeature f) const {
+	return
+		(f == kSupportsRTL);
+}
+
 bool ToucheMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const {
 	const Common::ADGameDescription *gd = desc;
 	if (gd) {

Modified: scummvm/trunk/engines/touche/touche.h
===================================================================
--- scummvm/trunk/engines/touche/touche.h	2008-11-04 13:57:29 UTC (rev 34895)
+++ scummvm/trunk/engines/touche/touche.h	2008-11-04 16:11:40 UTC (rev 34896)
@@ -361,8 +361,10 @@
 	ToucheEngine(OSystem *system, Common::Language language);
 	virtual ~ToucheEngine();
 
+	// Engine APIs
 	virtual int init();
 	virtual int go();
+	virtual bool hasFeature(EngineFeature f) const;
 	virtual void syncSoundSettings();
 
 protected:


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