diff options
author | Martin Kiewitz | 2009-10-07 21:47:34 +0000 |
---|---|---|
committer | Martin Kiewitz | 2009-10-07 21:47:34 +0000 |
commit | a61076a645e8c185b54d290f223b70fea2fccb3b (patch) | |
tree | 0a8d1b129af19ac5fa91a60a5046fc551801e951 /engines/sci/gui | |
parent | 1562add63191c482acf99da61d6d8d1e2bf8903d (diff) | |
download | scummvm-rg350-a61076a645e8c185b54d290f223b70fea2fccb3b.tar.gz scummvm-rg350-a61076a645e8c185b54d290f223b70fea2fccb3b.tar.bz2 scummvm-rg350-a61076a645e8c185b54d290f223b70fea2fccb3b.zip |
SCI: debug command undither implemented
svn-id: r44761
Diffstat (limited to 'engines/sci/gui')
-rw-r--r-- | engines/sci/gui/gui.cpp | 5 | ||||
-rw-r--r-- | engines/sci/gui/gui.h | 1 | ||||
-rw-r--r-- | engines/sci/gui/gui_screen.cpp | 19 | ||||
-rw-r--r-- | engines/sci/gui/gui_screen.h | 3 |
4 files changed, 21 insertions, 7 deletions
diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp index 331666edff..743172fe4e 100644 --- a/engines/sci/gui/gui.cpp +++ b/engines/sci/gui/gui.cpp @@ -496,6 +496,11 @@ void SciGui::moveCursor(Common::Point pos) { // FIXME! } +bool SciGui::debugUndither(bool flag) { + _screen->unditherSetState(flag); + return false; +} + bool SciGui::debugShowMap(int mapNo) { _screen->debugShowMap(mapNo); return false; diff --git a/engines/sci/gui/gui.h b/engines/sci/gui/gui.h index 33a945a634..2ebf4e85d4 100644 --- a/engines/sci/gui/gui.h +++ b/engines/sci/gui/gui.h @@ -90,6 +90,7 @@ public: virtual void setCursorPos(Common::Point pos); virtual void moveCursor(Common::Point pos); + virtual bool debugUndither(bool flag); virtual bool debugShowMap(int mapNo); private: diff --git a/engines/sci/gui/gui_screen.cpp b/engines/sci/gui/gui_screen.cpp index d7933c0535..e2da6fd072 100644 --- a/engines/sci/gui/gui_screen.cpp +++ b/engines/sci/gui/gui_screen.cpp @@ -60,6 +60,7 @@ SciGuiScreen::SciGuiScreen(int16 width, int16 height, int16 scaleFactor) : } _picNotValid = false; + _unditherState = false; } SciGuiScreen::~SciGuiScreen() { @@ -223,7 +224,7 @@ void SciGuiScreen::setPalette(GuiPalette*pal) { // Currently not really done, its supposed to be possible to only dither _visualScreen void SciGuiScreen::dither() { int y, x; - byte color; + byte color, ditheredColor; byte *screenPtr = _visualScreen; byte *displayPtr = _displayScreen; @@ -232,18 +233,22 @@ void SciGuiScreen::dither() { color = *screenPtr; if (color & 0xF0) { color ^= color << 4; -// remove remark to enable undithering -// *displayPtr = color; - // do the actual dithering - color = ((x^y) & 1) ? color >> 4 : color & 0x0F; - *screenPtr = color; - *displayPtr = color; // put remark here to enable unditherung + ditheredColor = ((x^y) & 1) ? color >> 4 : color & 0x0F; + *screenPtr = ditheredColor; + if (_unditherState) + *displayPtr = color; + else + *displayPtr = ditheredColor; } screenPtr++; displayPtr++; } } } +void SciGuiScreen::unditherSetState(bool flag) { + _unditherState = flag; +} + void SciGuiScreen::debugShowMap(int mapNo) { switch (mapNo) { case 0: diff --git a/engines/sci/gui/gui_screen.h b/engines/sci/gui/gui_screen.h index 0ce0f0f13c..0a631e980a 100644 --- a/engines/sci/gui/gui_screen.h +++ b/engines/sci/gui/gui_screen.h @@ -62,6 +62,7 @@ public: void setPalette(GuiPalette*pal); void dither(); + void unditherSetState(bool flag); void debugShowMap(int mapNo); @@ -74,6 +75,8 @@ public: int _picNotValid; // possible values 0, 1 and 2 + bool _unditherState; + private: void restoreBitsScreen(Common::Rect rect, byte *&memoryPtr, byte *screen); void saveBitsScreen(Common::Rect rect, byte *screen, byte *&memoryPtr); |