diff options
| author | Martin Kiewitz | 2010-09-25 19:28:56 +0000 | 
|---|---|---|
| committer | Martin Kiewitz | 2010-09-25 19:28:56 +0000 | 
| commit | 18cd3333c060bb5284f26275a14b7704e79aa440 (patch) | |
| tree | b86ebecf227e04ab6b455bf70bd57557bca31a33 | |
| parent | 9d50e47de321b193e0996dec84d585c3bb405ce8 (diff) | |
| download | scummvm-rg350-18cd3333c060bb5284f26275a14b7704e79aa440.tar.gz scummvm-rg350-18cd3333c060bb5284f26275a14b7704e79aa440.tar.bz2 scummvm-rg350-18cd3333c060bb5284f26275a14b7704e79aa440.zip | |
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
svn-id: r52887
| -rw-r--r-- | engines/sci/graphics/animate.cpp | 40 | ||||
| -rw-r--r-- | engines/sci/graphics/animate.h | 1 | 
2 files changed, 23 insertions, 18 deletions
| diff --git a/engines/sci/graphics/animate.cpp b/engines/sci/graphics/animate.cpp index 650ee0d6f9..808fae1e17 100644 --- a/engines/sci/graphics/animate.cpp +++ b/engines/sci/graphics/animate.cpp @@ -265,7 +265,7 @@ void GfxAnimate::fill(byte &old_picNotValid, bool maySetNsRect) {  			}  		} -		//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::reAnimate(Common::Rect rect) {  	}  } -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 @@ void GfxAnimate::addToPicDrawCels() {  		// 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::addToPicSetPicNotValid() {  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 @@ void GfxAnimate::kernelAddToPicList(reg_t listReference, int argc, reg_t *argv)  		error("kAddToPic called with non-list as parameter");  	makeSortedList(list); -	preprocessAddToPicList(); -	fill(tempPicNotValid, getSciVersion() >= SCI_VERSION_1_1 ? true : false);  	addToPicDrawCels();  	addToPicSetPicNotValid(); diff --git a/engines/sci/graphics/animate.h b/engines/sci/graphics/animate.h index 370e589643..ea4e2ebde3 100644 --- a/engines/sci/graphics/animate.h +++ b/engines/sci/graphics/animate.h @@ -101,7 +101,6 @@ public:  	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); | 
