aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r--engines/sci/graphics/animate.cpp20
-rw-r--r--engines/sci/graphics/animate.h6
2 files changed, 17 insertions, 9 deletions
diff --git a/engines/sci/graphics/animate.cpp b/engines/sci/graphics/animate.cpp
index 339132a76c..57879b6653 100644
--- a/engines/sci/graphics/animate.cpp
+++ b/engines/sci/graphics/animate.cpp
@@ -185,12 +185,6 @@ void GfxAnimate::makeSortedList(List *list) {
listEntry->scaleX = 128;
listEntry->scaleY = 128;
}
- // TODO
- // On scaleSignal bit 1 sierra sci does some stuff with global var 2, current Port
- // and some other stuff and sets scaleX/Y accordingly. It seems this functionality is needed in at
- // least sq5 right when starting the game before wilco exists the room. Currently we dont get scaling
- // but sierra sci does scaling there. I dont fully understand the code yet, that's why i didnt implement
- // anything.
} else {
listEntry->scaleSignal = 0;
listEntry->scaleX = 128;
@@ -236,6 +230,20 @@ void GfxAnimate::fill(byte &old_picNotValid) {
writeSelectorValue(_s->_segMan, curObject, SELECTOR(cel), listEntry->celNo);
}
+ // Process global scaling, if needed
+ if (listEntry->scaleSignal & kScaleSignalDoScaling) {
+ if (listEntry->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 maxCelHeight = (maxScale * view->getHeight(listEntry->loopNo, listEntry->celNo)) >> 7;
+ // TODO!
+
+ // and set objects scale selectors
+ //writeSelectorValue(_s->_segMan, curObject, SELECTOR(scaleX), listEntry->scaleX);
+ //writeSelectorValue(_s->_segMan, curObject, SELECTOR(scaleY), listEntry->scaleY);
+ }
+ }
+
// Create rect according to coordinates and given cel
if (listEntry->scaleSignal & kScaleSignalDoScaling) {
view->getCelScaledRect(listEntry->loopNo, listEntry->celNo, listEntry->x, listEntry->y, listEntry->z, listEntry->scaleX, listEntry->scaleY, &listEntry->celRect);
diff --git a/engines/sci/graphics/animate.h b/engines/sci/graphics/animate.h
index 324ca0d700..a7d925c6e0 100644
--- a/engines/sci/graphics/animate.h
+++ b/engines/sci/graphics/animate.h
@@ -51,9 +51,9 @@ enum ViewSignals {
};
enum ViewScaleSignals {
- kScaleSignalDoScaling = 0x0001, // enables scaling when drawing that cel (involves scaleX and scaleY)
- kScaleSignalUnknown1 = 0x0002, // seems to do something with globalvar 2, sets scaleX/scaleY
- kScaleSignalUnknown2 = 0x0004 // really unknown
+ kScaleSignalDoScaling = 0x0001, // enables scaling when drawing that cel (involves scaleX and scaleY)
+ kScaleSignalGlobalScaling = 0x0002, // means that global scaling shall get applied on that cel (sets scaleX/scaleY)
+ kScaleSignalUnknown2 = 0x0004 // really unknown
};
struct AnimateEntry {