From 8cf8acfd633227a55d794d39219c25b6b269d146 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 8 Apr 2006 11:21:04 +0000 Subject: Renamed various *GameSettings to GameSettings (our namespaces are enough to distinguish them) svn-id: r21686 --- engines/cine/cine.cpp | 12 ++++++------ engines/gob/gob.cpp | 8 ++++---- engines/kyra/kyra.cpp | 15 ++++++++++----- engines/lure/lure.cpp | 14 +++++++++----- engines/sword2/sword2.cpp | 16 ++++++++++------ 5 files changed, 39 insertions(+), 26 deletions(-) diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp index 8f0ebd2230..5c08e95ec1 100644 --- a/engines/cine/cine.cpp +++ b/engines/cine/cine.cpp @@ -57,7 +57,7 @@ char *savePath; -struct CINEGameSettings { +struct GameSettings { const char *name; const char *description; byte id; @@ -68,7 +68,7 @@ struct CINEGameSettings { } }; -static const CINEGameSettings cine_settings[] = { +static const GameSettings cine_settings[] = { {"fw", "Future Wars", Cine::GID_FW, MDT_ADLIB, "AUTO00.PRC"}, {"os", "Operation Stealth", Cine::GID_OS, MDT_ADLIB, "PROCS00"}, {NULL, NULL, 0, 0, NULL} @@ -76,7 +76,7 @@ static const CINEGameSettings cine_settings[] = { GameList Engine_CINE_gameIDList() { GameList games; - const CINEGameSettings *g = cine_settings; + const GameSettings *g = cine_settings; while (g->name) { games.push_back(g->toGameDescriptor()); @@ -87,7 +87,7 @@ GameList Engine_CINE_gameIDList() { } GameDescriptor Engine_CINE_findGameID(const char *gameid) { - const CINEGameSettings *g = cine_settings; + const GameSettings *g = cine_settings; while (g->name) { if (0 == scumm_stricmp(gameid, g->name)) break; @@ -98,7 +98,7 @@ GameDescriptor Engine_CINE_findGameID(const char *gameid) { DetectedGameList Engine_CINE_detectGames(const FSList &fslist) { DetectedGameList detectedGames; - const CINEGameSettings *g; + const GameSettings *g; for (g = cine_settings; g->name; ++g) { // Iterate over all files in the given directory @@ -134,7 +134,7 @@ CineEngine::CineEngine(GameDetector *detector, OSystem *syst) : Engine(syst) { _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume")); _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume")); - const CINEGameSettings *g; + const GameSettings *g; for (g = cine_settings; g->name; ++g) if (!scumm_stricmp(g->name, detector->_targetName.c_str())) diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp index 67b54dc693..d25740aded 100644 --- a/engines/gob/gob.cpp +++ b/engines/gob/gob.cpp @@ -55,14 +55,14 @@ enum { kMD5FileSizeLimit = 1024 * 1024 }; -struct GobGameSettings { +struct GameSettings { const char *gameid; const char *description; uint32 features; const char *md5sum; }; -static const GobGameSettings gob_games[] = { +static const GameSettings gob_games[] = { // Supplied by Florian Zeitz on scummvm-devel {"gob1", "Gobliiins (DOS EGA)", GF_GOB1 | GF_EGA, "82aea70ef26f41fa963dfae270993e49"}, {"gob1", "Gobliiins (DOS EGA)", GF_GOB1 | GF_EGA, "1f499458837008058b8ba6ae07057214"}, @@ -297,7 +297,7 @@ GameDescriptor Engine_GOB_findGameID(const char *gameid) { DetectedGameList Engine_GOB_detectGames(const FSList &fslist) { DetectedGameList detectedGames; - const GobGameSettings *g; + const GameSettings *g; FSList::const_iterator file; // Iterate over all files in the given directory @@ -351,7 +351,7 @@ Engine *Engine_GOB_create(GameDetector * detector, OSystem *syst) { error("Engine_GOB_create(): Cannot find intro.stk"); } - const GobGameSettings *g; + const GameSettings *g; bool found = false; // TODO diff --git a/engines/kyra/kyra.cpp b/engines/kyra/kyra.cpp index 75ade891cd..8bc80e9a72 100644 --- a/engines/kyra/kyra.cpp +++ b/engines/kyra/kyra.cpp @@ -50,7 +50,7 @@ #include "kyra/text.h" #include "kyra/debugger.h" -using namespace Kyra; +namespace Kyra { enum { // We only compute MD5 of the first megabyte of our data files. @@ -58,7 +58,7 @@ enum { }; // Kyra MD5 detection brutally ripped from the Gobliins engine. -struct KyraGameSettings { +struct GameSettings { const char *gameid; const char *description; byte id; @@ -69,7 +69,7 @@ struct KyraGameSettings { // We could get rid of md5 detection at least for kyra 1 since we can locate all // needed files for detecting the right language and version (Floppy, Talkie) -static const KyraGameSettings kyra_games[] = { +static const GameSettings kyra_games[] = { { "kyra1", "The Legend of Kyrandia", GI_KYRA1, GF_ENGLISH | GF_FLOPPY, // english floppy 1.0 from Malice "3c244298395520bb62b5edfe41688879", "GEMCUT.EMC" }, { "kyra1", "The Legend of Kyrandia", GI_KYRA1, GF_ENGLISH | GF_FLOPPY, @@ -118,6 +118,10 @@ static const KyraLanguageTable kyra_languages[] = { { 0, 0, Common::UNK_LANG } }; +} // End of namespace Kyra + +using namespace Kyra; + static Common::Language convertKyraLang(uint32 features) { if (features & GF_ENGLISH) { return Common::EN_USA; @@ -154,7 +158,7 @@ GameDescriptor Engine_KYRA_findGameID(const char *gameid) { DetectedGameList Engine_KYRA_detectGames(const FSList &fslist) { DetectedGameList detectedGames; - const KyraGameSettings *g; + const GameSettings *g; FSList::const_iterator file; // Iterate over all files in the given directory @@ -264,7 +268,7 @@ KyraEngine::KyraEngine(GameDetector *detector, OSystem *system) uint8 md5sum[16]; char md5str[32 + 1]; - const KyraGameSettings *g; + const GameSettings *g; bool found = false; // TODO @@ -1266,4 +1270,5 @@ void KyraEngine::runNpcScript(int func) { _scriptInterpreter->runScript(_npcScript); } } + } // End of namespace Kyra diff --git a/engines/lure/lure.cpp b/engines/lure/lure.cpp index cdc3a31279..e4b313580b 100644 --- a/engines/lure/lure.cpp +++ b/engines/lure/lure.cpp @@ -44,14 +44,14 @@ #include "lure/game.h" #include "lure/system.h" -using namespace Lure; +namespace Lure { enum { // We only compute MD5 of the first megabyte of our data files. kMD5FileSizeLimit = 1024 * 1024 }; -struct LureGameSettings { +struct GameSettings { const char *gameid; const char *description; byte id; @@ -62,7 +62,7 @@ struct LureGameSettings { }; // -static const LureGameSettings lure_games[] = { +static const GameSettings lure_games[] = { { "lure", "Lure of the Temptress", GI_LURE, GF_FLOPPY, Common::EN_USA, "e45ea5d279a268c7d3c6524c2f63a2d2", "disk1.vga" }, /* @@ -81,6 +81,10 @@ static const PlainGameDescriptor lure_list[] = { { 0, 0 } }; +} // End of namespace Lure + +using namespace Lure; + GameList Engine_LURE_gameIDList() { GameList games; const PlainGameDescriptor *g = lure_list; @@ -104,7 +108,7 @@ GameDescriptor Engine_LURE_findGameID(const char *gameid) { DetectedGameList Engine_LURE_detectGames(const FSList &fslist) { DetectedGameList detectedGames; - const LureGameSettings *g; + const GameSettings *g; FSList::const_iterator file; // Iterate over all files in the given directory @@ -213,7 +217,7 @@ void LureEngine::detectGame() { uint8 md5sum[16]; char md5str[32 + 1]; - const LureGameSettings *g; + const GameSettings *g; bool found = false; *md5str = 0; diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp index 8d74e94e45..b507813c19 100644 --- a/engines/sword2/sword2.cpp +++ b/engines/sword2/sword2.cpp @@ -48,14 +48,16 @@ extern bool isSmartphone(); #endif -struct Sword2GameSettings { +namespace Sword2 { + +struct GameSettings { const char *gameid; const char *description; uint32 features; const char *detectname; }; -static const Sword2GameSettings sword2_settings[] = { +static const GameSettings sword2_settings[] = { /* Broken Sword 2 */ {"sword2", "Broken Sword 2: The Smoking Mirror", 0, "players.clu" }, {"sword2alt", "Broken Sword 2: The Smoking Mirror (alt)", 0, "r2ctlns.ocx" }, @@ -63,8 +65,10 @@ static const Sword2GameSettings sword2_settings[] = { {NULL, NULL, 0, NULL} }; +} // End of namespace Sword2 + GameList Engine_SWORD2_gameIDList() { - const Sword2GameSettings *g = sword2_settings; + const Sword2::GameSettings *g = Sword2::sword2_settings; GameList games; while (g->gameid) { games.push_back(*g); @@ -74,7 +78,7 @@ GameList Engine_SWORD2_gameIDList() { } GameDescriptor Engine_SWORD2_findGameID(const char *gameid) { - const Sword2GameSettings *g = sword2_settings; + const Sword2::GameSettings *g = Sword2::sword2_settings; while (g->gameid) { if (0 == scumm_stricmp(gameid, g->gameid)) break; @@ -85,13 +89,13 @@ GameDescriptor Engine_SWORD2_findGameID(const char *gameid) { DetectedGameList Engine_SWORD2_detectGames(const FSList &fslist) { DetectedGameList detectedGames; - const Sword2GameSettings *g; + const Sword2::GameSettings *g; // TODO: It would be nice if we had code here which distinguishes // between the 'sword2' and 'sword2demo' targets. The current code // can't do that since they use the same detectname. - for (g = sword2_settings; g->gameid; ++g) { + for (g = Sword2::sword2_settings; g->gameid; ++g) { // Iterate over all files in the given directory for (FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) { if (!file->isDirectory()) { -- cgit v1.2.3