From e55124d097d1f175c733b5dba2ad8b93ea5caa30 Mon Sep 17 00:00:00 2001 From: rarified Date: Thu, 9 Sep 2021 19:28:06 -0600 Subject: [PATCH] More optimization repair; referenced string[0] instead of string[i] --- Sources/Plasma/PubUtilLib/plGImage/plFont.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plGImage/plFont.cpp b/Sources/Plasma/PubUtilLib/plGImage/plFont.cpp index f69a6045..b89020a5 100644 --- a/Sources/Plasma/PubUtilLib/plGImage/plFont.cpp +++ b/Sources/Plasma/PubUtilLib/plGImage/plFont.cpp @@ -468,7 +468,7 @@ void plFont::IRenderString( plMipmap *mip, UInt16 x, UInt16 y, const wchar_t *st // handle invalid chars discretely plCharacter* charToDraw = &(fCharacters[(UInt16)L' ' - fFirstChar]); if (fCharacters.Count() <= ((UInt16)string[i] - fFirstChar)) { - UInt16 w = wctob(string[0]); + UInt16 w = wctob(string[i]); if (w != EOF && (w - fFirstChar) <= fCharacters.Count()) charToDraw = &(fCharacters[w - fFirstChar]); } else { @@ -602,7 +602,7 @@ void plFont::IRenderString( plMipmap *mip, UInt16 x, UInt16 y, const wchar_t *st else if( ( fRenderInfo.fFlags & kRenderJustXMask ) == kRenderJustXForceLeft ) { Int16 baseX = fRenderInfo.fX; - + plCharacter& ch = fCharacters[(UInt16)L' ' - fFirstChar]; if (fCharacters.Count() <= ((UInt16)string[0] - fFirstChar)) { UInt16 w = wctob(string[0]);