Skip to content

Commit

Permalink
SCI: Fix when more than 10 font codes are used
Browse files Browse the repository at this point in the history
  • Loading branch information
lskovlun committed Dec 28, 2015
1 parent f4022c0 commit 9a3084d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions engines/sci/graphics/text16.cpp
Expand Up @@ -99,10 +99,8 @@ int16 GfxText16::CodeProcessing(const char *&text, GuiResourceId orgFontId, int1
// c -> sets textColor to current port pen color
// cX -> sets textColor to _textColors[X-1]
curCode = textCode[0];
curCodeParm = textCode[1];
if (Common::isDigit(curCodeParm)) {
curCodeParm -= '0';
} else {
curCodeParm = strtol(textCode+1, NULL, 10);
if (!Common::isDigit(textCode[1])) {
curCodeParm = -1;
}
switch (curCode) {
Expand Down

2 comments on commit 9a3084d

@OmerMor
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should probably also change the comment (lines 86-87), as the function's no longer restricted to one-digit codes.

@lskovlun
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks.

Please sign in to comment.