diff options
author | Eugene Sandulenko | 2017-08-01 09:55:20 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2017-08-01 10:42:22 +0200 |
commit | 115a7407e974198450cc7bffeaf664c98c44f72a (patch) | |
tree | 329a6f56ae0b06ad5da5ad6081e6cbbf152da518 /graphics/macgui | |
parent | 2f5b1f08efe697287c3e28c2cf97eb31996f23a9 (diff) | |
download | scummvm-rg350-115a7407e974198450cc7bffeaf664c98c44f72a.tar.gz scummvm-rg350-115a7407e974198450cc7bffeaf664c98c44f72a.tar.bz2 scummvm-rg350-115a7407e974198450cc7bffeaf664c98c44f72a.zip |
GRAPHICS: MACGUI: Keep original string in MacText
Diffstat (limited to 'graphics/macgui')
-rw-r--r-- | graphics/macgui/mactext.cpp | 15 | ||||
-rw-r--r-- | graphics/macgui/mactext.h | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp index fe6cf4ee62..b2ea78474a 100644 --- a/graphics/macgui/mactext.cpp +++ b/graphics/macgui/mactext.cpp @@ -37,6 +37,15 @@ const Font *MacFontRun::getFont() { return font; } +const Common::String MacFontRun::toString() { + return Common::String::format("\001\015%c%c%c%c%c%c%c%c%c%c%c%c", + (fontId >> 8) & 0xff, fontId & 0xff, + textSlant & 0xff, unk3f & 0xff, + (fontSize >> 8) & 0xff, fontSize & 0xff, + (palinfo1 >> 8) & 0xff, palinfo1 & 0xff, + (palinfo2 >> 8) & 0xff, palinfo2 & 0xff, + (palinfo3 >> 8) & 0xff, palinfo3 & 0xff); +} MacText::~MacText(){ delete _macFont; @@ -370,6 +379,9 @@ void MacText::appendText(Common::String str, int fontId = kMacFontChicago, int f MacFontRun fontRun = MacFontRun(_wm, fontId, fontSlant, 0, fontSize, 0, 0, 0); + _str += fontRun.toString(); + _str += str; + resizeAndFormatLines(newLines, &fontRun); splitString(str); @@ -382,6 +394,9 @@ void MacText::appendTextDefault(Common::String str) { uint oldLen = _textLines.size(); uint newLines = 1 + getNewlinesInString(str); + _str += _defaultFormatting.toString(); + _str += str; + resizeAndFormatLines(newLines, &_defaultFormatting); splitString(str); diff --git a/graphics/macgui/mactext.h b/graphics/macgui/mactext.h index 2f001f782a..1cdb0d3a12 100644 --- a/graphics/macgui/mactext.h +++ b/graphics/macgui/mactext.h @@ -71,6 +71,8 @@ struct MacFontRun { } const Font *getFont(); + + const Common::String toString(); }; struct MacTextLine { |