aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2009-10-31 12:19:35 +0000
committerFilippos Karapetis2009-10-31 12:19:35 +0000
commit43f476b5716e797525abf893ae58025109857176 (patch)
treee4dd42ec54d3ae13194e4e4ae3b6ad26c63d4554 /engines
parentcd3f9336abe5ac9c99c817bd4abcf37c8c940bde (diff)
downloadscummvm-rg350-43f476b5716e797525abf893ae58025109857176.tar.gz
scummvm-rg350-43f476b5716e797525abf893ae58025109857176.tar.bz2
scummvm-rg350-43f476b5716e797525abf893ae58025109857176.zip
Properly fixed putPixel() for scaled screens
svn-id: r45557
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/gui/gui_screen.cpp15
-rw-r--r--engines/sci/gui/gui_screen.h2
2 files changed, 10 insertions, 7 deletions
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;