aboutsummaryrefslogtreecommitdiff
path: root/engines/director/lingo
diff options
context:
space:
mode:
authorDmitry Iskrich2016-07-04 23:03:52 +0300
committerEugene Sandulenko2016-08-03 23:40:36 +0200
commitbb469dc84d9935335372c3c84c99ea99c06c3be4 (patch)
tree11238c46641dc0f09a45a645855d3d7740b02ed8 /engines/director/lingo
parentfb51685b07131d0fe62d2efd6d6eb068ae896792 (diff)
downloadscummvm-rg350-bb469dc84d9935335372c3c84c99ea99c06c3be4.tar.gz
scummvm-rg350-bb469dc84d9935335372c3c84c99ea99c06c3be4.tar.bz2
scummvm-rg350-bb469dc84d9935335372c3c84c99ea99c06c3be4.zip
DIRECTOR: Lingo: Set/Get common sprite fields
Diffstat (limited to 'engines/director/lingo')
-rw-r--r--engines/director/lingo/lingo-the.cpp44
1 files changed, 41 insertions, 3 deletions
diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index 168e9ee717..f772d0490f 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -24,6 +24,8 @@
namespace Director {
+class Sprite;
+
static struct TheEntityProto {
TheEntity entity;
const char *name;
@@ -159,10 +161,28 @@ void Lingo::setTheEntity(TheEntity entity, int id, TheField field, Datum &d) {
}
void Lingo::setTheSprite(int id, TheField field, Datum &d) {
+ Sprite *sprite = _vm->_currentScore->getSpriteById(id);
+
switch (field) {
case kTheCastNum:
- warning("STUB: setting thecastnum of sprite %d", id);
+ if (_vm->_currentScore->_casts.contains(d.u.i)) {
+ sprite->_cast = _vm->_currentScore->_casts[d.u.i];
+ sprite->_castId = d.u.i;
+ }
+ break;
+ case kTheWidth:
+ sprite->_width = d.u.i;
+ break;
+ case kTheHeight:
+ sprite->_height = d.u.i;
break;
+ case kTheTrails:
+ sprite->_trails = d.u.i;
+ break;
+ case kTheInk:
+ sprite->_ink = static_cast<InkType>(d.u.i);
+ break;
+
default:
error("Unprocessed setting field %d of sprite", field);
}
@@ -187,10 +207,27 @@ Datum Lingo::getTheEntity(TheEntity entity, int id, TheField field) {
Datum Lingo::getTheSprite(int id, TheField field) {
Datum d;
-
+ Sprite *sprite = _vm->_currentScore->getSpriteById(id);
switch (field) {
case kTheCastNum:
- warning("STUB: getting thecastnum of sprite %d", id);
+ d.type = INT;
+ d.u.i = sprite->_castId;
+ break;
+ case kTheWidth:
+ d.type = INT;
+ d.u.i = sprite->_width;
+ break;
+ case kTheHeight:
+ d.type = INT;
+ d.u.i = sprite->_height;
+ break;
+ case kTheTrails:
+ d.type = INT;
+ d.u.i = sprite->_trails;
+ break;
+ case kTheInk:
+ d.type = INT;
+ d.u.i = sprite->_ink;
break;
default:
error("Unprocessed getting field %d of sprite", field);
@@ -199,4 +236,5 @@ Datum Lingo::getTheSprite(int id, TheField field) {
return d;
}
+
} // End of namespace Director