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

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Thu Apr 17 00:23:10 CEST 2008


Revision: 31521
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31521&view=rev
Author:   lordhoto
Date:     2008-04-16 15:23:09 -0700 (Wed, 16 Apr 2008)

Log Message:
-----------
Fixed shape drawing in HoF (regression) and Kyra3.

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

Modified: scummvm/trunk/engines/kyra/scene_v3.cpp
===================================================================
--- scummvm/trunk/engines/kyra/scene_v3.cpp	2008-04-16 21:17:23 UTC (rev 31520)
+++ scummvm/trunk/engines/kyra/scene_v3.cpp	2008-04-16 22:23:09 UTC (rev 31521)
@@ -358,7 +358,7 @@
 	_maskPageMinY = minY;
 	_maskPageMaxY = minY + height - 1;
 
-	_screen->setShapePages(3, 5);
+	_screen->setShapePages(5, 3, _maskPageMinY, _maskPageMaxY);
 
 	musicUpdate(0);
 	_screen->loadBitmap(filename, 5, 5, 0, true);

Modified: scummvm/trunk/engines/kyra/screen.cpp
===================================================================
--- scummvm/trunk/engines/kyra/screen.cpp	2008-04-16 21:17:23 UTC (rev 31520)
+++ scummvm/trunk/engines/kyra/screen.cpp	2008-04-16 22:23:09 UTC (rev 31521)
@@ -1111,7 +1111,7 @@
 		_dsTable = va_arg(args, uint8*);
 		_dsTableLoopCount = va_arg(args, int);
 		if (!_dsTableLoopCount)
-			flags &= 0xFFFFFEFF;
+			flags &= ~0x100;
 	}
 
 	if (flags & 0x1000) {
@@ -1205,6 +1205,9 @@
 
 	int ppc = (flags >> 8) & 0x3F;
 	_dsPlot = dsPlotFunc[ppc];
+	DsPlotFunc dsPlot2 = dsPlotFunc[ppc], dsPlot3 = dsPlotFunc[ppc];
+	if (flags & 0x800)
+		dsPlot3 = dsPlotFunc[((flags >> 8) & 0xF7) & 0x3F];
 
 	if (!_dsPlot) {
 		warning("Missing drawShape plotting method type %d", ppc);
@@ -1212,6 +1215,7 @@
 		return;
 	}
 
+	int curY = y;
 	const uint8 *src = shapeData;
 	uint8 *dst = _dsDstPage = getPagePtr(pageNum);
 
@@ -1257,7 +1261,7 @@
 
 	uint16 frameSize = READ_LE_UINT16(src); src += 2;
 
-	int colorTableColors = ((_vm->gameFlags().gameID != GI_KYRA2) && (shapeFlags & 4)) ? *src++ : 16;
+	int colorTableColors = ((_vm->gameFlags().gameID != GI_KYRA1) && (shapeFlags & 4)) ? *src++ : 16;
 	
 	if (!(flags & 0x8000) && (shapeFlags & 1))
 		_dsTable2 = src;
@@ -1370,6 +1374,12 @@
 	uint8 *d = dst;
 
 	while (shapeHeight--) {
+		++curY;
+
+		bool normalPlot = true;
+		if (flags & 0x800)
+			normalPlot = (curY > _maskMinY && curY < _maskMaxY);
+
 		while (!(scaleCounterV & 0xff00)) {
 			scaleCounterV += _dsScaleH;
 			if (!(scaleCounterV & 0xff00)) {
@@ -1389,6 +1399,7 @@
 			if (_dsTmpWidth) {
 				cnt += shpWidthScaled1;
 				if (cnt > 0) {
+					_dsPlot = normalPlot ? dsPlot2 : dsPlot3;
 					(this->*_dsProcessLine)(d, s, cnt, scaleState);
 				}
 				cnt += _dsOffscreenRight;
@@ -2360,10 +2371,12 @@
 	return _mouseLockCount == 0;
 }
 
-void Screen::setShapePages(int page1, int page2) {
-	debugC(9, kDebugLevelScreen, "Screen::setShapePages(%d, %d)", page1, page2);
+void Screen::setShapePages(int page1, int page2, int minY, int maxY) {
+	debugC(9, kDebugLevelScreen, "Screen::setShapePages(%d, %d)", page1, page2, minY, maxY);
 	_shapePages[0] = _pagePtrs[page1];
 	_shapePages[1] = _pagePtrs[page2];
+	_maskMinY = minY;
+	_maskMaxY = maxY;
 }
 
 void Screen::setMouseCursor(int x, int y, byte *shape) {

Modified: scummvm/trunk/engines/kyra/screen.h
===================================================================
--- scummvm/trunk/engines/kyra/screen.h	2008-04-16 21:17:23 UTC (rev 31520)
+++ scummvm/trunk/engines/kyra/screen.h	2008-04-16 22:23:09 UTC (rev 31521)
@@ -200,7 +200,7 @@
 
 	void setAnimBlockPtr(int size);
 
-	void setShapePages(int page1, int page2);
+	void setShapePages(int page1, int page2, int minY = -1, int maxY = 321);
 
 	byte getShapeFlag1(int x, int y);
 	byte getShapeFlag2(int x, int y);
@@ -216,6 +216,7 @@
 	int _curPage;
 	uint8 *_currentPalette;
 	uint8 *_shapePages[2];
+	int _maskMinY, _maskMaxY;
 	FontId _currentFont;
 	bool _disableScreen;
 


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