aboutsummaryrefslogtreecommitdiff
path: root/engines
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
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')
-rw-r--r--engines/sci/graphics/compare.cpp37
-rw-r--r--engines/sci/graphics/palette.cpp2
2 files changed, 29 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);
diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp
index 73689fe3b2..00d59c7b92 100644
--- a/engines/sci/graphics/palette.cpp
+++ b/engines/sci/graphics/palette.cpp
@@ -72,6 +72,8 @@ GfxPalette::GfxPalette(ResourceManager *resMan, GfxScreen *screen, bool useMergi
}
GfxPalette::~GfxPalette() {
+ if (_palVaryResourceId != -1)
+ palVaryRemoveTimer();
}
bool GfxPalette::isMerging() {