Skip to content

Commit

Permalink
WINTERMUTE: Add FoxTail version properties
Browse files Browse the repository at this point in the history
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 aa97ca4
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
3 changes: 2 additions & 1 deletion engines/wintermute/base/base_engine.cpp
Expand Up @@ -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();
Expand Down
4 changes: 3 additions & 1 deletion engines/wintermute/base/base_engine.h
Expand Up @@ -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
Expand All @@ -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; }

Expand All @@ -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;
Expand Down
27 changes: 27 additions & 0 deletions engines/wintermute/base/base_game.cpp
Expand Up @@ -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

//////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion engines/wintermute/wintermute.cpp
Expand Up @@ -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)
Expand Down

0 comments on commit aa97ca4

Please sign in to comment.