[Scummvm-cvs-logs] SF.net SVN: scummvm:[52559] scummvm/trunk/engines/sci/graphics/animate.cpp
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Sun Sep 5 14:55:15 CEST 2010
Revision: 52559
http://scummvm.svn.sourceforge.net/scummvm/?rev=52559&view=rev
Author: m_kiewitz
Date: 2010-09-05 12:55:15 +0000 (Sun, 05 Sep 2010)
Log Message:
-----------
SCI: dont do global scaling on non-scaleable views
lb2floppy: scripts get confused in the rat scene, when scaleX/Y are set with applied global scaling. This results in kInitBresen to get called almost endlessly, which results in ego slowing down to a crawl and not being able to reach the upper right exit - fixes bug #3050606
Modified Paths:
--------------
scummvm/trunk/engines/sci/graphics/animate.cpp
Modified: scummvm/trunk/engines/sci/graphics/animate.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/animate.cpp 2010-09-05 12:53:15 UTC (rev 52558)
+++ scummvm/trunk/engines/sci/graphics/animate.cpp 2010-09-05 12:55:15 UTC (rev 52559)
@@ -229,44 +229,44 @@
it->celNo = viewCelCount - 1;
}
- // Process global scaling, if needed
- if (it->scaleSignal & kScaleSignalDoScaling) {
- if (it->scaleSignal & kScaleSignalGlobalScaling) {
- // Global scaling uses global var 2 and some other stuff to calculate scaleX/scaleY
- int16 maxScale = readSelectorValue(_s->_segMan, curObject, SELECTOR(maxScale));
- int16 celHeight = view->getHeight(it->loopNo, it->celNo);
- int16 maxCelHeight = (maxScale * celHeight) >> 7;
- reg_t globalVar2 = _s->variables[VAR_GLOBAL][2]; // current room object
- int16 vanishingY = readSelectorValue(_s->_segMan, globalVar2, SELECTOR(vanishingY));
+ if (!view->isScaleable()) {
+ // Laura Bow 2 (especially floppy) depends on this, some views are not supposed to be scaleable
+ // this "feature" was removed in later versions of SCI1.1
+ it->scaleSignal = 0;
+ it->scaleY = it->scaleX = 128;
+ } else {
+ // Process global scaling, if needed
+ if (it->scaleSignal & kScaleSignalDoScaling) {
+ if (it->scaleSignal & kScaleSignalGlobalScaling) {
+ // Global scaling uses global var 2 and some other stuff to calculate scaleX/scaleY
+ int16 maxScale = readSelectorValue(_s->_segMan, curObject, SELECTOR(maxScale));
+ int16 celHeight = view->getHeight(it->loopNo, it->celNo);
+ int16 maxCelHeight = (maxScale * celHeight) >> 7;
+ reg_t globalVar2 = _s->variables[VAR_GLOBAL][2]; // current room object
+ int16 vanishingY = readSelectorValue(_s->_segMan, globalVar2, SELECTOR(vanishingY));
- int16 fixedPortY = _ports->getPort()->rect.bottom - vanishingY;
- int16 fixedEntryY = it->y - vanishingY;
- if (!fixedEntryY)
- fixedEntryY = 1;
+ int16 fixedPortY = _ports->getPort()->rect.bottom - vanishingY;
+ int16 fixedEntryY = it->y - vanishingY;
+ if (!fixedEntryY)
+ fixedEntryY = 1;
- if ((celHeight == 0) || (fixedPortY == 0))
- error("global scaling panic");
+ if ((celHeight == 0) || (fixedPortY == 0))
+ error("global scaling panic");
- it->scaleY = ( maxCelHeight * fixedEntryY ) / fixedPortY;
- it->scaleY = (it->scaleY * 128) / celHeight;
+ it->scaleY = ( maxCelHeight * fixedEntryY ) / fixedPortY;
+ it->scaleY = (it->scaleY * 128) / celHeight;
- it->scaleX = it->scaleY;
+ it->scaleX = it->scaleY;
- // and set objects scale selectors
- writeSelectorValue(_s->_segMan, curObject, SELECTOR(scaleX), it->scaleX);
- writeSelectorValue(_s->_segMan, curObject, SELECTOR(scaleY), it->scaleY);
+ // and set objects scale selectors
+ writeSelectorValue(_s->_segMan, curObject, SELECTOR(scaleX), it->scaleX);
+ writeSelectorValue(_s->_segMan, curObject, SELECTOR(scaleY), it->scaleY);
+ }
}
}
//warning("%s view %d, loop %d, cel %d", _s->_segMan->getObjectName(curObject), it->viewId, it->loopNo, it->celNo);
- if (!view->isScaleable()) {
- // Laura Bow 2 (especially floppy) depends on this, some views are not supposed to be scaleable
- // this "feature" was removed in later versions of SCI1.1
- it->scaleSignal = 0;
- it->scaleY = it->scaleX = 128;
- }
-
bool setNsRect = maySetNsRect;
// Create rect according to coordinates and given cel
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