[Scummvm-cvs-logs] CVS: scummvm/gui ThemeNew.cpp,1.1,1.2

Johannes Schickel lordhoto at users.sourceforge.net
Fri Jan 27 08:01:00 CET 2006


Update of /cvsroot/scummvm/scummvm/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18940

Modified Files:
	ThemeNew.cpp 
Log Message:
Oops forgot to change calcColor to calcGradient before commiting.


Index: ThemeNew.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/ThemeNew.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ThemeNew.cpp	27 Jan 2006 15:43:23 -0000	1.1
+++ ThemeNew.cpp	27 Jan 2006 15:59:29 -0000	1.2
@@ -566,12 +566,12 @@
 	return true;
 }
 
-inline uint8 calcColor(uint8 start, uint8 end, int pos, int max) {
+inline uint8 calcGradient(uint8 start, uint8 end, int pos, int max) {
 	int diff = ((int)end - (int)start) * pos / max;
 	return start + diff;
 }
 
-OverlayColor calcColor(OverlayColor start, OverlayColor end, int pos, int max, uint factor = 1) {
+OverlayColor calcGradient(OverlayColor start, OverlayColor end, int pos, int max, uint factor = 1) {
 	pos *= factor;
 	if (pos > max) {
 		pos = max;
@@ -596,9 +596,9 @@
 		eg = (end >> 5) & 0x1F;
 		eb = (end >> 0) & 0x1F;
 	}
-	uint8 cr = calcColor(sr, er, pos, max);
-	uint8 cg = calcColor(sg, eg, pos, max);
-	uint8 cb = calcColor(sb, eb, pos, max);
+	uint8 cr = calcGradient(sr, er, pos, max);
+	uint8 cg = calcGradient(sg, eg, pos, max);
+	uint8 cb = calcGradient(sb, eb, pos, max);
 	if (gBitFormat == 565) {
 		result = ((int)(cr & 0x1F) << 11) | ((int)(cg & 0x3F) << 5) | (int)(cb & 0x1F);
 	} else {
@@ -611,7 +611,7 @@
 	OverlayColor *ptr = (OverlayColor*)_screen.getBasePtr(r.left, r.top);
 	int h = r.height();
 	while (h--) {
-		OverlayColor col = calcColor(start, end, r.height()-h, r.height());
+		OverlayColor col = calcGradient(start, end, r.height()-h, r.height());
 		for (int i = 0; i < r.width(); ++i) {
 			ptr[i] = col;
 		}
@@ -666,8 +666,8 @@
 			usedHeight = specialHeight;
 		}
 
-		OverlayColor startCol = calcColor(start, end, yPos-r.top, r.height(), factor);
-		OverlayColor endCol = calcColor(start, end, yPos-r.top+usedHeight, r.height(), factor);
+		OverlayColor startCol = calcGradient(start, end, yPos-r.top, r.height(), factor);
+		OverlayColor endCol = calcGradient(start, end, yPos-r.top+usedHeight, r.height(), factor);
 
 		for (int i = 0; i < partsW; ++i) {
 
@@ -731,7 +731,7 @@
 		src = (const OverlayColor*)surf->pixels + (surf->h - 1) * surf->w;
 		int drawWidth = (r.width() < surf->w) ? r.width() : surf->w;
 		for (int i = 0; i < r.height(); ++i) {
-			OverlayColor rowColor = calcColor(start, end, i, r.height(), factor);
+			OverlayColor rowColor = calcGradient(start, end, i, r.height(), factor);
 			for (int x = 0; x < drawWidth; ++x) {
 				if (src[x] != transparency && dst >= _screen.pixels) {
 					dst[x] = getColorAlpha(src[x], dst[x], alpha) & rowColor;
@@ -744,7 +744,7 @@
 		src = (const OverlayColor*)surf->pixels + (surf->h - 1) * surf->w;
 		int drawWidth = (r.width() < surf->w) ? r.width() : surf->w;
 		for (int i = 0; i < r.height(); ++i) {
-			OverlayColor rowColor = calcColor(start, end, i, r.height(), factor);
+			OverlayColor rowColor = calcGradient(start, end, i, r.height(), factor);
 			for (int x = 0; x < drawWidth; ++x) {
 				if (src[drawWidth-x-1] != transparency && dst >= _screen.pixels) {
 					dst[x] = getColorAlpha(src[drawWidth-x-1], dst[x], alpha) & rowColor;
@@ -757,7 +757,7 @@
 		src = (const OverlayColor*)surf->pixels;
 		int drawWidth = (r.width() < surf->w) ? r.width() : surf->w;
 		for (int i = 0; i < r.height(); ++i) {
-			OverlayColor rowColor = calcColor(start, end, i, r.height(), factor);
+			OverlayColor rowColor = calcGradient(start, end, i, r.height(), factor);
 			for (int x = 0; x < drawWidth; ++x) {
 				if (src[drawWidth-x-1] != transparency && dst >= _screen.pixels) {
 					dst[x] = getColorAlpha(src[drawWidth-x-1], dst[x], alpha) & rowColor;
@@ -770,7 +770,7 @@
 		src = (const OverlayColor*)surf->pixels;
 		int drawWidth = (r.width() < surf->w) ? r.width() : surf->w;
 		for (int i = 0; i < r.height(); ++i) {
-			OverlayColor rowColor = calcColor(start, end, i, r.height(), factor);
+			OverlayColor rowColor = calcGradient(start, end, i, r.height(), factor);
 			for (int x = 0; x < drawWidth; ++x) {
 				if (src[x] != transparency && dst >= _screen.pixels) {
 					dst[x] = getColorAlpha(src[x], dst[x], alpha) & rowColor;





More information about the Scummvm-git-logs mailing list