diff options
-rw-r--r-- | backends/wince/wince.cpp | 6 | ||||
-rw-r--r-- | base/engine.h | 27 | ||||
-rw-r--r-- | base/gameDetector.cpp | 6 | ||||
-rw-r--r-- | base/gameDetector.h | 2 | ||||
-rw-r--r-- | base/plugins.cpp | 2 | ||||
-rw-r--r-- | gui/launcher.cpp | 16 | ||||
-rw-r--r-- | queen/queen.cpp | 8 | ||||
-rw-r--r-- | queen/queen.h | 1 | ||||
-rw-r--r-- | scumm/intern.h | 14 | ||||
-rw-r--r-- | scumm/scumm.h | 5 | ||||
-rw-r--r-- | scumm/scummvm.cpp | 79 | ||||
-rw-r--r-- | simon/simon.cpp | 26 | ||||
-rw-r--r-- | sky/sky.cpp | 6 | ||||
-rw-r--r-- | sky/sky.h | 1 | ||||
-rw-r--r-- | sword2/anims.cpp | 2 | ||||
-rw-r--r-- | sword2/function.cpp | 2 | ||||
-rw-r--r-- | sword2/maketext.cpp | 2 | ||||
-rw-r--r-- | sword2/resman.cpp | 2 | ||||
-rw-r--r-- | sword2/sound.cpp | 2 | ||||
-rw-r--r-- | sword2/sword2.cpp | 15 | ||||
-rw-r--r-- | sword2/sword2.h | 6 |
21 files changed, 113 insertions, 117 deletions
diff --git a/backends/wince/wince.cpp b/backends/wince/wince.cpp index 86e3ec8043..f254763222 100644 --- a/backends/wince/wince.cpp +++ b/backends/wince/wince.cpp @@ -856,10 +856,10 @@ void runGame(char *game_name) { /* Start the engine */ - is_simon = (detector._game.id >= GID_SIMON_FIRST && detector._game.id <= GID_SIMON_LAST); - is_bass = (detector._game.id >= GID_SKY_FIRST && detector._game.id <= GID_SKY_LAST); + is_simon = (strcmp(detector._plugin.getName(), "simon") == 0); + is_bass = (strcmp(detector._plugin.getName(), "sky") == 0); - if (smartphone || detector._game.id == GID_SAMNMAX || detector._game.id == GID_FT || detector._game.id == GID_DIG || detector._game.id == GID_CMI) + if (smartphone || strcmp(game_name, "samnmax") == 0 || strcmp(game_name, "dig") == 0 || strcmp(game_name, "ft") == 0 || strcmp(game_name, "comi") == 0) hide_cursor = FALSE; else hide_cursor = TRUE; diff --git a/base/engine.h b/base/engine.h index 25ad6e343e..9d77668c40 100644 --- a/base/engine.h +++ b/base/engine.h @@ -29,33 +29,6 @@ extern const char *gScummVMVersion; // e.g. "0.4.1" extern const char *gScummVMBuildDate; // e.g. "2003-06-24" extern const char *gScummVMFullVersion; // e.g. "ScummVM 0.4.1 (2003-06-24)" -// TODO: Get rid of these enums. Ideally, GIDs should be -// 100% local to the module they are defined in. Right now -// we can't make this change since some of the backends -// and also gui/launcher.cpp contain tests on the GID. -// Ideally, all those should be converted to something else. -enum GameId { - GID_SCUMM_FIRST = 1, - GID_SCUMM_LAST = GID_SCUMM_FIRST + 99, - - // Simon the Sorcerer - GID_SIMON_FIRST, - GID_SIMON_LAST = GID_SIMON_FIRST + 49, - - // Beneath a Steel Sky - GID_SKY_FIRST, - GID_SKY_LAST = GID_SKY_FIRST + 9, - - // Broken Sword 2 - GID_SWORD2_FIRST, - GID_SWORD2_LAST = GID_SWORD2_FIRST + 9, - - // Flight of the Amazon Queen - GID_QUEEN_FIRST, - GID_QUEEN_LAST = GID_QUEEN_FIRST + 9 -}; - - class SoundMixer; class GameDetector; class Timer; diff --git a/base/gameDetector.cpp b/base/gameDetector.cpp index 7e8c9efa47..11ba903c74 100644 --- a/base/gameDetector.cpp +++ b/base/gameDetector.cpp @@ -179,7 +179,7 @@ GameDetector::GameDetector() { _dumpScripts = false; - _game.features = 0; + memset(&_game, 0, sizeof(_game)); _plugin = 0; } @@ -225,7 +225,7 @@ void listTargets() { GameSettings GameDetector::findGame(const String &gameName, const Plugin **plugin) { // Find the GameSettings for this target const PluginList &plugins = PluginManager::instance().getPlugins(); - GameSettings result = {NULL, NULL, 0, 0, MDT_NONE, 0, NULL}; + GameSettings result = {NULL, NULL, MDT_NONE, 0, NULL}; PluginList::ConstIterator iter = plugins.begin(); for (iter = plugins.begin(); iter != plugins.end(); ++iter) { @@ -290,7 +290,7 @@ void GameDetector::parseCommandLine(int argc, char **argv) { char shortCmdLower; bool isLongCmd, cmdValue; - // Iterate over all comman line arguments, backwards. + // Iterate over all command line arguments, backwards. for (i = argc - 1; i >= 1; i--) { s = argv[i]; diff --git a/base/gameDetector.h b/base/gameDetector.h index f82237eaf9..8e161933e0 100644 --- a/base/gameDetector.h +++ b/base/gameDetector.h @@ -23,7 +23,6 @@ #ifndef GAMEDETECTOR_H #define GAMEDETECTOR_H -#include "base/plugins.h" #include "common/str.h" class Engine; @@ -50,7 +49,6 @@ enum MidiDriverType { struct GameSettings { const char *gameName; const char *description; - byte id, version; int midi; // MidiDriverType values uint32 features; const char *detectname; diff --git a/base/plugins.cpp b/base/plugins.cpp index 3b9616733e..0c9eb267b2 100644 --- a/base/plugins.cpp +++ b/base/plugins.cpp @@ -52,7 +52,7 @@ GameSettings Plugin::findGame(const char *gameName) const { // Find the GameSettings for this game assert(gameName); GameList games = getSupportedGames(); - GameSettings result = {NULL, NULL, 0, 0, MDT_NONE, 0, NULL}; + GameSettings result = {NULL, NULL, MDT_NONE, 0, NULL}; for (GameList::Iterator g = games.begin(); g != games.end(); ++g) { if (!scumm_stricmp(g->gameName, gameName)) { result = *g; diff --git a/gui/launcher.cpp b/gui/launcher.cpp index 04b918649d..b402703435 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -100,10 +100,6 @@ EditGameDialog::EditGameDialog(NewGui *gui, const String &domain, GameSettings t description = target.description; } - // Determine whether this is a SCUMM game - // FIXME: This check is evil, as it requires us to hard code GIDs. - bool isScumm = (GID_SCUMM_FIRST <= target.id && target.id <= GID_SCUMM_LAST); - // Label & edit widget for the game ID new StaticTextWidget(this, 10, 10, 40, kLineHeight, "ID: ", kTextAlignRight); @@ -124,6 +120,14 @@ EditGameDialog::EditGameDialog(NewGui *gui, const String &domain, GameSettings t _fullscreenCheckbox = new CheckboxWidget(this, 15, 62, 200, 16, "Use Fullscreen Mode", 0, 'F'); _fullscreenCheckbox->setState(ConfMan.getBool("fullscreen", _domain)); +/* + // FIXME: The amiga checkbox is outdated cruft. It should be replaced by a + // a "platform" popup. + + // Determine whether this is a SCUMM game + // FIXME: This check is evil, as it requires us to hard code GIDs. + bool isScumm = (GID_SCUMM_FIRST <= target.id && target.id <= GID_SCUMM_LAST); + // Display 'Amiga' checkbox, but only for Scumm games. if (isScumm) { _amigaCheckbox = new CheckboxWidget(this, 15, 82, 200, 16, "Amiga Version", 0, 'A'); @@ -131,7 +135,7 @@ EditGameDialog::EditGameDialog(NewGui *gui, const String &domain, GameSettings t } else { _amigaCheckbox = 0; } - +*/ // Add OK & Cancel buttons addButton(_w - 2 * (kButtonWidth + 10), _h - 24, "Cancel", kCloseCmd, 0); addButton(_w - (kButtonWidth + 10), _h - 24, "OK", kOKCmd, 0); @@ -307,7 +311,7 @@ void LauncherDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat // ...so let's determine a list of candidates, games that // could be contained in the specified directory. GameList candidates = detectGames(dir); - GameSettings result = {NULL, NULL, 0, 0, MDT_NONE, 0, NULL}; + GameSettings result = {NULL, NULL, MDT_NONE, 0, NULL}; if (candidates.isEmpty()) { // No game was found in the specified directory diff --git a/queen/queen.cpp b/queen/queen.cpp index 72c79907ab..deb95e3da5 100644 --- a/queen/queen.cpp +++ b/queen/queen.cpp @@ -45,9 +45,9 @@ extern bool draw_keyboard; static const GameSettings queen_settings[] = { /* Flight of the Amazon Queen */ - { "queen", "Flight of the Amazon Queen", GID_QUEEN_FIRST, 99, MDT_ADLIB | MDT_NATIVE | MDT_PREFER_NATIVE, 0, "queen.1" }, - { "queencomp", "Flight of the Amazon Queen", GID_QUEEN_FIRST, 99, MDT_ADLIB | MDT_NATIVE | MDT_PREFER_NATIVE, 0, "queen.1c" }, - { NULL, NULL, 0, 0, MDT_NONE, 0, NULL} + { "queen", "Flight of the Amazon Queen", MDT_ADLIB | MDT_NATIVE | MDT_PREFER_NATIVE, 0, "queen.1" }, + { "queencomp", "Flight of the Amazon Queen", MDT_ADLIB | MDT_NATIVE | MDT_PREFER_NATIVE, 0, "queen.1c" }, + { NULL, NULL, MDT_NONE, 0, NULL} }; GameList Engine_QUEEN_gameList() { @@ -89,8 +89,6 @@ namespace Queen { QueenEngine::QueenEngine(GameDetector *detector, OSystem *syst) : Engine(detector, syst) { - _game = detector->_game.id; - if (!_mixer->bindToSystem(syst)) warning("Sound initialisation failed."); diff --git a/queen/queen.h b/queen/queen.h index d5dae15af3..6596654320 100644 --- a/queen/queen.h +++ b/queen/queen.h @@ -41,7 +41,6 @@ class Sound; class QueenEngine : public Engine { void errorString(const char *buf_input, char *buf_output); protected: - byte _game; bool _quickLaunch; // set when starting with -x uint16 _debugMode; diff --git a/scumm/intern.h b/scumm/intern.h index 799eab37e1..e5c34699eb 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -41,7 +41,7 @@ protected: const OpcodeEntryV5 *_opcodesV5; public: - ScummEngine_v5(GameDetector *detector, OSystem *syst) : ScummEngine(detector, syst) {} + ScummEngine_v5(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs) : ScummEngine(detector, syst, gs) {} protected: virtual void setupOpcodes(); @@ -171,7 +171,7 @@ protected: // of preserving the right readIndexFile / loadCharset !!! class ScummEngine_v3 : public ScummEngine_v5 { public: - ScummEngine_v3(GameDetector *detector, OSystem *syst) : ScummEngine_v5(detector, syst) {} + ScummEngine_v3(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs) : ScummEngine_v5(detector, syst, gs) {} protected: void readIndexFile(); @@ -198,7 +198,7 @@ protected: const OpcodeEntryV2 *_opcodesV2; public: - ScummEngine_v2(GameDetector *detector, OSystem *syst) : ScummEngine_v3(detector, syst) {} + ScummEngine_v2(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs) : ScummEngine_v3(detector, syst, gs) {} protected: virtual void setupOpcodes(); @@ -306,7 +306,7 @@ protected: class ScummEngine_v4 : public ScummEngine_v3 { public: - ScummEngine_v4(GameDetector *detector, OSystem *syst) : ScummEngine_v3(detector, syst) {} + ScummEngine_v4(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs) : ScummEngine_v3(detector, syst, gs) {} protected: void loadCharset(int no); @@ -325,7 +325,7 @@ protected: File _hFileTable[17]; public: - ScummEngine_v6(GameDetector *detector, OSystem *syst) : ScummEngine(detector, syst) + ScummEngine_v6(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs) : ScummEngine(detector, syst, gs) { VAR_VIDEONAME = 0xFF; @@ -536,7 +536,7 @@ protected: class ScummEngine_v7 : public ScummEngine_v6 { public: - ScummEngine_v7(GameDetector *detector, OSystem *syst) : ScummEngine_v6(detector, syst) {} + ScummEngine_v7(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs) : ScummEngine_v6(detector, syst, gs) {} protected: virtual void setupScummVars(); @@ -558,7 +558,7 @@ protected: const OpcodeEntryV8 *_opcodesV8; public: - ScummEngine_v8(GameDetector *detector, OSystem *syst) : ScummEngine_v7(detector, syst) {} + ScummEngine_v8(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs) : ScummEngine_v7(detector, syst, gs) {} protected: virtual void setupOpcodes(); diff --git a/scumm/scumm.h b/scumm/scumm.h index 499b667a57..10d1faaed9 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -52,6 +52,7 @@ class Sound; struct Box; struct BoxCoords; struct FindObjectInRoom; +struct ScummGameSettings; typedef Common::Map<Common::String, int> ObjectIDMap; @@ -166,7 +167,7 @@ enum { }; enum ScummGameId { - GID_TENTACLE = GID_SCUMM_FIRST, + GID_TENTACLE, GID_MONKEY2, GID_INDY4, GID_MONKEY, @@ -296,7 +297,7 @@ protected: public: // Constructor / Destructor - ScummEngine(GameDetector *detector, OSystem *syst); + ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs); virtual ~ScummEngine(); // Init functions diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index 4d9f5da62b..0dd4218e2d 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -77,7 +77,22 @@ enum MouseButtonStatus { // Use g_scumm from error() ONLY ScummEngine *g_scumm = 0; -static const GameSettings scumm_settings[] = { +struct ScummGameSettings { + const char *gameName; + const char *description; + byte id, version; + int midi; // MidiDriverType values + uint32 features; + const char *detectname; + + GameSettings toGameSettings() const { + GameSettings dummy = { gameName, description, midi, features, detectname }; + return dummy; + } +}; + + +static const ScummGameSettings scumm_settings[] = { /* Scumm Version 1 */ /* Scumm Version 2 */ @@ -269,11 +284,11 @@ static const GameSettings scumm_settings[] = { {NULL, NULL, 0, 0, MDT_NONE, 0, NULL} }; -ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst) +ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs) : Engine(detector, syst), - _gameId(detector->_game.id), - _version(detector->_game.version), - _features(detector->_game.features), + _gameId(gs.id), + _version(gs.version), + _features(gs.features), gdi(this), _pauseDialog(0), _optionsDialog(0), _saveLoadDialog(0), _targetName(detector->_targetName) { OSystem::Property prop; @@ -597,9 +612,9 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst) // Allow the user to override the game name with a custom string. // This allows some game versions to work which use filenames // differing from the regular version(s) of that game. - _gameName = ConfMan.hasKey("basename") ? ConfMan.get("basename") : detector->_game.gameName; + _gameName = ConfMan.hasKey("basename") ? ConfMan.get("basename") : gs.gameName; - _midiDriver = GameDetector::detectMusicDriver(detector->_game.midi); + _midiDriver = GameDetector::detectMusicDriver(gs.midi); _demoMode = ConfMan.getBool("demo_mode"); _noSubtitles = ConfMan.getBool("nosubtitles"); @@ -686,7 +701,7 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst) _imuse->property(IMuse::PROP_TEMPO_BASE, ConfMan.getInt("tempo")); _imuse->property(IMuse::PROP_OLD_ADLIB_INSTRUMENTS, (_features & GF_SMALL_HEADER) ? 1 : 0); _imuse->property(IMuse::PROP_MULTI_MIDI, ConfMan.getBool("multi_midi") && - _midiDriver != MD_NULL && (detector->_game.midi & MDT_ADLIB)); + _midiDriver != MD_NULL && (gs.midi & MDT_ADLIB)); _imuse->property(IMuse::PROP_NATIVE_MT32, _native_mt32); if (_features & GF_HUMONGOUS || _features & GF_FMTOWNS) { _imuse->property(IMuse::PROP_LIMIT_PLAYERS, 1); @@ -2640,16 +2655,18 @@ const char *tag2str(uint32 tag) { using namespace Scumm; GameList Engine_SCUMM_gameList() { - const GameSettings *g = scumm_settings; + const ScummGameSettings *g = scumm_settings; GameList games; - while (g->gameName) - games.push_back(*g++); + while (g->gameName) { + games.push_back(g->toGameSettings()); + g++; + } return games; } GameList Engine_SCUMM_detectGames(const FSList &fslist) { GameList detectedGames; - const GameSettings *g; + const ScummGameSettings *g; char detectName[128]; char detectName2[128]; char detectName3[128]; @@ -2683,7 +2700,7 @@ GameList Engine_SCUMM_detectGames(const FSList &fslist) { (0 == scumm_stricmp(detectName2, gameName)) || (0 == scumm_stricmp(detectName3, gameName))) { // Match found, add to list of candidates, then abort inner loop. - detectedGames.push_back(*g); + detectedGames.push_back(g->toGameSettings()); break; } } @@ -2694,49 +2711,61 @@ GameList Engine_SCUMM_detectGames(const FSList &fslist) { Engine *Engine_SCUMM_create(GameDetector *detector, OSystem *syst) { Engine *engine; + + const ScummGameSettings *g = scumm_settings; + while (g->gameName) { + if (!scumm_stricmp(detector->_game.gameName, g->gameName)) + break; + g++; + } + if (!g->gameName) + error("Invalid game '%s'\n", detector->_game.gameName); + + ScummGameSettings game = *g; + if (ConfMan.hasKey("amiga")) { warning("Configuration key 'amiga' is deprecated. Use 'platform=amiga' instead"); if (ConfMan.getBool("amiga")) - detector->_game.features |= GF_AMIGA; + game.features |= GF_AMIGA; } switch (Common::parsePlatform(ConfMan.get("platform"))) { case Common::kPlatformAmiga: - detector->_game.features |= GF_AMIGA; + game.features |= GF_AMIGA; break; case Common::kPlatformAtariST: - detector->_game.features |= GF_ATARI_ST; + game.features |= GF_ATARI_ST; break; case Common::kPlatformMacintosh: - detector->_game.features |= GF_MACINTOSH; + game.features |= GF_MACINTOSH; break; default: break; } - switch (detector->_game.version) { + switch (game.version) { case 1: case 2: - engine = new ScummEngine_v2(detector, syst); + engine = new ScummEngine_v2(detector, syst, game); break; case 3: - engine = new ScummEngine_v3(detector, syst); + engine = new ScummEngine_v3(detector, syst, game); break; case 4: - engine = new ScummEngine_v4(detector, syst); + engine = new ScummEngine_v4(detector, syst, game); break; case 5: - engine = new ScummEngine_v5(detector, syst); + engine = new ScummEngine_v5(detector, syst, game); break; case 6: - engine = new ScummEngine_v6(detector, syst); + engine = new ScummEngine_v6(detector, syst, game); break; case 7: - engine = new ScummEngine_v7(detector, syst); + engine = new ScummEngine_v7(detector, syst, game); break; #ifndef __PALM_OS__ case 8: - engine = new ScummEngine_v8(detector, syst); + engine = new ScummEngine_v8(detector, syst, game); break; #endif default: diff --git a/simon/simon.cpp b/simon/simon.cpp index 0f4e8e0e15..dd32e97150 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -49,19 +49,19 @@ extern bool draw_keyboard; static const GameSettings simon_settings[] = { // Simon the Sorcerer 1 & 2 (not SCUMM games) - {"simon1acorn", "Simon the Sorcerer 1 (Acorn)", GID_SIMON_FIRST, 99, MDT_ADLIB | MDT_NATIVE, GAME_SIMON1ACORN, "DATA"}, - {"simon1dos", "Simon the Sorcerer 1 (DOS)", GID_SIMON_FIRST, 99, MDT_ADLIB | MDT_NATIVE, GAME_SIMON1DOS, "GAMEPC"}, - {"simon1amiga", "Simon the Sorcerer 1 (Amiga)", GID_SIMON_FIRST, 99, MDT_NONE, GAME_SIMON1AMIGA, "gameamiga"}, - {"simon2dos", "Simon the Sorcerer 2 (DOS)", GID_SIMON_FIRST, 99, MDT_ADLIB | MDT_NATIVE, GAME_SIMON2DOS, "GAME32"}, - {"simon1talkie", "Simon the Sorcerer 1 Talkie (DOS)", GID_SIMON_FIRST, 99, MDT_ADLIB | MDT_NATIVE, GAME_SIMON1TALKIE, "SIMON.GME"}, - {"simon2talkie", "Simon the Sorcerer 2 Talkie (DOS)", GID_SIMON_FIRST, 99, MDT_ADLIB | MDT_NATIVE, GAME_SIMON2TALKIE, "GSPTR30"}, - {"simon1win", "Simon the Sorcerer 1 Talkie (Windows)", GID_SIMON_FIRST, 99, MDT_ADLIB | MDT_NATIVE, GAME_SIMON1WIN, "SIMON.GME"}, - {"simon1cd32", "Simon the Sorcerer 1 Talkie (Amiga CD32)", GID_SIMON_FIRST, 99, MDT_NONE, GAME_SIMON1CD32, "gameamiga"}, - {"simon2win", "Simon the Sorcerer 2 Talkie (Windows)", GID_SIMON_FIRST, 99, MDT_ADLIB | MDT_NATIVE, GAME_SIMON2WIN, "GSPTR30"}, - {"simon2mac", "Simon the Sorcerer 2 Talkie (Amiga or Mac)", GID_SIMON_FIRST, 99, MDT_ADLIB | MDT_NATIVE, GAME_SIMON2MAC, "GSPTR30"}, - {"simon1demo", "Simon the Sorcerer 1 (DOS Demo)", GID_SIMON_FIRST, 99, MDT_ADLIB | MDT_NATIVE, GAME_SIMON1DEMO, "GDEMO"}, - - {NULL, NULL, 0, 0, MDT_NONE, 0, NULL} + {"simon1acorn", "Simon the Sorcerer 1 (Acorn)", MDT_ADLIB | MDT_NATIVE, GAME_SIMON1ACORN, "DATA"}, + {"simon1dos", "Simon the Sorcerer 1 (DOS)", MDT_ADLIB | MDT_NATIVE, GAME_SIMON1DOS, "GAMEPC"}, + {"simon1amiga", "Simon the Sorcerer 1 (Amiga)", MDT_NONE, GAME_SIMON1AMIGA, "gameamiga"}, + {"simon2dos", "Simon the Sorcerer 2 (DOS)", MDT_ADLIB | MDT_NATIVE, GAME_SIMON2DOS, "GAME32"}, + {"simon1talkie", "Simon the Sorcerer 1 Talkie (DOS)", MDT_ADLIB | MDT_NATIVE, GAME_SIMON1TALKIE, "SIMON.GME"}, + {"simon2talkie", "Simon the Sorcerer 2 Talkie (DOS)", MDT_ADLIB | MDT_NATIVE, GAME_SIMON2TALKIE, "GSPTR30"}, + {"simon1win", "Simon the Sorcerer 1 Talkie (Windows)", MDT_ADLIB | MDT_NATIVE, GAME_SIMON1WIN, "SIMON.GME"}, + {"simon1cd32", "Simon the Sorcerer 1 Talkie (Amiga CD32)", MDT_NONE, GAME_SIMON1CD32, "gameamiga"}, + {"simon2win", "Simon the Sorcerer 2 Talkie (Windows)", MDT_ADLIB | MDT_NATIVE, GAME_SIMON2WIN, "GSPTR30"}, + {"simon2mac", "Simon the Sorcerer 2 Talkie (Amiga or Mac)", MDT_ADLIB | MDT_NATIVE, GAME_SIMON2MAC, "GSPTR30"}, + {"simon1demo", "Simon the Sorcerer 1 (DOS Demo)", MDT_ADLIB | MDT_NATIVE, GAME_SIMON1DEMO, "GDEMO"}, + + {NULL, NULL, MDT_NONE, 0, NULL} }; GameList Engine_SIMON_gameList() { diff --git a/sky/sky.cpp b/sky/sky.cpp index 360ec6fd46..473530da0b 100644 --- a/sky/sky.cpp +++ b/sky/sky.cpp @@ -80,8 +80,8 @@ extern bool draw_keyboard; static const GameSettings sky_settings[] = { /* Beneath a Steel Sky */ - {"sky", "Beneath a Steel Sky", GID_SKY_FIRST, 99, MDT_ADLIB | MDT_NATIVE | MDT_PREFER_NATIVE, 0, "sky.dsk" }, - {NULL, NULL, 0, 0, MDT_NONE, 0, NULL} + {"sky", "Beneath a Steel Sky", MDT_ADLIB | MDT_NATIVE | MDT_PREFER_NATIVE, 0, "sky.dsk" }, + {NULL, NULL, MDT_NONE, 0, NULL} }; GameList Engine_SKY_gameList() { @@ -122,8 +122,6 @@ SystemVars SkyEngine::_systemVars = {0, 0, 0, 0, 4316, 0, 0, false, false }; SkyEngine::SkyEngine(GameDetector *detector, OSystem *syst) : Engine(detector, syst) { - _game = detector->_game.id; - if (!_mixer->bindToSystem(syst)) warning("Sound initialisation failed."); @@ -51,7 +51,6 @@ class SkyIntro; class SkyEngine : public Engine { void errorString(const char *buf_input, char *buf_output); protected: - byte _game; byte _key_pressed; bool _quickLaunch; // set when starting with -x bool _floppyIntro; diff --git a/sword2/anims.cpp b/sword2/anims.cpp index adcfb92c61..c378394546 100644 --- a/sword2/anims.cpp +++ b/sword2/anims.cpp @@ -754,7 +754,7 @@ int32 Logic::fnPlaySequence(int32 *params) { MoviePlayer player; - if (sequenceTextLines && g_sword2->_gameId == GID_SWORD2) + if (sequenceTextLines && !(g_sword2->_features & GF_DEMO)) rv = player.play(filename, sequenceSpeechArray, leadOut); else rv = player.play(filename, NULL, leadOut); diff --git a/sword2/function.cpp b/sword2/function.cpp index 34ba74b70e..13a64dc0c5 100644 --- a/sword2/function.cpp +++ b/sword2/function.cpp @@ -455,7 +455,7 @@ int32 Logic::fnPlayCredits(int32 *params) { // FIXME: This probably isn't the correct way of shutting down ScummVM // Anyway, I don't know if we ever call this from the demo. - if (g_sword2->_gameId == GID_SWORD2_DEMO) { + if (g_sword2->_features & GF_DEMO) { Close_game(); // close engine systems down exit(0); // quit the game } diff --git a/sword2/maketext.cpp b/sword2/maketext.cpp index 1a0584aa4c..5a233ad444 100644 --- a/sword2/maketext.cpp +++ b/sword2/maketext.cpp @@ -590,7 +590,7 @@ void Sword2Engine::initialiseFontResourceFlags(void) { // Get the text line - skip the 2 chars containing the wavId - if (g_sword2->_gameId == GID_SWORD2_DEMO) + if (g_sword2->_features & GF_DEMO) textLine = FetchTextLine(textFile, 451) + 2; else textLine = FetchTextLine(textFile, 54) + 2; diff --git a/sword2/resman.cpp b/sword2/resman.cpp index 679adfcc32..d5047ed4d3 100644 --- a/sword2/resman.cpp +++ b/sword2/resman.cpp @@ -1222,7 +1222,7 @@ void ResourceManager::getCd(int cd) { // don't ask for CD's in the playable demo downloaded from our // web-site! - if (g_sword2->_gameId == GID_SWORD2_DEMO) + if (g_sword2->_features & GF_DEMO) return; #ifdef _PCGUIDE diff --git a/sword2/sound.cpp b/sword2/sound.cpp index b807e5d895..0eb9457b39 100644 --- a/sword2/sound.cpp +++ b/sword2/sound.cpp @@ -368,7 +368,7 @@ int32 Logic::fnPlayMusic(int32 *params) { // add the appropriate file extension & play it - if (g_sword2->_gameId == GID_SWORD2_DEMO) { + if (g_sword2->_features & GF_DEMO) { // The demo I found didn't come with any music file, but you // could use the music from the first CD of the complete game, // I suppose... diff --git a/sword2/sword2.cpp b/sword2/sword2.cpp index 636b58d72a..d94d6b60ef 100644 --- a/sword2/sword2.cpp +++ b/sword2/sword2.cpp @@ -57,10 +57,10 @@ extern uint16 _debugLevel; static const GameSettings sword2_settings[] = { /* Broken Sword 2 */ - {"sword2", "Broken Sword II", GID_SWORD2, 99, MDT_ADLIB | MDT_NATIVE, GF_DEFAULT_TO_1X_SCALER, "players.clu" }, - {"sword2alt", "Broken Sword II (alt)", GID_SWORD2, 99, MDT_ADLIB | MDT_NATIVE, GF_DEFAULT_TO_1X_SCALER, "r2ctlns.ocx" }, - {"sword2demo", "Broken Sword II (Demo)", GID_SWORD2_DEMO, 99, MDT_ADLIB | MDT_NATIVE, GF_DEFAULT_TO_1X_SCALER, "players.clu" }, - {NULL, NULL, 0, 0, MDT_NONE, 0, NULL} + {"sword2", "Broken Sword II", MDT_ADLIB | MDT_NATIVE, GF_DEFAULT_TO_1X_SCALER, "players.clu" }, + {"sword2alt", "Broken Sword II (alt)", MDT_ADLIB | MDT_NATIVE, GF_DEFAULT_TO_1X_SCALER, "r2ctlns.ocx" }, + {"sword2demo", "Broken Sword II (Demo)", MDT_ADLIB | MDT_NATIVE, GF_DEFAULT_TO_1X_SCALER | GF_DEMO, "players.clu" }, + {NULL, NULL, MDT_NONE, 0, NULL} }; GameList Engine_SWORD2_gameList() { @@ -123,7 +123,6 @@ Sword2Engine::Sword2Engine(GameDetector *detector, OSystem *syst) _newgui = NULL; _debugger = NULL; _features = detector->_game.features; - _gameId = detector->_game.id; _targetName = strdup(detector->_targetName.c_str()); _bootParam = ConfMan.getInt("boot_param"); _saveSlot = ConfMan.getInt("save_slot"); @@ -221,7 +220,7 @@ int32 Sword2Engine::InitialiseGame(void) { Init_fx_queue(); // all demos (not just web) - if (_gameId == GID_SWORD2_DEMO) { + if (_features & GF_DEMO) { // set script variable DEMO = 1; } @@ -374,7 +373,7 @@ void Sword2Engine::go() { } else if (c == 'P') { // 'P' while not paused = pause! PauseGame(); - } else if (c == 'C' && _gameId == GID_SWORD2) { + } else if (c == 'C' && !(_features & GF_DEMO)) { g_logic.fnPlayCredits(NULL); } #ifdef _SWORD2_DEBUG @@ -426,7 +425,7 @@ void Sword2Engine::Start_game(void) { debug(5, "Start_game() STARTING:"); // all demos not just web - if (_gameId == GID_SWORD2_DEMO) + if (_features & GF_DEMO) screen_manager_id = 19; // DOCKS SECTION START else screen_manager_id = 949; // INTRO & PARIS START diff --git a/sword2/sword2.h b/sword2/sword2.h index 3f0ad2d41f..21d30cff22 100644 --- a/sword2/sword2.h +++ b/sword2/sword2.h @@ -29,9 +29,8 @@ #include "bs2/driver/d_sound.h" #include "bs2/driver/d_draw.h" -enum BSGameId { - GID_SWORD2 = GID_SWORD2_FIRST, - GID_SWORD2_DEMO +enum { + GF_DEMO = 1 << 0 }; class NewGui; @@ -73,7 +72,6 @@ public: int32 InitialiseGame(void); GameDetector *_detector; uint32 _features; - byte _gameId; char *_targetName; // target name for saves Sound *_sound; |