diff options
author | Sven Hesse | 2011-01-29 22:45:51 +0000 |
---|---|---|
committer | Sven Hesse | 2011-01-29 22:45:51 +0000 |
commit | ce3d4b5d1b06644a210fd7198373488ad4c8cdf4 (patch) | |
tree | e358003d9216b4007e7fe69c08d7aba5d7f9e57d /engines | |
parent | 0c3a33c354c027ee238186794d96c3047d0a4ce2 (diff) | |
download | scummvm-rg350-ce3d4b5d1b06644a210fd7198373488ad4c8cdf4.tar.gz scummvm-rg350-ce3d4b5d1b06644a210fd7198373488ad4c8cdf4.tar.bz2 scummvm-rg350-ce3d4b5d1b06644a210fd7198373488ad4c8cdf4.zip |
GOB: Add GobEngine::isCurrentTot()
svn-id: r55630
Diffstat (limited to 'engines')
-rw-r--r-- | engines/gob/draw_v2.cpp | 2 | ||||
-rw-r--r-- | engines/gob/gob.cpp | 4 | ||||
-rw-r--r-- | engines/gob/gob.h | 2 | ||||
-rw-r--r-- | engines/gob/inter.cpp | 38 | ||||
-rw-r--r-- | engines/gob/inter_fascin.cpp | 6 | ||||
-rw-r--r-- | engines/gob/inter_v1.cpp | 11 | ||||
-rw-r--r-- | engines/gob/inter_v6.cpp | 3 | ||||
-rw-r--r-- | engines/gob/sound/sound.cpp | 12 | ||||
-rw-r--r-- | engines/gob/util.cpp | 2 |
9 files changed, 35 insertions, 45 deletions
diff --git a/engines/gob/draw_v2.cpp b/engines/gob/draw_v2.cpp index 8bbb5773d7..8ff7fc64a4 100644 --- a/engines/gob/draw_v2.cpp +++ b/engines/gob/draw_v2.cpp @@ -196,7 +196,7 @@ void Draw_v2::printTotText(int16 id) { // WORKAROUND: In the scripts of some Gobliins 2 versions, the dialog text IDs // for Fingus and the mayor are swapped. if ((_vm->getGameType() == kGameTypeGob2) && !_vm->isCD() && - _vm->_game->_curTotFile.equalsIgnoreCase("gob07.tot")) { + _vm->isCurrentTot("gob07.tot")) { if (id == 24) { if (_mayorWorkaroundStatus == 1) { diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp index 674eab3d47..d1443ad3f9 100644 --- a/engines/gob/gob.cpp +++ b/engines/gob/gob.cpp @@ -242,6 +242,10 @@ bool GobEngine::isDemo() const { return (isSCNDemo() || isBATDemo()); } +bool GobEngine::isCurrentTot(const Common::String &tot) const { + return _game->_curTotFile.equalsIgnoreCase(tot); +} + const Graphics::PixelFormat &GobEngine::getPixelFormat() const { return _pixelFormat; } diff --git a/engines/gob/gob.h b/engines/gob/gob.h index af0c9d4591..9bdbed45cf 100644 --- a/engines/gob/gob.h +++ b/engines/gob/gob.h @@ -231,6 +231,8 @@ public: bool isTrueColor() const; bool isDemo() const; + bool isCurrentTot(const Common::String &tot) const; + void setTrueColor(bool trueColor); GUI::Debugger *getDebugger() { return _console; } diff --git a/engines/gob/inter.cpp b/engines/gob/inter.cpp index 2ff96c9844..7c4dc7ec69 100644 --- a/engines/gob/inter.cpp +++ b/engines/gob/inter.cpp @@ -257,24 +257,15 @@ void Inter::funcBlock(int16 retFlag) { int addr = _vm->_game->_script->pos(); - if ((startaddr == 0x18B4 && addr == 0x1A7F && // Zombie, EGA - _vm->_game->_curTotFile.equalsIgnoreCase("avt005.tot")) || - (startaddr == 0x188D && addr == 0x1A58 && // Zombie, Mac - _vm->_game->_curTotFile.equalsIgnoreCase("avt005.tot")) || - (startaddr == 0x1299 && addr == 0x139A && // Dungeon - _vm->_game->_curTotFile.equalsIgnoreCase("avt006.tot")) || - (startaddr == 0x11C0 && addr == 0x12C9 && // Cauldron, EGA - _vm->_game->_curTotFile.equalsIgnoreCase("avt012.tot")) || - (startaddr == 0x11C8 && addr == 0x1341 && // Cauldron, Mac - _vm->_game->_curTotFile.equalsIgnoreCase("avt012.tot")) || - (startaddr == 0x09F2 && addr == 0x0AF3 && // Statue - _vm->_game->_curTotFile.equalsIgnoreCase("avt016.tot")) || - (startaddr == 0x0B92 && addr == 0x0C93 && // Castle - _vm->_game->_curTotFile.equalsIgnoreCase("avt019.tot")) || - (startaddr == 0x17D9 && addr == 0x18DA && // Finale, EGA - _vm->_game->_curTotFile.equalsIgnoreCase("avt022.tot")) || - (startaddr == 0x17E9 && addr == 0x19A8 && // Finale, Mac - _vm->_game->_curTotFile.equalsIgnoreCase("avt022.tot"))) { + if ((startaddr == 0x18B4 && addr == 0x1A7F && _vm->isCurrentTot("avt005.tot")) || // Zombie, EGA + (startaddr == 0x188D && addr == 0x1A58 && _vm->isCurrentTot("avt005.tot")) || // Zombie, Mac + (startaddr == 0x1299 && addr == 0x139A && _vm->isCurrentTot("avt006.tot")) || // Dungeon + (startaddr == 0x11C0 && addr == 0x12C9 && _vm->isCurrentTot("avt012.tot")) || // Cauldron, EGA + (startaddr == 0x11C8 && addr == 0x1341 && _vm->isCurrentTot("avt012.tot")) || // Cauldron, Mac + (startaddr == 0x09F2 && addr == 0x0AF3 && _vm->isCurrentTot("avt016.tot")) || // Statue + (startaddr == 0x0B92 && addr == 0x0C93 && _vm->isCurrentTot("avt019.tot")) || // Castle + (startaddr == 0x17D9 && addr == 0x18DA && _vm->isCurrentTot("avt022.tot")) || // Finale, EGA + (startaddr == 0x17E9 && addr == 0x19A8 && _vm->isCurrentTot("avt022.tot"))) { // Finale, Mac _vm->_util->longDelay(5000); } @@ -284,12 +275,11 @@ void Inter::funcBlock(int16 retFlag) { // Apart the CD version which is playing a speech in this room, all the versions // of Fascination have a too short delay between the storage room and the lab. // We manually add it here. - if ((_vm->getGameType() == kGameTypeFascination) && - _vm->_game->_curTotFile.equalsIgnoreCase("PLANQUE.tot")) { + if ((_vm->getGameType() == kGameTypeFascination) && _vm->isCurrentTot("PLANQUE.tot")) { int addr = _vm->_game->_script->pos(); if ((startaddr == 0x0202 && addr == 0x0330) || // Before Lab, Amiga & Atari, English - (startaddr == 0x023D && addr == 0x032D) || // Before Lab, PC floppy, German - (startaddr == 0x02C2 && addr == 0x03C2)) { // Before Lab, PC floppy, Hebrew + (startaddr == 0x023D && addr == 0x032D) || // Before Lab, PC floppy, German + (startaddr == 0x02C2 && addr == 0x03C2)) { // Before Lab, PC floppy, Hebrew warning("Fascination - Adding delay"); _vm->_util->longDelay(3000); } @@ -301,11 +291,11 @@ void Inter::funcBlock(int16 retFlag) { // A VGA version has some broken code in its scripts, this workaround skips the corrupted parts. if (_vm->getGameType() == kGameTypeFascination) { int addr = _vm->_game->_script->pos(); - if ((startaddr == 0x212D) && (addr == 0x290E) && (cmd == 0x90) && _vm->_game->_curTotFile.equalsIgnoreCase("INTRO1.tot")) { + if ((startaddr == 0x212D) && (addr == 0x290E) && (cmd == 0x90) && _vm->isCurrentTot("INTRO1.tot")) { _vm->_game->_script->skip(2); cmd = _vm->_game->_script->readByte(); } - if ((startaddr == 0x207D) && (addr == 0x22CE) && (cmd == 0x90) && _vm->_game->_curTotFile.equalsIgnoreCase("INTRO2.tot")) { + if ((startaddr == 0x207D) && (addr == 0x22CE) && (cmd == 0x90) && _vm->isCurrentTot("INTRO2.tot")) { _vm->_game->_script->skip(2); cmd = _vm->_game->_script->readByte(); } diff --git a/engines/gob/inter_fascin.cpp b/engines/gob/inter_fascin.cpp index 80f6755a36..51f4f92663 100644 --- a/engines/gob/inter_fascin.cpp +++ b/engines/gob/inter_fascin.cpp @@ -136,9 +136,9 @@ void Inter_Fascination::oFascin_repeatUntil(OpFuncParams ¶ms) { // fails, writes on purpose everywhere in the memory in order to hang the computer. // This results in a crash in Scummvm. This workaround avoids that crash. if (_vm->getPlatform() == Common::kPlatformPC) { - if ((_vm->_game->_curTotFile.equalsIgnoreCase("INTRO1.TOT") && (blockPos == 3533)) || - (_vm->_game->_curTotFile.equalsIgnoreCase("INTRO2.TOT") && (blockPos == 3519)) || - (_vm->_game->_curTotFile.equalsIgnoreCase("INTRO2.TOT") && (blockPos == 3265))) //PC Hebrew + if (((blockPos == 3533) && _vm->isCurrentTot("INTRO1.TOT")) || + ((blockPos == 3519) && _vm->isCurrentTot("INTRO2.TOT")) || + ((blockPos == 3265) && _vm->isCurrentTot("INTRO2.TOT"))) //PC Hebrew _terminate = 1; } } while (!flag && !_break && !_terminate && !_vm->shouldQuit()); diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp index 1cb7c264ae..23f9ea0a10 100644 --- a/engines/gob/inter_v1.cpp +++ b/engines/gob/inter_v1.cpp @@ -667,13 +667,13 @@ void Inter_v1::o1_callSub(OpFuncParams ¶ms) { // Skipping the copy protection screen in Gobliiins if (!_vm->_copyProtection && (_vm->getGameType() == kGameTypeGob1) && (offset == 3905) && - _vm->_game->_curTotFile.equalsIgnoreCase(_vm->_startTot)) { + _vm->isCurrentTot(_vm->_startTot)) { debugC(2, kDebugGameFlow, "Skipping copy protection screen"); return; } // Skipping the copy protection screen in Gobliins 2 if (!_vm->_copyProtection && (_vm->getGameType() == kGameTypeGob2) && (offset == 1746) && - _vm->_game->_curTotFile.equalsIgnoreCase("intro0.tot")) { + _vm->isCurrentTot("intro0.tot")) { debugC(2, kDebugGameFlow, "Skipping copy protection screen"); return; } @@ -809,7 +809,7 @@ void Inter_v1::o1_if(OpFuncParams ¶ms) { // WORKAROUND: Gob1 goblin stuck on reload bugs present in original - bugs #3018918 and 3065914 if ((_vm->getGameType() == kGameTypeGob1) && (_vm->_game->_script->pos() == 2933) && - _vm->_game->_curTotFile.equalsIgnoreCase("inter.tot") && VAR(285) != 0) { + _vm->isCurrentTot("inter.tot") && VAR(285) != 0) { warning("Workaround for Gob1 Goblin Stuck On Reload Bug applied..."); // VAR(59) actually locks goblin movement, but these variables trigger this in the script. WRITE_VAR(285, 0); @@ -888,7 +888,7 @@ void Inter_v1::o1_loadSpriteToPos(OpFuncParams ¶ms) { // WORKAROUND: The EGA version of Gobliiins 1 has an invalid expression there if (_vm->isEGA() && (_vm->_game->_script->pos() == 1398) && - _vm->_game->_curTotFile.equalsIgnoreCase("intro.tot")) { + _vm->isCurrentTot("intro.tot")) { _vm->_draw->_destSpriteY = 0; _vm->_game->_script->skip(1); @@ -1190,8 +1190,7 @@ void Inter_v1::o1_keyFunc(OpFuncParams ¶ms) { // to become 5000. We deliberately slow down busy-waiting, so we shorten // the counting, too. if ((_vm->getGameType() == kGameTypeWeen) && (VAR(59) < 4000) && - (_vm->_game->_script->pos() == 729) && - _vm->_game->_curTotFile.equalsIgnoreCase("intro5.tot")) + (_vm->_game->_script->pos() == 729) && _vm->isCurrentTot("intro5.tot")) WRITE_VAR(59, 4000); switch (cmd) { diff --git a/engines/gob/inter_v6.cpp b/engines/gob/inter_v6.cpp index 3104dc412b..73fc5d18a0 100644 --- a/engines/gob/inter_v6.cpp +++ b/engines/gob/inter_v6.cpp @@ -127,8 +127,7 @@ void Inter_v6::o6_playVmdOrMusic() { // WORKAROUND: When taking the music sheet from Dr. Dramish's car, // the video that lets the sheet vanish is missing. We'll // play the one where the sheet is already gone instead. - if (!strcmp(fileName, "MXRAMPART") && - _vm->_game->_curTotFile.equalsIgnoreCase("avt005.tot")) + if (!strcmp(fileName, "MXRAMPART") && _vm->isCurrentTot("avt005.tot")) strcpy(fileName, "PLCOFDR2"); if (!strcmp(fileName, "RIEN")) { diff --git a/engines/gob/sound/sound.cpp b/engines/gob/sound/sound.cpp index 02c3b28934..30bbb94fd4 100644 --- a/engines/gob/sound/sound.cpp +++ b/engines/gob/sound/sound.cpp @@ -562,10 +562,8 @@ void Sound::cdPlayBgMusic() { }; for (int i = 0; i < ARRAYSIZE(tracks); i++) - if (_vm->_game->_curTotFile.equalsIgnoreCase(tracks[i][0])) { - debugC(1, kDebugSound, "CDROM: Playing background music \"%s\" (\"%s\")", - tracks[i][1], _vm->_game->_curTotFile.c_str()); - + if (_vm->isCurrentTot(tracks[i][0])) { + debugC(1, kDebugSound, "CDROM: Playing background music \"%s\" (\"%s\")", tracks[i][1], tracks[i][0]); _cdrom->startTrack(tracks[i][1]); break; } @@ -587,10 +585,8 @@ void Sound::cdPlayMultMusic() { // Default to "ang?" for other languages (including EN_USA) int language = _vm->_global->_language <= 4 ? _vm->_global->_language : 2; for (int i = 0; i < ARRAYSIZE(tracks); i++) - if (_vm->_game->_curTotFile.equalsIgnoreCase(tracks[i][0])) { - debugC(1, kDebugSound, "CDROM: Playing mult music \"%s\" (\"%s\")", - tracks[i][language + 1], _vm->_game->_curTotFile.c_str()); - + if (_vm->isCurrentTot(tracks[i][0])) { + debugC(1, kDebugSound, "CDROM: Playing mult music \"%s\" (\"%s\")", tracks[i][language + 1], tracks[i][0]); _cdrom->startTrack(tracks[i][language + 1]); break; } diff --git a/engines/gob/util.cpp b/engines/gob/util.cpp index 57efdc074b..fe45adb702 100644 --- a/engines/gob/util.cpp +++ b/engines/gob/util.cpp @@ -153,7 +153,7 @@ void Util::processInput(bool scroll) { // WORKAROUND: // Force a check of the mouse in order to fix the sofa bug. This apply only for Gob3, and only // in the impacted TOT file so that the second screen animation is not broken. - if ((_vm->getGameType() == kGameTypeGob3) && _vm->_game->_curTotFile.equalsIgnoreCase("EMAP1008.TOT")) + if ((_vm->getGameType() == kGameTypeGob3) && _vm->isCurrentTot("EMAP1008.TOT")) _vm->_game->evaluateScroll(); } } |