[Scummvm-cvs-logs] SF.net SVN: scummvm:[53855] scummvm/trunk/engines/sci/graphics

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Tue Oct 26 22:19:17 CEST 2010


Revision: 53855
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53855&view=rev
Author:   m_kiewitz
Date:     2010-10-26 20:19:17 +0000 (Tue, 26 Oct 2010)

Log Message:
-----------
SCI: fix gfx issues when giving out cards hoyle4

bit 2 actually triggers special drawing of cels in sierra sci

Modified Paths:
--------------
    scummvm/trunk/engines/sci/graphics/animate.cpp
    scummvm/trunk/engines/sci/graphics/animate.h
    scummvm/trunk/engines/sci/graphics/view.cpp
    scummvm/trunk/engines/sci/graphics/view.h

Modified: scummvm/trunk/engines/sci/graphics/animate.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/animate.cpp	2010-10-26 20:14:17 UTC (rev 53854)
+++ scummvm/trunk/engines/sci/graphics/animate.cpp	2010-10-26 20:19:17 UTC (rev 53855)
@@ -283,17 +283,21 @@
 			if ((signal & kSignalHidden) && !(signal & kSignalAlwaysUpdate))
 				setNsRect = false;
 		} else {
-			view->getCelRect(it->loopNo, it->celNo, it->x, it->y, it->z, it->celRect);
+			//  This special handling is not included in the other SCI1.1 interpreters and MUST NOT be
+			//  checked in those cases, otherwise we will break games (e.g. EcoQuest 2, room 200)
+			if ((g_sci->getGameId() == GID_HOYLE4) && (it->scaleSignal & kScaleSignalHoyle4SpecialHandling)) {
+				view->getCelRect(it->loopNo, it->celNo, it->x, it->y, it->z, it->celRect);
+				it->celRect.left = readSelectorValue(_s->_segMan, curObject, SELECTOR(nsLeft));
+				it->celRect.top = readSelectorValue(_s->_segMan, curObject, SELECTOR(nsTop));
+				it->celRect.right = readSelectorValue(_s->_segMan, curObject, SELECTOR(nsRight));
+				it->celRect.bottom = readSelectorValue(_s->_segMan, curObject, SELECTOR(nsBottom));
+				view->getCelSpecialHoyle4Rect(it->loopNo, it->celNo, it->x, it->y, it->z, it->celRect);
+				setNsRect = false;
+			} else {
+				view->getCelRect(it->loopNo, it->celNo, it->x, it->y, it->z, it->celRect);
+			}
 		}
 
-		// Checking for this bit must be here for Hoyle4, otherwise cards are unclickable.
-		//  This feature is not included in the other SCI1.1 interpreters and MUST NOT be
-		//  checked in those cases, otherwise we will break games (e.g. EcoQuest 2, room 200)
-		// TODO: hoyle 4 has different code inside kAnimate and even special code, when bit 0 is not
-		//  set, but bit 2 is
-		if ((g_sci->getGameId() == GID_HOYLE4) && (it->scaleSignal & kScaleSignalHoyle4DontSetNsrect))
-			setNsRect = false;
-
 		if (setNsRect) {
 			writeSelectorValue(_s->_segMan, curObject, SELECTOR(nsLeft), it->celRect.left);
 			writeSelectorValue(_s->_segMan, curObject, SELECTOR(nsTop), it->celRect.top);

Modified: scummvm/trunk/engines/sci/graphics/animate.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/animate.h	2010-10-26 20:14:17 UTC (rev 53854)
+++ scummvm/trunk/engines/sci/graphics/animate.h	2010-10-26 20:19:17 UTC (rev 53855)
@@ -51,9 +51,9 @@
 };
 
 enum ViewScaleSignals {
-	kScaleSignalDoScaling			= 0x0001, // enables scaling when drawing that cel (involves scaleX and scaleY)
-	kScaleSignalGlobalScaling		= 0x0002, // means that global scaling shall get applied on that cel (sets scaleX/scaleY)
-	kScaleSignalHoyle4DontSetNsrect	= 0x0004  // HOYLE4-exclusive: do not set nsRect inside kAnimate(); for a test case see bug #3038424
+	kScaleSignalDoScaling				= 0x0001, // enables scaling when drawing that cel (involves scaleX and scaleY)
+	kScaleSignalGlobalScaling			= 0x0002, // means that global scaling shall get applied on that cel (sets scaleX/scaleY)
+	kScaleSignalHoyle4SpecialHandling	= 0x0004  // HOYLE4-exclusive: special handling inside kAnimate, is used when giving out cards
 
 };
 

Modified: scummvm/trunk/engines/sci/graphics/view.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/view.cpp	2010-10-26 20:14:17 UTC (rev 53854)
+++ scummvm/trunk/engines/sci/graphics/view.cpp	2010-10-26 20:19:17 UTC (rev 53855)
@@ -354,6 +354,16 @@
 	outRect.top = outRect.bottom - celInfo->height;
 }
 
+void GfxView::getCelSpecialHoyle4Rect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, Common::Rect &outRect) const {
+	const CelInfo *celInfo = getCelInfo(loopNo, celNo);
+	int16 adjustY = y - celInfo->height + celInfo->displaceY + 1;
+	int16 adjustX = x - ((celInfo->width - 1) >> 1) + celInfo->displaceX;
+	outRect.top += adjustY;
+	outRect.bottom += adjustY;
+	outRect.left += adjustX;
+	outRect.right += adjustX;
+}
+
 void GfxView::getCelScaledRect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, int16 scaleX, int16 scaleY, Common::Rect &outRect) const {
 	int16 scaledDisplaceX, scaledDisplaceY;
 	int16 scaledWidth, scaledHeight;

Modified: scummvm/trunk/engines/sci/graphics/view.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/view.h	2010-10-26 20:14:17 UTC (rev 53854)
+++ scummvm/trunk/engines/sci/graphics/view.h	2010-10-26 20:19:17 UTC (rev 53855)
@@ -66,6 +66,7 @@
 	int16 getHeight(int16 loopNo, int16 celNo) const;
 	const CelInfo *getCelInfo(int16 loopNo, int16 celNo) const;
 	void getCelRect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, Common::Rect &outRect) const;
+	void getCelSpecialHoyle4Rect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, Common::Rect &outRect) const;
 	void getCelScaledRect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, int16 scaleX, int16 scaleY, Common::Rect &outRect) const;
 	const byte *getBitmap(int16 loopNo, int16 celNo);
 	void draw(const Common::Rect &rect, const Common::Rect &clipRect, const Common::Rect &clipRectTranslated, int16 loopNo, int16 celNo, byte priority, uint16 EGAmappingNr, bool upscaledHires);


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