diff options
author | Colin Snover | 2016-11-27 10:53:06 -0600 |
---|---|---|
committer | Colin Snover | 2016-12-19 14:46:59 -0600 |
commit | 4cff1e400f7e1e885b12990a5a34772d05eb2285 (patch) | |
tree | a9e85d62fa6fd48bd2cc19d0d6a55d855fc5a6f4 /engines/sci/graphics | |
parent | 5220ce1e4f9090d0e6272d680dbfa3813233399b (diff) | |
download | scummvm-rg350-4cff1e400f7e1e885b12990a5a34772d05eb2285.tar.gz scummvm-rg350-4cff1e400f7e1e885b12990a5a34772d05eb2285.tar.bz2 scummvm-rg350-4cff1e400f7e1e885b12990a5a34772d05eb2285.zip |
SCI32: Add support for alternate graphics selectors
Used by at least Phantasmagoria 2.
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r-- | engines/sci/graphics/celobj32.cpp | 4 | ||||
-rw-r--r-- | engines/sci/graphics/frameout.cpp | 17 | ||||
-rw-r--r-- | engines/sci/graphics/plane32.cpp | 31 | ||||
-rw-r--r-- | engines/sci/graphics/screen_item32.cpp | 27 |
4 files changed, 60 insertions, 19 deletions
diff --git a/engines/sci/graphics/celobj32.cpp b/engines/sci/graphics/celobj32.cpp index 09ea05bd59..fe0fbf7cc4 100644 --- a/engines/sci/graphics/celobj32.cpp +++ b/engines/sci/graphics/celobj32.cpp @@ -21,6 +21,7 @@ */ #include "sci/resource.h" +#include "sci/engine/features.h" #include "sci/engine/seg_manager.h" #include "sci/engine/state.h" #include "sci/graphics/celobj32.h" @@ -949,6 +950,9 @@ CelObjView::CelObjView(const GuiResourceId viewId, const int16 loopNo, const int _width = READ_SCI11ENDIAN_UINT16(celHeader); _height = READ_SCI11ENDIAN_UINT16(celHeader + 2); _origin.x = _width / 2 - (int16)READ_SCI11ENDIAN_UINT16(celHeader + 4); + if (g_sci->_features->usesAlternateSelectors() && _mirrorX) { + _origin.x = _width - _origin.x - 1; + } _origin.y = _height - (int16)READ_SCI11ENDIAN_UINT16(celHeader + 6) - 1; _skipColor = celHeader[8]; _compressionType = (CelCompressionType)celHeader[9]; diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp index bf43c8b63b..fe43c75e5a 100644 --- a/engines/sci/graphics/frameout.cpp +++ b/engines/sci/graphics/frameout.cpp @@ -35,6 +35,7 @@ #include "sci/sci.h" #include "sci/console.h" +#include "sci/engine/features.h" #include "sci/engine/kernel.h" #include "sci/engine/state.h" #include "sci/engine/selector.h" @@ -1368,10 +1369,18 @@ bool GfxFrameout::kernelSetNowSeen(const reg_t screenItemObject) const { } Common::Rect result = screenItem->getNowSeenRect(*plane); - writeSelectorValue(_segMan, screenItemObject, SELECTOR(nsLeft), result.left); - writeSelectorValue(_segMan, screenItemObject, SELECTOR(nsTop), result.top); - writeSelectorValue(_segMan, screenItemObject, SELECTOR(nsRight), result.right - 1); - writeSelectorValue(_segMan, screenItemObject, SELECTOR(nsBottom), result.bottom - 1); + + if (g_sci->_features->usesAlternateSelectors()) { + writeSelectorValue(_segMan, screenItemObject, SELECTOR(left), result.left); + writeSelectorValue(_segMan, screenItemObject, SELECTOR(top), result.top); + writeSelectorValue(_segMan, screenItemObject, SELECTOR(right), result.right - 1); + writeSelectorValue(_segMan, screenItemObject, SELECTOR(bottom), result.bottom - 1); + } else { + writeSelectorValue(_segMan, screenItemObject, SELECTOR(nsLeft), result.left); + writeSelectorValue(_segMan, screenItemObject, SELECTOR(nsTop), result.top); + writeSelectorValue(_segMan, screenItemObject, SELECTOR(nsRight), result.right - 1); + writeSelectorValue(_segMan, screenItemObject, SELECTOR(nsBottom), result.bottom - 1); + } return true; } diff --git a/engines/sci/graphics/plane32.cpp b/engines/sci/graphics/plane32.cpp index 46622261f5..aa8cd52d42 100644 --- a/engines/sci/graphics/plane32.cpp +++ b/engines/sci/graphics/plane32.cpp @@ -80,10 +80,17 @@ _moved(0) { _vanishingPoint.x = readSelectorValue(segMan, object, SELECTOR(vanishingX)); _vanishingPoint.y = readSelectorValue(segMan, object, SELECTOR(vanishingY)); - _gameRect.left = readSelectorValue(segMan, object, SELECTOR(inLeft)); - _gameRect.top = readSelectorValue(segMan, object, SELECTOR(inTop)); - _gameRect.right = readSelectorValue(segMan, object, SELECTOR(inRight)) + 1; - _gameRect.bottom = readSelectorValue(segMan, object, SELECTOR(inBottom)) + 1; + if (g_sci->_features->usesAlternateSelectors()) { + _gameRect.left = readSelectorValue(segMan, object, SELECTOR(left)); + _gameRect.top = readSelectorValue(segMan, object, SELECTOR(top)); + _gameRect.right = readSelectorValue(segMan, object, SELECTOR(right)) + 1; + _gameRect.bottom = readSelectorValue(segMan, object, SELECTOR(bottom)) + 1; + } else { + _gameRect.left = readSelectorValue(segMan, object, SELECTOR(inLeft)); + _gameRect.top = readSelectorValue(segMan, object, SELECTOR(inTop)); + _gameRect.right = readSelectorValue(segMan, object, SELECTOR(inRight)) + 1; + _gameRect.bottom = readSelectorValue(segMan, object, SELECTOR(inBottom)) + 1; + } convertGameRectToPlaneRect(); _back = readSelectorValue(segMan, object, SELECTOR(back)); @@ -829,10 +836,18 @@ void Plane::update(const reg_t object) { SegManager *segMan = g_sci->getEngineState()->_segMan; _vanishingPoint.x = readSelectorValue(segMan, object, SELECTOR(vanishingX)); _vanishingPoint.y = readSelectorValue(segMan, object, SELECTOR(vanishingY)); - _gameRect.left = readSelectorValue(segMan, object, SELECTOR(inLeft)); - _gameRect.top = readSelectorValue(segMan, object, SELECTOR(inTop)); - _gameRect.right = readSelectorValue(segMan, object, SELECTOR(inRight)) + 1; - _gameRect.bottom = readSelectorValue(segMan, object, SELECTOR(inBottom)) + 1; + + if (g_sci->_features->usesAlternateSelectors()) { + _gameRect.left = readSelectorValue(segMan, object, SELECTOR(left)); + _gameRect.top = readSelectorValue(segMan, object, SELECTOR(top)); + _gameRect.right = readSelectorValue(segMan, object, SELECTOR(right)) + 1; + _gameRect.bottom = readSelectorValue(segMan, object, SELECTOR(bottom)) + 1; + } else { + _gameRect.left = readSelectorValue(segMan, object, SELECTOR(inLeft)); + _gameRect.top = readSelectorValue(segMan, object, SELECTOR(inTop)); + _gameRect.right = readSelectorValue(segMan, object, SELECTOR(inRight)) + 1; + _gameRect.bottom = readSelectorValue(segMan, object, SELECTOR(inBottom)) + 1; + } convertGameRectToPlaneRect(); _priority = readSelectorValue(segMan, object, SELECTOR(priority)); diff --git a/engines/sci/graphics/screen_item32.cpp b/engines/sci/graphics/screen_item32.cpp index a70f25fd6b..3c12a673a7 100644 --- a/engines/sci/graphics/screen_item32.cpp +++ b/engines/sci/graphics/screen_item32.cpp @@ -22,6 +22,7 @@ #include "sci/console.h" #include "sci/resource.h" +#include "sci/engine/features.h" #include "sci/engine/kernel.h" #include "sci/engine/selector.h" #include "sci/engine/state.h" @@ -238,14 +239,26 @@ void ScreenItem::setFromObject(SegManager *segMan, const reg_t object, const boo _z = readSelectorValue(segMan, object, SELECTOR(z)); _position.y -= _z; - if (readSelectorValue(segMan, object, SELECTOR(useInsetRect))) { - _useInsetRect = true; - _insetRect.left = readSelectorValue(segMan, object, SELECTOR(inLeft)); - _insetRect.top = readSelectorValue(segMan, object, SELECTOR(inTop)); - _insetRect.right = readSelectorValue(segMan, object, SELECTOR(inRight)) + 1; - _insetRect.bottom = readSelectorValue(segMan, object, SELECTOR(inBottom)) + 1; + if (g_sci->_features->usesAlternateSelectors()) { + if (readSelectorValue(segMan, object, SELECTOR(seenRect))) { + _useInsetRect = true; + _insetRect.left = readSelectorValue(segMan, object, SELECTOR(left)); + _insetRect.top = readSelectorValue(segMan, object, SELECTOR(top)); + _insetRect.right = readSelectorValue(segMan, object, SELECTOR(right)) + 1; + _insetRect.bottom = readSelectorValue(segMan, object, SELECTOR(bottom)) + 1; + } else { + _useInsetRect = false; + } } else { - _useInsetRect = false; + if (readSelectorValue(segMan, object, SELECTOR(useInsetRect))) { + _useInsetRect = true; + _insetRect.left = readSelectorValue(segMan, object, SELECTOR(inLeft)); + _insetRect.top = readSelectorValue(segMan, object, SELECTOR(inTop)); + _insetRect.right = readSelectorValue(segMan, object, SELECTOR(inRight)) + 1; + _insetRect.bottom = readSelectorValue(segMan, object, SELECTOR(inBottom)) + 1; + } else { + _useInsetRect = false; + } } segMan->getObject(object)->clearInfoSelectorFlag(kInfoFlagViewVisible); |