NGI: Loading of initial file for MDream

This commit is contained in:
Eugene Sandulenko 2020-10-04 21:56:01 +02:00
parent 1395a8b4e5
commit f48d052021
3 changed files with 19 additions and 2 deletions

View File

@ -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 {

View File

@ -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"));

View File

@ -132,6 +132,7 @@ public:
bool isDemo();
Common::Language getLanguage() const;
const char *getGameId() const;
int getGameGID() const;
Common::RandomSource _rnd;