diff options
author | Einar Johan Trøan Sømåen | 2012-12-13 22:17:36 +0100 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-12-13 22:17:36 +0100 |
commit | 61f387190c10274ccb649321c8244e1ca3d74b42 (patch) | |
tree | 7a3db89d9f2402a72b92cdceae0a04bacb1a27d7 /engines/wintermute/base/gfx/osystem/base_render_osystem.cpp | |
parent | 18a10a77442a717fc63422287f1f6bd0b561b03c (diff) | |
download | scummvm-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/gfx/osystem/base_render_osystem.cpp')
-rw-r--r-- | engines/wintermute/base/gfx/osystem/base_render_osystem.cpp | 13 |
1 files changed, 7 insertions, 6 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; } |