[Scummvm-git-logs] scummvm master -> 00a13baf84d25697f0086658726bbb63cfc27d5e

sev- sev at scummvm.org
Sun Sep 4 16:16:13 CEST 2016


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:
149267613a FULLPIPE: Implement FullpipeEngine::drawAlphaRectangle()
00a13baf84 FULLPIPE: Optimize sceneFade()


Commit: 149267613a0f9e4b04f63ee71865e5948871cf4f
    https://github.com/scummvm/scummvm/commit/149267613a0f9e4b04f63ee71865e5948871cf4f
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-09-04T15:13:27+02:00

Commit Message:
FULLPIPE: Implement FullpipeEngine::drawAlphaRectangle()

Changed paths:
    engines/fullpipe/gfx.cpp



diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp
index 76d29f7..32d2304 100644
--- a/engines/fullpipe/gfx.cpp
+++ b/engines/fullpipe/gfx.cpp
@@ -1265,7 +1265,16 @@ DynamicPhase *Shadows::findSize(int width, int height) {
 }
 
 void FullpipeEngine::drawAlphaRectangle(int x1, int y1, int x2, int y2, int alpha) {
-	warning("STUB: FullpipeEngine::drawAlphaRectangle()");
+	for (int y = y1; y < y2; y++) {
+		uint32 *ptr = (uint32 *)g_fp->_backgroundSurface.getBasePtr(0, y);
+
+		for (int x = x1; x < x2; x++) {
+			uint32 color = *ptr;
+			color = (color & 0xffffff00) | (alpha & 0xff);
+			*ptr = color;
+			ptr++;
+		}
+	}
 }
 
 void FullpipeEngine::sceneFade(Scene *sc, bool direction) {


Commit: 00a13baf84d25697f0086658726bbb63cfc27d5e
    https://github.com/scummvm/scummvm/commit/00a13baf84d25697f0086658726bbb63cfc27d5e
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-09-04T16:15:47+02:00

Commit Message:
FULLPIPE: Optimize sceneFade()

Changed paths:
    engines/fullpipe/gfx.cpp



diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp
index 32d2304..6d0edf7 100644
--- a/engines/fullpipe/gfx.cpp
+++ b/engines/fullpipe/gfx.cpp
@@ -1270,7 +1270,10 @@ void FullpipeEngine::drawAlphaRectangle(int x1, int y1, int x2, int y2, int alph
 
 		for (int x = x1; x < x2; x++) {
 			uint32 color = *ptr;
-			color = (color & 0xffffff00) | (alpha & 0xff);
+			color = (((color >> 24) & 0xff) * alpha / 0xff) << 24 |
+					(((color >> 16) & 0xff) * alpha / 0xff) << 16 |
+					(((color >>  8) & 0xff) * alpha / 0xff) <<  8 |
+					(color & 0xff);
 			*ptr = color;
 			ptr++;
 		}
@@ -1282,20 +1285,7 @@ void FullpipeEngine::sceneFade(Scene *sc, bool direction) {
 		int ticks = g_fp->_system->getMillis();
 		sc->draw();
 
-		for (int y = 0; y < g_fp->_backgroundSurface.h; y++) {
-			uint32 *ptr = (uint32 *)g_fp->_backgroundSurface.getBasePtr(0, y);
-
-			for (int x = 0; x < g_fp->_backgroundSurface.w; x++) {
-				uint32 color = *ptr;
-				color = (((color >> 24) & 0xff) * dim / 0xff) << 24 |
-						(((color >> 16) & 0xff) * dim / 0xff) << 16 |
-						(((color >>  8) & 0xff) * dim / 0xff) <<  8 |
-						(color & 0xff);
-				*ptr = color;
-				ptr++;
-			}
-		}
-
+		drawAlphaRectangle(0, 0, g_fp->_backgroundSurface.w, g_fp->_backgroundSurface.h, direction ? dim : 255 - dim);
 		g_fp->_system->copyRectToScreen(g_fp->_backgroundSurface.getBasePtr(0, 0), g_fp->_backgroundSurface.pitch, 0, 0, 800, 600);
 
 		g_fp->_system->updateScreen();





More information about the Scummvm-git-logs mailing list