From 43f476b5716e797525abf893ae58025109857176 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 31 Oct 2009 12:19:35 +0000 Subject: Properly fixed putPixel() for scaled screens svn-id: r45557 --- engines/sci/gui/gui_screen.cpp | 15 ++++++++------- engines/sci/gui/gui_screen.h | 2 ++ 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'engines') diff --git a/engines/sci/gui/gui_screen.cpp b/engines/sci/gui/gui_screen.cpp index eeced790e7..3b05452d35 100644 --- a/engines/sci/gui/gui_screen.cpp +++ b/engines/sci/gui/gui_screen.cpp @@ -117,17 +117,18 @@ Common::Rect SciGuiScreen::getScaledRect(Common::Rect rect) { void SciGuiScreen::putPixel(int x, int y, byte drawMask, byte color, byte priority, byte control) { int offset = y * _width + x; - int displayOffset = y * _displayWidth * _scaleFactor + x * _scaleFactor; if (drawMask & SCI_SCREEN_MASK_VISUAL) { _visualScreen[offset] = color; - _displayScreen[displayOffset] = color; - // If we need to scale, update the display screen appropriately - if (_scaleFactor != 1) - _displayScreen[(y + 1) * _displayWidth + x] = color; // one pixel down - _displayScreen[y * _displayWidth + x + 1] = color; // one pixel right - _displayScreen[(y + 1) * _displayWidth + x + 1] = color; // one pixel down and right + if (_scaleFactor == 1) { + _displayScreen[offset] = color; + } else { + _displayScreen[y * _displayWidth * 2 + x * 2] = color; // the actual pixel + _displayScreen[(y + 1) * _displayWidth * 2 + x * 2] = color; // one pixel down + _displayScreen[y * _displayWidth * 2 + (x * 2) + 1] = color; // one pixel right + _displayScreen[(y + 1) * _displayWidth * 2 + (x * 2) + 1] = color; // one pixel down and right + } } if (drawMask & SCI_SCREEN_MASK_PRIORITY) _priorityScreen[offset] = priority; diff --git a/engines/sci/gui/gui_screen.h b/engines/sci/gui/gui_screen.h index 4cac837f3a..583f9c41a4 100644 --- a/engines/sci/gui/gui_screen.h +++ b/engines/sci/gui/gui_screen.h @@ -76,6 +76,8 @@ public: void debugShowMap(int mapNo); + int getScaleFactor() { return _scaleFactor; } + uint16 _width; uint16 _height; uint _pixels; -- cgit v1.2.3