diff --git a/engines/ngi/metaengine.cpp b/engines/ngi/metaengine.cpp index e39d0886111..129a77f9154 100644 --- a/engines/ngi/metaengine.cpp +++ b/engines/ngi/metaengine.cpp @@ -49,6 +49,10 @@ const char *NGIEngine::getGameId() const { return _gameDescription->desc.gameId; } +int NGIEngine::getGameGID() const { + return _gameDescription->gameId; +} + } // End of namspace Fullpipe class NGIMetaEngine : public AdvancedMetaEngine { diff --git a/engines/ngi/ngi.cpp b/engines/ngi/ngi.cpp index 4356563fcc3..5b95cfa1ff3 100644 --- a/engines/ngi/ngi.cpp +++ b/engines/ngi/ngi.cpp @@ -31,6 +31,7 @@ #include "graphics/surface.h" #include "ngi/ngi.h" +#include "ngi/detection.h" #include "ngi/gameloader.h" #include "ngi/messages.h" #include "ngi/behavior.h" @@ -282,8 +283,19 @@ Common::Error NGIEngine::run() { if (ConfMan.hasKey("save_slot")) scene = -1; - if (!loadGam("fullpipe.gam", scene)) - return Common::kNoGameDataFoundError; + switch (getGameGID()) { + case GID_FULLPIPE: + if (!loadGam("fullpipe.gam", scene)) + return Common::kNoGameDataFoundError; + break; + case GID_MDREAM: + if (!loadGam("new.gam", scene)) + return Common::kNoGameDataFoundError; + break; + default: + warning("Unknown GID"); + return Common::kUnsupportedGameidError; + } if (ConfMan.hasKey("save_slot")) { loadGameState(ConfMan.getInt("save_slot")); diff --git a/engines/ngi/ngi.h b/engines/ngi/ngi.h index edd6ab6262a..ca75bc867eb 100644 --- a/engines/ngi/ngi.h +++ b/engines/ngi/ngi.h @@ -132,6 +132,7 @@ public: bool isDemo(); Common::Language getLanguage() const; const char *getGameId() const; + int getGameGID() const; Common::RandomSource _rnd;