diff options
author | Max Horn | 2006-03-09 02:52:51 +0000 |
---|---|---|
committer | Max Horn | 2006-03-09 02:52:51 +0000 |
commit | 86565fcca57454e91124410cfd6864ef1e202dc0 (patch) | |
tree | 83cc82217179d56f23836628520b7f63b4a0607d /base/gameDetector.h | |
parent | d2f78184af00cd91f3f1f251199a436b53f4ae64 (diff) | |
download | scummvm-rg350-86565fcca57454e91124410cfd6864ef1e202dc0.tar.gz scummvm-rg350-86565fcca57454e91124410cfd6864ef1e202dc0.tar.bz2 scummvm-rg350-86565fcca57454e91124410cfd6864ef1e202dc0.zip |
- Renamed GameSettings to PlainGameDescriptor
- Added new GameDescriptor struct (similar to PlainGameDescriptor but with
Common::String members instead of const char * ones)
- Changed DetectedGame to subclass GameDescriptor
- Removed toGameSettings() in favor of new (template) constructors in
DetectedGame and GameDescriptor
- Fixed a bug in the obsolete gameid handling in the SCUMM & SIMON engines
svn-id: r21150
Diffstat (limited to 'base/gameDetector.h')
-rw-r--r-- | base/gameDetector.h | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/base/gameDetector.h b/base/gameDetector.h index 0cada3e597..6eb9c5c231 100644 --- a/base/gameDetector.h +++ b/base/gameDetector.h @@ -34,25 +34,32 @@ namespace Audio { class Mixer; } -struct GameSettings { +struct PlainGameDescriptor { const char *gameid; const char *description; // TODO: Rename this to "title" or so }; -/** - * This template function allows to easily convert structs that mimic GameSettings - * to a GameSettings instance. - * - * Normally, one would just subclass GameSettings to get this effect much easier. - * However, subclassing a struct turns it into a non-POD type. One of the - * consequences is that you can't have inline intialized arrays of that type. - * But we heavily rely on those, hence we can't subclass GameSettings... - */ -template <class T> -GameSettings toGameSettings(const T &g) { - GameSettings dummy = { g.gameid, g.description }; - return dummy; -} +struct GameDescriptor { + Common::String gameid; + Common::String description; // TODO: Rename this to "title" or so + + GameDescriptor() {} + GameDescriptor(Common::String g, Common::String d) : + gameid(g), description(d) {} + + /** + * This template constructor allows to easily convert structs that mimic GameDescriptor + * to a GameDescriptor instance. + * + * Normally, one would just subclass GameDescriptor to get this effect much easier. + * However, subclassing a struct turns it into a non-POD type. One of the + * consequences is that you can't have inline intialized arrays of that type. + * But we heavily rely on those, hence we can't subclass GameDescriptor... + */ + template <class T> + GameDescriptor(const T &g) : + gameid(g.gameid), description(g.description) {} +}; class GameDetector { @@ -78,7 +85,7 @@ public: static Audio::Mixer *createMixer(); - static GameSettings findGame(const String &gameName, const Plugin **plugin = NULL); + static GameDescriptor findGame(const String &gameName, const Plugin **plugin = NULL); //protected: void setTarget(const String &name); // TODO: This should be protected |