aboutsummaryrefslogtreecommitdiff
path: root/engines/director
diff options
context:
space:
mode:
authorTobia Tesan2017-05-01 00:11:22 +0200
committerEugene Sandulenko2017-05-02 21:01:23 +0100
commit61cd407405777a85bd6f40b3c1b04d340d811c34 (patch)
treef5e8bdeb5200c2f77586660e7f03af9bf8b798f0 /engines/director
parent84a65f9df0d895d841cad3191302ea592809af2d (diff)
downloadscummvm-rg350-61cd407405777a85bd6f40b3c1b04d340d811c34.tar.gz
scummvm-rg350-61cd407405777a85bd6f40b3c1b04d340d811c34.tar.bz2
scummvm-rg350-61cd407405777a85bd6f40b3c1b04d340d811c34.zip
DIRECTOR: Use text from textCasts
Diffstat (limited to 'engines/director')
-rw-r--r--engines/director/frame.cpp17
-rw-r--r--engines/director/frame.h2
2 files changed, 5 insertions, 14 deletions
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index e6a8505fea..770617e6f9 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -593,9 +593,7 @@ void Frame::renderSprites(Graphics::ManagedSurface &surface, bool renderTrail) {
if (castType == kCastShape) {
renderShape(surface, i);
} else if (castType == kCastText) {
- uint id = (_vm->getVersion() < 4) ? _sprites[i]->_castId + 1024 : _sprites[i]->_textCast->children[0].index;
- const Stxt *stxt = _vm->getCurrentScore()->_loadedStxts->getVal(id);
- renderText(surface, i, stxt, NULL);
+ renderText(surface, i, NULL);
} else if (castType == kCastButton) {
renderButton(surface, i, _vm->getVersion() < 4 ? _sprites[i]->_castId + 1024 : _sprites[i]->_buttonCast->children[0].index);
} else {
@@ -672,8 +670,7 @@ void Frame::renderButton(Graphics::ManagedSurface &surface, uint16 spriteId, uin
Common::Rect textRect(0, 0, width, height);
// pass the rect of the button into the label.
- const Stxt *stxt = _vm->getCurrentScore()->_loadedStxts->getVal(textId);
- renderText(surface, spriteId, stxt, &textRect);
+ renderText(surface, spriteId, &textRect);
// TODO: review all cases to confirm if we should use text height.
// height = textRect.height();
@@ -729,15 +726,9 @@ void Frame::inkBasedBlit(Graphics::ManagedSurface &targetSurface, const Graphics
}
-void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, const Stxt *stxt, Common::Rect *textSize) {
+void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Common::Rect *textSize) {
TextCast *textCast = _sprites[spriteId]->_buttonCast != nullptr ? (TextCast*)_sprites[spriteId]->_buttonCast : _sprites[spriteId]->_textCast;
- textCast->fontId = stxt->_fontId;
- textCast->textSlant = stxt->_textSlant;
- textCast->fontSize = stxt->_fontSize;
- textCast->palinfo1 = stxt->_palinfo1;
- textCast->palinfo2 = stxt->_palinfo2;
- textCast->palinfo3 = stxt->_palinfo3;
int x = _sprites[spriteId]->_startPoint.x; // +rectLeft;
int y = _sprites[spriteId]->_startPoint.y; // +rectTop;
@@ -786,7 +777,7 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, const
else
alignment++;
- Graphics::MacText mt(stxt->_ftext, _vm->_wm, macFont, 0x00, 0xff, width, (Graphics::TextAlign)alignment, 1);
+ Graphics::MacText mt(textCast->_ftext, _vm->_wm, macFont, 0x00, 0xff, width, (Graphics::TextAlign)alignment, 1);
mt.render();
const Graphics::ManagedSurface *textSurface = mt.getSurface();
diff --git a/engines/director/frame.h b/engines/director/frame.h
index fd0dbc8aef..546573fb40 100644
--- a/engines/director/frame.h
+++ b/engines/director/frame.h
@@ -128,7 +128,7 @@ private:
void playTransition(Score *score);
void playSoundChannel();
void renderSprites(Graphics::ManagedSurface &surface, bool renderTrail);
- void renderText(Graphics::ManagedSurface &surface, uint16 spriteId, const Stxt *stxt, Common::Rect *textSize);
+ void renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Common::Rect *textSize);
void renderShape(Graphics::ManagedSurface &surface, uint16 spriteId);
void renderButton(Graphics::ManagedSurface &surface, uint16 spriteId, uint16 textId);
void readPaletteInfo(Common::SeekableSubReadStreamEndian &stream);