[Scummvm-git-logs] scummvm master -> 705c4b2c8dbc54108ee12d56a384ea9b31df3996

sev- sev at scummvm.org
Fri Nov 15 18:05:00 CET 2019


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:
705c4b2c8d PINK: Fix text color selection and added some debug output


Commit: 705c4b2c8dbc54108ee12d56a384ea9b31df3996
    https://github.com/scummvm/scummvm/commit/705c4b2c8dbc54108ee12d56a384ea9b31df3996
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2019-11-15T18:04:30+01:00

Commit Message:
PINK: Fix text color selection and added some debug output

Changed paths:
    engines/pink/objects/actions/action_text.cpp


diff --git a/engines/pink/objects/actions/action_text.cpp b/engines/pink/objects/actions/action_text.cpp
index 448756b..c12a892 100644
--- a/engines/pink/objects/actions/action_text.cpp
+++ b/engines/pink/objects/actions/action_text.cpp
@@ -156,9 +156,9 @@ void ActionText::draw(Graphics::ManagedSurface *surface) {
 	text.drawToPoint(surface, Common::Rect(0, 0, _xRight - _xLeft, _yBottom - _yTop), Common::Point(_xLeft, _yTop));
 }
 
-#define RED(rgb) ((rgb) & 0xFF)
+#define BLUE(rgb) ((rgb) & 0xFF)
 #define GREEN(rgb) (((rgb) >> 8) & 0xFF)
-#define BLUE(rgb) (((rgb) >> 16) & 0xFF)
+#define RED(rgb) (((rgb) >> 16) & 0xFF)
 
 static uint findBestColor(byte *palette, uint32 rgb) {
 	uint bestColor = 0;
@@ -175,6 +175,9 @@ static uint findBestColor(byte *palette, uint32 rgb) {
 			min = dist;
 		}
 	}
+
+	debug(2, "for color %06x the best color is %02x%02x%02x", rgb, palette[bestColor * 3], palette[bestColor * 3 + 1], palette[bestColor * 3 + 2]);
+
 	return bestColor;
 }
 
@@ -182,7 +185,9 @@ void ActionText::findColorsInPalette() {
 	byte palette[256 * 3];
 	g_system->getPaletteManager()->grabPalette(palette, 0, 256);
 
+	debug(2, "textcolorindex: %06x", _textRGB);
 	_textColorIndex = findBestColor(palette, _textRGB);
+	debug(2, "backgroundColorIndex: %06x", _backgroundRGB);
 	_backgroundColorIndex = findBestColor(palette, _backgroundRGB);
 }
 





More information about the Scummvm-git-logs mailing list