diff options
| author | Matthew Hoops | 2015-09-29 21:00:56 -0400 | 
|---|---|---|
| committer | Johannes Schickel | 2016-03-13 13:52:24 +0100 | 
| commit | fb6fe1332aaa9ab4d0ec0ad4ee8015ce4076bd85 (patch) | |
| tree | cc1284f92298cfd8307ba6985f4105bdce147324 | |
| parent | d85eb8ded68a20de383d84064aacd1a4c81db4e9 (diff) | |
| download | scummvm-rg350-fb6fe1332aaa9ab4d0ec0ad4ee8015ce4076bd85.tar.gz scummvm-rg350-fb6fe1332aaa9ab4d0ec0ad4ee8015ce4076bd85.tar.bz2 scummvm-rg350-fb6fe1332aaa9ab4d0ec0ad4ee8015ce4076bd85.zip  | |
BACKENDS: Move to an openCD() without parameters as the public API
| -rw-r--r-- | backends/audiocd/audiocd.h | 3 | ||||
| -rw-r--r-- | backends/audiocd/default/default-audiocd.cpp | 5 | ||||
| -rw-r--r-- | backends/audiocd/default/default-audiocd.h | 7 | ||||
| -rw-r--r-- | backends/platform/dc/dc.h | 2 | ||||
| -rw-r--r-- | backends/platform/dc/dcmain.cpp | 2 | ||||
| -rw-r--r-- | backends/platform/ds/arm9/source/osystem_ds.cpp | 2 | ||||
| -rw-r--r-- | backends/platform/ds/arm9/source/osystem_ds.h | 2 | ||||
| -rw-r--r-- | engines/drascula/drascula.cpp | 4 | ||||
| -rw-r--r-- | engines/gob/gob.cpp | 4 | ||||
| -rw-r--r-- | engines/groovie/groovie.cpp | 6 | ||||
| -rw-r--r-- | engines/made/made.cpp | 4 | ||||
| -rw-r--r-- | engines/scumm/scumm.cpp | 5 | ||||
| -rw-r--r-- | engines/tinsel/tinsel.cpp | 4 | 
13 files changed, 23 insertions, 27 deletions
diff --git a/backends/audiocd/audiocd.h b/backends/audiocd/audiocd.h index 6eae8e096b..72a01fd87e 100644 --- a/backends/audiocd/audiocd.h +++ b/backends/audiocd/audiocd.h @@ -109,10 +109,9 @@ public:  	/**  	 * Initialize the specified CD drive for audio playback. -	 * @param drive the drive id  	 * @return true if the CD drive was inited successfully  	 */ -	virtual bool openCD(int drive) = 0; +	virtual bool openCD() = 0;  	/**  	 * Poll CD status. diff --git a/backends/audiocd/default/default-audiocd.cpp b/backends/audiocd/default/default-audiocd.cpp index abf80ac4cd..0c5bb8df03 100644 --- a/backends/audiocd/default/default-audiocd.cpp +++ b/backends/audiocd/default/default-audiocd.cpp @@ -22,6 +22,7 @@  #include "backends/audiocd/default/default-audiocd.h"  #include "audio/audiostream.h" +#include "common/config-manager.h"  #include "common/system.h"  DefaultAudioCDManager::DefaultAudioCDManager() { @@ -152,3 +153,7 @@ DefaultAudioCDManager::Status DefaultAudioCDManager::getStatus() const {  	info.playing = isPlaying();  	return info;  } + +bool DefaultAudioCDManager::openCD() { +	return openCD(ConfMan.getInt("cdrom")); +} diff --git a/backends/audiocd/default/default-audiocd.h b/backends/audiocd/default/default-audiocd.h index 9e4ba6b33e..1d64690add 100644 --- a/backends/audiocd/default/default-audiocd.h +++ b/backends/audiocd/default/default-audiocd.h @@ -42,6 +42,13 @@ public:  	void update();  	virtual Status getStatus() const; // Subclasses should override for better status results +	bool openCD(); + +	/** +	 * Open a CD using the specified drive index +	 * @param drive The index of the drive +	 * @note The index is implementation-defined, but 0 is always the best choice +	 */  	virtual bool openCD(int drive) { return false; }  	virtual void updateCD() {}  	virtual bool pollCD() const { return false; } diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h index d8ab549c3a..80e484f6f8 100644 --- a/backends/platform/dc/dc.h +++ b/backends/platform/dc/dc.h @@ -58,7 +58,7 @@ class DCHardware {  class DCCDManager : public DefaultAudioCDManager {    // Initialize the specified CD drive for audio playback. -  bool openCD(int drive); +  bool openCD();    // Poll cdrom status    // Returns true if cd audio is playing diff --git a/backends/platform/dc/dcmain.cpp b/backends/platform/dc/dcmain.cpp index eede796991..aa8430afc8 100644 --- a/backends/platform/dc/dcmain.cpp +++ b/backends/platform/dc/dcmain.cpp @@ -123,7 +123,7 @@ void DCCDManager::updateCD()    // Dummy.  The CD drive takes care of itself.  } -bool DCCDManager::openCD(int drive) +bool DCCDManager::openCD()  {    // Dummy.    return true; diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp index c53f57523d..f23192cd9d 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.cpp +++ b/backends/platform/ds/arm9/source/osystem_ds.cpp @@ -715,7 +715,7 @@ void OSystem_DS::deleteMutex(MutexRef mutex) {  // and should be replaced by an AudioCDManager subclass,  // see backends/audiocd/ and common/system.h -bool OSystem_DS::openCD(int drive) { +bool OSystem_DS::openCD() {  	return DS::CD::checkCD();  } diff --git a/backends/platform/ds/arm9/source/osystem_ds.h b/backends/platform/ds/arm9/source/osystem_ds.h index f4dbac66f7..9b66e24b88 100644 --- a/backends/platform/ds/arm9/source/osystem_ds.h +++ b/backends/platform/ds/arm9/source/osystem_ds.h @@ -130,7 +130,7 @@ public:  	// FIXME/TODO: The CD API as follows is *obsolete*  	// and should be replaced by an AudioCDManager subclass,  	// see backends/audiocd/ and common/system.h -	virtual bool openCD(int drive); +	virtual bool openCD();  	virtual bool pollCD();  	virtual void playCD(int track, int num_loops, int start_frame, int duration);  	virtual void stopCD(); diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index c72d77c281..1a7659fc85 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -183,9 +183,7 @@ DrasculaEngine::DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gam  	const Common::FSNode gameDataDir(ConfMan.get("path"));  	SearchMan.addSubDirectoryMatching(gameDataDir, "audio"); -	int cd_num = ConfMan.getInt("cdrom"); -	if (cd_num >= 0) -		_system->getAudioCDManager()->openCD(cd_num); +	_system->getAudioCDManager()->openCD();  	_lang = kEnglish; diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp index 24bdb858d8..df2d804bd2 100644 --- a/engines/gob/gob.cpp +++ b/engines/gob/gob.cpp @@ -296,9 +296,7 @@ Common::Error GobEngine::run() {  	if (isCD())  		checkCD(); -	int cd_num = ConfMan.getInt("cdrom"); -	if (cd_num >= 0) -		_system->getAudioCDManager()->openCD(cd_num); +	_system->getAudioCDManager()->openCD();  	_global->_debugFlag = 1;  	_video->_doRangeClamp = true; diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp index 2021cef6e8..a25bf0008b 100644 --- a/engines/groovie/groovie.cpp +++ b/engines/groovie/groovie.cpp @@ -257,11 +257,7 @@ Common::Error GroovieEngine::run() {  	// the same cd  	if (getPlatform() != Common::kPlatformIOS) {  		checkCD(); - -		// Initialize the CD -		int cd_num = ConfMan.getInt("cdrom"); -		if (cd_num >= 0) -			_system->getAudioCDManager()->openCD(cd_num); +		_system->getAudioCDManager()->openCD();  	}  	while (!shouldQuit()) { diff --git a/engines/made/made.cpp b/engines/made/made.cpp index ab07ef757b..57130e277f 100644 --- a/engines/made/made.cpp +++ b/engines/made/made.cpp @@ -67,9 +67,7 @@ MadeEngine::MadeEngine(OSystem *syst, const MadeGameDescription *gameDesc) : Eng  	_console = new MadeConsole(this); -	int cd_num = ConfMan.getInt("cdrom"); -	if (cd_num >= 0) -		_system->getAudioCDManager()->openCD(cd_num); +	_system->getAudioCDManager()->openCD();  	_pmvPlayer = new PmvPlayer(this, _mixer);  	_res = new ResourceReader(); diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 89d2d3dc72..680bdb2463 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1275,10 +1275,7 @@ void ScummEngine::setupScumm() {  	// On some systems it's not safe to run CD audio games from the CD.  	if (_game.features & GF_AUDIOTRACKS && !Common::File::exists("CDDA.SOU")) {  		checkCD(); - -		int cd_num = ConfMan.getInt("cdrom"); -		if (cd_num >= 0) -			_system->getAudioCDManager()->openCD(cd_num); +		_system->getAudioCDManager()->openCD();  	}  	// Create the sound manager diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp index 2adddca4fd..782dd7ae48 100644 --- a/engines/tinsel/tinsel.cpp +++ b/engines/tinsel/tinsel.cpp @@ -841,9 +841,7 @@ TinselEngine::TinselEngine(OSystem *syst, const TinselGameDescription *gameDesc)  		if (!scumm_stricmp(g->gameid, gameid))  			_gameId = g->id; -	int cd_num = ConfMan.getInt("cdrom"); -	if (cd_num >= 0) -		_system->getAudioCDManager()->openCD(cd_num); +	_system->getAudioCDManager()->openCD();  	_mousePos.x = 0;  	_mousePos.y = 0;  | 
