From 7bce8acd2e56eec870ffb7d269c6a8cb04af0735 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Wed, 9 Dec 2009 09:31:07 +0000 Subject: SCI: implemented _picNotValidSci11 for new kPicNotValid behaviour in sci1.1 (fixes island of dr. brain first pic after copy protection not showing up) svn-id: r46305 --- engines/sci/gui/gui.cpp | 31 +++++++++++++++++++++++-------- engines/sci/gui/gui.h | 1 + engines/sci/gui/gui_gfx.cpp | 9 +++++++-- engines/sci/gui/gui_screen.cpp | 3 ++- engines/sci/gui/gui_screen.h | 1 + 5 files changed, 34 insertions(+), 11 deletions(-) (limited to 'engines/sci/gui') diff --git a/engines/sci/gui/gui.cpp b/engines/sci/gui/gui.cpp index be1ca1ca47..a5be962870 100644 --- a/engines/sci/gui/gui.cpp +++ b/engines/sci/gui/gui.cpp @@ -366,6 +366,12 @@ void SciGui::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo ce _palette->setOnScreen(); } +int SciGui::getControlPicNotValid() { + if (getSciVersion() >= SCI_VERSION_1_1) + return _screen->_picNotValidSci11; + return _screen->_picNotValid; +} + void SciGui::drawControlButton(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 style, bool hilite) { if (!hilite) { rect.grow(1); @@ -378,7 +384,7 @@ void SciGui::drawControlButton(Common::Rect rect, reg_t obj, const char *text, i rect.grow(1); if (style & 8) // selected _gfx->FrameRect(rect); - if (_screen->_picNotValid == 0) { + if (!getControlPicNotValid()) { rect.grow(1); _gfx->BitsShow(rect); } @@ -398,7 +404,7 @@ void SciGui::drawControlText(Common::Rect rect, reg_t obj, const char *text, int _gfx->FrameRect(rect); } rect.grow(1); - if (_screen->_picNotValid == 0) + if (!getControlPicNotValid()) _gfx->BitsShow(rect); } else { _gfx->InvertRect(rect); @@ -422,7 +428,7 @@ void SciGui::drawControlTextEdit(Common::Rect rect, reg_t obj, const char *text, _text->SetFont(oldFontId); rect.grow(1); } - if (_screen->_picNotValid == 0) + if (!getControlPicNotValid()) _gfx->BitsShow(rect); } @@ -432,7 +438,7 @@ void SciGui::drawControlIcon(Common::Rect rect, reg_t obj, GuiResourceId viewId, if (style & 0x20) { _gfx->FrameRect(rect); } - if (_screen->_picNotValid == 0) + if (!getControlPicNotValid()) _gfx->BitsShow(rect); } else { _gfx->InvertRect(rect); @@ -447,7 +453,7 @@ void SciGui::drawControlList(Common::Rect rect, reg_t obj, int16 maxChars, int16 if (isAlias && (style & 8)) { _gfx->FrameRect(rect); } - if (_screen->_picNotValid == 0) + if (!getControlPicNotValid()) _gfx->BitsShow(rect); } } @@ -524,10 +530,19 @@ void SciGui::graphAdjustPriority(int top, int bottom) { } int16 SciGui::picNotValid(int16 newPicNotValid) { - int16 oldPicNotValid = _screen->_picNotValid; + int16 oldPicNotValid; + + if (getSciVersion() >= SCI_VERSION_1_1) { + oldPicNotValid = _screen->_picNotValidSci11; - if (newPicNotValid != -1) - _screen->_picNotValid = newPicNotValid; + if (newPicNotValid != -1) + _screen->_picNotValidSci11 = newPicNotValid; + } else { + oldPicNotValid = _screen->_picNotValid; + + if (newPicNotValid != -1) + _screen->_picNotValid = newPicNotValid; + } return oldPicNotValid; } diff --git a/engines/sci/gui/gui.h b/engines/sci/gui/gui.h index 4d51efd95e..0ec4d8ce23 100644 --- a/engines/sci/gui/gui.h +++ b/engines/sci/gui/gui.h @@ -165,6 +165,7 @@ private: virtual void initPriorityBands(); virtual void animateShowPic(); virtual void addToPicSetPicNotValid(); + virtual int getControlPicNotValid(); SciGuiWindowMgr *_windowMgr; SciGuiAnimate *_animate; diff --git a/engines/sci/gui/gui_gfx.cpp b/engines/sci/gui/gui_gfx.cpp index a23fbda762..55d9dcedea 100644 --- a/engines/sci/gui/gui_gfx.cpp +++ b/engines/sci/gui/gui_gfx.cpp @@ -347,8 +347,13 @@ void SciGuiGfx::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo Common::Rect clipRectTranslated = clipRect; OffsetRect(clipRectTranslated); view->draw(rect, clipRect, clipRectTranslated, loopNo, celNo, priority, paletteNo, origHeight); - if (!_screen->_picNotValid) - BitsShow(rect); + if (getSciVersion() >= SCI_VERSION_1_1) { + if (!_screen->_picNotValidSci11) + BitsShow(rect); + } else { + if (!_screen->_picNotValid) + BitsShow(rect); + } } } diff --git a/engines/sci/gui/gui_screen.cpp b/engines/sci/gui/gui_screen.cpp index b993684080..702b68d6b6 100644 --- a/engines/sci/gui/gui_screen.cpp +++ b/engines/sci/gui/gui_screen.cpp @@ -54,7 +54,8 @@ SciGuiScreen::SciGuiScreen(ResourceManager *resMan, int16 width, int16 height, b // Sets display screen to be actually displayed _activeScreen = _displayScreen; - _picNotValid = false; + _picNotValid = 0; + _picNotValidSci11 = 0; _unditherState = true; if (_resMan->isVGA()) { diff --git a/engines/sci/gui/gui_screen.h b/engines/sci/gui/gui_screen.h index e82c22f16a..1429e3d7be 100644 --- a/engines/sci/gui/gui_screen.h +++ b/engines/sci/gui/gui_screen.h @@ -91,6 +91,7 @@ public: uint _displayPixels; int _picNotValid; // possible values 0, 1 and 2 + int _picNotValidSci11; // another variable that is used by kPicNotValid in sci1.1 byte _colorWhite; byte _colorDefaultVectorData; -- cgit v1.2.3