[Scummvm-cvs-logs] SF.net SVN: scummvm:[41962] scummvm/trunk/engines/kyra/screen.cpp

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Mon Jun 29 21:02:16 CEST 2009


Revision: 41962
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41962&view=rev
Author:   lordhoto
Date:     2009-06-29 19:02:15 +0000 (Mon, 29 Jun 2009)

Log Message:
-----------
Fix bug in drawShape, which caused invisibility in Kyra1 to be displayed incorrectly.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/screen.cpp

Modified: scummvm/trunk/engines/kyra/screen.cpp
===================================================================
--- scummvm/trunk/engines/kyra/screen.cpp	2009-06-29 18:49:28 UTC (rev 41961)
+++ scummvm/trunk/engines/kyra/screen.cpp	2009-06-29 19:02:15 UTC (rev 41962)
@@ -38,6 +38,11 @@
 	_cursorColorKey((vm->gameFlags().gameID == GI_KYRA1) ? 0xFF : 0x00) {
 	_debugEnabled = false;
 	_maskMinY = _maskMaxY = -1;
+
+	_drawShapeVar1 = 0;
+	_drawShapeVar3 = 1;
+	_drawShapeVar4 = 0;
+	_drawShapeVar5 = 0;
 }
 
 Screen::~Screen() {
@@ -1193,8 +1198,10 @@
 	if (!shapeData)
 		return;
 
-	int f = _vm->gameFlags().useAltShapeHeader ? 2 : 0;
-	if (shapeData[f] & 1)
+	if (_vm->gameFlags().useAltShapeHeader)
+		shapeData += 2;
+
+	if (*shapeData & 1)
 		flags |= 0x400;
 
 	va_list args;
@@ -1204,11 +1211,6 @@
 		1, 3, 2, 5, 4, 3, 2, 1
 	};
 
-	_drawShapeVar1 = 0;
-	_drawShapeVar3 = 1;
-	_drawShapeVar4 = 0;
-	_drawShapeVar5 = 0;
-
 	_dsTable = 0;
 	_dsTableLoopCount = 0;
 	_dsTable2 = 0;
@@ -1234,8 +1236,8 @@
 	}
 
 	if (flags & 0x200) {
-		_drawShapeVar1 += 1;
-		_drawShapeVar1 &= 7;
+		++_drawShapeVar1;
+		_drawShapeVar1 &= (_vm->gameFlags().gameID == GI_KYRA1) ? 0x7 : 0xF;
 		_drawShapeVar3 = drawShapeVar2[_drawShapeVar1];
 		_drawShapeVar4 = 0;
 		_drawShapeVar5 = 256;
@@ -1326,12 +1328,12 @@
 
 	int scaleCounterV = 0;
 
-	f = flags & 0x0f;
-	_dsProcessMargin = dsMarginFunc[f];
-	_dsScaleSkip = dsSkipFunc[f];
-	_dsProcessLine = dsLineFunc[f];
+	const int drawFunc = flags & 0x0f;
+	_dsProcessMargin = dsMarginFunc[drawFunc];
+	_dsScaleSkip = dsSkipFunc[drawFunc];
+	_dsProcessLine = dsLineFunc[drawFunc];
 
-	int ppc = (flags >> 8) & 0x3F;
+	const int ppc = (flags >> 8) & 0x3F;
 	_dsPlot = dsPlotFunc[ppc];
 	DsPlotFunc dsPlot2 = dsPlotFunc[ppc], dsPlot3 = dsPlotFunc[ppc];
 	if (flags & 0x800)
@@ -1363,8 +1365,6 @@
 
 	int y2 = y1 + dsDim->h;
 
-	if (_vm->gameFlags().useAltShapeHeader)
-		src += 2;
 	uint16 shapeFlags = READ_LE_UINT16(src); src += 2;
 
 	int shapeHeight = *src++;


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