diff options
author | Max Horn | 2008-11-05 17:24:56 +0000 |
---|---|---|
committer | Max Horn | 2008-11-05 17:24:56 +0000 |
commit | f32be876337e3b280ee4ea257e9868a0d61e399d (patch) | |
tree | 999037656b6a01f8a0e379801f64c79d18a76dba | |
parent | fe2935ad4b550afa68977169140267ef2ef4a3da (diff) | |
download | scummvm-rg350-f32be876337e3b280ee4ea257e9868a0d61e399d.tar.gz scummvm-rg350-f32be876337e3b280ee4ea257e9868a0d61e399d.tar.bz2 scummvm-rg350-f32be876337e3b280ee4ea257e9868a0d61e399d.zip |
Turned enum PluginError into Common::Error, which in the future is to be used in more places. Help with this is highly welcome
svn-id: r34906
-rw-r--r-- | backends/midi/alsa.cpp | 6 | ||||
-rw-r--r-- | backends/midi/camd.cpp | 6 | ||||
-rw-r--r-- | backends/midi/coreaudio.cpp | 6 | ||||
-rw-r--r-- | backends/midi/coremidi.cpp | 6 | ||||
-rw-r--r-- | backends/midi/dmedia.cpp | 6 | ||||
-rw-r--r-- | backends/midi/quicktime.cpp | 6 | ||||
-rw-r--r-- | backends/midi/seq.cpp | 6 | ||||
-rw-r--r-- | backends/midi/stmidi.cpp | 6 | ||||
-rw-r--r-- | backends/midi/timidity.cpp | 6 | ||||
-rw-r--r-- | backends/midi/windows.cpp | 6 | ||||
-rw-r--r-- | backends/midi/ypa1.cpp | 6 | ||||
-rw-r--r-- | backends/midi/zodiac.cpp | 6 | ||||
-rw-r--r-- | base/main.cpp | 8 | ||||
-rw-r--r-- | common/advancedDetector.cpp | 2 | ||||
-rw-r--r-- | common/advancedDetector.h | 2 | ||||
-rw-r--r-- | common/error.h | 25 | ||||
-rw-r--r-- | engines/metaengine.h | 4 | ||||
-rw-r--r-- | engines/queen/queen.cpp | 6 | ||||
-rw-r--r-- | engines/scumm/detection.cpp | 10 | ||||
-rw-r--r-- | engines/sky/sky.cpp | 8 | ||||
-rw-r--r-- | engines/sword1/sword1.cpp | 7 | ||||
-rw-r--r-- | engines/sword2/sword2.cpp | 10 | ||||
-rw-r--r-- | sound/musicplugin.h | 4 | ||||
-rw-r--r-- | sound/null.cpp | 6 | ||||
-rw-r--r-- | sound/softsynth/adlib.cpp | 6 | ||||
-rw-r--r-- | sound/softsynth/fluidsynth.cpp | 4 | ||||
-rw-r--r-- | sound/softsynth/mt32.cpp | 6 | ||||
-rw-r--r-- | sound/softsynth/ym2612.cpp | 6 |
28 files changed, 97 insertions, 89 deletions
diff --git a/backends/midi/alsa.cpp b/backends/midi/alsa.cpp index 5a978a0fd2..b78066cdd4 100644 --- a/backends/midi/alsa.cpp +++ b/backends/midi/alsa.cpp @@ -269,7 +269,7 @@ public: } MusicDevices getDevices() const; - PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; + Common::Error createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; }; #define perm_ok(pinfo,bits) ((snd_seq_port_info_get_capability(pinfo) & (bits)) == (bits)) @@ -315,10 +315,10 @@ MusicDevices AlsaMusicPlugin::getDevices() const { return devices; } -PluginError AlsaMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { +Common::Error AlsaMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { *mididriver = new MidiDriver_ALSA(); - return kNoError; + return Common::kNoError; } MidiDriver *MidiDriver_ALSA_create(Audio::Mixer *mixer) { diff --git a/backends/midi/camd.cpp b/backends/midi/camd.cpp index d6d5819a6e..bab047746b 100644 --- a/backends/midi/camd.cpp +++ b/backends/midi/camd.cpp @@ -177,7 +177,7 @@ public: } MusicDevices getDevices() const; - PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; + Common::Error createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; }; MusicDevices CamdMusicPlugin::getDevices() const { @@ -188,10 +188,10 @@ MusicDevices CamdMusicPlugin::getDevices() const { return devices; } -PluginError CamdMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { +Common::Error CamdMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { *mididriver = new MidiDriver_CAMD(); - return kNoError; + return Common::kNoError; } MidiDriver *MidiDriver_CAMD_create(Audio::Mixer *mixer) { diff --git a/backends/midi/coreaudio.cpp b/backends/midi/coreaudio.cpp index bf35fb90ba..0d72a1576a 100644 --- a/backends/midi/coreaudio.cpp +++ b/backends/midi/coreaudio.cpp @@ -218,7 +218,7 @@ public: } MusicDevices getDevices() const; - PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; + Common::Error createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; }; MusicDevices CoreAudioMusicPlugin::getDevices() const { @@ -229,10 +229,10 @@ MusicDevices CoreAudioMusicPlugin::getDevices() const { return devices; } -PluginError CoreAudioMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { +Common::Error CoreAudioMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { *mididriver = new MidiDriver_CORE(); - return kNoError; + return Common::kNoError; } MidiDriver *MidiDriver_CORE_create(Audio::Mixer *mixer) { diff --git a/backends/midi/coremidi.cpp b/backends/midi/coremidi.cpp index da82249792..e63788d154 100644 --- a/backends/midi/coremidi.cpp +++ b/backends/midi/coremidi.cpp @@ -190,7 +190,7 @@ public: } MusicDevices getDevices() const; - PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; + Common::Error createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; }; MusicDevices CoreMIDIMusicPlugin::getDevices() const { @@ -201,10 +201,10 @@ MusicDevices CoreMIDIMusicPlugin::getDevices() const { return devices; } -PluginError CoreMIDIMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { +Common::Error CoreMIDIMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { *mididriver = new MidiDriver_CoreMIDI(); - return kNoError; + return Common::kNoError; } MidiDriver *MidiDriver_CoreMIDI_create(Audio::Mixer *mixer) { diff --git a/backends/midi/dmedia.cpp b/backends/midi/dmedia.cpp index b4bd426ca4..eb639cc6c8 100644 --- a/backends/midi/dmedia.cpp +++ b/backends/midi/dmedia.cpp @@ -189,7 +189,7 @@ public: } MusicDevices getDevices() const; - PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; + Common::Error createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; }; MusicDevices DMediaMusicPlugin::getDevices() const { @@ -200,10 +200,10 @@ MusicDevices DMediaMusicPlugin::getDevices() const { return devices; } -PluginError DMediaMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { +Common::Error DMediaMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { *mididriver = new MidiDriver_DMEDIA(); - return kNoError; + return Common::kNoError; } MidiDriver *MidiDriver_DMEDIA_create(Audio::Mixer *mixer) { diff --git a/backends/midi/quicktime.cpp b/backends/midi/quicktime.cpp index a18eadcb30..3a21c65c20 100644 --- a/backends/midi/quicktime.cpp +++ b/backends/midi/quicktime.cpp @@ -274,7 +274,7 @@ public: } MusicDevices getDevices() const; - PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; + Common::Error createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; }; MusicDevices QuickTimeMusicPlugin::getDevices() const { @@ -285,10 +285,10 @@ MusicDevices QuickTimeMusicPlugin::getDevices() const { return devices; } -PluginError QuickTimeMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { +Common::Error QuickTimeMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { *mididriver = new MidiDriver_QT(); - return kNoError; + return Common::kNoError; } MidiDriver *MidiDriver_QT_create(Audio::Mixer *mixer) { diff --git a/backends/midi/seq.cpp b/backends/midi/seq.cpp index 9e86181674..920356147f 100644 --- a/backends/midi/seq.cpp +++ b/backends/midi/seq.cpp @@ -184,7 +184,7 @@ public: } MusicDevices getDevices() const; - PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; + Common::Error createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; }; MusicDevices SeqMusicPlugin::getDevices() const { @@ -195,10 +195,10 @@ MusicDevices SeqMusicPlugin::getDevices() const { return devices; } -PluginError SeqMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { +Common::Error SeqMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { *mididriver = new MidiDriver_SEQ(); - return kNoError; + return Common::kNoError; } MidiDriver *MidiDriver_SEQ_create(Audio::Mixer *mixer) { diff --git a/backends/midi/stmidi.cpp b/backends/midi/stmidi.cpp index addb23c6bd..6cba1b819d 100644 --- a/backends/midi/stmidi.cpp +++ b/backends/midi/stmidi.cpp @@ -119,7 +119,7 @@ public: } MusicDevices getDevices() const; - PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) + Common::Error createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; }; @@ -131,10 +131,10 @@ MusicDevices StMidiMusicPlugin::getDevices() const { return devices; } -PluginError StMidiMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { +Common::Error StMidiMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { *mididriver = new MidiDriver_STMIDI(); - return kNoError; + return Common::kNoError; } MidiDriver *MidiDriver_STMIDI_create(Audio::Mixer *mixer) { diff --git a/backends/midi/timidity.cpp b/backends/midi/timidity.cpp index b262fed88c..d13fc4b79a 100644 --- a/backends/midi/timidity.cpp +++ b/backends/midi/timidity.cpp @@ -525,7 +525,7 @@ public: } MusicDevices getDevices() const; - PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; + Common::Error createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; }; MusicDevices TimidityMusicPlugin::getDevices() const { @@ -534,10 +534,10 @@ MusicDevices TimidityMusicPlugin::getDevices() const { return devices; } -PluginError TimidityMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { +Common::Error TimidityMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { *mididriver = new MidiDriver_TIMIDITY(); - return kNoError; + return Common::kNoError; } MidiDriver *MidiDriver_TIMIDITY_create(Audio::Mixer *mixer) { diff --git a/backends/midi/windows.cpp b/backends/midi/windows.cpp index c564c124fe..d1f79f4fa3 100644 --- a/backends/midi/windows.cpp +++ b/backends/midi/windows.cpp @@ -158,7 +158,7 @@ public: } MusicDevices getDevices() const; - PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; + Common::Error createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; }; MusicDevices WindowsMusicPlugin::getDevices() const { @@ -169,10 +169,10 @@ MusicDevices WindowsMusicPlugin::getDevices() const { return devices; } -PluginError WindowsMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { +Common::Error WindowsMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { *mididriver = new MidiDriver_WIN(); - return kNoError; + return Common::kNoError; } MidiDriver *MidiDriver_WIN_create(Audio::Mixer *mixer) { diff --git a/backends/midi/ypa1.cpp b/backends/midi/ypa1.cpp index 88f9c3de8f..ab49136121 100644 --- a/backends/midi/ypa1.cpp +++ b/backends/midi/ypa1.cpp @@ -117,7 +117,7 @@ public: } MusicDevices getDevices() const; - PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; + Common::Error createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; }; MusicDevices YamahaPa1MusicPlugin::getDevices() const { @@ -128,10 +128,10 @@ MusicDevices YamahaPa1MusicPlugin::getDevices() const { return devices; } -PluginError YamahaPa1MusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { +Common::Error YamahaPa1MusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { *mididriver = new MidiDriver_YamahaPa1(); - return kNoError; + return Common::kNoError; } MidiDriver *MidiDriver_YamahaPa1_create(Audio::Mixer *mixer) { diff --git a/backends/midi/zodiac.cpp b/backends/midi/zodiac.cpp index 456e4df43a..f17f6796b7 100644 --- a/backends/midi/zodiac.cpp +++ b/backends/midi/zodiac.cpp @@ -135,7 +135,7 @@ public: } MusicDevices getDevices() const; - PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; + Common::Error createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; }; MusicDevices ZodiacMusicPlugin::getDevices() const { @@ -146,10 +146,10 @@ MusicDevices ZodiacMusicPlugin::getDevices() const { return devices; } -PluginError ZodiacMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { +Common::Error ZodiacMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { *mididriver = new MidiDriver_Zodiac(); - return kNoError; + return Common::kNoError; } MidiDriver *MidiDriver_Zodiac_create(Audio::Mixer *mixer) { diff --git a/base/main.cpp b/base/main.cpp index 4245e6c3b1..cde4e4fd2c 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -132,18 +132,18 @@ static int runGame(const EnginePlugin *plugin, OSystem &system, const Common::St // Create the game engine Engine *engine = 0; - PluginError err = (*plugin)->createInstance(&system, &engine); - if (!engine || err != kNoError) { + Common::Error err = (*plugin)->createInstance(&system, &engine); + if (!engine || err != Common::kNoError) { // TODO: Show an error dialog or so? // TODO: Also take 'err' into consideration... //GUI::MessageDialog alert("ScummVM could not find any game in the specified directory!"); //alert.runModal(); const char *errMsg = 0; switch (err) { - case kInvalidPathError: + case Common::kInvalidPathError: errMsg = "Invalid game path"; break; - case kNoGameDataFoundError: + case Common::kNoGameDataFoundError: errMsg = "Unable to locate game data"; break; default: diff --git a/common/advancedDetector.cpp b/common/advancedDetector.cpp index 1ec8c47715..71b83d0d62 100644 --- a/common/advancedDetector.cpp +++ b/common/advancedDetector.cpp @@ -220,7 +220,7 @@ GameList AdvancedMetaEngine::detectGames(const FSList &fslist) const { return detectedGames; } -PluginError AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine) const { +Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine) const { assert(engine); upgradeTargetIfNecessary(params); diff --git a/common/advancedDetector.h b/common/advancedDetector.h index b72b9fbfc4..d2a38d2835 100644 --- a/common/advancedDetector.h +++ b/common/advancedDetector.h @@ -201,7 +201,7 @@ public: virtual GameList getSupportedGames() const; virtual GameDescriptor findGame(const char *gameid) const; virtual GameList detectGames(const FSList &fslist) const; - virtual PluginError createInstance(OSystem *syst, Engine **engine) const; + virtual Common::Error createInstance(OSystem *syst, Engine **engine) const; // To be provided by subclasses virtual bool createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const = 0; diff --git a/common/error.h b/common/error.h index 90a140e08a..39d76a8c36 100644 --- a/common/error.h +++ b/common/error.h @@ -32,6 +32,8 @@ /** * Errors used in the SaveFileManager class. + * + * @todo Merge this partially into Common::Error. We only need a small subset of these errors, though. */ enum SFMError { SFM_NO_ERROR, //Default state, indicates no error has been recorded @@ -44,17 +46,26 @@ enum SFMError { SFM_DIR_ROFS //mkdir()::EROFS: The parent directory resides on a read-only file system }; +namespace Common { + /** * Error codes which may be reported by plugins under various circumstances. - * @todo Turn this into a global 'ErrorCode' enum used by all of ScummVM ? + * + * @todo Clarify the names, and add doxygen comments to each error. + * @todo Add more error values, e.g. for load/save errors. Use those in SaveFileManager, + * (Meta)Engine save/load API, Engine::init() and Engine::go(), ... + * @todo Maybe add an API which keeps track of an error message, + * similiar to SDL_SetError/SDL_GetError/SDL_ClearError? */ -enum PluginError { - kNoError = 0, // No error occured - kInvalidPathError, - kNoGameDataFoundError, - kUnsupportedGameidError, +enum Error { + kNoError = 0, //!< No error occured + kInvalidPathError, //!< Engine initialization: Invalid game path was passed + kNoGameDataFoundError, //!< Engine initialization: No game data was found in the specified location + kUnsupportedGameidError, //!< Engine initialization: Gameid not supported by this (Meta)Engine - kUnknownError // Catch-all error, used if no other error code matches + kUnknownError //!< Catch-all error, used if no other error code matches }; +} // End of namespace Common + #endif //COMMON_ERROR_H diff --git a/engines/metaengine.h b/engines/metaengine.h index 24995cd41b..fb4c5c2938 100644 --- a/engines/metaengine.h +++ b/engines/metaengine.h @@ -75,9 +75,9 @@ public: * @param syst Pointer to the global OSystem object * @param engine Pointer to a pointer which the MetaEngine sets to * the newly create Engine, or 0 in case of an error - * @return a PluginError describing the error which occurred, or kNoError + * @return a Common::Error describing the error which occurred, or kNoError */ - virtual PluginError createInstance(OSystem *syst, Engine **engine) const = 0; + virtual Common::Error createInstance(OSystem *syst, Engine **engine) const = 0; /** * Return a list of all save states associated with the given target. diff --git a/engines/queen/queen.cpp b/engines/queen/queen.cpp index 8740497587..50936f8bb7 100644 --- a/engines/queen/queen.cpp +++ b/engines/queen/queen.cpp @@ -65,7 +65,7 @@ public: virtual SaveStateList listSaves(const char *target) const; virtual void removeSaveState(const char *target, int slot) const; - virtual PluginError createInstance(OSystem *syst, Engine **engine) const; + virtual Common::Error createInstance(OSystem *syst, Engine **engine) const; }; const char *QueenMetaEngine::getName() const { @@ -174,10 +174,10 @@ void QueenMetaEngine::removeSaveState(const char *target, int slot) const { g_system->getSavefileManager()->removeSavefile(filename.c_str()); } -PluginError QueenMetaEngine::createInstance(OSystem *syst, Engine **engine) const { +Common::Error QueenMetaEngine::createInstance(OSystem *syst, Engine **engine) const { assert(engine); *engine = new Queen::QueenEngine(syst); - return kNoError; + return Common::kNoError; } #if PLUGIN_ENABLED_DYNAMIC(QUEEN) diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index 297e0b8efd..fc85e13250 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -682,7 +682,7 @@ public: virtual GameDescriptor findGame(const char *gameid) const; virtual GameList detectGames(const Common::FSList &fslist) const; - virtual PluginError createInstance(OSystem *syst, Engine **engine) const; + virtual Common::Error createInstance(OSystem *syst, Engine **engine) const; virtual SaveStateList listSaves(const char *target) const; virtual void removeSaveState(const char *target, int slot) const; @@ -765,7 +765,7 @@ GameList ScummMetaEngine::detectGames(const Common::FSList &fslist) const { * * This is heavily based on our MD5 detection scheme. */ -PluginError ScummMetaEngine::createInstance(OSystem *syst, Engine **engine) const { +Common::Error ScummMetaEngine::createInstance(OSystem *syst, Engine **engine) const { assert(syst); assert(engine); const char *gameid = ConfMan.get("gameid").c_str(); @@ -792,7 +792,7 @@ PluginError ScummMetaEngine::createInstance(OSystem *syst, Engine **engine) cons Common::FSList fslist; Common::FSNode dir(ConfMan.get("path")); if (!dir.getChildren(fslist, Common::FSNode::kListFilesOnly)) { - return kInvalidPathError; + return Common::kInvalidPathError; } // Invoke the detector, but fixed to the specified gameid. @@ -801,7 +801,7 @@ PluginError ScummMetaEngine::createInstance(OSystem *syst, Engine **engine) cons // Unable to locate game data if (results.empty()) { - return kNoGameDataFoundError; + return Common::kNoGameDataFoundError; } // No unique match found. If a platform override is present, try to @@ -943,7 +943,7 @@ PluginError ScummMetaEngine::createInstance(OSystem *syst, Engine **engine) cons error("Engine_SCUMM_create(): Unknown version of game engine"); } - return kNoError; + return Common::kNoError; } const char *ScummMetaEngine::getName() const { diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp index 8250766f1a..1abb3d94f6 100644 --- a/engines/sky/sky.cpp +++ b/engines/sky/sky.cpp @@ -23,8 +23,6 @@ * */ - - #include "base/plugins.h" #include "common/config-manager.h" @@ -115,7 +113,7 @@ public: virtual GameDescriptor findGame(const char *gameid) const; virtual GameList detectGames(const Common::FSList &fslist) const; - virtual PluginError createInstance(OSystem *syst, Engine **engine) const; + virtual Common::Error createInstance(OSystem *syst, Engine **engine) const; virtual SaveStateList listSaves(const char *target) const; }; @@ -203,10 +201,10 @@ GameList SkyMetaEngine::detectGames(const Common::FSList &fslist) const { return detectedGames; } -PluginError SkyMetaEngine::createInstance(OSystem *syst, Engine **engine) const { +Common::Error SkyMetaEngine::createInstance(OSystem *syst, Engine **engine) const { assert(engine); *engine = new Sky::SkyEngine(syst); - return kNoError; + return Common::kNoError; } SaveStateList SkyMetaEngine::listSaves(const char *target) const { diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp index 982b6cf6e4..9a6bfac030 100644 --- a/engines/sword1/sword1.cpp +++ b/engines/sword1/sword1.cpp @@ -23,7 +23,6 @@ * */ - #include "sword1/sword1.h" #include "base/plugins.h" @@ -101,7 +100,7 @@ public: virtual GameList detectGames(const Common::FSList &fslist) const; virtual SaveStateList listSaves(const char *target) const; - virtual PluginError createInstance(OSystem *syst, Engine **engine) const; + virtual Common::Error createInstance(OSystem *syst, Engine **engine) const; }; bool SwordMetaEngine::hasFeature(MetaEngineFeature f) const { @@ -195,10 +194,10 @@ GameList SwordMetaEngine::detectGames(const Common::FSList &fslist) const { return detectedGames; } -PluginError SwordMetaEngine::createInstance(OSystem *syst, Engine **engine) const { +Common::Error SwordMetaEngine::createInstance(OSystem *syst, Engine **engine) const { assert(engine); *engine = new SwordEngine(syst); - return kNoError; + return Common::kNoError; } SaveStateList SwordMetaEngine::listSaves(const char *target) const { diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp index 23751ea3ef..c596e2f8c0 100644 --- a/engines/sword2/sword2.cpp +++ b/engines/sword2/sword2.cpp @@ -87,7 +87,7 @@ public: virtual SaveStateList listSaves(const char *target) const; virtual void removeSaveState(const char *target, int slot) const; - virtual PluginError createInstance(OSystem *syst, Engine **engine) const; + virtual Common::Error createInstance(OSystem *syst, Engine **engine) const; }; bool Sword2MetaEngine::hasFeature(MetaEngineFeature f) const { @@ -211,14 +211,14 @@ void Sword2MetaEngine::removeSaveState(const char *target, int slot) const { g_system->getSavefileManager()->removeSavefile(filename.c_str()); } -PluginError Sword2MetaEngine::createInstance(OSystem *syst, Engine **engine) const { +Common::Error Sword2MetaEngine::createInstance(OSystem *syst, Engine **engine) const { assert(syst); assert(engine); Common::FSList fslist; Common::FSNode dir(ConfMan.get("path")); if (!dir.getChildren(fslist, Common::FSNode::kListAll)) { - return kInvalidPathError; + return Common::kInvalidPathError; } // Invoke the detector @@ -228,11 +228,11 @@ PluginError Sword2MetaEngine::createInstance(OSystem *syst, Engine **engine) con for (uint i = 0; i < detectedGames.size(); i++) { if (detectedGames[i].gameid() == gameid) { *engine = new Sword2::Sword2Engine(syst); - return kNoError; + return Common::kNoError; } } - return kNoGameDataFoundError; + return Common::kNoGameDataFoundError; } #if PLUGIN_ENABLED_DYNAMIC(SWORD2) diff --git a/sound/musicplugin.h b/sound/musicplugin.h index bdbd07ad31..cd49942b83 100644 --- a/sound/musicplugin.h +++ b/sound/musicplugin.h @@ -100,9 +100,9 @@ public: * @param mixer Pointer to the global Mixer object * @param mididriver Pointer to a pointer which the MusicPluginObject sets * to the newly create MidiDriver, or 0 in case of an error - * @return a PluginError describing the error which occurred, or kNoError + * @return a Common::Error describing the error which occurred, or kNoError */ - virtual PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const = 0; + virtual Common::Error createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const = 0; }; diff --git a/sound/null.cpp b/sound/null.cpp index 7559a6d816..fb5cbf806a 100644 --- a/sound/null.cpp +++ b/sound/null.cpp @@ -46,13 +46,13 @@ public: } MusicDevices getDevices() const; - PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; + Common::Error createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; }; -PluginError NullMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { +Common::Error NullMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { *mididriver = new MidiDriver_NULL(); - return kNoError; + return Common::kNoError; } MusicDevices NullMusicPlugin::getDevices() const { diff --git a/sound/softsynth/adlib.cpp b/sound/softsynth/adlib.cpp index 3898956e15..86ee466065 100644 --- a/sound/softsynth/adlib.cpp +++ b/sound/softsynth/adlib.cpp @@ -1529,7 +1529,7 @@ public: } MusicDevices getDevices() const; - PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; + Common::Error createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; }; MusicDevices AdlibEmuMusicPlugin::getDevices() const { @@ -1538,10 +1538,10 @@ MusicDevices AdlibEmuMusicPlugin::getDevices() const { return devices; } -PluginError AdlibEmuMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { +Common::Error AdlibEmuMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { *mididriver = new MidiDriver_ADLIB(mixer); - return kNoError; + return Common::kNoError; } MidiDriver *MidiDriver_ADLIB_create(Audio::Mixer *mixer) { diff --git a/sound/softsynth/fluidsynth.cpp b/sound/softsynth/fluidsynth.cpp index eff9f4123c..4bf68afaea 100644 --- a/sound/softsynth/fluidsynth.cpp +++ b/sound/softsynth/fluidsynth.cpp @@ -230,7 +230,7 @@ public: } MusicDevices getDevices() const; - PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; + Common::Error createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; }; MusicDevices FluidSynthMusicPlugin::getDevices() const { @@ -239,7 +239,7 @@ MusicDevices FluidSynthMusicPlugin::getDevices() const { return devices; } -PluginError FluidSynthMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { +Common::Error FluidSynthMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { *mididriver = new MidiDriver_FluidSynth(mixer); return kNoError; diff --git a/sound/softsynth/mt32.cpp b/sound/softsynth/mt32.cpp index 3e3f9d91ff..1987fee839 100644 --- a/sound/softsynth/mt32.cpp +++ b/sound/softsynth/mt32.cpp @@ -495,7 +495,7 @@ public: } MusicDevices getDevices() const; - PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; + Common::Error createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; }; MusicDevices MT32EmuMusicPlugin::getDevices() const { @@ -504,10 +504,10 @@ MusicDevices MT32EmuMusicPlugin::getDevices() const { return devices; } -PluginError MT32EmuMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { +Common::Error MT32EmuMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { *mididriver = new MidiDriver_MT32(mixer); - return kNoError; + return Common::kNoError; } MidiDriver *MidiDriver_MT32_create(Audio::Mixer *mixer) { diff --git a/sound/softsynth/ym2612.cpp b/sound/softsynth/ym2612.cpp index 2a08bf631e..efdf292150 100644 --- a/sound/softsynth/ym2612.cpp +++ b/sound/softsynth/ym2612.cpp @@ -766,7 +766,7 @@ public: } MusicDevices getDevices() const; - PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; + Common::Error createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const; }; MusicDevices TownsEmuMusicPlugin::getDevices() const { @@ -775,10 +775,10 @@ MusicDevices TownsEmuMusicPlugin::getDevices() const { return devices; } -PluginError TownsEmuMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { +Common::Error TownsEmuMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const { *mididriver = new MidiDriver_YM2612(mixer); - return kNoError; + return Common::kNoError; } MidiDriver *MidiDriver_YM2612_create(Audio::Mixer *mixer) { |