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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Tue Dec 9 20:54:01 CET 2008


Revision: 35293
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35293&view=rev
Author:   fingolfin
Date:     2008-12-09 19:54:01 +0000 (Tue, 09 Dec 2008)

Log Message:
-----------
Removed some dead code, clarified comments, cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/cursor.cpp
    scummvm/trunk/engines/scumm/scumm.cpp
    scummvm/trunk/engines/scumm/string.cpp
    scummvm/trunk/engines/tinsel/polygons.cpp

Modified: scummvm/trunk/engines/scumm/cursor.cpp
===================================================================
--- scummvm/trunk/engines/scumm/cursor.cpp	2008-12-09 19:53:01 UTC (rev 35292)
+++ scummvm/trunk/engines/scumm/cursor.cpp	2008-12-09 19:54:01 UTC (rev 35293)
@@ -22,7 +22,6 @@
  *
  */
 
-
 #include "common/system.h"
 #include "common/util.h"
 #include "graphics/cursorman.h"
@@ -322,12 +321,9 @@
 }
 
 void ScummEngine_v5::redefineBuiltinCursorFromChar(int index, int chr) {
-	// Cursor image in both Looms are based on images from charset.
-	if (_game.id != GID_LOOM) {
-		// FIXME: Actually: is this opcode ever called by a non-Loom game?
-		// Which V3-V5 game besides Loom makes use of custom cursors, ever?
-		error("V3--V5 SO_CURSOR_IMAGE(%d,%d) called - tell Fingolfin where you saw this!", index, chr);
-	}
+	// Cursor image in both Loom versions are based on images from charset.
+	// This function is *only* supported for Loom!
+	assert(_game.id == GID_LOOM);
 
 	assert(index >= 0 && index < 4);
 
@@ -367,11 +363,8 @@
 
 void ScummEngine_v5::redefineBuiltinCursorHotspot(int index, int x, int y) {
 	// Cursor image in both Looms are based on images from charset.
-	if (_game.id != GID_LOOM) {
-		// FIXME: Actually: is this opcode ever called by a non-Loom game?
-		// Which V3-V5 game besides Loom makes use of custom cursors, ever?
-		error("V3--V5 SO_CURSOR_HOTSPOT(%d,%d,%d) called - tell Fingolfin where you saw this!", index, x, y);
-	}
+	// This function is *only* supported for Loom!
+	assert(_game.id == GID_LOOM);
 
 	assert(index >= 0 && index < 4);
 

Modified: scummvm/trunk/engines/scumm/scumm.cpp
===================================================================
--- scummvm/trunk/engines/scumm/scumm.cpp	2008-12-09 19:53:01 UTC (rev 35292)
+++ scummvm/trunk/engines/scumm/scumm.cpp	2008-12-09 19:54:01 UTC (rev 35293)
@@ -2157,7 +2157,7 @@
 // TODO: Check this function - we should probably be reinitting a lot more stuff, and I suspect
 //	 this leaks memory like a sieve
 
-// Fingolfing seez: An alternate way to implement restarting would be to create
+// Fingolfin seez: An alternate way to implement restarting would be to create
 // a save state right after startup ... to this end we could introduce a SaveFile
 // subclass which is implemented using a memory buffer (i.e. no actual file is
 // created). Then to restart we just have to load that pseudo save state.

Modified: scummvm/trunk/engines/scumm/string.cpp
===================================================================
--- scummvm/trunk/engines/scumm/string.cpp	2008-12-09 19:53:01 UTC (rev 35292)
+++ scummvm/trunk/engines/scumm/string.cpp	2008-12-09 19:54:01 UTC (rev 35293)
@@ -837,29 +837,11 @@
 	uint color;
 	int code = (_game.heversion >= 80) ? 127 : 64;
 
-	bool cmi_pos_hack = false;
+	// drawString is not used in SCUMM v7 and v8
+	assert(_game.version < 7);
 
 	convertMessageToString(msg, buf, sizeof(buf));
 
-	if (_game.version >= 7) {
-		// I recently disabled charset mask related code for V7+ games, thinking
-		// that it should never be needed there. Well, I missed on case: In this
-		// method, it could potentially still be used. Now the question is:
-		// Does this actually ever happen? Basically, drawString is called from
-		// two spots: First off, from drawVerb, which I *think* is not used for
-		// V7+ games (but I am not 100% sure), and secondly from printString().
-		// The latter is much harder to predict. Maybe in some obscure place it
-		// is used after all?
-		//
-		// Hence I am adding this error message, hoping that either somebody
-		// triggers it (at which point I can investigate), or, if nobody ever
-		// triggers it, we can assume that it's safe to keep this error even
-		// after the release.
-		//
-		// TODO/FIXME: Remove or update this hack before the next release!
-		error("drawString(%d, '%s') -- please inform Fingolfin about this crash!", a, buf);
-	}
-
 	_charset->_top = _string[a].ypos + _screenTop;
 	_charset->_startLeft = _charset->_left = _string[a].xpos;
 	_charset->_right = _string[a].right;
@@ -999,19 +981,10 @@
 					c = 0x20; //not in S-JIS
 				} else {
 					c += buf[i++] * 256;
-					if (_game.id == GID_CMI) {
-						cmi_pos_hack = true;
-						_charset->_top += 6;
-					}
 				}
 			}
-			_charset->printChar(c, (_game.version < 7));
+			_charset->printChar(c, true);
 			_charset->_blitAlso = false;
-
-			if (cmi_pos_hack) {
-				cmi_pos_hack = false;
-				_charset->_top -= 6;
-			}
 		}
 	}
 

Modified: scummvm/trunk/engines/tinsel/polygons.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/polygons.cpp	2008-12-09 19:53:01 UTC (rev 35292)
+++ scummvm/trunk/engines/tinsel/polygons.cpp	2008-12-09 19:54:01 UTC (rev 35293)
@@ -769,8 +769,10 @@
 }
 
 /**
- * Indirect method of calling PathOnTheWay(), to put the burden of
- * recursion onto the main stack.
+ * Indirect method of calling PathOnTheWay().
+ * Used to be implemented using coroutines, to put the burden of
+ * recursion onto the main stack. Since our "fake" coroutines use the
+ * same stack for everything anyway, we can do without the coroutines.
  */
 HPOLYGON GetPathOnTheWay(HPOLYGON hFrom, HPOLYGON hTo) {
 	CHECK_HP(hFrom, "Out of range polygon handle (6)");
@@ -794,7 +796,6 @@
 /**
  * Given a node path, work out which end node is nearest the given point.
  */
-
 int NearestEndNode(HPOLYGON hPath, int x, int y) {
 	const POLYGON *pp;
 
@@ -825,7 +826,6 @@
  * nodes is nearest together.
  * Return which node in the start path is part of the closest pair.
  */
-
 int NearEndNode(HPOLYGON hSpath, HPOLYGON hDpath) {
 	const POLYGON *pSpath, *pDpath;
 


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