aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2019-12-29 01:11:12 +0100
committerEugene Sandulenko2019-12-29 01:11:12 +0100
commit7d0390bdbfc538f933a3e6884c81d74aa56f4642 (patch)
tree69a775ec96416e9ff9785e089ab1948c8dcb229a /engines
parent00b7f1d7aa5753e2e992ea9663ea700155a60964 (diff)
downloadscummvm-rg350-7d0390bdbfc538f933a3e6884c81d74aa56f4642.tar.gz
scummvm-rg350-7d0390bdbfc538f933a3e6884c81d74aa56f4642.tar.bz2
scummvm-rg350-7d0390bdbfc538f933a3e6884c81d74aa56f4642.zip
DIRECTOR: LINGO: Implement 'set the text of cast'
Diffstat (limited to 'engines')
-rw-r--r--engines/director/lingo/lingo-the.cpp32
1 files changed, 26 insertions, 6 deletions
diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index 50194e294c..33c394db2a 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -751,11 +751,6 @@ void Lingo::setTheCast(Datum &id1, int field, Datum &d) {
CastType castType = score->_castTypes[id];
CastInfo *castInfo = score->_castsInfo[id + score->_castIDoffset];
- if (!castInfo) {
- warning("Lingo::setTheCast(): The cast %d not found. type: %d", id, castType);
- return;
- }
-
switch (field) {
case kTheCastType:
// TODO: You can actually switch the cast type!?
@@ -764,12 +759,24 @@ void Lingo::setTheCast(Datum &id1, int field, Datum &d) {
//cast->modified = 1;
break;
case kTheFileName:
+ if (!castInfo) {
+ warning("Lingo::setTheCast(): The cast %d not found. type: %d", id, castType);
+ return;
+ }
castInfo->fileName = *d.u.s;
break;
case kTheName:
+ if (!castInfo) {
+ warning("Lingo::setTheCast(): The cast %d not found. type: %d", id, castType);
+ return;
+ }
castInfo->name = *d.u.s;
break;
case kTheScriptText:
+ if (!castInfo) {
+ warning("Lingo::setTheCast(): The cast %d not found. type: %d", id, castType);
+ return;
+ }
castInfo->script = *d.u.s;
break;
case kTheWidth:
@@ -801,8 +808,21 @@ void Lingo::setTheCast(Datum &id1, int field, Datum &d) {
shape->_modified = 1;
}
break;
+ case kTheText:
+ if (castType == kCastText) {
+ if (!score->_loadedText->contains(id)) {
+ warning("Lingo::setTheCast(): Unknown STXT cast id %d", id);
+ return;
+ } else {
+ d.toString();
+ score->_loadedText->getVal(id)->setText(d.u.s->c_str());
+ }
+ } else {
+ warning("Lingo::setTheCast(): Unprocessed setting text of cast %d type %d", id, castType);
+ }
+ break;
default:
- warning("Lingo::setTheCast(): Unprocessed getting field %d of cast %d", field, id);
+ warning("Lingo::setTheCast(): Unprocessed setting field %d of cast %d", field, id);
}
}