[Scummvm-git-logs] scummvm master -> 77c104d548bde903687c274185c5921a27629cd6
sluicebox
noreply at scummvm.org
Sun Jan 5 06:14:50 UTC 2025
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:
77c104d548 AGI: PREAGI: Fix TROLL menu string truncation
Commit: 77c104d548bde903687c274185c5921a27629cd6
https://github.com/scummvm/scummvm/commit/77c104d548bde903687c274185c5921a27629cd6
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2025-01-04T22:13:46-08:00
Commit Message:
AGI: PREAGI: Fix TROLL menu string truncation
Follow-up to: 94c91b5439e1fce2e8a53a640dc793c03f8b23a9
Fixes the period character being overwritten with a newline character
on menu descriptions that are 39 characters long, as they are displayed
with 1 leading space character. The menu code was building fixed-width
strings and placing newline characters at the end of each, but preagi
fixed-width menu strings automatically wrap to the next line.
Once the missing leading-space character was fixed, it exposed that
there was no room for the new line characters.
Changed paths:
engines/agi/preagi/troll.cpp
diff --git a/engines/agi/preagi/troll.cpp b/engines/agi/preagi/troll.cpp
index 502dc47ce36..d3573f9ee82 100644
--- a/engines/agi/preagi/troll.cpp
+++ b/engines/agi/preagi/troll.cpp
@@ -447,13 +447,14 @@ int TrollEngine::drawRoom(char *menu) {
int n = 0;
menu[0] = ' '; // leading space
menu[1] = '\0';
- strncat(menu, (char *)_gameData + _locMessagesIdx[_currentRoom], 38);
+ strncat(menu, (char *)_gameData + _locMessagesIdx[_currentRoom], 39);
for (int i = 0; i < 3; i++) {
if (_roomDescs[_roomPicture - 1].options[i]) {
- strncat(menu, Common::String::format("\n %d.", i + 1).c_str(), 5);
+ strncat(menu, Common::String::format(" %d.", i + 1).c_str(), 4);
strncat(menu, (char *)_gameData + _options[_roomDescs[_roomPicture - 1].options[i] - 1], 35);
+ strncat(menu, " ", 1);
n = i + 1;
}
More information about the Scummvm-git-logs
mailing list