[Scummvm-git-logs] scummvm master -> 2fa3484f5e957a184466842b7c2cccb7e09de2b5

AndywinXp noreply at scummvm.org
Fri Nov 11 16:15:27 UTC 2022


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:
2fa3484f5e SCUMM: FT: Fix string rendering for tall characters


Commit: 2fa3484f5e957a184466842b7c2cccb7e09de2b5
    https://github.com/scummvm/scummvm/commit/2fa3484f5e957a184466842b7c2cccb7e09de2b5
Author: AndywinXp (andywinxp at gmail.com)
Date: 2022-11-11T17:15:13+01:00

Commit Message:
SCUMM: FT: Fix string rendering for tall characters

The disasm shows that the rendering rect for a printed blastText should be 4 pixel taller in total:
2 on top, and 2 on the bottom. This fixes issues in which taller characters (like accented letters)
triggered almost invisible graphical glitches.

Changed paths:
    engines/scumm/string_v7.cpp


diff --git a/engines/scumm/string_v7.cpp b/engines/scumm/string_v7.cpp
index 7f2ab34b930..2a0c073dab8 100644
--- a/engines/scumm/string_v7.cpp
+++ b/engines/scumm/string_v7.cpp
@@ -229,8 +229,8 @@ void TextRenderer_v7::drawString(const char *str, byte *buffer, Common::Rect &cl
 
 	clipRect.left = MAX<int>(0, ((flags & kStyleAlignCenter) ? x - maxWidth / 2 : ((flags & kStyleAlignRight) ? x - maxWidth : x)) - xAdj);
 	clipRect.right = MIN<int>(clipRect.right, clipRect.left + xAdj + maxWidth);
-	clipRect.top = y2;
-	clipRect.bottom = y + (_newStyle ? 0 : 1);
+	clipRect.top = y2 - (_newStyle ? 0 : 2);
+	clipRect.bottom = y + (_newStyle ? 0 : 2);
 }
 
 void TextRenderer_v7::drawStringWrap(const char *str, byte *buffer, Common::Rect &clipRect, int x, int y, int pitch, int16 col, TextStyleFlags flags) {
@@ -384,8 +384,8 @@ void TextRenderer_v7::drawStringWrap(const char *str, byte *buffer, Common::Rect
 
 	clipRect.left = MAX<int>(0, ((flags & kStyleAlignCenter) ? x - maxWidth / 2 : ((flags & kStyleAlignRight) ? x - maxWidth : x)) - xAdj);
 	clipRect.right = MIN<int>(clipRect.right, clipRect.left + xAdj + maxWidth);
-	clipRect.top = y2;
-	clipRect.bottom = y + (_newStyle ? 0 : 1);
+	clipRect.top = y2 - (_newStyle ? 0 : 2);
+	clipRect.bottom = y + (_newStyle ? 0 : 2);
 }
 
 Common::Rect TextRenderer_v7::calcStringDimensions(const char *str, int x, int y, TextStyleFlags flags) {




More information about the Scummvm-git-logs mailing list