aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2017-05-15 21:53:05 +0200
committerWillem Jan Palenstijn2017-05-15 22:03:25 +0200
commit388419c53cce03171ab857ec3c7b6958eca272ca (patch)
treec1f9f337fb17c67873fd8ae8e827cfc342571cfd /engines
parent5c31db05942912e06939eb194fd1535a8a51142b (diff)
downloadscummvm-rg350-388419c53cce03171ab857ec3c7b6958eca272ca.tar.gz
scummvm-rg350-388419c53cce03171ab857ec3c7b6958eca272ca.tar.bz2
scummvm-rg350-388419c53cce03171ab857ec3c7b6958eca272ca.zip
SCI: Ignore priority and transparency for KQ6 hi-res views
This fixes bug 9786. Thanks to m_kiewitz for verifying with disasm.
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/graphics/view.cpp57
1 files changed, 29 insertions, 28 deletions
diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp
index 91303be5a7..788b473a0f 100644
--- a/engines/sci/graphics/view.cpp
+++ b/engines/sci/graphics/view.cpp
@@ -801,34 +801,7 @@ void GfxView::draw(const Common::Rect &rect, const Common::Rect &clipRect, const
const byte *bitmapData = bitmap.getUnsafeDataAt((clipRect.top - rect.top) * celWidth + (clipRect.left - rect.left), celWidth * (height - 1) + width);
- if (!_EGAmapping) {
- for (int y = 0; y < height; y++, bitmapData += celWidth) {
- for (int x = 0; x < width; x++) {
- const byte color = bitmapData[x];
- if (color != clearKey) {
- const int x2 = clipRectTranslated.left + x;
- const int y2 = clipRectTranslated.top + y;
- if (!upscaledHires) {
- if (priority >= _screen->getPriority(x2, y2)) {
- byte outputColor = palette->mapping[color];
- // SCI16 remapping (QFG4 demo)
- if (g_sci->_gfxRemap16 && g_sci->_gfxRemap16->isRemapped(outputColor))
- outputColor = g_sci->_gfxRemap16->remapColor(outputColor, _screen->getVisual(x2, y2));
- _screen->putPixel(x2, y2, drawMask, outputColor, priority, 0);
- }
- } else {
- // UpscaledHires means view is hires and is supposed to
- // get drawn onto lowres screen.
- // FIXME(?): we can't read priority directly with the
- // hires coordinates. May not be needed at all in kq6
- // FIXME: Handle proper aspect ratio. Some GK1 hires images
- // are in 640x400 instead of 640x480
- _screen->putPixelOnDisplay(x2, y2, palette->mapping[color]);
- }
- }
- }
- }
- } else {
+ if (_EGAmapping) {
const SciSpan<const byte> EGAmapping = _EGAmapping.subspan(EGAmappingNr * SCI_VIEW_EGAMAPPING_SIZE, SCI_VIEW_EGAMAPPING_SIZE);
for (int y = 0; y < height; y++, bitmapData += celWidth) {
for (int x = 0; x < width; x++) {
@@ -839,6 +812,34 @@ void GfxView::draw(const Common::Rect &rect, const Common::Rect &clipRect, const
_screen->putPixel(x2, y2, drawMask, color, priority, 0);
}
}
+ } else if (upscaledHires) {
+ // UpscaledHires means view is hires and is supposed to
+ // get drawn onto lowres screen.
+ for (int y = 0; y < height; y++, bitmapData += celWidth) {
+ for (int x = 0; x < width; x++) {
+ const byte color = bitmapData[x];
+ const int x2 = clipRectTranslated.left + x;
+ const int y2 = clipRectTranslated.top + y;
+ _screen->putPixelOnDisplay(x2, y2, palette->mapping[color]);
+ }
+ }
+ } else {
+ for (int y = 0; y < height; y++, bitmapData += celWidth) {
+ for (int x = 0; x < width; x++) {
+ const byte color = bitmapData[x];
+ if (color != clearKey) {
+ const int x2 = clipRectTranslated.left + x;
+ const int y2 = clipRectTranslated.top + y;
+ if (priority >= _screen->getPriority(x2, y2)) {
+ byte outputColor = palette->mapping[color];
+ // SCI16 remapping (QFG4 demo)
+ if (g_sci->_gfxRemap16 && g_sci->_gfxRemap16->isRemapped(outputColor))
+ outputColor = g_sci->_gfxRemap16->remapColor(outputColor, _screen->getVisual(x2, y2));
+ _screen->putPixel(x2, y2, drawMask, outputColor, priority, 0);
+ }
+ }
+ }
+ }
}
}