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

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Wed Nov 17 19:22:22 CET 2010


Revision: 54297
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54297&view=rev
Author:   mthreepwood
Date:     2010-11-17 18:22:22 +0000 (Wed, 17 Nov 2010)

Log Message:
-----------
MOHAWK: Apply patch #2988976: "MYST: Fix drawing partial subimages"

Modified Paths:
--------------
    scummvm/trunk/engines/mohawk/graphics.cpp
    scummvm/trunk/engines/mohawk/myst.cpp

Modified: scummvm/trunk/engines/mohawk/graphics.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/graphics.cpp	2010-11-17 17:21:02 UTC (rev 54296)
+++ scummvm/trunk/engines/mohawk/graphics.cpp	2010-11-17 18:22:22 UTC (rev 54297)
@@ -206,7 +206,11 @@
 	if (surface) {
 		uint16 width = MIN<int>(surface->w, dest.width());
 		uint16 height = MIN<int>(surface->h, dest.height());
-		_vm->_system->copyRectToScreen((byte *)surface->getBasePtr(src.left, src.top), surface->pitch, dest.left, dest.top, width, height);
+
+		// Convert from bitmap coordinates to surface coordinates
+		uint16 top = surface->h - src.top - height;
+
+		_vm->_system->copyRectToScreen((byte *)surface->getBasePtr(src.left, top), surface->pitch, dest.left, dest.top, width, height);
 		surface->free();
 		delete surface;
 	}

Modified: scummvm/trunk/engines/mohawk/myst.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst.cpp	2010-11-17 17:21:02 UTC (rev 54296)
+++ scummvm/trunk/engines/mohawk/myst.cpp	2010-11-17 18:22:22 UTC (rev 54297)
@@ -1312,9 +1312,12 @@
 			_subImages[i].rect.right = rlstStream->readSint16LE();
 			_subImages[i].rect.bottom = rlstStream->readSint16LE();
 		} else {
-			_subImages[i].rect.top = 0;
-			_subImages[i].rect.right = 0;
-			_subImages[i].rect.bottom = 0;
+			// Use the hotspot rect as the source rect since the subimage is fullscreen
+			// Convert to bitmap coordinates (upside down)
+			_subImages[i].rect.left = _rect.left;
+			_subImages[i].rect.top = 333 - _rect.bottom;
+			_subImages[i].rect.right = _rect.right;
+			_subImages[i].rect.bottom = 333 - _rect.top;
 		}
 
 		debugC(kDebugResource, "\twdib: %d", _subImages[i].wdib);
@@ -1379,24 +1382,7 @@
 		} else
 			imageToDraw = _subImages[subImageId].wdib;
 
-		if (_subImages[subImageId].rect.left == -1)
-			_vm->_gfx->copyImageSectionToScreen(imageToDraw, _rect, _rect);
-			//vm->_gfx->copyImageToScreen(imageToDraw, Common::Rect(0, 0, 544, 333));
-		// TODO: Think this is the case when the image is full screen.. need to modify graphics to add functions for returning size of image.
-		// This is not right either...
-		//else if (_rect.width() != _subImages[draw_subimage_id].rect.width() || _rect.height() != _subImages[draw_subimage_id].rect.height())
-		// HACK: Hardcode cases of this until general rule can be ascertained
-		//       These cases seem to have the source rect in the wdib with an vertical i.e. top+X, bottom+X where X is a constant, but could
-		//       be negative, translations, when in fact both the source and dest should be equal...
-		//else if ((vm->getCurStack() == kSeleniticStack   && vm->getCurCard() == 1155 && tmp == 1) || // X=
-		//        (vm->getCurStack() == kSeleniticStack   && vm->getCurCard() == 1225 && tmp == 1) || // X=
-		//        (vm->getCurStack() == kMystStack        && vm->getCurCard() == 4247 && tmp == 0) || // X=
-		//        (vm->getCurStack() == kChannelwoodStack && vm->getCurCard() == 3161 && tmp == 0))   // X=
-		//	vm->_gfx->copyImageSectionToScreen(imageToDraw, _rect, _rect);
-		//    // TODO: Small vertical movement remains on change. Suspect off by one error from these to real
-		//	//        solution.
-		else
-			_vm->_gfx->copyImageSectionToScreen(imageToDraw, _subImages[subImageId].rect, _rect);
+		_vm->_gfx->copyImageSectionToScreen(imageToDraw, _subImages[subImageId].rect, _rect);
 	}
 }
 


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