[Scummvm-git-logs] scummvm branch-2-7 -> 77aafe19daca32c289d7fdf457a2e5f2f276a029
criezy
noreply at scummvm.org
Mon Jul 3 22:23:22 UTC 2023
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:
ffea2bea3b AGS: Apply alternative blending to hires fonts in alfont
77aafe19da NEWS: Mention AGS text improvement
Commit: ffea2bea3bb5bea838356d4bb2a30b06c9ed9962
https://github.com/scummvm/scummvm/commit/ffea2bea3bb5bea838356d4bb2a30b06c9ed9962
Author: Walter Agazzi (walter.agazzi at protonmail.com)
Date: 2023-07-03T23:08:01+01:00
Commit Message:
AGS: Apply alternative blending to hires fonts in alfont
When displaying hires fonts, alfont applies an alternative blending mode
which was not implemented, causing hi-res text to display improperly in
multiple games (Mage's Initiation, Starship Quasar and Larry Lotter the
most relevant cases)
Changed paths:
engines/ags/lib/alfont/alfont.cpp
diff --git a/engines/ags/lib/alfont/alfont.cpp b/engines/ags/lib/alfont/alfont.cpp
index b585969c888..8ed56273a77 100644
--- a/engines/ags/lib/alfont/alfont.cpp
+++ b/engines/ags/lib/alfont/alfont.cpp
@@ -178,10 +178,30 @@ unsigned long __preservedalpha_blender_trans24(unsigned long x, unsigned long y,
/* replaces set_trans_blender() */
void set_preservedalpha_trans_blender(int r, int g, int b, int a) {
+ // TODO: The current putpixel() implementation does not support blending in DRAW_MODE_TRANS mode (which is not implemented),
+ // so we can't just call set_blender_mode() here.
+ // The actual blending is done by the apply_trans_blender() function, just before the putpixel() calls
+
//set_blender_mode(__skiptranspixels_blender_trans15, __skiptranspixels_blender_trans16, __preservedalpha_blender_trans24, r, g, b, a);
- set_blender_mode(kAlphaPreservedBlenderMode, r, g, b, a);
+ //set_blender_mode(kAlphaPreservedBlenderMode, r, g, b, a);
}
+/* blends a pixel using the alternative blenders, this is a replacement
+ * for the previous function using set_blender_mode
+ */
+int apply_trans_blender(BITMAP *bmp, int color1, int color2, int alpha) {
+ switch (bitmap_color_depth(bmp)) {
+ case 15:
+ return __skiptranspixels_blender_trans15(color1, color2, alpha);
+ case 16:
+ return __skiptranspixels_blender_trans16(color1, color2, alpha);
+ case 24:
+ case 32:
+ return __preservedalpha_blender_trans24(color1, color2, alpha);
+ default:
+ return color1;
+ }
+}
/* helpers */
@@ -1529,13 +1549,15 @@ void alfont_textout_aa_ex(BITMAP *bmp, ALFONT_FONT *f, const char *s, int x, int
for (bmp_y = real_y; bmp_y < max_bmp_y; bmp_y++) {
for (bmp_x = real_x; bmp_x < max_bmp_x; bmp_x++) {
const int alpha = *bmp_p++;
-
+ const int orig_color = color;
if (alpha) {
if (alpha >= 255)
solid_mode();
else {
drawing_mode(DRAW_MODE_TRANS, NULL, 0, 0);
set_preservedalpha_trans_blender(0, 0, 0, alpha);
+ // apply blending
+ color = apply_trans_blender(bmp, color, getpixel(bmp, bmp_x, bmp_y), alpha);
}
if (first_x > bmp_x) first_x = bmp_x;
if (final_x < bmp_x) final_x = bmp_x;
@@ -1574,6 +1596,8 @@ void alfont_textout_aa_ex(BITMAP *bmp, ALFONT_FONT *f, const char *s, int x, int
putpixel(bmp, bmp_x, bmp_y, color);
}
}
+ if (color != orig_color) // restore original color
+ color = orig_color;
}
}
} else { //restore original pic
Commit: 77aafe19daca32c289d7fdf457a2e5f2f276a029
https://github.com/scummvm/scummvm/commit/77aafe19daca32c289d7fdf457a2e5f2f276a029
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2023-07-03T23:22:51+01:00
Commit Message:
NEWS: Mention AGS text improvement
Changed paths:
NEWS.md
diff --git a/NEWS.md b/NEWS.md
index a6e4918f3a3..232bcb843a3 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -22,7 +22,8 @@ For a more comprehensive changelog of the latest experimental code, see:
- Fixed wrong walkspeed in old games (e.g. Apprentice).
- Added small workaround for purple texts appearing transparent.
- Minor changes to debug/error messages and code style.
-
+ - Improved display of text.
+
CRYOMNI3D:
- Fixed files access preventing to finish Versailles.
More information about the Scummvm-git-logs
mailing list