diff options
author | Einar Johan Trøan Sømåen | 2012-12-16 23:13:09 +0100 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-12-16 23:13:58 +0100 |
commit | 127afbac8cffea5b0f0e5100de2d3bc28a8736ba (patch) | |
tree | 351b07980da3da6821ec93b7f644cd99e60ff08e /engines/wintermute/base/gfx/osystem/base_render_osystem.cpp | |
parent | 6d79a66766ede297ace36e060a0ab2b06aa42025 (diff) | |
download | scummvm-rg350-127afbac8cffea5b0f0e5100de2d3bc28a8736ba.tar.gz scummvm-rg350-127afbac8cffea5b0f0e5100de2d3bc28a8736ba.tar.bz2 scummvm-rg350-127afbac8cffea5b0f0e5100de2d3bc28a8736ba.zip |
WINTERMUTE: Don't check the entire ticket-queue for every ticket.
Diffstat (limited to 'engines/wintermute/base/gfx/osystem/base_render_osystem.cpp')
-rw-r--r-- | engines/wintermute/base/gfx/osystem/base_render_osystem.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp index 32bb608d1c..097ea7fa42 100644 --- a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp +++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp @@ -260,6 +260,11 @@ void BaseRenderOSystem::drawSurface(BaseSurfaceOSystem *owner, const Graphics::S if ((dstRect->left < 0 && dstRect->right < 0) || (dstRect->top < 0 && dstRect->bottom < 0)) { return; } + // Start searching from the beginning for the first and second items (since it's empty the first time around + // then keep incrementing the start-position, to avoid comparing against already used tickets. + if (_drawNum == 0 || _drawNum == 1) { + _lastAddedTicket = _renderQueue.begin(); + } if (owner) { // Fade-tickets are owner-less RenderTicket compare(owner, NULL, srcRect, dstRect, mirrorX, mirrorY, disableAlpha); @@ -272,7 +277,7 @@ void BaseRenderOSystem::drawSurface(BaseSurfaceOSystem *owner, const Graphics::S // LOTS of tickets. RenderQueueIterator endIterator = _renderQueue.end(); RenderTicket *compareTicket = NULL; - for (it = _renderQueue.begin(); it != endIterator; ++it) { + for (it = _lastAddedTicket; it != endIterator; ++it) { compareTicket = *it; if (*(compareTicket) == compare && compareTicket->_isValid) { compareTicket->_colorMod = _colorMod; @@ -280,6 +285,7 @@ void BaseRenderOSystem::drawSurface(BaseSurfaceOSystem *owner, const Graphics::S drawFromSurface(compareTicket); } else { drawFromTicket(compareTicket); + _lastAddedTicket++; } return; } @@ -289,10 +295,11 @@ void BaseRenderOSystem::drawSurface(BaseSurfaceOSystem *owner, const Graphics::S ticket->_colorMod = _colorMod; if (!_disableDirtyRects) { drawFromTicket(ticket); + drawFromSurface(ticket); + _lastAddedTicket++; } else { ticket->_wantsDraw = true; _renderQueue.push_back(ticket); - drawFromSurface(ticket); } } |