aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-12-13 22:17:36 +0100
committerEinar Johan Trøan Sømåen2012-12-13 22:17:36 +0100
commit61f387190c10274ccb649321c8244e1ca3d74b42 (patch)
tree7a3db89d9f2402a72b92cdceae0a04bacb1a27d7 /engines/wintermute/base
parent18a10a77442a717fc63422287f1f6bd0b561b03c (diff)
downloadscummvm-rg350-61f387190c10274ccb649321c8244e1ca3d74b42.tar.gz
scummvm-rg350-61f387190c10274ccb649321c8244e1ca3d74b42.tar.bz2
scummvm-rg350-61f387190c10274ccb649321c8244e1ca3d74b42.zip
WINTERMUTE: Avoid unneccessary alpha-blits when using dirty-rects.
Diffstat (limited to 'engines/wintermute/base')
-rw-r--r--engines/wintermute/base/gfx/osystem/base_render_osystem.cpp13
-rw-r--r--engines/wintermute/base/gfx/osystem/base_render_osystem.h4
2 files changed, 10 insertions, 7 deletions
diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
index c32054ac32..3a69e53d16 100644
--- a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
+++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
@@ -477,7 +477,7 @@ void BaseRenderOSystem::drawTickets() {
dstClip.translate(-offsetX, -offsetY);
_colorMod = ticket->_colorMod;
- drawFromSurface(ticket->getSurface(), &ticket->_srcRect, &pos, &dstClip, ticket->_mirror);
+ drawFromSurface(ticket, &ticket->_srcRect, &pos, &dstClip);
_needsFlip = true;
}
// Some tickets want redraw but don't actually clip the dirty area (typically the ones that shouldnt become clear-color)
@@ -523,17 +523,18 @@ void BaseRenderOSystem::drawFromSurface(RenderTicket *ticket, Common::Rect *clip
delete clipRect;
}
}
-void BaseRenderOSystem::drawFromSurface(const Graphics::Surface *surf, Common::Rect *srcRect, Common::Rect *dstRect, Common::Rect *clipRect, uint32 mirror) {
- TransparentSurface src(*surf, false);
+void BaseRenderOSystem::drawFromSurface(RenderTicket *ticket, Common::Rect *srcRect, Common::Rect *dstRect, Common::Rect *clipRect) {
+ TransparentSurface src(*ticket->getSurface(), false);
bool doDelete = false;
if (!clipRect) {
doDelete = true;
clipRect = new Common::Rect();
- clipRect->setWidth(surf->w);
- clipRect->setHeight(surf->h);
+ clipRect->setWidth(ticket->getSurface()->w);
+ clipRect->setHeight(ticket->getSurface()->h);
}
- src.blit(*_renderSurface, dstRect->left, dstRect->top, mirror, clipRect, _colorMod, clipRect->width(), clipRect->height());
+ src._enableAlphaBlit = ticket->_hasAlpha;
+ src.blit(*_renderSurface, dstRect->left, dstRect->top, ticket->_mirror, clipRect, _colorMod, clipRect->width(), clipRect->height());
if (doDelete) {
delete clipRect;
}
diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.h b/engines/wintermute/base/gfx/osystem/base_render_osystem.h
index 1cef0038a1..e13085d68a 100644
--- a/engines/wintermute/base/gfx/osystem/base_render_osystem.h
+++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.h
@@ -106,8 +106,10 @@ public:
private:
void addDirtyRect(const Common::Rect &rect);
void drawTickets();
+ // Non-dirty-rects:
void drawFromSurface(RenderTicket *ticket, Common::Rect *clipRect);
- void drawFromSurface(const Graphics::Surface *surf, Common::Rect *srcRect, Common::Rect *dstRect, Common::Rect *clipRect, uint32 mirror);
+ // Dirty-rects:
+ void drawFromSurface(RenderTicket *ticket, Common::Rect *srcRect, Common::Rect *dstRect, Common::Rect *clipRect);
typedef Common::List<RenderTicket *>::iterator RenderQueueIterator;
Common::Rect *_dirtyRect;
Common::List<RenderTicket *> _renderQueue;