aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base/gfx
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2014-01-21 01:27:22 +0100
committerEinar Johan Trøan Sømåen2014-01-21 01:32:49 +0100
commit0b76f66edcf283f48f8f945dc18a764bf427fdf1 (patch)
treec1718e815d54f29ce9dc5d66963667646c563232 /engines/wintermute/base/gfx
parent4f4599b542257bf3fec95102fe1c964966ce508f (diff)
downloadscummvm-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/wintermute/base/gfx')
-rw-r--r--engines/wintermute/base/gfx/osystem/base_render_osystem.cpp19
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.