Added word wrapping to the status line (necessary when giving long sets of Tell instructions)

svn-id: r23809
This commit is contained in:
Paul Gilbert 2006-08-30 11:48:43 +00:00
parent 1ba14890c6
commit e0d2b0764f

View File

@ -441,7 +441,18 @@ void Room::update() {
if (_hotspotId != 0)
s.writeString(0, 0, _hotspotName, false, DIALOG_TEXT_COLOUR);
} else {
s.writeString(0, 0, _statusLine, false, DIALOG_WHITE_COLOUR);
// Word wrap (if necessary) the status line and dispaly it
char *statusLineCopy = strdup(_statusLine);
char **lines;
uint8 numLines;
int16 yPos = 0;
s.wordWrap(statusLineCopy, s.width(), lines, numLines);
for (int lineNum = 0; lineNum < numLines; ++lineNum) {
s.writeString(0, yPos, lines[lineNum], false, DIALOG_WHITE_COLOUR);
yPos += FONT_HEIGHT;
}
Memory::dealloc(lines);
Memory::dealloc(statusLineCopy);
}
// If show information is turned on, show extra debugging information