diff options
author | Einar Johan Trøan Sømåen | 2012-12-13 23:43:18 +0100 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-12-16 23:13:58 +0100 |
commit | 6d79a66766ede297ace36e060a0ab2b06aa42025 (patch) | |
tree | afbcbe61111296c3efb67edee138eee997e8cb78 /engines/wintermute/base/gfx/osystem/base_render_osystem.cpp | |
parent | c14f45ee0544254ffeca5cde4d92cd99efdff4b6 (diff) | |
download | scummvm-rg350-6d79a66766ede297ace36e060a0ab2b06aa42025.tar.gz scummvm-rg350-6d79a66766ede297ace36e060a0ab2b06aa42025.tar.bz2 scummvm-rg350-6d79a66766ede297ace36e060a0ab2b06aa42025.zip |
WINTERMUTE: Move draw-code to render_ticket.cpp
Diffstat (limited to 'engines/wintermute/base/gfx/osystem/base_render_osystem.cpp')
-rw-r--r-- | engines/wintermute/base/gfx/osystem/base_render_osystem.cpp | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp index 5097d2078f..32bb608d1c 100644 --- a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp +++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp @@ -277,7 +277,7 @@ void BaseRenderOSystem::drawSurface(BaseSurfaceOSystem *owner, const Graphics::S if (*(compareTicket) == compare && compareTicket->_isValid) { compareTicket->_colorMod = _colorMod; if (_disableDirtyRects) { - drawFromSurface(compareTicket, NULL); + drawFromSurface(compareTicket); } else { drawFromTicket(compareTicket); } @@ -292,7 +292,7 @@ void BaseRenderOSystem::drawSurface(BaseSurfaceOSystem *owner, const Graphics::S } else { ticket->_wantsDraw = true; _renderQueue.push_back(ticket); - drawFromSurface(ticket, NULL); + drawFromSurface(ticket); } } @@ -426,7 +426,7 @@ void BaseRenderOSystem::drawTickets() { dstClip.translate(-offsetX, -offsetY); _colorMod = ticket->_colorMod; - drawFromSurface(ticket, &ticket->_srcRect, &pos, &dstClip); + drawFromSurface(ticket, &pos, &dstClip); _needsFlip = true; } // Some tickets want redraw but don't actually clip the dirty area (typically the ones that shouldnt become clear-color) @@ -456,24 +456,12 @@ void BaseRenderOSystem::drawTickets() { } // Replacement for SDL2's SDL_RenderCopy -void BaseRenderOSystem::drawFromSurface(RenderTicket *ticket, Common::Rect *clipRect) { - TransparentSurface src(*ticket->getSurface(), false); - bool doDelete = false; - if (!clipRect) { - doDelete = true; - clipRect = new Common::Rect(); - clipRect->setWidth(ticket->getSurface()->w); - clipRect->setHeight(ticket->getSurface()->h); - } - - src._enableAlphaBlit = ticket->_hasAlpha; - src.blit(*_renderSurface, ticket->_dstRect.left, ticket->_dstRect.top, ticket->_mirror, clipRect, _colorMod, clipRect->width(), clipRect->height()); - if (doDelete) { - delete clipRect; - } +void BaseRenderOSystem::drawFromSurface(RenderTicket *ticket) { + ticket->drawToSurface(_renderSurface); } -void BaseRenderOSystem::drawFromSurface(RenderTicket *ticket, Common::Rect *srcRect, Common::Rect *dstRect, Common::Rect *clipRect) { - ticket->drawToSurface(_renderSurface, srcRect, dstRect, clipRect); + +void BaseRenderOSystem::drawFromSurface(RenderTicket *ticket, Common::Rect *dstRect, Common::Rect *clipRect) { + ticket->drawToSurface(_renderSurface, dstRect, clipRect); } ////////////////////////////////////////////////////////////////////////// |