[Scummvm-git-logs] scummvm master -> 388419c53cce03171ab857ec3c7b6958eca272ca
wjp
wjp at usecode.org
Mon May 15 22:04:05 CEST 2017
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
388419c53c SCI: Ignore priority and transparency for KQ6 hi-res views
Commit: 388419c53cce03171ab857ec3c7b6958eca272ca
https://github.com/scummvm/scummvm/commit/388419c53cce03171ab857ec3c7b6958eca272ca
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2017-05-15T22:03:25+02:00
Commit Message:
SCI: Ignore priority and transparency for KQ6 hi-res views
This fixes bug 9786. Thanks to m_kiewitz for verifying with disasm.
Changed paths:
engines/sci/graphics/view.cpp
diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp
index 91303be..788b473 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);
+ }
+ }
+ }
+ }
}
}
More information about the Scummvm-git-logs
mailing list