[Scummvm-cvs-logs] scummvm master -> 0b76f66edcf283f48f8f945dc18a764bf427fdf1

somaen einarjohants at gmail.com
Tue Jan 21 01:33:33 CET 2014


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
4f4599b542 WINTERMUTE: Fix bug that prevented the opaque and binary blit speedups from working.
0b76f66edc WINTERMUTE: Special-case FMV-handling to not fill the screen with background color.


Commit: 4f4599b542257bf3fec95102fe1c964966ce508f
    https://github.com/scummvm/scummvm/commit/4f4599b542257bf3fec95102fe1c964966ce508f
Author: Einar Johan Trøan Sømåen (einarjohants at gmail.com)
Date: 2014-01-20T16:32:40-08:00

Commit Message:
WINTERMUTE: Fix bug that prevented the opaque and binary blit speedups from working.

Changed paths:
    engines/wintermute/graphics/transparent_surface.cpp



diff --git a/engines/wintermute/graphics/transparent_surface.cpp b/engines/wintermute/graphics/transparent_surface.cpp
index 053acf2..7972243 100644
--- a/engines/wintermute/graphics/transparent_surface.cpp
+++ b/engines/wintermute/graphics/transparent_surface.cpp
@@ -519,9 +519,9 @@ Common::Rect TransparentSurface::blit(Graphics::Surface &target, int posX, int p
 		byte *ino= (byte *)img->getBasePtr(xp, yp);
 		byte *outo = (byte *)target.getBasePtr(posX, posY);
 
-		if (color == 0xFFFFFF && blendMode == BLEND_NORMAL && _alphaMode == ALPHA_OPAQUE) {
+		if (color == 0xFFFFFFFF && blendMode == BLEND_NORMAL && _alphaMode == ALPHA_OPAQUE) {
 			doBlitOpaqueFast(ino, outo, img->w, img->h, target.pitch, inStep, inoStep);
-		} else if (color == 0xFFFFFF && blendMode == BLEND_NORMAL && _alphaMode == ALPHA_BINARY) {
+		} else if (color == 0xFFFFFFFF && blendMode == BLEND_NORMAL && _alphaMode == ALPHA_BINARY) {
 			doBlitBinaryFast(ino, outo, img->w, img->h, target.pitch, inStep, inoStep);
 		} else {
 			if (blendMode == BLEND_ADDITIVE) {


Commit: 0b76f66edcf283f48f8f945dc18a764bf427fdf1
    https://github.com/scummvm/scummvm/commit/0b76f66edcf283f48f8f945dc18a764bf427fdf1
Author: Einar Johan Trøan Sømåen (einarjohants at gmail.com)
Date: 2014-01-20T16:32:49-08:00

Commit Message:
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.

Changed paths:
    engines/wintermute/base/gfx/osystem/base_render_osystem.cpp



diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
index ff63789..35918b8 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.






More information about the Scummvm-git-logs mailing list