aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/advancedDetector.cpp2
-rw-r--r--common/advancedDetector.h2
-rw-r--r--common/error.h25
3 files changed, 20 insertions, 9 deletions
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