aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/compare.cpp
diff options
context:
space:
mode:
authorMartin Kiewitz2010-07-27 11:11:47 +0000
committerMartin Kiewitz2010-07-27 11:11:47 +0000
commit114f4dfb0a1b9bea16ec51fc3d0cc866779f3c44 (patch)
treee0d8b00bf5b1d57bb11f286790eb294679bee3d8 /engines/sci/graphics/compare.cpp
parenteef7417487a657b14fa1204a009556bbb6e1c295 (diff)
downloadscummvm-rg350-114f4dfb0a1b9bea16ec51fc3d0cc866779f3c44.tar.gz
scummvm-rg350-114f4dfb0a1b9bea16ec51fc3d0cc866779f3c44.tar.bz2
scummvm-rg350-114f4dfb0a1b9bea16ec51fc3d0cc866779f3c44.zip
SCI: adding scaling code in kBaseSetter
and fixing palVary timer crash when exiting engine during palVary processing svn-id: r51361
Diffstat (limited to 'engines/sci/graphics/compare.cpp')
-rw-r--r--engines/sci/graphics/compare.cpp37
1 files changed, 27 insertions, 10 deletions
diff --git a/engines/sci/graphics/compare.cpp b/engines/sci/graphics/compare.cpp
index 46ccd84e7f..9eda688a64 100644
--- a/engines/sci/graphics/compare.cpp
+++ b/engines/sci/graphics/compare.cpp
@@ -229,21 +229,38 @@ void GfxCompare::kernelBaseSetter(reg_t object) {
if (viewId == 0xFFFF) // invalid view
return;
- GfxView *tmpView = _cache->getView(viewId);
+ uint16 scaleSignal = 0;
+ if (getSciVersion() >= SCI_VERSION_1_1) {
+ scaleSignal = readSelectorValue(_segMan, object, SELECTOR(scaleSignal)) & kScaleSignalDoScaling;
+ if (scaleSignal) {
+ int16 scaleY = readSelectorValue(_segMan, object, SELECTOR(scaleY));
+ if (scaleY < 64)
+ scaleSignal = 0;
+ }
+ }
+
Common::Rect celRect;
- if (tmpView->isSci2Hires())
- _screen->adjustToUpscaledCoordinates(y, x);
+ if (!scaleSignal) {
+ GfxView *tmpView = _cache->getView(viewId);
+ if (tmpView->isSci2Hires())
+ _screen->adjustToUpscaledCoordinates(y, x);
- tmpView->getCelRect(loopNo, celNo, x, y, z, celRect);
+ tmpView->getCelRect(loopNo, celNo, x, y, z, celRect);
- if (tmpView->isSci2Hires()) {
- _screen->adjustBackUpscaledCoordinates(celRect.top, celRect.left);
- _screen->adjustBackUpscaledCoordinates(celRect.bottom, celRect.right);
- }
+ if (tmpView->isSci2Hires()) {
+ _screen->adjustBackUpscaledCoordinates(celRect.top, celRect.left);
+ _screen->adjustBackUpscaledCoordinates(celRect.bottom, celRect.right);
+ }
- celRect.bottom = y + 1;
- celRect.top = celRect.bottom - yStep;
+ celRect.bottom = y + 1;
+ celRect.top = celRect.bottom - yStep;
+ } else {
+ celRect.left = readSelectorValue(_segMan, object, SELECTOR(nsLeft));
+ celRect.right = readSelectorValue(_segMan, object, SELECTOR(nsRight));
+ celRect.top = readSelectorValue(_segMan, object, SELECTOR(nsTop));
+ celRect.bottom = readSelectorValue(_segMan, object, SELECTOR(nsBottom));
+ }
writeSelectorValue(_segMan, object, SELECTOR(brLeft), celRect.left);
writeSelectorValue(_segMan, object, SELECTOR(brRight), celRect.right);