diff options
author | Einar Johan Trøan Sømåen | 2014-01-21 01:27:22 +0100 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2014-01-21 01:32:49 +0100 |
commit | 0b76f66edcf283f48f8f945dc18a764bf427fdf1 (patch) | |
tree | c1718e815d54f29ce9dc5d66963667646c563232 /engines | |
parent | 4f4599b542257bf3fec95102fe1c964966ce508f (diff) | |
download | scummvm-rg350-0b76f66edcf283f48f8f945dc18a764bf427fdf1.tar.gz scummvm-rg350-0b76f66edcf283f48f8f945dc18a764bf427fdf1.tar.bz2 scummvm-rg350-0b76f66edcf283f48f8f945dc18a764bf427fdf1.zip |
WINTERMUTE: Special-case FMV-handling to not fill the screen with background color.
If we have only one thing being drawn, and that is opaque, we can
skip filling the render surface with background color.
This shaves another few wasted cycles of the FMV playback. (Since we
now don’t have to write the entire render surface TWICE).
This reduces the time spent in drawTickets() to ~60% of what it was before.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/wintermute/base/gfx/osystem/base_render_osystem.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp index ff63789d18..35918b8e90 100644 --- a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp +++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp @@ -399,10 +399,23 @@ void BaseRenderOSystem::drawTickets() { return; } - // Apply the clear-color to the dirty rect. - _renderSurface->fillRect(*_dirtyRect, _clearColor); + it = _renderQueue.begin(); _lastFrameIter = _renderQueue.end(); - for (it = _renderQueue.begin(); it != _renderQueue.end(); ++it) { + // A special case: If the screen has one giant OPAQUE rect to be drawn, then we skip filling + // the background colour. Typical use-case: Fullscreen FMVs. + // Caveat: The FPS-counter will invalidate this. + if (it != _lastFrameIter && _renderQueue.front() == _renderQueue.back() && (*it)->_transform._alphaDisable == true) { + // If our single opaque rect fills the dirty rect, we can skip filling. + if (*_dirtyRect != (*it)->_dstRect) { + // Apply the clear-color to the dirty rect. + _renderSurface->fillRect(*_dirtyRect, _clearColor); + } + // Otherwise Do NOT fill. + } else { + // Apply the clear-color to the dirty rect. + _renderSurface->fillRect(*_dirtyRect, _clearColor); + } + for (; it != _renderQueue.end(); ++it) { RenderTicket *ticket = *it; if (ticket->_dstRect.intersects(*_dirtyRect)) { // dstClip is the area we want redrawn. |