aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2010-01-05 13:21:39 +0000
committerFilippos Karapetis2010-01-05 13:21:39 +0000
commit928322314d82c9c7f549d6d9881025e30f5b9a8f (patch)
treecf813dd9c79a1c28d04ce1ddf4a498b77454baab /engines
parent3b8512b10429157ebf6f065247ec67e82d04c96d (diff)
downloadscummvm-rg350-928322314d82c9c7f549d6d9881025e30f5b9a8f.tar.gz
scummvm-rg350-928322314d82c9c7f549d6d9881025e30f5b9a8f.tar.bz2
scummvm-rg350-928322314d82c9c7f549d6d9881025e30f5b9a8f.zip
Removed duplicate code
svn-id: r47024
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/graphics/gfx.cpp33
-rw-r--r--engines/sci/graphics/gfx.h4
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);