diff options
author | uruk | 2014-06-27 23:40:23 +0200 |
---|---|---|
committer | uruk | 2014-06-27 23:40:23 +0200 |
commit | 2514d866301ca9c9bcc26b54031889e2a0e5a28d (patch) | |
tree | f952b07e97fe58d2c9a201de0b3b988f2d46f7b8 | |
parent | 723bdc12add207c5a8c87e3b3300e61458e568b5 (diff) | |
download | scummvm-rg350-2514d866301ca9c9bcc26b54031889e2a0e5a28d.tar.gz scummvm-rg350-2514d866301ca9c9bcc26b54031889e2a0e5a28d.tar.bz2 scummvm-rg350-2514d866301ca9c9bcc26b54031889e2a0e5a28d.zip |
CGE2: Implement Sprite::step() fully.
-rw-r--r-- | engines/cge2/vga13h.cpp | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/engines/cge2/vga13h.cpp b/engines/cge2/vga13h.cpp index 9507ade704..29ee5c8b44 100644 --- a/engines/cge2/vga13h.cpp +++ b/engines/cge2/vga13h.cpp @@ -492,7 +492,36 @@ void Sprite::step(int nr) { _seqPtr = _ext->_seq[_seqPtr]._next; if (_file[2] == '~') { // FLY-type sprite - warning("STUB: Sprite::step() - FLY-type sprite"); + seq = _ext->_seq; + // return to middle + p._x -= seq->_dx; + p._y -= seq->_dy; + p._z -= seq->_dz; + // generate motion + if (_vm->newRandom(10) < 5) { + if ((seq + 1)->_dx) + seq->_dx += _vm->newRandom(3) - 1; + if ((seq + 1)->_dy) + seq->_dy += _vm->newRandom(3) - 1; + if ((seq + 1)->_dz) + seq->_dz += _vm->newRandom(3) - 1; + } + if (seq->_dx < -(seq + 1)->_dx) + seq->_dx += 2; + if (seq->_dx >= (seq + 1)->_dx) + seq->_dx -= 2; + if (seq->_dy < -(seq + 1)->_dy) + seq->_dy += 2; + if (seq->_dy >= (seq + 1)->_dy) + seq->_dy -= 2; + if (seq->_dz < -(seq + 1)->_dz) + seq->_dz += 2; + if (seq->_dz >= (seq + 1)->_dz) + seq->_dz -= 2; + p._x += seq->_dx; + p._y += seq->_dy; + p._z += seq->_dz; + gotoxyz(p); } else { seq = _ext->_seq + _seqPtr; if (seq->_dz == 127 && seq->_dx != 0) { |