[Scummvm-cvs-logs] scummvm master -> 61f387190c10274ccb649321c8244e1ca3d74b42

somaen einarjohan at somadalen.com
Thu Dec 13 22:18:33 CET 2012


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

Summary:
61f387190c WINTERMUTE: Avoid unneccessary alpha-blits when using dirty-rects.


Commit: 61f387190c10274ccb649321c8244e1ca3d74b42
    https://github.com/scummvm/scummvm/commit/61f387190c10274ccb649321c8244e1ca3d74b42
Author: Einar Johan Trøan Sømåen (einarjohants at gmail.com)
Date: 2012-12-13T13:17:36-08:00

Commit Message:
WINTERMUTE: Avoid unneccessary alpha-blits when using dirty-rects.

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



diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
index c32054a..3a69e53 100644
--- a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
+++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
@@ -477,7 +477,7 @@ void BaseRenderOSystem::drawTickets() {
 			dstClip.translate(-offsetX, -offsetY);
 
 			_colorMod = ticket->_colorMod;
-			drawFromSurface(ticket->getSurface(), &ticket->_srcRect, &pos, &dstClip, ticket->_mirror);
+			drawFromSurface(ticket, &ticket->_srcRect, &pos, &dstClip);
 			_needsFlip = true;
 		}
 		// Some tickets want redraw but don't actually clip the dirty area (typically the ones that shouldnt become clear-color)
@@ -523,17 +523,18 @@ void BaseRenderOSystem::drawFromSurface(RenderTicket *ticket, Common::Rect *clip
 		delete clipRect;
 	}
 }
-void BaseRenderOSystem::drawFromSurface(const Graphics::Surface *surf, Common::Rect *srcRect, Common::Rect *dstRect, Common::Rect *clipRect, uint32 mirror) {
-	TransparentSurface src(*surf, false);
+void BaseRenderOSystem::drawFromSurface(RenderTicket *ticket, Common::Rect *srcRect, Common::Rect *dstRect, Common::Rect *clipRect) {
+	TransparentSurface src(*ticket->getSurface(), false);
 	bool doDelete = false;
 	if (!clipRect) {
 		doDelete = true;
 		clipRect = new Common::Rect();
-		clipRect->setWidth(surf->w);
-		clipRect->setHeight(surf->h);
+		clipRect->setWidth(ticket->getSurface()->w);
+		clipRect->setHeight(ticket->getSurface()->h);
 	}
 
-	src.blit(*_renderSurface, dstRect->left, dstRect->top, mirror, clipRect, _colorMod, clipRect->width(), clipRect->height());
+	src._enableAlphaBlit = ticket->_hasAlpha;
+	src.blit(*_renderSurface, dstRect->left, dstRect->top, ticket->_mirror, clipRect, _colorMod, clipRect->width(), clipRect->height());
 	if (doDelete) {
 		delete clipRect;
 	}
diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.h b/engines/wintermute/base/gfx/osystem/base_render_osystem.h
index 1cef003..e13085d 100644
--- a/engines/wintermute/base/gfx/osystem/base_render_osystem.h
+++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.h
@@ -106,8 +106,10 @@ public:
 private:
 	void addDirtyRect(const Common::Rect &rect);
 	void drawTickets();
+	// Non-dirty-rects:
 	void drawFromSurface(RenderTicket *ticket, Common::Rect *clipRect);
-	void drawFromSurface(const Graphics::Surface *surf, Common::Rect *srcRect, Common::Rect *dstRect, Common::Rect *clipRect, uint32 mirror);
+	// Dirty-rects:
+	void drawFromSurface(RenderTicket *ticket, Common::Rect *srcRect, Common::Rect *dstRect, Common::Rect *clipRect);
 	typedef Common::List<RenderTicket *>::iterator RenderQueueIterator;
 	Common::Rect *_dirtyRect;
 	Common::List<RenderTicket *> _renderQueue;






More information about the Scummvm-git-logs mailing list