diff options
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r-- | engines/sci/graphics/gfx.cpp | 33 | ||||
-rw-r--r-- | engines/sci/graphics/gfx.h | 4 |
2 files changed, 9 insertions, 28 deletions
diff --git a/engines/sci/graphics/gfx.cpp b/engines/sci/graphics/gfx.cpp index be4c7d357d..030d585407 100644 --- a/engines/sci/graphics/gfx.cpp +++ b/engines/sci/graphics/gfx.cpp @@ -332,21 +332,15 @@ void Gfx::drawPicture(GuiResourceId pictureId, int16 animationNr, bool mirroredF void Gfx::drawCel(GuiResourceId viewId, LoopNo loopNo, CelNo celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, int16 origHeight) { View *view = getView(viewId); Common::Rect rect; - Common::Rect clipRect; + if (view) { rect.left = leftPos; rect.top = topPos; rect.right = rect.left + view->getWidth(loopNo, celNo); rect.bottom = rect.top + view->getHeight(loopNo, celNo); - clipRect = rect; - clipRect.clip(_curPort->rect); - if (clipRect.isEmpty()) { // nothing to draw - return; - } - Common::Rect clipRectTranslated = clipRect; - OffsetRect(clipRectTranslated); - view->draw(rect, clipRect, clipRectTranslated, loopNo, celNo, priority, paletteNo, origHeight); + drawCel(view, loopNo, celNo, rect, priority, paletteNo, origHeight); + if (getSciVersion() >= SCI_VERSION_1_1) { if (!_screen->_picNotValidSci11) BitsShow(rect); @@ -358,26 +352,13 @@ void Gfx::drawCel(GuiResourceId viewId, LoopNo loopNo, CelNo celNo, uint16 leftP } // This version of drawCel is not supposed to call BitsShow()! -void Gfx::drawCel(GuiResourceId viewId, LoopNo loopNo, CelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo) { - View *view = getView(viewId); - Common::Rect clipRect; - if (view) { - clipRect = celRect; - clipRect.clip(_curPort->rect); - if (clipRect.isEmpty()) { // nothing to draw - return; - } - - Common::Rect clipRectTranslated = clipRect; - OffsetRect(clipRectTranslated); - view->draw(celRect, clipRect, clipRectTranslated, loopNo, celNo, priority, paletteNo); - } +void Gfx::drawCel(GuiResourceId viewId, LoopNo loopNo, CelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo, int16 origHeight) { + drawCel(getView(viewId), loopNo, celNo, celRect, priority, paletteNo); } // This version of drawCel is not supposed to call BitsShow()! -void Gfx::drawCel(View *view, LoopNo loopNo, CelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo) { - Common::Rect clipRect; - clipRect = celRect; +void Gfx::drawCel(View *view, LoopNo loopNo, CelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo, int16 origHeight) { + Common::Rect clipRect = celRect; clipRect.clip(_curPort->rect); if (clipRect.isEmpty()) // nothing to draw return; diff --git a/engines/sci/graphics/gfx.h b/engines/sci/graphics/gfx.h index c6edd36ec8..4d9befd829 100644 --- a/engines/sci/graphics/gfx.h +++ b/engines/sci/graphics/gfx.h @@ -85,8 +85,8 @@ public: void drawPicture(GuiResourceId pictureId, int16 animationNr, bool mirroredFlag, bool addToFlag, GuiResourceId paletteId); void drawCel(GuiResourceId viewId, LoopNo loopNo, CelNo celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, int16 origHeight = -1); - void drawCel(GuiResourceId viewId, LoopNo loopNo, CelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo); - void drawCel(View *view, LoopNo loopNo, CelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo); + void drawCel(GuiResourceId viewId, LoopNo loopNo, CelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo, int16 origHeight = -1); + void drawCel(View *view, LoopNo loopNo, CelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo, int16 origHeight = -1); uint16 onControl(uint16 screenMask, Common::Rect rect); |