[Scummvm-git-logs] scummvm branch-2-5 -> 748ba7353a4a15807ecc7e3f93ab64392ac6d3e8

dreammaster noreply at scummvm.org
Sun Dec 19 03:34:48 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:
748ba7353a SHERLOCK: Calculate font height/width more accurately


Commit: 748ba7353a4a15807ecc7e3f93ab64392ac6d3e8
    https://github.com/scummvm/scummvm/commit/748ba7353a4a15807ecc7e3f93ab64392ac6d3e8
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2021-12-18T19:34:33-08:00

Commit Message:
SHERLOCK: Calculate font height/width more accurately

Each character in a font can have an X and Y offset. This was not
considered when calculating the width and height of the font. One way
this could be noticed was in Serrated Scalpel, when talking to a
character with a lot of conversation options. Scrolling down would
highlight the "Up" button. Selecting a conversation option would then
dim the button, but the bottommost pixel of the "p" was still
highlighted.

Hopefully this does not negatively affect anything else.

Changed paths:
    engines/sherlock/fonts.cpp


diff --git a/engines/sherlock/fonts.cpp b/engines/sherlock/fonts.cpp
index 8efe66067b..b42f9f4533 100644
--- a/engines/sherlock/fonts.cpp
+++ b/engines/sherlock/fonts.cpp
@@ -131,8 +131,8 @@ void Fonts::setFont(int fontNum) {
 	// Iterate through the frames to find the widest and tallest font characters
 	_fontHeight = _widestChar = 0;
 	for (uint idx = 0; idx < MIN<uint>(_charCount, 128 - 32); ++idx) {
-		_fontHeight = MAX((int16)_fontHeight, (*_font)[idx]._frame.h);
-		_widestChar = MAX((int16)_widestChar, (*_font)[idx]._frame.w);
+		_fontHeight = MAX(_fontHeight, (*_font)[idx]._frame.h + (*_font)[idx]._offset.y);
+		_widestChar = MAX(_widestChar, (*_font)[idx]._frame.w + (*_font)[idx]._offset.x);
 	}
 
 	// Initialize the Y offset table for the extended character set




More information about the Scummvm-git-logs mailing list