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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Sat Sep 25 21:28:57 CEST 2010


Revision: 52887
          http://scummvm.svn.sourceforge.net/scummvm/?rev=52887&view=rev
Author:   m_kiewitz
Date:     2010-09-25 19:28:56 +0000 (Sat, 25 Sep 2010)

Log Message:
-----------
SCI: changes to kAddToPic

kAddToPic doesnt do loop/cel fixups, it also doesnt support global scaling and will only set nsRect on scaled Cels, not reusing fill() of kAnimate anymore, but doing those things separately

fixes kq6 - 2nd window shown instead of peppermint bush (bug #3070465)

should be save to backport

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

Modified: scummvm/trunk/engines/sci/graphics/animate.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/animate.cpp	2010-09-25 18:07:19 UTC (rev 52886)
+++ scummvm/trunk/engines/sci/graphics/animate.cpp	2010-09-25 19:28:56 UTC (rev 52887)
@@ -265,7 +265,7 @@
 			}
 		}
 
-		//warning("%s view %d, loop %d, cel %d", _s->_segMan->getObjectName(curObject), it->viewId, it->loopNo, it->celNo);
+		//warning("%s view %d, loop %d, cel %d, signal %x", _s->_segMan->getObjectName(curObject), it->viewId, it->loopNo, it->celNo, it->signal);
 
 		bool setNsRect = maySetNsRect;
 
@@ -543,19 +543,6 @@
 	}
 }
 
-void GfxAnimate::preprocessAddToPicList() {
-	AnimateList::iterator it;
-	const AnimateList::iterator end = _list.end();
-
-	for (it = _list.begin(); it != end; ++it) {
-		if (it->priority == -1)
-			it->priority = _ports->kernelCoordinateToPriority(it->y);
-
-		// Do not allow priority to get changed by fill()
-		it->signal |= kSignalFixedPriority;
-	}
-}
-
 void GfxAnimate::addToPicDrawCels() {
 	reg_t curObject;
 	GfxView *view = NULL;
@@ -568,6 +555,28 @@
 		// Get the corresponding view
 		view = _cache->getView(it->viewId);
 
+		// kAddToPic does not do loop/cel-number fixups, it also doesn't support global scaling
+
+		if (it->priority == -1)
+			it->priority = _ports->kernelCoordinateToPriority(it->y);
+
+		if (!view->isScaleable()) {
+			// Laura Bow 2 specific - ffs. fill()
+			it->scaleSignal = 0;
+			it->scaleY = it->scaleX = 128;
+		}
+
+		// Create rect according to coordinates and given cel
+		if (it->scaleSignal & kScaleSignalDoScaling) {
+			view->getCelScaledRect(it->loopNo, it->celNo, it->x, it->y, it->z, it->scaleX, it->scaleY, it->celRect);
+			writeSelectorValue(_s->_segMan, curObject, SELECTOR(nsLeft), it->celRect.left);
+			writeSelectorValue(_s->_segMan, curObject, SELECTOR(nsTop), it->celRect.top);
+			writeSelectorValue(_s->_segMan, curObject, SELECTOR(nsRight), it->celRect.right);
+			writeSelectorValue(_s->_segMan, curObject, SELECTOR(nsBottom), it->celRect.bottom);
+		} else {
+			view->getCelRect(it->loopNo, it->celNo, it->x, it->y, it->z, it->celRect);
+		}
+
 		// draw corresponding cel
 		_paint16->drawCel(it->viewId, it->loopNo, it->celNo, it->celRect, it->priority, it->paletteNo, it->scaleX, it->scaleY);
 		if ((it->signal & kSignalIgnoreActor) == 0) {
@@ -714,7 +723,6 @@
 
 void GfxAnimate::kernelAddToPicList(reg_t listReference, int argc, reg_t *argv) {
 	List *list;
-	byte tempPicNotValid = 0;
 
 	_ports->setPort((Port *)_ports->_picWind);
 
@@ -723,8 +731,6 @@
 		error("kAddToPic called with non-list as parameter");
 
 	makeSortedList(list);
-	preprocessAddToPicList();
-	fill(tempPicNotValid, getSciVersion() >= SCI_VERSION_1_1 ? true : false);
 	addToPicDrawCels();
 
 	addToPicSetPicNotValid();

Modified: scummvm/trunk/engines/sci/graphics/animate.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/animate.h	2010-09-25 18:07:19 UTC (rev 52886)
+++ scummvm/trunk/engines/sci/graphics/animate.h	2010-09-25 19:28:56 UTC (rev 52887)
@@ -101,7 +101,6 @@
 	void updateScreen(byte oldPicNotValid);
 	void restoreAndDelete(int argc, reg_t *argv);
 	void reAnimate(Common::Rect rect);
-	void preprocessAddToPicList();
 	void addToPicDrawCels();
 	void addToPicDrawView(GuiResourceId viewId, int16 loopNo, int16 celNo, int16 leftPos, int16 topPos, int16 priority, int16 control);
 


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