GRAPHICS: MACGUI: Keep original string in MacText
This commit is contained in:
parent
2f5b1f08ef
commit
115a7407e9
2 changed files with 17 additions and 0 deletions
|
@ -37,6 +37,15 @@ const Font *MacFontRun::getFont() {
|
||||||
return font;
|
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(){
|
MacText::~MacText(){
|
||||||
delete _macFont;
|
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);
|
MacFontRun fontRun = MacFontRun(_wm, fontId, fontSlant, 0, fontSize, 0, 0, 0);
|
||||||
|
|
||||||
|
_str += fontRun.toString();
|
||||||
|
_str += str;
|
||||||
|
|
||||||
resizeAndFormatLines(newLines, &fontRun);
|
resizeAndFormatLines(newLines, &fontRun);
|
||||||
|
|
||||||
splitString(str);
|
splitString(str);
|
||||||
|
@ -382,6 +394,9 @@ void MacText::appendTextDefault(Common::String str) {
|
||||||
uint oldLen = _textLines.size();
|
uint oldLen = _textLines.size();
|
||||||
uint newLines = 1 + getNewlinesInString(str);
|
uint newLines = 1 + getNewlinesInString(str);
|
||||||
|
|
||||||
|
_str += _defaultFormatting.toString();
|
||||||
|
_str += str;
|
||||||
|
|
||||||
resizeAndFormatLines(newLines, &_defaultFormatting);
|
resizeAndFormatLines(newLines, &_defaultFormatting);
|
||||||
|
|
||||||
splitString(str);
|
splitString(str);
|
||||||
|
|
|
@ -71,6 +71,8 @@ struct MacFontRun {
|
||||||
}
|
}
|
||||||
|
|
||||||
const Font *getFont();
|
const Font *getFont();
|
||||||
|
|
||||||
|
const Common::String toString();
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MacTextLine {
|
struct MacTextLine {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue