SCUMM: Rename enhancementClassActive to enhancementEnabled

This commit is contained in:
AndywinXp 2023-11-06 08:04:17 +01:00 committed by Eugene Sandulenko
parent e7f4f25881
commit 8461f25218
26 changed files with 91 additions and 91 deletions

View File

@ -417,7 +417,7 @@ void Actor_v3::setupActorScale() {
// in the German release (and then it'd probably be better to restore
// that safeguard instead, since the game clearly doesn't expect you
// to go back inside the castle), but I don't own this version. -dwa
if (_number == 2 && _costume == 7 && _vm->_game.id == GID_INDY3 && _vm->_currentRoom == 12 && _vm->enhancementClassActive(kEnhMinorBugFixes)) {
if (_number == 2 && _costume == 7 && _vm->_game.id == GID_INDY3 && _vm->_currentRoom == 12 && _vm->enhancementEnabled(kEnhMinorBugFixes)) {
_scalex = 0x50;
_scaley = 0x50;
} else {
@ -1648,7 +1648,7 @@ void Actor::putActor(int dstX, int dstY, int newRoom) {
// WORKAROUND: The green transparency of the tank in the Hall of Oddities
// is positioned one pixel too far to the left. This appears to be a bug
// in the original game as well.
if (_vm->_game.id == GID_SAMNMAX && newRoom == 16 && _number == 5 && dstX == 235 && dstY == 236 && _vm->enhancementClassActive(kEnhMinorBugFixes))
if (_vm->_game.id == GID_SAMNMAX && newRoom == 16 && _number == 5 && dstX == 235 && dstY == 236 && _vm->enhancementEnabled(kEnhMinorBugFixes))
dstX++;
_pos.x = dstX;

View File

@ -418,7 +418,7 @@ byte AkosRenderer::drawLimb(const Actor *a, int limb) {
// WORKAROUND bug #13532: There is a frame (of Freddi's eye) in US release of Freddi 3 accidentaly being big
// and an horizontal line at the bottom, causing this line to appear at the bottom of the screen.
// We draw the whole frame one pixel down so it does not appear on screen.
if (_vm->_game.id == GID_FREDDI3 && _vm->_language == Common::EN_USA && a->_costume == 258 && (code & AKC_CelMask) == 35 && _vm->enhancementClassActive(kEnhVisualChanges))
if (_vm->_game.id == GID_FREDDI3 && _vm->_language == Common::EN_USA && a->_costume == 258 && (code & AKC_CelMask) == 35 && _vm->enhancementEnabled(kEnhVisualChanges))
yMoveCur += 1;
if (i == extra - 1) {

View File

@ -176,7 +176,7 @@ byte ScummEngine::getMaskFromBox(int box) {
// stands at a specific place near Nur-Ab-Sal's abode. This is a bug in
// the data files, as it also occurs with the original engine. We work
// around it here anyway.
if (_game.id == GID_INDY4 && _currentRoom == 225 && _roomResource == 94 && box == 8 && enhancementClassActive(kEnhMinorBugFixes))
if (_game.id == GID_INDY4 && _currentRoom == 225 && _roomResource == 94 && box == 8 && enhancementEnabled(kEnhMinorBugFixes))
return 0;
if (_game.version == 8)

View File

@ -1558,7 +1558,7 @@ CharsetRendererMac::CharsetRendererMac(ScummEngine *vm, const Common::String &fo
// (At the time of writing, there are still cases, at least in Loom,
// where text isn't correctly positioned.)
_useCorrectFontSpacing = _vm->_game.id == GID_LOOM || _vm->enhancementClassActive(kEnhSubFmtCntChanges);
_useCorrectFontSpacing = _vm->_game.id == GID_LOOM || _vm->enhancementEnabled(kEnhSubFmtCntChanges);
_pad = false;
_glyphSurface = nullptr;

View File

@ -765,7 +765,7 @@ void ClassicCostumeLoader::loadCostume(int id) {
// WORKAROUND bug #13433: Guybrush can give the stick to two dogs: the one
// guarding the jail, and the one in front of the mansion. But the palette
// for this costume is invalid in the second case on Amiga, causing a glitch.
if (_vm->_game.id == GID_MONKEY2 && _vm->_game.platform == Common::kPlatformAmiga && _vm->_currentRoom == 53 && id == 55 && _numColors == 16 && _vm->enhancementClassActive(kEnhMinorBugFixes)) {
if (_vm->_game.id == GID_MONKEY2 && _vm->_game.platform == Common::kPlatformAmiga && _vm->_currentRoom == 53 && id == 55 && _numColors == 16 && _vm->enhancementEnabled(kEnhMinorBugFixes)) {
// Note: handmade, trying to match the colors between rooms 53 and 29,
// and based on (similar) costume 1.
_palette = amigaMonkey2Costume55Room53;
@ -937,7 +937,7 @@ byte ClassicCostumeRenderer::drawLimb(const Actor *a, int limb) {
bool mirror = _mirror;
if (_vm->_game.id == GID_TENTACLE && _vm->_currentRoom == 61 && a->_number == 1 && _loaded._id == 324 && _vm->enhancementClassActive(kEnhMinorBugFixes)) {
if (_vm->_game.id == GID_TENTACLE && _vm->_currentRoom == 61 && a->_number == 1 && _loaded._id == 324 && _vm->enhancementEnabled(kEnhMinorBugFixes)) {
if (limb == 0) {
_mirror = true;
xmoveCur--;

View File

@ -45,10 +45,10 @@ namespace Scumm {
* if that's the case... congratulations, you've come to the right place! :-)
*
* Marking a piece of code as an enhancement is as simple as guarding it with
* a conditional check using the enhancementClassActive(<class>) function.
* a conditional check using the enhancementEnabled(<class>) function.
* For example:
*
* if (enhancementClassActive(<kMyBeautifulEnhancementClass>)) {
* if (enhancementEnabled(<kMyBeautifulEnhancementClass>)) {
* // Piece of code which makes Guybrush hair white
* }
*

View File

@ -455,7 +455,7 @@ const char *InfoDialog::getPlainEngineString(int stringno, bool forceHardcodedSt
result = (const char *)_vm->getStringAddressVar(string_map_table_v6[stringno - 1].num);
if (!result) {
if (stringno >= 22 && stringno <= 27 && _vm->_game.id == GID_TENTACLE && _vm->enhancementClassActive(kEnhTextLocFixes) && strcmp(_vm->_game.variant, "Floppy")) {
if (stringno >= 22 && stringno <= 27 && _vm->_game.id == GID_TENTACLE && _vm->enhancementEnabled(kEnhTextLocFixes) && strcmp(_vm->_game.variant, "Floppy")) {
result = getStaticResString(_vm->_language, stringno - 1).string;
} else {
result = string_map_table_v6[stringno - 1].string;

View File

@ -2223,7 +2223,7 @@ bool Gdi::drawStrip(byte *dstPtr, VirtScreen *vs, int x, int y, const int width,
// FM-TOWNS release. We take care not to apply this palette change to the
// text or inventory, as they still require the original colors.
if (_vm->_game.id == GID_INDY3 && (_vm->_game.features & GF_OLD256) && _vm->_game.platform != Common::kPlatformFMTowns
&& _vm->_roomResource == 46 && smapLen == 43159 && vs->number == kMainVirtScreen && _vm->enhancementClassActive(kEnhMinorBugFixes)) {
&& _vm->_roomResource == 46 && smapLen == 43159 && vs->number == kMainVirtScreen && _vm->enhancementEnabled(kEnhMinorBugFixes)) {
if (_roomPalette[11] == 11 && _roomPalette[86] == 86)
_roomPalette[11] = 86;
if (_roomPalette[13] == 13 && _roomPalette[80] == 80)
@ -2246,7 +2246,7 @@ bool Gdi::drawStrip(byte *dstPtr, VirtScreen *vs, int x, int y, const int width,
_vm->_currentRoom == 36 &&
vs->number == kMainVirtScreen &&
y == 8 && x >= 7 && x <= 30 && height == 88 &&
_vm->enhancementClassActive(kEnhVisualChanges)) {
_vm->enhancementEnabled(kEnhVisualChanges)) {
_roomPalette[47] = 15;
byte result = decompressBitmap(dstPtr, vs->pitch, smap_ptr + offset, height);
@ -2267,7 +2267,7 @@ bool Gdi::drawStrip(byte *dstPtr, VirtScreen *vs, int x, int y, const int width,
_vm->_currentRoom == 11 &&
vs->number == kMainVirtScreen &&
y == 24 && x >= 28 && x <= 52 && height == 56 &&
_vm->enhancementClassActive(kEnhVisualChanges)) {
_vm->enhancementEnabled(kEnhVisualChanges)) {
_roomPalette[1] = 15;
byte result = decompressBitmap(dstPtr, vs->pitch, smap_ptr + offset, height);

View File

@ -2030,7 +2030,7 @@ void ScummEngine::queryQuit(bool returnToLauncher) {
// WORKAROUND: In the german version of LOOM FM-Towns, the string in the game data is stored with a '\r'
// character at the end. This means that the string being displayed on screen will end with "(J oder N)J",
// and localizedYesKey will be assigned to '\r'. Let's fix this by truncating the relevant string.
if (enhancementClassActive(kEnhMinorBugFixes) && _game.id == GID_LOOM &&
if (enhancementEnabled(kEnhMinorBugFixes) && _game.id == GID_LOOM &&
_game.platform == Common::kPlatformFMTowns &&
strstr(msgLabelPtr, "(J oder N)J\r")) {
msgLabelPtr[Common::strnlen(msgLabelPtr, sizeof(msgLabelPtr)) - 1] = '\0';

View File

@ -82,7 +82,7 @@ void ScummEngine::mac_drawStripToScreen(VirtScreen *vs, int top, int x, int y, i
if (_renderMode == Common::kRenderMacintoshBW) {
for (int h = 0; h < height; h++) {
for (int w = 0; w < width; w++) {
int color = enhancementClassActive(kEnhVisualChanges) ? _shadowPalette[pixels[w]] : pixels[w];
int color = enhancementEnabled(kEnhVisualChanges) ? _shadowPalette[pixels[w]] : pixels[w];
if (ts[2 * w] == CHARSET_MASK_TRANSPARENCY)
mac[2 * w] = Graphics::macEGADither[color][0];
if (ts[2 * w + 1] == CHARSET_MASK_TRANSPARENCY)

View File

@ -907,7 +907,7 @@ void ScummEngine_v72he::o72_actorOps() {
a->_talkColor = pop();
// WORKAROUND bug #13730: defined subtitles color 16 is very dark and hard to read on the dark background.
// we change it to brighter color to ease reading.
if (_game.id == GID_FREDDI4 && _game.heversion == 98 && _currentRoom == 43 && a->_talkColor == 16 && enhancementClassActive(kEnhSubFmtCntChanges))
if (_game.id == GID_FREDDI4 && _game.heversion == 98 && _currentRoom == 43 && a->_talkColor == 16 && enhancementEnabled(kEnhSubFmtCntChanges))
a->_talkColor = 200;
break;
case SO_ACTOR_NAME:
@ -2189,7 +2189,7 @@ void ScummEngine_v72he::decodeParseString(int m, int n) {
_string[m].color = pop();
// WORKAROUND bug #13730: defined subtitles color 16 is very dark and hard to read on the dark background.
// we change it to brighter color to ease reading.
if (_game.id == GID_FREDDI4 && _game.heversion == 98 && _currentRoom == 43 && _string[m].color == 16 && enhancementClassActive(kEnhSubFmtCntChanges))
if (_game.id == GID_FREDDI4 && _game.heversion == 98 && _currentRoom == 43 && _string[m].color == 16 && enhancementEnabled(kEnhSubFmtCntChanges))
_string[m].color = 200;
} else {
push(colors);

View File

@ -483,7 +483,7 @@ void IMuseDigital::playFtMusic(const char *songName, int transitionType, int vol
// WORKAROUND for bug in the original: at the beginning of the game, going in
// and out of the bar a couple of times breaks and temporarily stops the music
// Here, we override the fade out, just like the remastered does
if (oldSoundId == soundId && soundId == 622 && _vm->enhancementClassActive(kEnhAudioChanges)) {
if (oldSoundId == soundId && soundId == 622 && _vm->enhancementEnabled(kEnhAudioChanges)) {
diMUSEFadeParam(soundId, DIMUSE_P_VOLUME, volume, 200);
}
} else if (diMUSEStartStream(soundId, 126, DIMUSE_BUFFER_MUSIC)) {

View File

@ -1135,7 +1135,7 @@ void ScummEngine::processKeyboard(Common::KeyState lastKeyHit) {
return;
}
if (enhancementClassActive(kEnhUIUX) && _game.id == GID_LOOM &&
if (enhancementEnabled(kEnhUIUX) && _game.id == GID_LOOM &&
mainmenuKeyEnabled && (lastKeyHit.keycode == Common::KEYCODE_d && lastKeyHit.hasFlags(Common::KBD_CTRL))) {
// Drafts menu
showDraftsInventory();

View File

@ -249,7 +249,7 @@ bool ScummEngine::hasFeature(EngineFeature f) const {
(f == kSupportsQuitDialogOverride && (_useOriginalGUI || !ChainedGamesMan.empty()));
}
bool Scumm::ScummEngine::enhancementClassActive(int32 cls) {
bool Scumm::ScummEngine::enhancementEnabled(int32 cls) {
return _activeEnhancements & cls;
}

View File

@ -705,7 +705,7 @@ void ScummEngine::drawObject(int obj, int arg) {
// copyright reasons, so we just patch the impacted bytes from a fixed OI
// (made with BMRP.EXE).
if (_game.id == GID_INDY3 && (_game.features & GF_OLD256) && _currentRoom == 135
&& od.obj_nr == 324 && numstrip == od.width / 8 && enhancementClassActive(kEnhVisualChanges)) {
&& od.obj_nr == 324 && numstrip == od.width / 8 && enhancementEnabled(kEnhVisualChanges)) {
// Extra safety: make sure that the OI has the expected length. Indy3
// should always be GF_SMALL_HEADER, but that's implicit, so do an
// explicit check, since we're doing some low-level byte tricks.

View File

@ -245,7 +245,7 @@ void Player_Towns_v1::startSound(int sound) {
velocity = velocity ? velocity >> 2 : ptr[14] >> 1;
uint16 len = READ_LE_UINT16(ptr) + 2;
playPcmTrack(sound, ptr + 6, velocity, 64, note ? note : (len > 50 ? ptr[50] : 60), READ_LE_UINT16(ptr + 10));
} else if (type == 1 || (_vm->_game.id == GID_INDY3 && sound == 40 && _vm->enhancementClassActive(kEnhAudioChanges))) {
} else if (type == 1 || (_vm->_game.id == GID_INDY3 && sound == 40 && _vm->enhancementEnabled(kEnhAudioChanges))) {
// WORKAROUND: Indy 3 FMTOWNS: No/distorted music in Venice
// The Venice music does not exist as CD audio and the original doesn't feature music
// in this scene. It does, however, exist as Euphony track albeit with an odd sound

View File

@ -1767,7 +1767,7 @@ void ScummEngine::applyWorkaroundIfNeeded(ResType type, int idx) {
// immediately overwritten. This probably affects all CD versions, so we
// just have to add further patches as they are reported.
if (_game.id == GID_MONKEY && type == rtRoom && idx == 25 && enhancementClassActive(kEnhRestoredContent)) {
if (_game.id == GID_MONKEY && type == rtRoom && idx == 25 && enhancementEnabled(kEnhRestoredContent)) {
tryPatchMI1CannibalScript(getResourceAddress(type, idx), size);
} else

View File

@ -202,7 +202,7 @@ void ScummEngine_v4::loadCharset(int no) {
// does exist, but at the invalid \x86 position. So we replace \x85 with
// \x86 (and then \x86 with \x87 so that the whole charset resource keeps
// the same size), but only when detecting the faulty 904.LFL file.
if ((_game.id == GID_MONKEY_EGA || _game.id == GID_MONKEY_VGA) && no == 4 && size == 4857 && _language == Common::FR_FRA && enhancementClassActive(kEnhTextLocFixes)) {
if ((_game.id == GID_MONKEY_EGA || _game.id == GID_MONKEY_VGA) && no == 4 && size == 4857 && _language == Common::FR_FRA && enhancementEnabled(kEnhTextLocFixes)) {
Common::MemoryReadStream stream(data, size);
Common::String md5 = Common::computeStreamMD5AsString(stream);

View File

@ -713,7 +713,7 @@ void ScummEngine::writeVar(uint var, int value) {
// Any modifications here depend on knowing if the script will
// set the timer value back to something sensible afterwards.
if (_game.id == GID_SAMNMAX && vm.slot[_currentScript].number == 65 && var == VAR_TIMER_NEXT && enhancementClassActive(kEnhTimingChanges)) {
if (_game.id == GID_SAMNMAX && vm.slot[_currentScript].number == 65 && var == VAR_TIMER_NEXT && enhancementEnabled(kEnhTimingChanges)) {
// "Wirst Du brutzeln, wie eine grobe Bratwurst!"
if (value == 1 && _language == Common::DE_DEU)
value = 4;
@ -733,7 +733,7 @@ void ScummEngine::writeVar(uint var, int value) {
// throughout the intro. This does not apply to the VGA talkie
// version, because there the fire isn't animated.
else if (_game.id == GID_LOOM && !(_game.features & GF_DEMO) && _game.version < 4 && vm.slot[_currentScript].number == 44 && var == VAR_TIMER_NEXT && enhancementClassActive(kEnhTimingChanges)) {
else if (_game.id == GID_LOOM && !(_game.features & GF_DEMO) && _game.version < 4 && vm.slot[_currentScript].number == 44 && var == VAR_TIMER_NEXT && enhancementEnabled(kEnhTimingChanges)) {
Actor *a = derefActorSafe(4, "writeVar");
if (a) {
a->setAnimSpeed((value == 0) ? 6 : 0);
@ -993,7 +993,7 @@ void ScummEngine::runExitScript() {
//
// The same sound effect is also used in the underwater cavern (room
// 33), so we do the same fade out as in that room's exit script.
if (_game.id == GID_DIG && _currentRoom == 44 && enhancementClassActive(kEnhAudioChanges)) {
if (_game.id == GID_DIG && _currentRoom == 44 && enhancementEnabled(kEnhAudioChanges)) {
int scriptCmds[] = { 14, 215, 0x600, 0, 30, 0, 0, 0 };
_sound->soundKludge(scriptCmds, ARRAYSIZE(scriptCmds));
}

View File

@ -420,7 +420,7 @@ void ScummEngine_v2::decodeParseString() {
else if (_game.id == GID_MANIAC && _game.version == 1
&& _game.platform == Common::kPlatformDOS
&& !(_game.features & GF_DEMO) && _language == Common::EN_ANY
&& vm.slot[_currentScript].number == 260 && enhancementClassActive(kEnhTextLocFixes)
&& vm.slot[_currentScript].number == 260 && enhancementEnabled(kEnhTextLocFixes)
&& strncmp((char *)buffer + 26, " tring ", 7) == 0) {
for (byte *p = ptr; p >= buffer + 29; p--)
*(p + 1) = *p;
@ -480,7 +480,7 @@ void ScummEngine_v2::writeVar(uint var, int value) {
&& _game.platform != Common::kPlatformNES
&& vm.slot[_currentScript].number == 4
&& VAR(VAR_CLICK_AREA) == kSentenceClickArea
&& var == 34 && value == 0 && enhancementClassActive(kEnhRestoredContent)) {
&& var == 34 && value == 0 && enhancementEnabled(kEnhRestoredContent)) {
value = 1;
}
@ -887,7 +887,7 @@ void ScummEngine_v2::o2_verbOps() {
// erroneously set one of the verbs' ("Unlock") y coordinate to 1600 instead of
// 168 via scripts. We apply the fix and mark it as an enhancement.
if (_game.id == GID_MANIAC && _game.version == 2 && _language == Common::IT_ITA &&
slot == 15 && y == 1600 && enhancementClassActive(kEnhTextLocFixes)) {
slot == 15 && y == 1600 && enhancementEnabled(kEnhTextLocFixes)) {
vs->curRect.top = 168;
} else {
vs->curRect.top = y;

View File

@ -428,7 +428,7 @@ void ScummEngine_v5::o5_actorOps() {
// also observed when doing the QA for the PC version.
if (_game.id == GID_MONKEY2 && _game.platform == Common::kPlatformFMTowns &&
vm.slot[_currentScript].number == 45 && _currentRoom == 45 &&
(_scriptPointer - _scriptOrgPointer == 0xA9) && enhancementClassActive(kEnhRestoredContent)) {
(_scriptPointer - _scriptOrgPointer == 0xA9) && enhancementEnabled(kEnhRestoredContent)) {
_scriptPointer += 0xCF - 0xA1;
writeVar(32811, 0); // clear bit 43
return;
@ -448,7 +448,7 @@ void ScummEngine_v5::o5_actorOps() {
// this, but in a different way which doesn't look as portable between releases.
if ((_game.id == GID_MONKEY_EGA || _game.id == GID_MONKEY_VGA || (_game.id == GID_MONKEY && !(_game.features & GF_ULTIMATE_TALKIE))) &&
_roomResource == 87 && vm.slot[_currentScript].number == 10002 && act == 9 &&
enhancementClassActive(kEnhVisualChanges)) {
enhancementEnabled(kEnhVisualChanges)) {
const int scriptNr = (_game.version == 5) ? 122 : 119;
if (!isScriptRunning(scriptNr)) {
a->putActor(0);
@ -480,7 +480,7 @@ void ScummEngine_v5::o5_actorOps() {
// But in the VGA CD version, only costume 0 is used
// and the close-up is missing the cigar smoke.
if (_game.id == GID_MONKEY && _currentRoom == 76 && act == 12 && i == 0 && enhancementClassActive(kEnhVisualChanges)) {
if (_game.id == GID_MONKEY && _currentRoom == 76 && act == 12 && i == 0 && enhancementEnabled(kEnhVisualChanges)) {
i = 76;
}
@ -537,7 +537,7 @@ void ScummEngine_v5::o5_actorOps() {
if (_game.id == GID_INDY3 && _game.platform == Common::kPlatformFMTowns &&
(a->_costume == 23 || a->_costume == 28 || a->_costume == 29) &&
(_currentRoom == 20 || _currentRoom == 28 || _currentRoom == 32) && enhancementClassActive(kEnhVisualChanges)) {
(_currentRoom == 20 || _currentRoom == 28 || _currentRoom == 32) && enhancementEnabled(kEnhVisualChanges)) {
break;
}
@ -650,7 +650,7 @@ void ScummEngine_v5::o5_setClass() {
if (_game.id == GID_MONKEY && _game.platform != Common::kPlatformFMTowns &&
_game.platform != Common::kPlatformSegaCD && _roomResource == 59 &&
vm.slot[_currentScript].number == 10002 && obj == 915 && cls == 6 &&
_currentPalette[251 * 3] == 0 && enhancementClassActive(kEnhVisualChanges) &&
_currentPalette[251 * 3] == 0 && enhancementEnabled(kEnhVisualChanges) &&
!(_game.features & GF_ULTIMATE_TALKIE)) {
// True as long as Guybrush isn't done with the voodoo recipe on the
// Sea Monkey. The Ultimate Talkie Edition probably does this as a way
@ -745,7 +745,7 @@ void ScummEngine_v5::o5_add() {
// We restore the old behavior by adding 0, not 1, to the second
// variable when examining the clock tower.
if (_game.id == GID_MONKEY && vm.slot[_currentScript].number == 210 && _currentRoom == 35 && _resultVarNumber == 248 && a == 1 && enhancementClassActive(kEnhRestoredContent)) {
if (_game.id == GID_MONKEY && vm.slot[_currentScript].number == 210 && _currentRoom == 35 && _resultVarNumber == 248 && a == 1 && enhancementEnabled(kEnhRestoredContent)) {
a = 0;
}
@ -912,7 +912,7 @@ void ScummEngine_v5::o5_cursorCommand() {
// if we even want that "fixed", but it does lead to bug tickets in Monkey 1 FM-TOWNS") and the
// "fix" restores the original appearance (which - as per usual - is a matter of personal taste...).
// So let people make their own choice with the Enhancement setting.
int m = (_game.platform == Common::kPlatformFMTowns && _game.id == GID_MONKEY && !enhancementClassActive(kEnhVisualChanges)) ? 2 : 1;
int m = (_game.platform == Common::kPlatformFMTowns && _game.id == GID_MONKEY && !enhancementEnabled(kEnhVisualChanges)) ? 2 : 1;
for (i = 0; i < 16; i++)
_charsetColorMap[i] = _charsetData[_string[1]._default.charset][i] = (unsigned char)table[i * m];
}
@ -935,7 +935,7 @@ void ScummEngine_v5::o5_cutscene() {
// from the zeppelin with the biplane is missing the `[1]` parameter
// which disables the verb interface. For some reason, this only causes
// a problem on the FM-TOWNS version, though... also happens under UNZ.
if (_game.id == GID_INDY3 && _game.platform == Common::kPlatformFMTowns && _currentRoom == 80 && vm.slot[_currentScript].number == 201 && args[0] == 0 && enhancementClassActive(kEnhVisualChanges)) {
if (_game.id == GID_INDY3 && _game.platform == Common::kPlatformFMTowns && _currentRoom == 80 && vm.slot[_currentScript].number == 201 && args[0] == 0 && enhancementEnabled(kEnhVisualChanges)) {
args[0] = 1;
}
@ -1076,7 +1076,7 @@ void ScummEngine_v5::o5_drawObject() {
// be called if Bit[129] is set in that script, so if it does happen, it means
// the check was missing, and so we ignore the next 32 bytes of Dread's reaction.
if (_game.id == GID_MONKEY2 && !(_game.features & GF_ULTIMATE_TALKIE) && _currentRoom == 22 && vm.slot[_currentScript].number == 201 && obj == 237 &&
state == 1 && readVar(0x8000 + 129) == 1 && enhancementClassActive(kEnhMinorBugFixes)) {
state == 1 && readVar(0x8000 + 129) == 1 && enhancementEnabled(kEnhMinorBugFixes)) {
_scriptPointer += 32;
return;
}
@ -1087,7 +1087,7 @@ void ScummEngine_v5::o5_drawObject() {
// picked up the real Grail. This was probably done as a way to unconditionally
// reset the animation if it's already been played, but we can just do an
// unconditional reset of all previous frames instead, restoring the first one.
if (_game.id == GID_INDY3 && _roomResource == 87 && vm.slot[_currentScript].number == 200 && obj == 899 && state == 1 && VAR(VAR_TIMER_NEXT) != 12 && enhancementClassActive(kEnhRestoredContent)) {
if (_game.id == GID_INDY3 && _roomResource == 87 && vm.slot[_currentScript].number == 200 && obj == 899 && state == 1 && VAR(VAR_TIMER_NEXT) != 12 && enhancementEnabled(kEnhRestoredContent)) {
i = _numLocalObjects - 1;
do {
if (_objs[i].obj_nr)
@ -1103,7 +1103,7 @@ void ScummEngine_v5::o5_drawObject() {
// all later versions; this smaller workaround appears to be enough.
if (_game.id == GID_LOOM && _game.version == 3 && !(_game.features & GF_OLD256) && _roomResource == 32 &&
vm.slot[_currentScript].number == 10002 && obj == 540 && state == 1 && xpos == 255 && ypos == 255 &&
enhancementClassActive(kEnhMinorBugFixes)) {
enhancementEnabled(kEnhMinorBugFixes)) {
if (getState(541) == 1) {
putState(obj, state);
obj = 541;
@ -1242,7 +1242,7 @@ void ScummEngine_v5::o5_findObject() {
if (_game.id == GID_LOOM && _game.version == 3 &&
(_game.platform == Common::kPlatformDOS || _game.platform == Common::kPlatformAmiga || _game.platform == Common::kPlatformAtariST) &&
_currentRoom == 38 && obj == 623 && enhancementClassActive(kEnhMinorBugFixes)) {
_currentRoom == 38 && obj == 623 && enhancementEnabled(kEnhMinorBugFixes)) {
obj = 609;
}
@ -1251,7 +1251,7 @@ void ScummEngine_v5::o5_findObject() {
// script is responsible for actually moving you to the other room and
// this script is empty, redirect the action to the cave object's
// script instead.
if (_game.id == GID_LOOM && _game.version == 4 && _currentRoom == 33 && obj == 482 && enhancementClassActive(kEnhMinorBugFixes)) {
if (_game.id == GID_LOOM && _game.version == 4 && _currentRoom == 33 && obj == 482 && enhancementEnabled(kEnhMinorBugFixes)) {
obj = 468;
}
@ -1636,7 +1636,7 @@ void ScummEngine_v5::o5_isLessEqual() {
// together that they look like one. This adjusts the timing of the
// second one.
if (_game.id == GID_LOOM && _game.version >= 4 && _language == Common::EN_ANY && vm.slot[_currentScript].number == 95 && var == VAR_MUSIC_TIMER && b == 1708 && enhancementClassActive(kEnhVisualChanges)) {
if (_game.id == GID_LOOM && _game.version >= 4 && _language == Common::EN_ANY && vm.slot[_currentScript].number == 95 && var == VAR_MUSIC_TIMER && b == 1708 && enhancementEnabled(kEnhVisualChanges)) {
b = 1815;
}
@ -1666,7 +1666,7 @@ void ScummEngine_v5::o5_notEqualZero() {
// Library, since Dread's ship is gone.
if (_game.id == GID_MONKEY2 && ((_roomResource == 22 && vm.slot[_currentScript].number == 202) ||
(_roomResource == 2 && vm.slot[_currentScript].number == 10002) ||
vm.slot[_currentScript].number == 97) && enhancementClassActive(kEnhGameBreakingBugFixes)) {
vm.slot[_currentScript].number == 97) && enhancementEnabled(kEnhGameBreakingBugFixes)) {
int var = fetchScriptWord();
a = readVar(var);
@ -1684,7 +1684,7 @@ void ScummEngine_v5::o5_notEqualZero() {
//
// Note that fixing this unveils the script error causing the possible
// dead-end described above.
if (!(_game.features & GF_ULTIMATE_TALKIE) && var == 0x8000 + 70 && a == 0 && getOwner(519) == VAR(VAR_EGO) && enhancementClassActive(kEnhRestoredContent)) {
if (!(_game.features & GF_ULTIMATE_TALKIE) && var == 0x8000 + 70 && a == 0 && getOwner(519) == VAR(VAR_EGO) && enhancementEnabled(kEnhRestoredContent)) {
a = 1;
}
@ -1772,7 +1772,7 @@ void ScummEngine_v5::o5_loadRoom() {
// the one where Indy enters the office for the first time. If object 23 (National
// Archeology) is in possession of Indy (owner == 1) then it's safe to force the
// coat (object 24) and broken window (object 25) into the room.
if (_game.id == GID_INDY4 && room == 1 && _objectOwnerTable[23] == 1 && enhancementClassActive(kEnhMinorBugFixes)) {
if (_game.id == GID_INDY4 && room == 1 && _objectOwnerTable[23] == 1 && enhancementEnabled(kEnhMinorBugFixes)) {
putState(24, 1);
putState(25, 1);
}
@ -1783,7 +1783,7 @@ void ScummEngine_v5::o5_loadRoom() {
// you will always get the close-up where he's wearing his own clothes.
if (_game.id == GID_LOOM && _game.version == 3 && room == 29 &&
vm.slot[_currentScript].number == 112 && enhancementClassActive(kEnhVisualChanges)) {
vm.slot[_currentScript].number == 112 && enhancementEnabled(kEnhVisualChanges)) {
Actor *a = derefActorSafe(VAR(VAR_EGO), "o5_loadRoom");
// Bobbin's normal costume is number 1. If he's wearing anything
@ -1975,14 +1975,14 @@ void ScummEngine_v5::o5_putActor() {
// other coordinates. The difference is never more than a single pixel,
// so there's not much reason to correct those.
if (_game.id == GID_MONKEY && _currentRoom == 76 && act == 12 && enhancementClassActive(kEnhVisualChanges)) {
if (_game.id == GID_MONKEY && _currentRoom == 76 && act == 12 && enhancementEnabled(kEnhVisualChanges)) {
if (x == 176 && y == 80) {
x = 174;
y = 86;
} else if (x == 176 && y == 78) {
x = 172;
}
} else if (_game.id == GID_ZAK && _game.platform == Common::kPlatformFMTowns && _currentRoom == 42 && vm.slot[_currentScript].number == 201 && act == 6 && x == 136 && y == 0 && enhancementClassActive(kEnhVisualChanges)) {
} else if (_game.id == GID_ZAK && _game.platform == Common::kPlatformFMTowns && _currentRoom == 42 && vm.slot[_currentScript].number == 201 && act == 6 && x == 136 && y == 0 && enhancementEnabled(kEnhVisualChanges)) {
// WORKAROUND: bug #2762: When switching back to Zak after using the blue
// crystal on the bird in Lima, the bird will disappear, come back and
// disappear again. This is really strange and only happens with the
@ -2254,7 +2254,7 @@ void ScummEngine_v5::o5_roomOps() {
// we want the original color 3 for the cigar smoke. It
// should be ok since there is no GUI in this scene.
if (_game.id == GID_MONKEY && _currentRoom == 76 && d == 3 && enhancementClassActive(kEnhVisualChanges)) {
if (_game.id == GID_MONKEY && _currentRoom == 76 && d == 3 && enhancementEnabled(kEnhVisualChanges)) {
// Do nothing
} else {
setPalColor(d, a, b, c); /* index, r, g, b */
@ -2562,7 +2562,7 @@ void ScummEngine_v5::o5_setState() {
// though, since it properly resets the state of the (invisible) laundry claim
// ticket part of the door, so we just reuse its setState and setClass calls.
if (_game.id == GID_MONKEY2 && _currentRoom == 13 && vm.slot[_currentScript].number == 200 &&
obj == 108 && state == 1 && getState(100) != 1 && getState(111) != 2 && enhancementClassActive(kEnhMinorBugFixes)) {
obj == 108 && state == 1 && getState(100) != 1 && getState(111) != 2 && enhancementEnabled(kEnhMinorBugFixes)) {
putState(111, 2);
markObjectRectAsDirty(111);
putClass(111, 160, true);
@ -2669,7 +2669,7 @@ void ScummEngine_v5::o5_stopSound() {
// 10001 regardless of which room it is. We figure out which one by
// looking at which rooms we're moving between.
if (_game.id == GID_MONKEY && (_game.features & GF_AUDIOTRACKS) && sound == 126 && vm.slot[_currentScript].number == 10001 && VAR(VAR_ROOM) == 43 && VAR(VAR_NEW_ROOM) == 76 && enhancementClassActive(kEnhAudioChanges)) {
if (_game.id == GID_MONKEY && (_game.features & GF_AUDIOTRACKS) && sound == 126 && vm.slot[_currentScript].number == 10001 && VAR(VAR_ROOM) == 43 && VAR(VAR_NEW_ROOM) == 76 && enhancementEnabled(kEnhAudioChanges)) {
return;
}
@ -2677,7 +2677,7 @@ void ScummEngine_v5::o5_stopSound() {
// music status variable when you stop it. Wendy's music would then
// resume when leaving some rooms (such as room 3 with the chandelier),
// even though her CD player was off.
if (_game.id == GID_MANIAC && _game.platform == Common::kPlatformNES && sound == 75 && vm.slot[_currentScript].number == 50 && VAR(VAR_EGO) == 6 && VAR(224) == sound && enhancementClassActive(kEnhAudioChanges)) {
if (_game.id == GID_MANIAC && _game.platform == Common::kPlatformNES && sound == 75 && vm.slot[_currentScript].number == 50 && VAR(VAR_EGO) == 6 && VAR(224) == sound && enhancementEnabled(kEnhAudioChanges)) {
VAR(224) = 0;
}
@ -2728,7 +2728,7 @@ void ScummEngine_v5::o5_startScript() {
// than gliding in from off-stage. The only thing that's affected is
// whether Bobbin or Rusty speaks first, and the dialog makes sense
// either way.
if (_game.id == GID_LOOM && _game.version == 3 && script == 207 && isScriptRunning(98) && enhancementClassActive(kEnhVisualChanges))
if (_game.id == GID_LOOM && _game.version == 3 && script == 207 && isScriptRunning(98) && enhancementEnabled(kEnhVisualChanges))
return;
// WORKAROUND bug #2198: Script 171 loads a complete room resource,
@ -2755,7 +2755,7 @@ void ScummEngine_v5::o5_startScript() {
// stealth") is missing a Local[0] value for the actor number. This
// causes the line to be silently skipped (as in the original).
if (_game.id == GID_LOOM && _game.version == 3 && _roomResource == 23 && script == 232 && data[0] == 0 &&
vm.slot[_currentScript].number >= 422 && vm.slot[_currentScript].number <= 425 && enhancementClassActive(kEnhRestoredContent)) {
vm.slot[_currentScript].number >= 422 && vm.slot[_currentScript].number <= 425 && enhancementEnabled(kEnhRestoredContent)) {
// Restore the missing line by attaching it to the shepherd on which the
// draft was used.
data[0] = vm.slot[_currentScript].number % 10;
@ -2808,7 +2808,7 @@ void ScummEngine_v5::o5_stopScript() {
if (_game.id == GID_INDY4 && script == 164 && _roomResource == 50 &&
vm.slot[_currentScript].number == 213 && VAR(VAR_HAVE_MSG) &&
getOwner(933) == VAR(VAR_EGO) && getClass(933, 146) && enhancementClassActive(kEnhRestoredContent)) {
getOwner(933) == VAR(VAR_EGO) && getClass(933, 146) && enhancementEnabled(kEnhRestoredContent)) {
// WORKAROUND bug #2215: Due to a script bug, a line of text is skipped
// which Indy is supposed to speak when he finds Orichalcum in some old
// bones in the caves below Crete, if (and only if) he has already put
@ -3075,7 +3075,7 @@ void ScummEngine_v5::o5_walkActorTo() {
// it, as in the other releases. Another v5 bug fixed on SegaCD, though!
if (_game.id == GID_MONKEY && !(_game.features & GF_ULTIMATE_TALKIE) && _game.platform != Common::kPlatformSegaCD &&
_currentRoom == 30 && vm.slot[_currentScript].number == 207 && a->_number == 11 &&
x == 232 && y == 141 && enhancementClassActive(kEnhVisualChanges)) {
x == 232 && y == 141 && enhancementEnabled(kEnhVisualChanges)) {
if (whereIsObject(387) == WIO_ROOM && getState(387) == 1 && getState(437) == 1) {
int args[NUM_SCRIPT_LOCAL];
memset(args, 0, sizeof(args));
@ -3244,7 +3244,7 @@ void ScummEngine_v5::decodeParseString() {
_currentRoom == 36 &&
vm.slot[_currentScript].number == 201 &&
color == 2 &&
enhancementClassActive(kEnhVisualChanges)) {
enhancementEnabled(kEnhVisualChanges)) {
color = findClosestPaletteColor(_currentPalette, 256, 0, 171, 0);
}
@ -3325,20 +3325,20 @@ void ScummEngine_v5::decodeParseStringTextString(int textSlot) {
const int len = resStrLen(_scriptPointer);
if (_game.id == GID_LOOM && _game.version == 4 && _language == Common::EN_ANY &&
vm.slot[_currentScript].number == 95 && enhancementClassActive(kEnhTextLocFixes) &&
vm.slot[_currentScript].number == 95 && enhancementEnabled(kEnhTextLocFixes) &&
strcmp((const char *)_scriptPointer, "I am Choas.") == 0) {
// WORKAROUND: This happens when Chaos introduces
// herself to bishop Mandible. Of all the places to put
// a typo...
printString(textSlot, (const byte *)"I am Chaos.");
} else if (_game.id == GID_LOOM && _game.version == 4 && _roomResource == 90 &&
vm.slot[_currentScript].number == 203 && _string[textSlot].color == 0x0F && enhancementClassActive(kEnhSubFmtCntChanges)) {
vm.slot[_currentScript].number == 203 && _string[textSlot].color == 0x0F && enhancementEnabled(kEnhSubFmtCntChanges)) {
// WORKAROUND: When Mandible speaks with Goodmold, his second
// speech line is missing its color parameter.
_string[textSlot].color = 0x0A;
printString(textSlot, _scriptPointer);
} else if (_game.id == GID_INDY3 && _game.platform == Common::kPlatformFMTowns && _roomResource == 80 &&
vm.slot[_currentScript].number == 201 && enhancementClassActive(kEnhSubFmtCntChanges)) {
vm.slot[_currentScript].number == 201 && enhancementEnabled(kEnhSubFmtCntChanges)) {
// WORKAROUND: When Indy and his father escape the zeppelin
// with the biplane in the FM-TOWNS version, they share the
// same text color. Indeed, they're not given any explicit
@ -3352,7 +3352,7 @@ void ScummEngine_v5::decodeParseStringTextString(int textSlot) {
_string[textSlot].color = 0x0E;
printString(textSlot, _scriptPointer);
} else if (_game.id == GID_INDY4 && _roomResource == 23 && vm.slot[_currentScript].number == 167 &&
len == 24 && enhancementClassActive(kEnhTextLocFixes) && memcmp(_scriptPointer+16, "pregod", 6) == 0) {
len == 24 && enhancementEnabled(kEnhTextLocFixes) && memcmp(_scriptPointer+16, "pregod", 6) == 0) {
// WORKAROUND for bug #2961: At the end of Indy4, if Ubermann is told
// to use 20 orichalcum beads, he'll count "pregod8" and "pregod9"
// instead of "18" and "19", in some releases.
@ -3369,7 +3369,7 @@ void ScummEngine_v5::decodeParseStringTextString(int textSlot) {
printString(textSlot, tmpBuf);
} else if (_game.id == GID_INDY4 && _language == Common::EN_ANY && _roomResource == 10 &&
vm.slot[_currentScript].number == 209 && _actorToPrintStrFor == 4 && len == 81 &&
strcmp(_game.variant, "Floppy") != 0 && enhancementClassActive(kEnhSubFmtCntChanges)) {
strcmp(_game.variant, "Floppy") != 0 && enhancementEnabled(kEnhSubFmtCntChanges)) {
// WORKAROUND: The English Talkie version of Indy4 changed Kerner's
// lines when he uses the phone booth in New York, but the text doesn't
// match the voice and it mentions the wrong person, in most releases.
@ -3387,7 +3387,7 @@ void ScummEngine_v5::decodeParseStringTextString(int textSlot) {
}
} else if (_game.id == GID_INDY4 && vm.slot[_currentScript].number == 161 && _actorToPrintStrFor == 2 &&
_game.platform != Common::kPlatformAmiga && strcmp(_game.variant, "Floppy") != 0 &&
enhancementClassActive(kEnhAudioChanges)) {
enhancementEnabled(kEnhAudioChanges)) {
// WORKAROUND: In Indy 4, if one plays as Sophia and looks at Indy, then
// her "There's nothing to look at." reaction line will be said with
// Indy's voice, because script 68-161 doesn't check for Sophia in this
@ -3420,7 +3420,7 @@ void ScummEngine_v5::decodeParseStringTextString(int textSlot) {
(_roomResource == 45 && vm.slot[_currentScript].number == 200 &&
isValidActor(10) && _actors[10]->isInCurrentRoom())) &&
_actorToPrintStrFor == 255 && _string[textSlot].color != 0x0F &&
enhancementClassActive(kEnhSubFmtCntChanges)) {
enhancementEnabled(kEnhSubFmtCntChanges)) {
// WORKAROUND: When Guybrush goes to the church at the end of Monkey1,
// the color for the ghost priest's lines is inconsistent in the v5
// releases (except for the SegaCD one with the smaller palette).
@ -3432,7 +3432,7 @@ void ScummEngine_v5::decodeParseStringTextString(int textSlot) {
_game.platform != Common::kPlatformSegaCD &&
(vm.slot[_currentScript].number == 140 || vm.slot[_currentScript].number == 294) &&
_actorToPrintStrFor == 255 && _string[textSlot].color == 0x06 &&
enhancementClassActive(kEnhSubFmtCntChanges)) {
enhancementEnabled(kEnhSubFmtCntChanges)) {
// WORKAROUND: In MI1 CD, the colors when the navigator head speaks are
// not the intended ones (dark purple instead of brown), because the
// original `Color(6)` parameter was kept without adjusting it for the

View File

@ -887,7 +887,7 @@ void ScummEngine_v6::o6_startScript() {
// This also happens with the original interpreters and with the remaster.
if (_game.id == GID_TENTACLE && _roomResource == 13 &&
vm.slot[_currentScript].number == 21 && script == 106 &&
args[0] == 91 && enhancementClassActive(kEnhRestoredContent)) {
args[0] == 91 && enhancementEnabled(kEnhRestoredContent)) {
return;
}
@ -905,7 +905,7 @@ void ScummEngine_v6::o6_startScript() {
// This fix checks for this situation happening (and only this one), and makes a call
// to a soundKludge operation like script 29 would have done.
if (_game.id == GID_CMI && _currentRoom == 19 &&
vm.slot[_currentScript].number == 168 && script == 118 && enhancementClassActive(kEnhAudioChanges)) {
vm.slot[_currentScript].number == 168 && script == 118 && enhancementEnabled(kEnhAudioChanges)) {
int list[16] = { 4096, 1278, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
_sound->soundKludge(list, 2);
}
@ -915,7 +915,7 @@ void ScummEngine_v6::o6_startScript() {
// stopping and starting their speech. This was a script bug in the original
// game, which would also block the "That was informative" reaction from Sam.
if (_game.id == GID_SAMNMAX && _roomResource == 59 &&
vm.slot[_currentScript].number == 201 && script == 48 && enhancementClassActive(kEnhRestoredContent)) {
vm.slot[_currentScript].number == 201 && script == 48 && enhancementEnabled(kEnhRestoredContent)) {
o6_breakHere();
}
@ -1300,7 +1300,7 @@ void ScummEngine_v6::o6_loadRoom() {
// WORKAROUND bug #13378: During Sam's reactions to Max beating up the
// scientist in the intro, we sometimes have to slow down animations
// artificially. This is where we speed them back up again.
if (_game.id == GID_SAMNMAX && vm.slot[_currentScript].number == 65 && room == 6 && enhancementClassActive(kEnhTimingChanges)) {
if (_game.id == GID_SAMNMAX && vm.slot[_currentScript].number == 65 && room == 6 && enhancementEnabled(kEnhTimingChanges)) {
int actors[] = { 2, 3, 10 };
for (int i = 0; i < ARRAYSIZE(actors); i++) {
@ -1426,7 +1426,7 @@ void ScummEngine_v6::o6_animateActor() {
int act = pop();
if (_game.id == GID_SAMNMAX && _roomResource == 35 && vm.slot[_currentScript].number == 202 &&
act == 4 && anim == 14 && enhancementClassActive(kEnhMinorBugFixes)) {
act == 4 && anim == 14 && enhancementEnabled(kEnhMinorBugFixes)) {
// WORKAROUND bug #2068 (Animation glitch at World of Fish).
// Before starting animation 14 of the fisherman, make sure he isn't
// talking anymore, otherwise the fishing line may appear twice when Max
@ -1438,7 +1438,7 @@ void ScummEngine_v6::o6_animateActor() {
}
if (_game.id == GID_SAMNMAX && _roomResource == 47 && vm.slot[_currentScript].number == 202 &&
act == 2 && anim == 249 && enhancementClassActive(kEnhMinorBugFixes)) {
act == 2 && anim == 249 && enhancementEnabled(kEnhMinorBugFixes)) {
// WORKAROUND for bug #3832: parts of Bruno are left on the screen when he
// escapes Bumpusville with Trixie. Bruno (act. 11) and Trixie (act. 12) are
// properly removed from the scene by the script, but not the combined actor
@ -1725,7 +1725,7 @@ void ScummEngine_v6::o6_beginOverride() {
//
// To amend this, we intercept this exact script override and we force the playback of sound 2277,
// which is the iMUSE sequence which would have been played after the dialogue.
if (enhancementClassActive(kEnhAudioChanges) && _game.id == GID_CMI && _currentRoom == 37 && vm.slot[_currentScript].number == 251 &&
if (enhancementEnabled(kEnhAudioChanges) && _game.id == GID_CMI && _currentRoom == 37 && vm.slot[_currentScript].number == 251 &&
_sound->isSoundRunning(2275) != 0 && (_scriptPointer - _scriptOrgPointer) == 0x1A) {
int list[16] = {0x1001, 2277, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
_sound->soundKludge(list, 2);
@ -2034,7 +2034,7 @@ void ScummEngine_v6::o6_actorOps() {
// chattering teeth, but yet when he comes back he's not wearing them
// during this cutscene.
if (_game.id == GID_TENTACLE && _currentRoom == 13 && vm.slot[_currentScript].number == 211 &&
a->_number == 8 && i == 53 && enhancementClassActive(kEnhVisualChanges)) {
a->_number == 8 && i == 53 && enhancementEnabled(kEnhVisualChanges)) {
i = 69;
}
a->setActorCostume(i);
@ -2654,7 +2654,7 @@ void ScummEngine_v6::o6_talkActor() {
// will feel off -- so we can't use the _forcedWaitForMessage trick.
if (_game.id == GID_SAMNMAX && _roomResource == 11 && vm.slot[_currentScript].number == 67
&& getOwner(70) != 2 && !readVar(0x8000 + 67) && !readVar(0x8000 + 39) && readVar(0x8000 + 12) == 1
&& !getClass(126, 6) && enhancementClassActive(kEnhRestoredContent)) {
&& !getClass(126, 6) && enhancementEnabled(kEnhRestoredContent)) {
if (VAR(VAR_HAVE_MSG)) {
_scriptPointer--;
o6_breakHere();
@ -2669,7 +2669,7 @@ void ScummEngine_v6::o6_talkActor() {
// a talkActor opcode.
if (_game.id == GID_TENTACLE && vm.slot[_currentScript].number == 307
&& VAR(VAR_EGO) != 2 && _actorToPrintStrFor == 2
&& enhancementClassActive(kEnhMinorBugFixes)) {
&& enhancementEnabled(kEnhMinorBugFixes)) {
_scriptPointer += resStrLen(_scriptPointer) + 1;
return;
}
@ -2680,7 +2680,7 @@ void ScummEngine_v6::o6_talkActor() {
// hasn't been properly replaced... Fixed in the 2017 remaster, though.
if (_game.id == GID_FT && _language == Common::FR_FRA
&& _roomResource == 7 && vm.slot[_currentScript].number == 77
&& _actorToPrintStrFor == 1 && enhancementClassActive(kEnhTextLocFixes)) {
&& _actorToPrintStrFor == 1 && enhancementEnabled(kEnhTextLocFixes)) {
const int len = resStrLen(_scriptPointer) + 1;
if (len == 93 && memcmp(_scriptPointer + 16 + 18, "piano-low-kick", 14) == 0) {
byte *tmpBuf = new byte[len - 14 + 3];
@ -2706,7 +2706,7 @@ void ScummEngine_v6::o6_talkActor() {
// no stable offset for all the floppy, CD and translated versions, and
// no easy way to only target the impacted lines.
if (_game.id == GID_TENTACLE && vm.slot[_currentScript].number == 9
&& vm.localvar[_currentScript][0] == 216 && _actorToPrintStrFor == 4 && enhancementClassActive(kEnhRestoredContent)) {
&& vm.localvar[_currentScript][0] == 216 && _actorToPrintStrFor == 4 && enhancementEnabled(kEnhRestoredContent)) {
_forcedWaitForMessage = true;
_scriptPointer--;
@ -2724,7 +2724,7 @@ void ScummEngine_v6::o6_talkActor() {
// [0166] (73) } else {
//
// Here we simulate that opcode.
if (_game.id == GID_DIG && vm.slot[_currentScript].number == 88 && enhancementClassActive(kEnhRestoredContent)) {
if (_game.id == GID_DIG && vm.slot[_currentScript].number == 88 && enhancementEnabled(kEnhRestoredContent)) {
if (offset == 0x158 || offset == 0x214 || offset == 0x231 || offset == 0x278) {
_forcedWaitForMessage = true;
_scriptPointer--;
@ -2743,7 +2743,7 @@ void ScummEngine_v6::o6_talkActor() {
if (_game.id == GID_DIG && _roomResource == 58 && vm.slot[_currentScript].number == 402
&& _actorToPrintStrFor == 3 && vm.localvar[_currentScript][0] == 0
&& readVar(0x8000 + 94) && readVar(0x8000 + 78) && !readVar(0x8000 + 97)
&& _scummVars[269] == 3 && getState(388) == 2 && enhancementClassActive(kEnhRestoredContent)) {
&& _scummVars[269] == 3 && getState(388) == 2 && enhancementEnabled(kEnhRestoredContent)) {
_forcedWaitForMessage = true;
_scriptPointer--;

View File

@ -1490,7 +1490,7 @@ void ScummEngine::setupScumm(const Common::String &macResourceFile) {
}
// Skip the sound pre-loading
if (_game.id == GID_SAMNMAX && _bootParam == 0 && enhancementClassActive(kEnhUIUX)) {
if (_game.id == GID_SAMNMAX && _bootParam == 0 && enhancementEnabled(kEnhUIUX)) {
_bootParam = -1;
}
@ -2412,7 +2412,7 @@ Common::Error ScummEngine::go() {
// custom names for save states. We do this in order to avoid
// lag and/or lose keyboard inputs.
if (enhancementClassActive(kEnhUIUX)) {
if (enhancementEnabled(kEnhUIUX)) {
// INDY3:
if (_game.id == GID_INDY3 && _currentRoom == 14) {
delta = 3;

View File

@ -581,7 +581,7 @@ public:
void errorString(const char *buf_input, char *buf_output, int buf_output_size) override;
bool hasFeature(EngineFeature f) const override;
bool enhancementClassActive(int32 cls);
bool enhancementEnabled(int32 cls);
void syncSoundSettings() override;
Common::Error loadGameState(int slot) override;

View File

@ -1442,7 +1442,7 @@ void Sound::startCDTimer() {
// LOOM Steam uses a fixed 240Hz rate. This was probably done to get rid of some
// audio glitches which are confirmed to be in the original. So let's activate this
// fix for the DOS version of LOOM as well, if enhancements are enabled.
if (_isLoomSteam || (_vm->_game.id == GID_LOOM && _vm->enhancementClassActive(kEnhMinorBugFixes)))
if (_isLoomSteam || (_vm->_game.id == GID_LOOM && _vm->enhancementEnabled(kEnhMinorBugFixes)))
interval = 1000000 / LOOM_STEAM_CDDA_RATE;
_vm->getTimerManager()->removeTimerProc(&cdTimerHandler);
@ -1676,7 +1676,7 @@ int ScummEngine::readSoundResource(ResId idx) {
// Some of the Mac MI2 music only exists as Roland tracks. The
// original interpreter doesn't play them. I don't think there
// is any similarly missing FoA music.
if (_game.id == GID_MONKEY2 && _game.platform == Common::kPlatformMacintosh && !enhancementClassActive(kEnhAudioChanges)) {
if (_game.id == GID_MONKEY2 && _game.platform == Common::kPlatformMacintosh && !enhancementEnabled(kEnhAudioChanges)) {
pri = -1;
break;
}

View File

@ -70,7 +70,7 @@ void ScummEngine::printString(int m, const byte *msg) {
vm.slot[_currentScript].number == 203 &&
_actorToPrintStrFor == 255 && strcmp((const char *)msg, " ") == 0 &&
getOwner(200) == VAR(VAR_EGO) && VAR(VAR_HAVE_MSG) &&
enhancementClassActive(kEnhMinorBugFixes)) {
enhancementEnabled(kEnhMinorBugFixes)) {
return;
}
@ -82,7 +82,7 @@ void ScummEngine::printString(int m, const byte *msg) {
// In the italian CD version, the whole scene is sped up to
// keep up with Sam's speech. We compensate for this by slowing
// down the other animations.
if (_game.id == GID_SAMNMAX && vm.slot[_currentScript].number == 65 && enhancementClassActive(kEnhTimingChanges)) {
if (_game.id == GID_SAMNMAX && vm.slot[_currentScript].number == 65 && enhancementEnabled(kEnhTimingChanges)) {
Actor *a;
if (_language == Common::DE_DEU && strcmp(_game.variant, "Floppy") != 0) {
@ -214,7 +214,7 @@ bool ScummEngine::handleNextCharsetCode(Actor *a, int *code) {
// one or more embedded "wait" codes. Rather than
// relying on the calculated talk delay, hard-code
// better ones.
if (_game.id == GID_SAMNMAX && enhancementClassActive(kEnhTimingChanges) && isScriptRunning(65)) {
if (_game.id == GID_SAMNMAX && enhancementEnabled(kEnhTimingChanges) && isScriptRunning(65)) {
typedef struct {
const char *str;
const int16 talkDelay;
@ -1479,7 +1479,7 @@ int ScummEngine::convertMessageToString(const byte *msg, byte *dst, int dstSize)
// uses `startAnim(7)` for this.
if (_game.id == GID_SAMNMAX && _currentRoom == 52 && vm.slot[_currentScript].number == 102 &&
chr == 9 && readVar(0x8000 + 95) != 0 && (VAR(171) == 997 || VAR(171) == 998) &&
dst[-2] == 8 && enhancementClassActive(kEnhMinorBugFixes)) {
dst[-2] == 8 && enhancementEnabled(kEnhMinorBugFixes)) {
dst[-2] = 7;
}
@ -1510,7 +1510,7 @@ int ScummEngine::convertMessageToString(const byte *msg, byte *dst, int dstSize)
// WORKAROUND bug #12249 (occurs also in original): Missing actor animation in German versions of SAMNMAX
// Adding the missing startAnim(14) animation escape sequence while copying the text fixes it.
if (_game.id == GID_SAMNMAX && _currentRoom == 56 && vm.slot[_currentScript].number == 200 &&
_language == Common::DE_DEU && enhancementClassActive(kEnhMinorBugFixes)) {
_language == Common::DE_DEU && enhancementEnabled(kEnhMinorBugFixes)) {
// 0xE5E6 is the CD version, 0xE373 is for the floppy version
if (vm.slot[_currentScript].offs == 0xE5E6 || vm.slot[_currentScript].offs == 0xE373) {
*dst++ = 0xFF;