[Scummvm-cvs-logs] SF.net SVN: scummvm:[47024] scummvm/trunk/engines/sci/graphics
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Tue Jan 5 14:21:40 CET 2010
Revision: 47024
http://scummvm.svn.sourceforge.net/scummvm/?rev=47024&view=rev
Author: thebluegr
Date: 2010-01-05 13:21:39 +0000 (Tue, 05 Jan 2010)
Log Message:
-----------
Removed duplicate code
Modified Paths:
--------------
scummvm/trunk/engines/sci/graphics/gfx.cpp
scummvm/trunk/engines/sci/graphics/gfx.h
Modified: scummvm/trunk/engines/sci/graphics/gfx.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/gfx.cpp 2010-01-05 10:28:09 UTC (rev 47023)
+++ scummvm/trunk/engines/sci/graphics/gfx.cpp 2010-01-05 13:21:39 UTC (rev 47024)
@@ -332,21 +332,15 @@
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 @@
}
// 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;
Modified: scummvm/trunk/engines/sci/graphics/gfx.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/gfx.h 2010-01-05 10:28:09 UTC (rev 47023)
+++ scummvm/trunk/engines/sci/graphics/gfx.h 2010-01-05 13:21:39 UTC (rev 47024)
@@ -85,8 +85,8 @@
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);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list