[Scummvm-git-logs] scummvm master -> a307a91916300908fb6d08ae146805b44acbb925

stevenhoefel stevenhoefel at hotmail.com
Mon Apr 3 06:38:47 CEST 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
a307a91916 DIRECTOR: Use button cast when rendering button text.


Commit: a307a91916300908fb6d08ae146805b44acbb925
    https://github.com/scummvm/scummvm/commit/a307a91916300908fb6d08ae146805b44acbb925
Author: stevenhoefel (stevenhoefel at hotmail.com)
Date: 2017-04-03T14:38:36+10:00

Commit Message:
DIRECTOR: Use button cast when rendering button text.

Changed paths:
    engines/director/frame.cpp
    engines/director/score.cpp


diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index e2f3b4c..ba53d6d 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -741,7 +741,7 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo
 	if (textStream == NULL)
 		return;
 
-	TextCast *textCast = _sprites[spriteId]->_textCast;
+	TextCast *textCast = _sprites[spriteId]->_buttonCast != nullptr ? (TextCast*)_sprites[spriteId]->_buttonCast : _sprites[spriteId]->_textCast;
 
 	uint32 unk1 = textStream->readUint32();
 	uint32 strLen = textStream->readUint32();
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index e8210b5..e31b97a 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -438,13 +438,6 @@ void Score::setSpriteCasts() {
 				}
 			} else if (_loadedButtons->contains(castId)) {
 				_frames[i]->_sprites[j]->_buttonCast = _loadedButtons->getVal(castId);
-				if (_frames[i]->_sprites[j]->_buttonCast->children.size() == 1) {
-					Resource child = _frames[i]->_sprites[j]->_buttonCast->children[0];
-					_loadedText->setVal(child.index, new TextCast(*_movieArchive->getResource(child.tag, child.index), _vm->getVersion()));
-					_frames[i]->_sprites[j]->_textCast = _loadedText->getVal(child.index);
-				} else if (_frames[i]->_sprites[j]->_buttonCast->children.size() > 0) {
-					warning("Cast %d has too many children!", j);
-				}
 			}
 
 			//if (_loadedScripts->contains(castId))





More information about the Scummvm-git-logs mailing list