diff options
author | Eugene Sandulenko | 2016-10-18 11:31:28 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-10-18 11:50:12 +0200 |
commit | 6ef67b9186535f8058dabfbbd181ad3ad032e079 (patch) | |
tree | 2bae7cf4c9f2c6d413992adb5899d634211d22f3 /engines/director | |
parent | e19cb159430d4672c16865263c729a689e9e98cf (diff) | |
download | scummvm-rg350-6ef67b9186535f8058dabfbbd181ad3ad032e079.tar.gz scummvm-rg350-6ef67b9186535f8058dabfbbd181ad3ad032e079.tar.bz2 scummvm-rg350-6ef67b9186535f8058dabfbbd181ad3ad032e079.zip |
DIRECTOR: Further work on text cast loading and rendering
Diffstat (limited to 'engines/director')
-rw-r--r-- | engines/director/frame.cpp | 6 | ||||
-rw-r--r-- | engines/director/score.cpp | 8 | ||||
-rw-r--r-- | engines/director/score.h | 2 |
3 files changed, 13 insertions, 3 deletions
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp index 53b7502779..0ce7f2be9b 100644 --- a/engines/director/frame.cpp +++ b/engines/director/frame.cpp @@ -599,7 +599,9 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteID) { text += ch; } - debugC(3, kDebugText, "renderText: unk1: %d strLen: %d dataLen: %d textlen: %d", unk1, strLen, dataLen, text.size()); + debugC(3, kDebugText, "renderText: unk1: %d strLen: %d dataLen: %d textlen: %u", unk1, strLen, dataLen, text.size()); + if (strLen < 200) + debugC(3, kDebugText, "text: '%s'", text.c_str()); uint32 rectLeft = static_cast<TextCast *>(_sprites[spriteID]->_cast)->initialRect.left; uint32 rectTop = static_cast<TextCast *>(_sprites[spriteID]->_cast)->initialRect.top; @@ -618,6 +620,8 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteID) { const Graphics::Font *font = _vm->_wm->_fontMan->getFont(macFont); + debugC(3, kDebugText, "renderText: x: %d y: %d w: %d h: %d font: '%s'", x, y, width, height, _vm->_wm->_fontMan->getFontName(macFont)); + font->drawString(&surface, text, x, y, width, 0); if (textCast->borderSize != kSizeNone) { diff --git a/engines/director/score.cpp b/engines/director/score.cpp index c95aae1121..5c594c20fc 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -714,13 +714,15 @@ BitmapCast::BitmapCast(Common::SeekableSubReadStreamEndian &stream) { } TextCast::TextCast(Common::SeekableSubReadStreamEndian &stream) { - /*byte flags =*/ stream.readByte(); + flags1 = stream.readByte(); borderSize = static_cast<SizeType>(stream.readByte()); gutterSize = static_cast<SizeType>(stream.readByte()); boxShadow = static_cast<SizeType>(stream.readByte()); textType = static_cast<TextType>(stream.readByte()); textAlign = static_cast<TextAlignType>(stream.readUint16()); - stream.skip(6); //palinfo + palinfo1 = stream.readUint16(); + palinfo2 = stream.readUint16(); + palinfo3 = stream.readUint16(); int t = stream.readUint32(); assert(t == 0); // So far we saw only 0 here @@ -734,6 +736,8 @@ TextCast::TextCast(Common::SeekableSubReadStreamEndian &stream) { textFlags.push_back(kTextFlagAutoTab); if (flags & 0x4) textFlags.push_back(kTextFlagDoNotWrap); + if (flags & 0xf8) + warning("Unproxessed text cast flags: %x", flags & 0xf8); // TODO: FIXME: guesswork fontId = stream.readByte(); diff --git a/engines/director/score.h b/engines/director/score.h index ad07b6defc..b5c66d1d61 100644 --- a/engines/director/score.h +++ b/engines/director/score.h @@ -132,12 +132,14 @@ struct TextCast : Cast { SizeType gutterSize; SizeType boxShadow; + byte flags1; uint32 fontId; uint16 fontSize; TextType textType; TextAlignType textAlign; SizeType textShadow; Common::Array<TextFlag> textFlags; + int16 palinfo1, palinfo2, palinfo3; }; enum ButtonType { |