From 77959acd51982d9fedec94ac07241b1702681c6a Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 13 Dec 2011 16:17:06 +0100 Subject: KYRA: Cast char to uint8 before passing it to getCharWidth. This assures getCharWidth really gets the character number and now sign extended version of it in case char is signed. --- engines/kyra/sequences_hof.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/kyra') diff --git a/engines/kyra/sequences_hof.cpp b/engines/kyra/sequences_hof.cpp index 50b5db78fc..b27f0df137 100644 --- a/engines/kyra/sequences_hof.cpp +++ b/engines/kyra/sequences_hof.cpp @@ -2622,7 +2622,7 @@ void KyraEngine_HoF::seq_displayScrollText(uint8 *data, const ScreenDim *d, int while (*str2) { cChar[0] = *str2; _screen->printText(cChar, x, y, col1++, 0); - x += _screen->getCharWidth(*str2++); + x += _screen->getCharWidth((uint8)*str2++); } palCycle = true; } else if (!strcmp(str, specialData[1])) { @@ -2631,7 +2631,7 @@ void KyraEngine_HoF::seq_displayScrollText(uint8 *data, const ScreenDim *d, int while (*str2) { cChar[0] = *str2; _screen->printText(cChar, x, y, col1--, 0); - x += _screen->getCharWidth(*str2++); + x += _screen->getCharWidth((uint8)*str2++); } palCycle = true; } else { -- cgit v1.2.3