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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Sat Jul 31 02:48:05 CEST 2010


Revision: 51526
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51526&view=rev
Author:   m_kiewitz
Date:     2010-07-31 00:48:03 +0000 (Sat, 31 Jul 2010)

Log Message:
-----------
SCI: fix kAddToPic called with view data

and adding workaround for pq2 when showing windows with pictures
change to kAddToPic fixes bad coordinates of cels when restoring the game (should also fix lsl2)

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/workarounds.cpp
    scummvm/trunk/engines/sci/graphics/animate.cpp

Modified: scummvm/trunk/engines/sci/engine/workarounds.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/workarounds.cpp	2010-07-31 00:33:26 UTC (rev 51525)
+++ scummvm/trunk/engines/sci/engine/workarounds.cpp	2010-07-31 00:48:03 UTC (rev 51526)
@@ -128,12 +128,14 @@
 
 //    gameID,           room,script,lvl,          object-name, method-name,    call,index,                workaround
 const SciWorkaroundEntry kCelHigh_workarounds[] = {
+    { GID_PQ2,            -1,   255,  0,              "DIcon", "setSize",        -1,    0, { WORKAROUND_STILLCALL, 0 } }, // when showing picture within windows, called with 2nd/3rd parameters as objects
 	{ GID_SQ1,             1,   255,  0,              "DIcon", "setSize",        -1,    0, { WORKAROUND_STILLCALL, 0 } }, // DEMO: Called with 2nd/3rd parameters as objects when clicking on the menu
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };
 
 //    gameID,           room,script,lvl,          object-name, method-name,    call,index,                workaround
 const SciWorkaroundEntry kCelWide_workarounds[] = {
+    { GID_PQ2,            -1,   255,  0,              "DIcon", "setSize",        -1,    0, { WORKAROUND_STILLCALL, 0 } }, // when showing picture within windows, called with 2nd/3rd parameters as objects
 	{ GID_SQ1,             1,   255,  0,              "DIcon", "setSize",        -1,    0, { WORKAROUND_STILLCALL, 0 } }, // DEMO: Called with 2nd/3rd parameters as objects when clicking on the menu - bug #3035720
 	SCI_WORKAROUNDENTRY_TERMINATOR
 };

Modified: scummvm/trunk/engines/sci/graphics/animate.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/animate.cpp	2010-07-31 00:33:26 UTC (rev 51525)
+++ scummvm/trunk/engines/sci/graphics/animate.cpp	2010-07-31 00:48:03 UTC (rev 51526)
@@ -527,13 +527,21 @@
 	}
 }
 
-void GfxAnimate::addToPicDrawView(GuiResourceId viewId, int16 loopNo, int16 celNo, int16 leftPos, int16 topPos, int16 priority, int16 control) {
+void GfxAnimate::addToPicDrawView(GuiResourceId viewId, int16 loopNo, int16 celNo, int16 x, int16 y, int16 priority, int16 control) {
 	GfxView *view = _cache->getView(viewId);
 	Common::Rect celRect;
 
+	if (priority == -1)
+		priority = _ports->kernelCoordinateToPriority(y);
+
 	// Create rect according to coordinates and given cel
-	view->getCelRect(loopNo, celNo, leftPos, topPos, priority, celRect);
+	view->getCelRect(loopNo, celNo, x, y, 0, celRect);
 	_paint16->drawCel(view, loopNo, celNo, celRect, priority, 0);
+
+	if (control != -1) {
+		celRect.top = CLIP<int16>(_ports->kernelPriorityToCoordinate(priority) - 1, celRect.top, celRect.bottom - 1);
+		_paint16->fillRect(celRect, GFX_SCREEN_MASK_CONTROL, 0, 0, control);
+	}
 }
 
 
@@ -633,9 +641,9 @@
 	addToPicSetPicNotValid();
 }
 
-void GfxAnimate::kernelAddToPicView(GuiResourceId viewId, int16 loopNo, int16 celNo, int16 leftPos, int16 topPos, int16 priority, int16 control) {
+void GfxAnimate::kernelAddToPicView(GuiResourceId viewId, int16 loopNo, int16 celNo, int16 x, int16 y, int16 priority, int16 control) {
 	_ports->setPort((Port *)_ports->_picWind);
-	addToPicDrawView(viewId, loopNo, celNo, leftPos, topPos, priority, control);
+	addToPicDrawView(viewId, loopNo, celNo, x, y, priority, control);
 	addToPicSetPicNotValid();
 }
 


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