MOHAWK: Simplify retrieving game features

This commit is contained in:
Bastien Bouclet 2020-03-27 20:14:46 +01:00
parent c9476543e0
commit 1d731aeef9
20 changed files with 74 additions and 67 deletions

View File

@ -127,7 +127,7 @@ void MystCursorManager::setCursor(uint16 id) {
// We're using the screen palette for the original game, but we need
// to use this for any 8bpp cursor in ME.
if (_vm->getFeatures() & GF_ME)
if (_vm->isGameVariant(GF_ME))
CursorMan.replaceCursorPalette(mhkSurface->getPalette(), 0, 256);
} else {
Graphics::PixelFormat pixelFormat = g_system->getScreenFormat();

View File

@ -73,6 +73,10 @@ uint32 MohawkEngine::getFeatures() const {
return _gameDescription->features;
}
bool MohawkEngine::isGameVariant(MohawkGameFeatures feature) const {
return (_gameDescription->features & feature) != 0;
}
Common::Platform MohawkEngine::getPlatform() const {
return _gameDescription->desc.platform;
}

View File

@ -125,16 +125,16 @@ MystOptionsWidget::MystOptionsWidget(GuiObject *boss, const Common::String &name
_dropPageButton = new GUI::ButtonWidget(widgetsBoss(), "MystOptionsDialog.DropPage", _("~D~rop Page"), nullptr, kDropCmd);
// Myst ME only has maps
if (vm->getFeatures() & GF_ME) {
if (vm->isGameVariant(GF_ME)) {
_showMapButton = new GUI::ButtonWidget(widgetsBoss(), "MystOptionsDialog.ShowMap", _("Show ~M~ap"), nullptr, kMapCmd);
}
// Myst demo only has a menu
if (vm->getFeatures() & GF_DEMO) {
if (vm->isGameVariant(GF_DEMO)) {
_returnToMenuButton = new GUI::ButtonWidget(widgetsBoss(), "MystOptionsDialog.MainMenu", _("Main Men~u~"), nullptr, kMenuCmd);
}
if (vm->getFeatures() & GF_25TH) {
if (vm->isGameVariant(GF_25TH)) {
GUI::StaticTextWidget *languageCaption = new GUI::StaticTextWidget(widgetsBoss(), "MystOptionsDialog.LanguageDesc", _("Language:"));
languageCaption->setAlign(Graphics::kTextAlignRight);

View File

@ -87,6 +87,7 @@ public:
const MohawkGameDescription *_gameDescription;
const char *getGameId() const;
uint32 getFeatures() const;
bool isGameVariant(MohawkGameFeatures feature) const;
const char *getAppName() const;
Common::Platform getPlatform() const;
uint8 getGameType() const;

View File

@ -144,7 +144,7 @@ void MohawkEngine_Myst::cachePreload(uint32 tag, uint16 id) {
for (uint32 i = 0; i < _mhk.size(); i++) {
// Check for MJMP in Myst ME
if ((getFeatures() & GF_ME) && tag == ID_MSND && _mhk[i]->hasResource(ID_MJMP, id)) {
if (isGameVariant(GF_ME) && tag == ID_MSND && _mhk[i]->hasResource(ID_MJMP, id)) {
Common::SeekableReadStream *tempData = _mhk[i]->getResource(ID_MJMP, id);
uint16 msndId = tempData->readUint16LE();
delete tempData;
@ -429,9 +429,9 @@ Common::Error MohawkEngine_Myst::run() {
// Start us on the first stack.
if (getGameType() == GType_MAKINGOF)
changeToStack(kMakingOfStack, 1, 0, 0);
else if (getFeatures() & GF_DEMO)
else if (isGameVariant(GF_DEMO))
changeToStack(kDemoStack, 2000, 0, 0);
else if (getFeatures() & GF_25TH)
else if (isGameVariant(GF_25TH))
changeToStack(kMenuStack, 1, 0, 0);
else
changeToStack(kIntroStack, 1, 0, 0);
@ -501,7 +501,7 @@ void MohawkEngine_Myst::loadStackArchives(MystStack stackId) {
loadArchive(mystFiles[stackId], nullptr, true);
if (getFeatures() & GF_ME) {
if (isGameVariant(GF_ME)) {
if (languageDesc) {
loadArchive("help", languageDesc->archiveSuffix, false);
}
@ -509,7 +509,7 @@ void MohawkEngine_Myst::loadStackArchives(MystStack stackId) {
loadArchive("help", nullptr, true);
}
if (getFeatures() & GF_25TH) {
if (isGameVariant(GF_25TH)) {
loadArchive("menu", nullptr, true);
}
}
@ -543,9 +543,9 @@ void MohawkEngine_Myst::registerDefaultSettings() {
void MohawkEngine_Myst::applyGameSettings() {
// Allow changing the language when in the main menu when the game has not yet been started.
// It's not possible to reliably change the language one the game is started as the current
// It's not possible to reliably change the language once the game is started as the current
// view cannot be reconstructed using the save / stack state.
if ((getFeatures() & GF_25TH) && !isGameStarted()) {
if (isGameVariant(GF_25TH) && !isGameStarted()) {
_currentLanguage = Common::parseLanguage(ConfMan.get("language"));
_gfx->loadMenuFont();
changeToStack(_stack->getStackId(), _card->getId(), 0, 0);
@ -696,7 +696,7 @@ bool MohawkEngine_Myst::canDoAction(MystEventAction action) {
case kMystActionShowMap:
return actionsAllowed && stack->getMap();
case kMystActionOpenMainMenu:
assert(getFeatures() & GF_DEMO);
assert(isGameVariant(GF_DEMO));
return actionsAllowed && stack->getStackId() != kDemoStack;
default:
// Not implemented yet
@ -721,14 +721,14 @@ void MohawkEngine_Myst::doAction(MystEventAction action) {
break;
}
if (getFeatures() & GF_DEMO) {
if (isGameVariant(GF_DEMO)) {
if (_stack->getStackId() != kDemoStack && isInteractive()) {
changeToStack(kDemoStack, 2002, 0, 0);
}
break;
}
if (getFeatures() & GF_25TH && isInteractive()) {
if (isGameVariant(GF_25TH) && isInteractive()) {
if (_stack->getStackId() == kMenuStack) {
// If the menu is active and a game is loaded, go back to the game
if (_prevStack) {
@ -858,7 +858,7 @@ void MohawkEngine_Myst::changeToStack(MystStack stackId, uint16 card, uint16 lin
// In Myst ME, play a fullscreen flyby movie, except when loading saves.
// Also play a flyby when first linking to Myst.
if (getFeatures() & GF_ME
if (isGameVariant(GF_ME)
&& ((_stack && _stack->getStackId() == kMystStack) || (stackId == kMystStack && card == 4134))) {
playFlybyMovie(stackId);
}
@ -962,7 +962,7 @@ void MohawkEngine_Myst::changeToCard(uint16 card, TransitionType transition) {
_card->enter();
// The demo resets the cursor at each card change except when in the library
if (getFeatures() & GF_DEMO
if (isGameVariant(GF_DEMO)
&& _gameState->_globals.currentAge != kMystLibrary) {
_cursor->setDefaultCursor();
}
@ -1059,7 +1059,7 @@ Common::Error MohawkEngine_Myst::saveGameState(int slot, const Common::String &d
}
bool MohawkEngine_Myst::hasGameSaveSupport() const {
return !(getFeatures() & GF_DEMO) && getGameType() != GType_MAKINGOF;
return !isGameVariant(GF_DEMO) && getGameType() != GType_MAKINGOF;
}
bool MohawkEngine_Myst::isInteractive() const {

View File

@ -176,7 +176,7 @@ void MystCard::loadView() {
// Precache Card Resources
uint32 cacheImageType;
if (_vm->getFeatures() & GF_ME)
if (_vm->isGameVariant(GF_ME))
cacheImageType = ID_PICT;
else
cacheImageType = ID_WDIB;

View File

@ -44,7 +44,7 @@ MystGraphics::MystGraphics(MohawkEngine_Myst* vm) :
_viewport = Common::Rect(544, 332);
if (_vm->getFeatures() & GF_ME) {
if (_vm->isGameVariant(GF_ME)) {
// High color
initGraphics(_viewport.width(), _viewport.height(), nullptr);
@ -66,7 +66,7 @@ MystGraphics::MystGraphics(MohawkEngine_Myst* vm) :
_mainMenuBackupScreenThumbnail.reset(new Graphics::Surface());
_mainMenuBackupBackBuffer.reset(new Graphics::Surface());
if (_vm->getFeatures() & GF_25TH) {
if (_vm->isGameVariant(GF_ME) && _vm->isGameVariant(GF_25TH)) {
loadMenuFont();
}
}
@ -110,7 +110,7 @@ MohawkSurface *MystGraphics::decodeImage(uint16 id) {
// that PICT resources can contain WDIB's instead of PICT's.
Common::SeekableReadStream *dataStream = nullptr;
if (_vm->getFeatures() & GF_ME && _vm->hasResource(ID_PICT, id)) {
if (_vm->isGameVariant(GF_ME) && _vm->hasResource(ID_PICT, id)) {
// The PICT resource exists. However, it could still contain a MystBitmap
// instead of a PICT image...
dataStream = _vm->getResource(ID_PICT, id);
@ -121,7 +121,7 @@ MohawkSurface *MystGraphics::decodeImage(uint16 id) {
bool isPict = false;
if ((_vm->getFeatures() & GF_ME) && dataStream->size() > 512 + 10 + 4) {
if (_vm->isGameVariant(GF_ME) && dataStream->size() > 512 + 10 + 4) {
// Here we detect whether it's really a PICT or a WDIB. Since a MystBitmap
// would be compressed, there's no way to detect for the BM without a hack.
// So, we search for the PICT version opcode for detection.
@ -144,7 +144,7 @@ MohawkSurface *MystGraphics::decodeImage(uint16 id) {
} else {
mhkSurface = _bmpDecoder->decodeImage(dataStream);
if (_vm->getFeatures() & GF_ME) {
if (_vm->isGameVariant(GF_ME)) {
mhkSurface->convertToTrueColor();
} else {
remapSurfaceToSystemPalette(mhkSurface);
@ -166,7 +166,7 @@ void MystGraphics::applyImagePatches(uint16 id, const MohawkSurface *mhkSurface)
//
// Here we stomp over the "off" with an "on".
// The fixed image was provided by dafioram in bug Trac#10115.
if (id == 2019 && _vm->getFeatures() & GF_ME && _vm->getLanguage() == Common::EN_ANY) {
if (id == 2019 && _vm->isGameVariant(GF_ME) && _vm->getLanguage() == Common::EN_ANY) {
static const byte markerSwitchInstructionsFixPic[] = {
0x1d, 0x1c, 0x19, 0x19, 0x19, 0x19, 0x1c, 0x19, 0x19, 0x17, 0x19, 0x19, 0x19, 0x19, 0x19,
0x1e, 0x1e, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19, 0x19,
@ -270,7 +270,7 @@ void MystGraphics::copyImageSectionToBackBuffer(uint16 image, Common::Rect src,
MohawkSurface *mhkSurface = findImage(image);
Graphics::Surface *surface = mhkSurface->getSurface();
if (image == 2258 && _vm->getFeatures() & GF_ME) {
if (image == 2258 && _vm->isGameVariant(GF_ME)) {
// In Myst ME, the image for the open red page brother door
// when the special lights are on does not have the correct width.
// We work around this issue by tweaking the destination rectangle
@ -317,7 +317,7 @@ void MystGraphics::copyImageSectionToBackBuffer(uint16 image, Common::Rect src,
for (uint16 i = 0; i < height; i++)
memcpy(_backBuffer->getBasePtr(dest.left, i + dest.top), surface->getBasePtr(src.left, top + i), width * surface->format.bytesPerPixel);
if (!(_vm->getFeatures() & GF_ME)) {
if (!_vm->isGameVariant(GF_ME)) {
// Make sure the palette is set
assert(mhkSurface->getPalette());
memcpy(_palette, mhkSurface->getPalette(), 256 * 3);
@ -685,11 +685,11 @@ void MystGraphics::drawRect(Common::Rect rect, RectState state) {
Graphics::Surface *screen = _vm->_system->lockScreen();
if (state == kRectEnabled)
screen->frameRect(rect, (_vm->getFeatures() & GF_ME) ? _pixelFormat.RGBToColor(0, 255, 0) : 250);
screen->frameRect(rect, _vm->isGameVariant(GF_ME) ? _pixelFormat.RGBToColor(0, 255, 0) : 250);
else if (state == kRectUnreachable)
screen->frameRect(rect, (_vm->getFeatures() & GF_ME) ? _pixelFormat.RGBToColor(0, 0, 255) : 252);
screen->frameRect(rect, _vm->isGameVariant(GF_ME) ? _pixelFormat.RGBToColor(0, 0, 255) : 252);
else
screen->frameRect(rect, (_vm->getFeatures() & GF_ME) ? _pixelFormat.RGBToColor(255, 0, 0) : 249);
screen->frameRect(rect, _vm->isGameVariant(GF_ME) ? _pixelFormat.RGBToColor(255, 0, 0) : 249);
_vm->_system->unlockScreen();
}
@ -700,7 +700,7 @@ void MystGraphics::drawLine(const Common::Point &p1, const Common::Point &p2, ui
void MystGraphics::fadeToBlack() {
// This is only for the demo
assert(!(_vm->getFeatures() & GF_ME));
assert(!_vm->isGameVariant(GF_ME));
// Linear fade in 64 steps
for (int i = 63; i >= 0; i--) {
@ -718,7 +718,7 @@ void MystGraphics::fadeToBlack() {
void MystGraphics::fadeFromBlack() {
// This is only for the demo
assert(!(_vm->getFeatures() & GF_ME));
assert(!_vm->isGameVariant(GF_ME));
copyBackBufferToScreen(_viewport);

View File

@ -764,7 +764,7 @@ void MystScriptParser::o_changeStack(uint16 var, const ArgumentsArray &args) {
_vm->_sound->stopEffect();
if (_vm->getFeatures() & GF_DEMO) {
if (_vm->isGameVariant(GF_DEMO)) {
// No need to have a table for just this data...
if (targetStack == 1)
_vm->changeToStack(kDemoSlidesStack, 1000, soundIdLinkSrc, soundIdLinkDst);

View File

@ -46,7 +46,7 @@ MystSound::~MystSound() {
}
Audio::RewindableAudioStream *MystSound::makeAudioStream(uint16 id, CueList *cueList) {
if (_vm->getFeatures() & GF_ME)
if (_vm->isGameVariant(GF_ME))
return Audio::makeWAVStream(_vm->getResource(ID_MSND, convertMystID(id)), DisposeAfterUse::YES);
else
return makeMohawkWaveStream(_vm->getResource(ID_MSND, id), cueList);

View File

@ -116,7 +116,7 @@ void Intro::introMovies_run() {
case 4:
_introStep = 5;
if (!(_vm->getFeatures() & GF_DEMO)) { // The demo doesn't have the intro video
if (!_vm->isGameVariant(GF_DEMO)) { // The demo doesn't have the intro video
video = _vm->playMovieFullscreen("intro", kIntroStack);
}
break;
@ -125,7 +125,7 @@ void Intro::introMovies_run() {
_introStep = 6;
break;
default:
if (_vm->getFeatures() & GF_DEMO)
if (_vm->isGameVariant(GF_DEMO))
_vm->changeToCard(2001, kTransitionRightToLeft);
else
_vm->changeToCard(2, kTransitionRightToLeft);
@ -135,7 +135,7 @@ void Intro::introMovies_run() {
void Intro::o_playIntroMovies(uint16 var, const ArgumentsArray &args) {
_introMoviesRunning = true;
if (_vm->getFeatures() & GF_25TH) {
if (_vm->isGameVariant(GF_25TH)) {
// In the 25th anniversary version, the Broderbund / Cyan Logo were already shown
// before the main menu. No need to play them again here.
_introStep = 4;

View File

@ -2975,7 +2975,7 @@ void Myst::clockGearForwardOneStep(uint16 gear) {
void Myst::clockWeightDownOneStep() {
// The Myst ME version of this video is encoded faster than the original
// The weight goes on the floor one step too early. Original ME engine also has this behavior.
bool updateVideo = !(_vm->getFeatures() & GF_ME) || _clockWeightPosition < (2214 - 246);
bool updateVideo = !_vm->isGameVariant(GF_ME) || _clockWeightPosition < (2214 - 246);
// Set video bounds
if (updateVideo) {
@ -3278,7 +3278,7 @@ Common::Point Myst::towerRotationMapComputeCoords(uint16 angle) {
void Myst::towerRotationMapDrawLine(const Common::Point &end, bool rotationLabelVisible) {
uint32 color;
if (_vm->getFeatures() & GF_ME) {
if (_vm->isGameVariant(GF_ME)) {
Graphics::PixelFormat pf = _vm->_system->getScreenFormat();
if (!_towerRotationOverSpot)
@ -3505,7 +3505,7 @@ void Myst::o_observatory_init(uint16 var, const ArgumentsArray &args) {
bool Myst::observatoryIsDDMMYYYY2400() {
// TODO: Auto-detect based on the month rect position
return !(_vm->getFeatures() & GF_ME) && (_vm->getLanguage() == Common::FR_FRA
return !_vm->isGameVariant(GF_ME) && (_vm->getLanguage() == Common::FR_FRA
|| _vm->getLanguage() == Common::DE_DEU);
}

View File

@ -213,7 +213,7 @@ bool MystGameState::saveState(int slot) {
debugC(kDebugSaveLoad, "Saving game to '%s'", filename.c_str());
Common::Serializer s(nullptr, saveFile);
syncGameState(s, _vm->getFeatures() & GF_ME);
syncGameState(s, _vm->isGameVariant(GF_ME));
saveFile->finalize();
delete saveFile;
@ -532,7 +532,7 @@ void MystGameState::addZipDest(MystStack stack, uint16 view) {
ZipDests *zipDests = nullptr;
// The demo has no zip dest storage
if (_vm->getFeatures() & GF_DEMO)
if (_vm->isGameVariant(GF_DEMO))
return;
// Select stack
@ -578,7 +578,7 @@ bool MystGameState::isReachableZipDest(MystStack stack, uint16 view) {
return false;
// The demo has no zip dest storage
if (_vm->getFeatures() & GF_DEMO)
if (_vm->isGameVariant(GF_DEMO))
return false;
// Select stack

View File

@ -176,7 +176,7 @@ Common::Error MohawkEngine_Riven::run() {
_cursor->showCursor();
// Let's begin, shall we?
if (getFeatures() & GF_DEMO) {
if (isGameVariant(GF_DEMO)) {
// Start the demo off with the videos
changeToStack(kStackAspit);
changeToCard(6);
@ -263,12 +263,12 @@ void MohawkEngine_Riven::processInput() {
runOptionsDialog();
break;
case kRivenActionOpenMainMenu:
if (getFeatures() & GF_DEMO) {
if (isGameVariant(GF_DEMO)) {
// Return to the main menu in the demo
if (_stack->getId() != kStackAspit)
changeToStack(kStackAspit);
changeToCard(1);
} else if (!_scriptMan->hasQueuedScripts() && getFeatures() & GF_25TH) {
} else if (!_scriptMan->hasQueuedScripts() && isGameVariant(GF_25TH)) {
// Check if we haven't jumped to menu
if (_menuSavedStack == -1) {
goToMainMenu();
@ -281,7 +281,7 @@ void MohawkEngine_Riven::processInput() {
break;
case kRivenActionPlayIntroVideos:
// Play the intro videos in the demo
if (getFeatures() & GF_DEMO) {
if (isGameVariant(GF_DEMO)) {
if (_stack->getId() != kStackAspit)
changeToStack(kStackAspit);
changeToCard(6);
@ -392,7 +392,7 @@ void MohawkEngine_Riven::changeToStack(uint16 stackId) {
char prefix = RivenStacks::getName(stackId)[0];
// Load the localization override file if any
if (getFeatures() & GF_25TH) {
if (isGameVariant(GF_25TH)) {
loadLanguageDatafile(prefix, stackId);
}
@ -467,9 +467,9 @@ const char **MohawkEngine_Riven::listExpectedDatafiles() const {
};
const char **datafiles;
if (getFeatures() & GF_DEMO) {
if (isGameVariant(GF_DEMO)) {
datafiles = datafilesDemo;
} else if (getFeatures() & GF_DVD) {
} else if (isGameVariant(GF_DVD)) {
datafiles = datafilesDVD;
} else {
datafiles = datafilesCD;
@ -624,7 +624,7 @@ void MohawkEngine_Riven::changeToCard(uint16 dest) {
// on different cards).
_gfx->clearCache();
if (!(getFeatures() & GF_DEMO)) {
if (!isGameVariant(GF_DEMO)) {
for (byte i = 0; i < ARRAYSIZE(rivenSpecialChange); i++)
if (_stack->getId() == rivenSpecialChange[i].startStack && dest == _stack->getCardStackId(
rivenSpecialChange[i].startCardRMAP)) {
@ -813,7 +813,7 @@ bool MohawkEngine_Riven::isZipVisitedCard(const Common::String &hotspotName) con
}
bool MohawkEngine_Riven::canLoadGameStateCurrently() {
if (getFeatures() & GF_DEMO) {
if (isGameVariant(GF_DEMO)) {
return false;
}

View File

@ -219,7 +219,7 @@ void RivenCard::applyPropertiesPatch2E76(uint32 globalId) {
// }
// break;
// }
if (globalId == 0x2E76 && !(_vm->getFeatures() & GF_DVD)) {
if (globalId == 0x2E76 && !_vm->isGameVariant(GF_DVD)) {
uint16 aGehnVariable = _vm->getStack()->getIdFromName(kVariableNames, "agehn");
uint16 aTrapBookVariable = _vm->getStack()->getIdFromName(kVariableNames, "atrapbook");
uint16 patchData[] = {
@ -398,7 +398,7 @@ void RivenCard::applyPropertiesPatch22118(uint32 globalId) {
}
void RivenCard::applyPropertiesPatchE2E(uint32 globalId) {
if (!(_vm->getFeatures() & GF_25TH))
if (!_vm->isGameVariant(GF_25TH))
return;
// The main menu in the Myst 25th anniversary version is patched to include new items:

View File

@ -340,7 +340,9 @@ RivenGraphics::RivenGraphics(MohawkEngine_Riven* vm) :
_effectScreen = new Graphics::Surface();
_effectScreen->create(608, 392, _pixelFormat);
loadMenuFont();
if (_vm->isGameVariant(GF_25TH)) {
loadMenuFont();
}
}
RivenGraphics::~RivenGraphics() {

View File

@ -54,7 +54,7 @@ void RivenInventory::draw() {
clearArea();
// Draw the demo's exit button
if (_vm->getFeatures() & GF_DEMO) {
if (_vm->isGameVariant(GF_DEMO)) {
// extras.mhk tBMP 101 contains "EXIT" instead of Atrus' journal in the demo!
// The demo's extras.mhk contains all the other inventory/marble/credits image
// but has hacked tBMP 101 with "EXIT". *sigh*
@ -100,7 +100,7 @@ void RivenInventory::checkClick(const Common::Point &mousePos) {
}
// In the demo, check if we've clicked the exit button
if (_vm->getFeatures() & GF_DEMO) {
if (_vm->isGameVariant(GF_DEMO)) {
if (_demoExitRect.contains(mousePos)) {
if (_vm->getStack()->getId() == kStackAspit && _vm->getCard()->getId() == 1) {
// From the main menu, go to the "quit" screen
@ -181,7 +181,7 @@ bool RivenInventory::isVisible() const {
return false;
}
if (_vm->getFeatures() & GF_DEMO) {
if (_vm->isGameVariant(GF_DEMO)) {
// The inventory is always visible in the demo
return true;
}

View File

@ -165,7 +165,7 @@ SaveStateDescriptor RivenSaveLoad::querySaveMetaInfos(const int slot) {
}
Common::Error RivenSaveLoad::loadGame(const int slot) {
if (_vm->getFeatures() & GF_DEMO) // Don't load games in the demo
if (_vm->isGameVariant(GF_DEMO)) // Don't load games in the demo
return Common::kNoError;
Common::String filename = buildSaveFilename(slot);
@ -187,8 +187,8 @@ Common::Error RivenSaveLoad::loadGame(const int slot) {
Common::SeekableReadStream *vers = mhk->getResource(ID_VERS, 1);
uint32 saveGameVersion = vers->readUint32BE();
delete vers;
if ((saveGameVersion == kCDSaveGameVersion && (_vm->getFeatures() & GF_DVD))
|| (saveGameVersion == kDVDSaveGameVersion && !(_vm->getFeatures() & GF_DVD))) {
if ((saveGameVersion == kCDSaveGameVersion && _vm->isGameVariant(GF_DVD))
|| (saveGameVersion == kDVDSaveGameVersion && !_vm->isGameVariant(GF_DVD))) {
warning("Unable to load: Saved game created using an incompatible game version - CD vs DVD");
delete mhk;
return Common::Error(Common::kUnknownError, "Saved game created using an incompatible game version - CD vs DVD");
@ -297,7 +297,7 @@ Common::Error RivenSaveLoad::loadGame(const int slot) {
Common::MemoryWriteStreamDynamic *RivenSaveLoad::genVERSSection() {
Common::MemoryWriteStreamDynamic *stream = new Common::MemoryWriteStreamDynamic(DisposeAfterUse::YES);
if (_vm->getFeatures() & GF_DVD)
if (_vm->isGameVariant(GF_DVD))
stream->writeUint32BE(kDVDSaveGameVersion);
else
stream->writeUint32BE(kCDSaveGameVersion);

View File

@ -313,7 +313,7 @@ void RivenScript::applyCardPatches(MohawkEngine_Riven *vm, uint32 cardGlobalId,
// switchCard(534);
// playSound(112, 256, 0);
if (cardGlobalId == 0x2E900 && scriptType == kMouseDownScript && hotspotId == 3
&& !(vm->getFeatures() & GF_DVD)) {
&& !vm->isGameVariant(GF_DVD)) {
shouldApplyPatches = true;
RivenSimpleCommand::ArgumentArray arguments;
arguments.push_back(112);
@ -325,7 +325,7 @@ void RivenScript::applyCardPatches(MohawkEngine_Riven *vm, uint32 cardGlobalId,
// Second part of the patch to fix the invalid card change when entering Gehn's office
// The first part is in the card patches.
if (cardGlobalId == 0x2E76 && scriptType == kCardUpdateScript && !(vm->getFeatures() & GF_DVD)) {
if (cardGlobalId == 0x2E76 && scriptType == kCardUpdateScript && !vm->isGameVariant(GF_DVD)) {
shouldApplyPatches = true;
for (uint i = 0; i < _commands.size(); i++) {
@ -367,7 +367,7 @@ void RivenScript::applyCardPatches(MohawkEngine_Riven *vm, uint32 cardGlobalId,
// Override the main menu new game script to call an external command.
// This way we can reset all the state when starting a new game while a game is already started.
if (cardGlobalId == 0xE2E && scriptType == kMouseDownScript && hotspotId == 16
&& (vm->getFeatures() & GF_25TH)) {
&& vm->isGameVariant(GF_25TH)) {
shouldApplyPatches = true;
_commands.clear();

View File

@ -90,7 +90,7 @@ void ASpit::xastartupbtnhide(const ArgumentArray &args) {
// The original game hides the start/setup buttons depending on an ini entry.
// It's safe to ignore this command.
if (!(_vm->getFeatures() & GF_25TH))
if (!_vm->isGameVariant(GF_25TH))
return;
int lang = -1;
@ -202,7 +202,7 @@ void ASpit::xaatrusbooknextpage(const ArgumentArray &args) {
// Keep turning pages while the mouse is pressed
while (keepTurningPages()) {
// Check for the last page
if (((_vm->getFeatures() & GF_DEMO) && page == 6) || page == 10)
if ((_vm->isGameVariant(GF_DEMO) && page == 6) || page == 10)
return;
// Update the page number

View File

@ -140,7 +140,7 @@ void VideoEntry::setVolume(int volume) {
VideoManager::VideoManager(MohawkEngine *vm) : _vm(vm) {
// Set dithering enabled, if required
_enableDither = (_vm->getGameType() == GType_MYST || _vm->getGameType() == GType_MAKINGOF) && !(_vm->getFeatures() & GF_ME);
_enableDither = (_vm->getGameType() == GType_MYST || _vm->getGameType() == GType_MAKINGOF) && !_vm->isGameVariant(GF_ME);
}
VideoManager::~VideoManager() {