[Scummvm-git-logs] scummvm master -> 0672ca0f2b3f7924f247c0d8f1bf88cd5736760a

dreammaster dreammaster at scummvm.org
Sat Jul 3 18:49:35 UTC 2021


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:
0672ca0f2b AGS: Fix rendering purple text that matches the transparent color


Commit: 0672ca0f2b3f7924f247c0d8f1bf88cd5736760a
    https://github.com/scummvm/scummvm/commit/0672ca0f2b3f7924f247c0d8f1bf88cd5736760a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-07-03T11:49:23-07:00

Commit Message:
AGS: Fix rendering purple text that matches the transparent color

Changed paths:
    engines/ags/engine/ac/display.cpp
    engines/ags/lib/alfont/alfont.cpp
    engines/ags/shared/gfx/allegro_bitmap.cpp


diff --git a/engines/ags/engine/ac/display.cpp b/engines/ags/engine/ac/display.cpp
index 362e14f2e5..b58e08f58d 100644
--- a/engines/ags/engine/ac/display.cpp
+++ b/engines/ags/engine/ac/display.cpp
@@ -438,7 +438,6 @@ bool ShouldAntiAliasText() {
 }
 
 void wouttext_outline(Shared::Bitmap *ds, int xxp, int yyp, int usingfont, color_t text_color, const char *texx) {
-
 	color_t outline_color = ds->GetCompatibleColor(_GP(play).speech_text_shadow);
 	if (get_font_outline(usingfont) >= 0) {
 		// MACPORT FIX 9/6/5: cast
diff --git a/engines/ags/lib/alfont/alfont.cpp b/engines/ags/lib/alfont/alfont.cpp
index 1cc6b47fde..2efe207a04 100644
--- a/engines/ags/lib/alfont/alfont.cpp
+++ b/engines/ags/lib/alfont/alfont.cpp
@@ -71,7 +71,8 @@ void alfont_textout(BITMAP *bmp, ALFONT_FONT *font, const char *text, int x, int
 	// The original alfont changes the y based on the font height and ascent.
 	y += (font->_size - font->getFont()->getFontAscent());
 	Graphics::ManagedSurface &surf = **bmp;
-	font->getFont()->drawString(&surf, text, x, y, bmp->w - x, color);
+	font->getFont()->drawString(&surf, text, x, y, bmp->w - x,
+		(color == surf.getTransparentColor()) ? color - 1 : color);
 }
 
 void alfont_set_font_size(ALFONT_FONT *font, int size) {
diff --git a/engines/ags/shared/gfx/allegro_bitmap.cpp b/engines/ags/shared/gfx/allegro_bitmap.cpp
index b7ea8dfd08..3c2e96ced9 100644
--- a/engines/ags/shared/gfx/allegro_bitmap.cpp
+++ b/engines/ags/shared/gfx/allegro_bitmap.cpp
@@ -151,9 +151,8 @@ void Bitmap::SetMaskColor(color_t color) {
 }
 
 color_t Bitmap::GetCompatibleColor(color_t color) {
-	color_t compat_color = 0;
-	__my_setcolor(&compat_color, color, bitmap_color_depth(_alBitmap));
-	return compat_color;
+	byte r = getr16(color), g = getg16(color), b = getb16(color);
+	return (color_t)_alBitmap->format.RGBToColor(r, g, b);
 }
 
 //=============================================================================




More information about the Scummvm-git-logs mailing list