diff options
Diffstat (limited to 'engines/sci/gui')
-rw-r--r-- | engines/sci/gui/gui_cursor.cpp | 7 | ||||
-rw-r--r-- | engines/sci/gui/gui_cursor.h | 2 | ||||
-rw-r--r-- | engines/sci/gui/gui_gfx.cpp | 5 | ||||
-rw-r--r-- | engines/sci/gui/gui_picture.cpp | 12 | ||||
-rw-r--r-- | engines/sci/gui/gui_screen.cpp | 21 | ||||
-rw-r--r-- | engines/sci/gui/gui_screen.h | 8 |
6 files changed, 36 insertions, 19 deletions
diff --git a/engines/sci/gui/gui_cursor.cpp b/engines/sci/gui/gui_cursor.cpp index 76f1eb1b02..702c9447e6 100644 --- a/engines/sci/gui/gui_cursor.cpp +++ b/engines/sci/gui/gui_cursor.cpp @@ -30,13 +30,14 @@ #include "sci/sci.h" #include "sci/engine/state.h" #include "sci/gui/gui_palette.h" +#include "sci/gui/gui_screen.h" #include "sci/gui/gui_view.h" #include "sci/gui/gui_cursor.h" namespace Sci { -SciGuiCursor::SciGuiCursor(ResourceManager *resMan, SciGuiPalette *palette) - : _resMan(resMan), _palette(palette) { +SciGuiCursor::SciGuiCursor(ResourceManager *resMan, SciGuiPalette *palette, SciGuiScreen *screen) + : _resMan(resMan), _palette(palette), _screen(screen) { setPosition(Common::Point(160, 150)); // TODO: how is that different in 640x400 games? setMoveZone(Common::Rect(0, 0, 320, 200)); // TODO: hires games @@ -88,7 +89,7 @@ void SciGuiCursor::setShape(GuiResourceId resourceId) { // Now find out what colors we are supposed to use colorMapping[0] = 0; // Black is hardcoded - colorMapping[1] = _resMan->isVGA() ? 255 : 15; // White is also hardcoded + colorMapping[1] = _screen->_colorWhite; // White is also hardcoded colorMapping[2] = SCI_CURSOR_SCI0_TRANSPARENCYCOLOR; colorMapping[3] = _palette->matchColor(&_palette->_sysPalette, 170, 170, 170); // Grey diff --git a/engines/sci/gui/gui_cursor.h b/engines/sci/gui/gui_cursor.h index 9e237720ca..93527643f5 100644 --- a/engines/sci/gui/gui_cursor.h +++ b/engines/sci/gui/gui_cursor.h @@ -37,7 +37,7 @@ class SciGuiView; class SciGuiPalette; class SciGuiCursor { public: - SciGuiCursor(ResourceManager *resMan, SciGuiPalette *palette); + SciGuiCursor(ResourceManager *resMan, SciGuiPalette *palette, SciGuiScreen *screen); ~SciGuiCursor(); void show(); diff --git a/engines/sci/gui/gui_gfx.cpp b/engines/sci/gui/gui_gfx.cpp index e44a44a819..0a3a36ce33 100644 --- a/engines/sci/gui/gui_gfx.cpp +++ b/engines/sci/gui/gui_gfx.cpp @@ -302,10 +302,7 @@ void SciGuiGfx::drawPicture(GuiResourceId pictureId, int16 animationNr, bool mir picture = new SciGuiPicture(_s->resMan, this, _screen, _palette, pictureId); // do we add to a picture? if not -> clear screen if (!addToFlag) { - if (_s->resMan->isVGA()) - ClearScreen(255); - else - ClearScreen(15); + ClearScreen(_screen->_colorClearScreen); } picture->draw(animationNr, mirroredFlag, addToFlag, paletteId); } diff --git a/engines/sci/gui/gui_picture.cpp b/engines/sci/gui/gui_picture.cpp index 75892b7574..a21748286d 100644 --- a/engines/sci/gui/gui_picture.cpp +++ b/engines/sci/gui/gui_picture.cpp @@ -301,7 +301,8 @@ static const byte vector_defaultEGApriority[PIC_EGAPRIORITY_SIZE] = { void SciGuiPicture::drawVectorData(byte *data, int dataSize) { byte pic_op; - byte pic_color = 0, pic_priority = 255, pic_control = 255; + byte pic_color = _screen->_colorDefaultVectorData; + byte pic_priority = 255, pic_control = 255; int16 x = 0, y = 0, oldx, oldy; byte EGApalettes[PIC_EGAPALETTE_TOTALSIZE] = {0}; byte *EGApalette = &EGApalettes[_EGApaletteNo * PIC_EGAPALETTE_SIZE]; @@ -604,13 +605,8 @@ void SciGuiPicture::vectorFloodFill(int16 x, int16 y, byte color, byte priority, // This logic was taken directly from sierra sci, floodfill will get aborted on various occations if (screenMask & SCI_SCREEN_MASK_VISUAL) { - if (_resMan->isVGA()) { - if ((color == 255) || (searchColor != 255)) - return; - } else { - if ((color == 15) || (searchColor != 15)) - return; - } + if ((color == _screen->_colorWhite) || (searchColor != _screen->_colorClearScreen)) + return; } else if (screenMask & SCI_SCREEN_MASK_PRIORITY) { if ((priority == 0) || (searchPriority != 0)) return; diff --git a/engines/sci/gui/gui_screen.cpp b/engines/sci/gui/gui_screen.cpp index 6e1be2a2d6..6818ed3182 100644 --- a/engines/sci/gui/gui_screen.cpp +++ b/engines/sci/gui/gui_screen.cpp @@ -33,8 +33,8 @@ namespace Sci { -SciGuiScreen::SciGuiScreen(int16 width, int16 height, int16 scaleFactor) : - _width(width), _height(height) { +SciGuiScreen::SciGuiScreen(ResourceManager *resMan, int16 width, int16 height, int16 scaleFactor) : + _resMan(resMan), _width(width), _height(height) { _pixels = _width * _height; @@ -53,6 +53,23 @@ SciGuiScreen::SciGuiScreen(int16 width, int16 height, int16 scaleFactor) : _picNotValid = false; _unditherState = true; + + if (_resMan->isVGA()) { + _colorWhite = 255; + // TODO: Find out whats really different between SCI11 and SCI1, because actually the clearScreen in SCI11 + // really uses 255 as well + if (getSciVersion() >= SCI_VERSION_1_1) { + _colorClearScreen = 0; + _colorDefaultVectorData = 255; + } else { + _colorClearScreen = 255; + _colorDefaultVectorData = 0; + } + } else { + _colorWhite = 15; + _colorClearScreen = 15; + _colorDefaultVectorData = 0; + } } SciGuiScreen::~SciGuiScreen() { diff --git a/engines/sci/gui/gui_screen.h b/engines/sci/gui/gui_screen.h index 74c5c53bc1..4c54c544f3 100644 --- a/engines/sci/gui/gui_screen.h +++ b/engines/sci/gui/gui_screen.h @@ -42,7 +42,7 @@ namespace Sci { class SciGuiScreen { public: - SciGuiScreen(int16 width = 320, int16 height = 200, int16 scaleFactor = 1); + SciGuiScreen(ResourceManager *resMan, int16 width = 320, int16 height = 200, int16 scaleFactor = 1); ~SciGuiScreen(); void copyToScreen(); @@ -85,6 +85,10 @@ public: int _picNotValid; // possible values 0, 1 and 2 + byte _colorWhite; + byte _colorClearScreen; + byte _colorDefaultVectorData; + private: void bitsRestoreScreen(Common::Rect rect, byte *&memoryPtr, byte *screen); void bitsSaveScreen(Common::Rect rect, byte *screen, byte *&memoryPtr); @@ -104,6 +108,8 @@ public: // HACK. TODO: make private byte *_displayScreen; private: + ResourceManager *_resMan; + // this is a pointer to the currently active screen (changing it only required for debug purposes) byte *_activeScreen; }; |