Skip to content

Commit

Permalink
DIRECTOR: Add sprite controlling fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Iskrich authored and sev- committed Aug 3, 2016
1 parent aac3497 commit 445bf8f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
21 changes: 21 additions & 0 deletions engines/director/lingo/lingo-the.cpp
Expand Up @@ -184,6 +184,15 @@ void Lingo::setTheSprite(int id, TheField field, Datum &d) {
case kTheInk:
sprite->_ink = static_cast<InkType>(d.u.i);
break;
case kTheLocH:
sprite->_startPoint.x = d.u.i;
break;
case kTheLocV:
sprite->_startPoint.y = d.u.i;
break;
case kTheConstraint:
sprite->_constraint = d.u.i;
break;

default:
error("Unprocessed setting field %d of sprite", field);
Expand Down Expand Up @@ -229,6 +238,18 @@ Datum Lingo::getTheSprite(int id, TheField field) {
case kTheInk:
d.u.i = sprite->_ink;
break;
case kTheInk:
sprite->_ink = static_cast<InkType>(d.u.i);
break;
case kTheLocH:
d.u.i = sprite->_startPoint.x;
break;
case kTheLocV:
d.u.i = sprite->_startPoint.y;
break;
case kTheConstraint:
d.u.i = sprite->_constraint;
break;
default:
error("Unprocessed getting field %d of sprite", field);
}
Expand Down
2 changes: 2 additions & 0 deletions engines/director/score.cpp
Expand Up @@ -1535,6 +1535,8 @@ Sprite::Sprite() {
_flags = 0;
_height = 0;
_castId = 0;
_constraint = 0;
_moveable = 0;
_castId = 0;
}

Expand Down
4 changes: 4 additions & 0 deletions engines/director/score.h
Expand Up @@ -286,6 +286,10 @@ class Sprite {
Common::Point _startPoint;
uint16 _width;
uint16 _height;
//TODO: default constraint = 0, if turned on, sprite is constrainted to the bounding rect
//As i know, constrainted != 0 only if sprite moveable
byte _constraint;
byte _moveable;
};

class Frame {
Expand Down

0 comments on commit 445bf8f

Please sign in to comment.