Permalink
Browse files

WINTERMUTE: Add FoxTail version properties

FoxTail requires 2 new game properties that are used to display game version at Options menu.
I mapped BuildVersion to ScummVM version and GameVersion to last number in detected game version.
I guess we need to discuss, what those versions should actually be.
  • Loading branch information...
lolbot-iichan committed Aug 26, 2018
1 parent 6e20c01 commit aa97ca45aed4d5b4a344fd4853778f4b8629fb3d
@@ -61,9 +61,10 @@ BaseEngine::~BaseEngine() {
delete _classReg;
}

void BaseEngine::createInstance(const Common::String &targetName, const Common::String &gameId, Common::Language lang, WMETargetExecutable targetExecutable) {
void BaseEngine::createInstance(const Common::String &targetName, const Common::String &gameId, const Common::String &extra, Common::Language lang, WMETargetExecutable targetExecutable) {
instance()._targetName = targetName;
instance()._gameId = gameId;
instance()._gameIdExtra = extra;
instance()._language = lang;
instance()._targetExecutable = targetExecutable;
instance().init();
@@ -63,6 +63,7 @@ class BaseEngine : public Common::Singleton<Wintermute::BaseEngine> {
void init();
BaseFileManager *_fileManager;
Common::String _gameId;
Common::String _gameIdExtra;
Common::String _targetName;
BaseGame *_gameRef;
// We need random numbers
@@ -73,7 +74,7 @@ class BaseEngine : public Common::Singleton<Wintermute::BaseEngine> {
public:
BaseEngine();
~BaseEngine();
static void createInstance(const Common::String &targetName, const Common::String &gameId, Common::Language lang, WMETargetExecutable targetExecutable = LATEST_VERSION);
static void createInstance(const Common::String &targetName, const Common::String &gameId, const Common::String &extra, Common::Language lang, WMETargetExecutable targetExecutable = LATEST_VERSION);

void setGameRef(BaseGame *gameRef) { _gameRef = gameRef; }

@@ -90,6 +91,7 @@ class BaseEngine : public Common::Singleton<Wintermute::BaseEngine> {
static void LOG(bool res, const char *fmt, ...);
Common::String getGameTargetName() const { return _targetName; }
Common::String getGameId() const { return _gameId; }
Common::String getGameIdExtra() const { return _gameIdExtra; }
Common::Language getLanguage() const { return _language; }
WMETargetExecutable getTargetExecutable() const {
return _targetExecutable;
@@ -2337,6 +2337,33 @@ ScValue *BaseGame::scGetProperty(const Common::String &name) {
}
return _scValue;
}

//////////////////////////////////////////////////////////////////////////
// [FoxTail] BuildVersion (RO)
// Used to display full game version at options.script in UpdateControls()
// Returns engine version number as a dotted string "1.2.362"
// This implementation returns ScummVM version instead
//////////////////////////////////////////////////////////////////////////
else if (name == "BuildVersion") {
_scValue->setString(gScummVMVersion);
return _scValue;
}

//////////////////////////////////////////////////////////////////////////
// [FoxTail] GameVersion (RO)
// Used to display full game version at options.script in UpdateControls()
// Returns FoxTail version number as a string
//////////////////////////////////////////////////////////////////////////
else if (name == "GameVersion") {
if (BaseEngine::instance().getGameIdExtra() == "1.2.230.1291") {
_scValue->setString("1291");
} else if (BaseEngine::instance().getGameIdExtra() == "1.2.362.2047") {
_scValue->setString("2047");
} else {
_scValue->setString("UNKNOWN");
}
return _scValue;
}
#endif

//////////////////////////////////////////////////////////////////////////
@@ -144,7 +144,7 @@ Common::Error WintermuteEngine::run() {
}

int WintermuteEngine::init() {
BaseEngine::createInstance(_targetName, _gameDescription->adDesc.gameId, _gameDescription->adDesc.language, _gameDescription->targetExecutable);
BaseEngine::createInstance(_targetName, _gameDescription->adDesc.gameId, _gameDescription->adDesc.extra, _gameDescription->adDesc.language, _gameDescription->targetExecutable);

// check dependencies for games with high resolution assets
#if not defined(USE_PNG) || not defined(USE_JPEG) || not defined(USE_VORBIS)

0 comments on commit aa97ca4

Please sign in to comment.