[Scummvm-cvs-logs] SF.net SVN: scummvm: [22185] scummvm/trunk/engines/scumm/boxes.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Wed Apr 26 10:16:09 CEST 2006


Revision: 22185
Author:   fingolfin
Date:     2006-04-26 10:15:29 -0700 (Wed, 26 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22185&view=rev

Log Message:
-----------
cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/boxes.cpp
Modified: scummvm/trunk/engines/scumm/boxes.cpp
===================================================================
--- scummvm/trunk/engines/scumm/boxes.cpp	2006-04-26 14:35:53 UTC (rev 22184)
+++ scummvm/trunk/engines/scumm/boxes.cpp	2006-04-26 17:15:29 UTC (rev 22185)
@@ -177,7 +177,8 @@
 	if (!ptr)
 		return 255;
 
-	int slot , scale;
+	int slot = 0;
+	int scale;
 
 	if (_game.version == 8) {
 		// COMI has a separate field for the scale slot...
@@ -187,14 +188,12 @@
 		scale = READ_LE_UINT16(&ptr->old.scale);
 		if (scale & 0x8000)
 			slot = (scale & 0x7FFF) + 1;
-		else
-			slot = 0;
 	}
 
 	// Was a scale slot specified? If so, we compute the effective scale
 	// from it, ignoring the box scale.
 	if (slot)
-    scale = getScaleFromSlot(slot, x, y);
+		scale = getScaleFromSlot(slot, x, y);
 
 	return scale;
 }
@@ -289,9 +288,9 @@
 	 * 255. We have to be careful in handling this and some border cases.
 	 *
 	 * Some typical graphs look like these:
-	 *       ---         ---     ---
-	 *      /         ---           \
-	 *  ___/       ---               \___
+	 *       ---         _--     ---
+	 *      /         _--           \
+	 *  ___/       _--               \___
 	 *
 	 * The method used here is to compute the slope of secants fixed at the
 	 * left and right end. For most cases this detects the cut-over points
@@ -336,6 +335,7 @@
 	// The values of y1 and y2, as well as the scale, can now easily be computed
 	setScaleSlot(slot, 0, lowerIdx, resptr[lowerIdx], 0, upperIdx, resptr[upperIdx]);
 
+#if 0
 	// Compute the variance, for debugging. It shouldn't exceed 1
 	ScaleSlot &s = _scaleSlots[slot-1];
 	int y;
@@ -354,6 +354,7 @@
 	variance = sum / (200.0 - 1.0);
 	if (variance > 1)
 		debug(1, "scale item %d, variance %f exceeds 1 (room %d)", slot, variance, _currentRoom);
+#endif
 }
 
 void ScummEngine::setScaleSlot(int slot, int x1, int y1, int scale1, int x2, int y2, int scale2) {


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