diff options
author | Eugene Sandulenko | 2016-07-04 22:34:42 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | 22f72fc2a71891368799f1400ab8278d0f8c1d7f (patch) | |
tree | 4cdf2f37530943856c425db70fab4b3634b3b5ed | |
parent | bb469dc84d9935335372c3c84c99ea99c06c3be4 (diff) | |
download | scummvm-rg350-22f72fc2a71891368799f1400ab8278d0f8c1d7f.tar.gz scummvm-rg350-22f72fc2a71891368799f1400ab8278d0f8c1d7f.tar.bz2 scummvm-rg350-22f72fc2a71891368799f1400ab8278d0f8c1d7f.zip |
DIRECTOR: Lingo: Optimise 'the' setters and getters.
-rw-r--r-- | engines/director/lingo/lingo-the.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp index f772d0490f..4d54110489 100644 --- a/engines/director/lingo/lingo-the.cpp +++ b/engines/director/lingo/lingo-the.cpp @@ -163,6 +163,8 @@ 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); + d.toInt(); // Enforce Integer + switch (field) { case kTheCastNum: if (_vm->_currentScore->_casts.contains(d.u.i)) { @@ -208,25 +210,23 @@ Datum Lingo::getTheEntity(TheEntity entity, int id, TheField field) { Datum Lingo::getTheSprite(int id, TheField field) { Datum d; Sprite *sprite = _vm->_currentScore->getSpriteById(id); + + d.type = INT; + switch (field) { case kTheCastNum: - 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: |