[Scummvm-cvs-logs] SF.net SVN: scummvm:[55630] scummvm/trunk/engines/gob

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Sat Jan 29 23:45:51 CET 2011


Revision: 55630
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55630&view=rev
Author:   drmccoy
Date:     2011-01-29 22:45:51 +0000 (Sat, 29 Jan 2011)

Log Message:
-----------
GOB: Add GobEngine::isCurrentTot()

Modified Paths:
--------------
    scummvm/trunk/engines/gob/draw_v2.cpp
    scummvm/trunk/engines/gob/gob.cpp
    scummvm/trunk/engines/gob/gob.h
    scummvm/trunk/engines/gob/inter.cpp
    scummvm/trunk/engines/gob/inter_fascin.cpp
    scummvm/trunk/engines/gob/inter_v1.cpp
    scummvm/trunk/engines/gob/inter_v6.cpp
    scummvm/trunk/engines/gob/sound/sound.cpp
    scummvm/trunk/engines/gob/util.cpp

Modified: scummvm/trunk/engines/gob/draw_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/draw_v2.cpp	2011-01-29 22:45:15 UTC (rev 55629)
+++ scummvm/trunk/engines/gob/draw_v2.cpp	2011-01-29 22:45:51 UTC (rev 55630)
@@ -196,7 +196,7 @@
 	// 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) {

Modified: scummvm/trunk/engines/gob/gob.cpp
===================================================================
--- scummvm/trunk/engines/gob/gob.cpp	2011-01-29 22:45:15 UTC (rev 55629)
+++ scummvm/trunk/engines/gob/gob.cpp	2011-01-29 22:45:51 UTC (rev 55630)
@@ -242,6 +242,10 @@
 	return (isSCNDemo() || isBATDemo());
 }
 
+bool GobEngine::isCurrentTot(const Common::String &tot) const {
+	return _game->_curTotFile.equalsIgnoreCase(tot);
+}
+
 const Graphics::PixelFormat &GobEngine::getPixelFormat() const {
 	return _pixelFormat;
 }

Modified: scummvm/trunk/engines/gob/gob.h
===================================================================
--- scummvm/trunk/engines/gob/gob.h	2011-01-29 22:45:15 UTC (rev 55629)
+++ scummvm/trunk/engines/gob/gob.h	2011-01-29 22:45:51 UTC (rev 55630)
@@ -231,6 +231,8 @@
 	bool isTrueColor() const;
 	bool isDemo() const;
 
+	bool isCurrentTot(const Common::String &tot) const;
+
 	void setTrueColor(bool trueColor);
 
 	GUI::Debugger *getDebugger() { return _console; }

Modified: scummvm/trunk/engines/gob/inter.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter.cpp	2011-01-29 22:45:15 UTC (rev 55629)
+++ scummvm/trunk/engines/gob/inter.cpp	2011-01-29 22:45:51 UTC (rev 55630)
@@ -257,24 +257,15 @@
 
 			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 @@
 		// 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 @@
 		// 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();
 			}

Modified: scummvm/trunk/engines/gob/inter_fascin.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_fascin.cpp	2011-01-29 22:45:15 UTC (rev 55629)
+++ scummvm/trunk/engines/gob/inter_fascin.cpp	2011-01-29 22:45:51 UTC (rev 55630)
@@ -136,9 +136,9 @@
 		// 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());

Modified: scummvm/trunk/engines/gob/inter_v1.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v1.cpp	2011-01-29 22:45:15 UTC (rev 55629)
+++ scummvm/trunk/engines/gob/inter_v1.cpp	2011-01-29 22:45:51 UTC (rev 55630)
@@ -667,13 +667,13 @@
 
 	// 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 @@
 
 	// 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 @@
 
 	// 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 @@
 	// 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) {

Modified: scummvm/trunk/engines/gob/inter_v6.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v6.cpp	2011-01-29 22:45:15 UTC (rev 55629)
+++ scummvm/trunk/engines/gob/inter_v6.cpp	2011-01-29 22:45:51 UTC (rev 55630)
@@ -127,8 +127,7 @@
 	// 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")) {

Modified: scummvm/trunk/engines/gob/sound/sound.cpp
===================================================================
--- scummvm/trunk/engines/gob/sound/sound.cpp	2011-01-29 22:45:15 UTC (rev 55629)
+++ scummvm/trunk/engines/gob/sound/sound.cpp	2011-01-29 22:45:51 UTC (rev 55630)
@@ -562,10 +562,8 @@
 	};
 
 	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 @@
 	// 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;
 		}

Modified: scummvm/trunk/engines/gob/util.cpp
===================================================================
--- scummvm/trunk/engines/gob/util.cpp	2011-01-29 22:45:15 UTC (rev 55629)
+++ scummvm/trunk/engines/gob/util.cpp	2011-01-29 22:45:51 UTC (rev 55630)
@@ -153,7 +153,7 @@
 		// 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();
 	}
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list