diff options
author | Paul Gilbert | 2015-06-11 22:02:33 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-06-11 22:02:33 -0400 |
commit | 3d0e2cb5b000bfa9ff731fc6a83ec402bd9f7aad (patch) | |
tree | f3780949461d600f733e33cea286f425d5f80619 /engines/sherlock/tattoo/tattoo_people.cpp | |
parent | f812447274fc1de46560e4e611c9d4cb9bf39beb (diff) | |
download | scummvm-rg350-3d0e2cb5b000bfa9ff731fc6a83ec402bd9f7aad.tar.gz scummvm-rg350-3d0e2cb5b000bfa9ff731fc6a83ec402bd9f7aad.tar.bz2 scummvm-rg350-3d0e2cb5b000bfa9ff731fc6a83ec402bd9f7aad.zip |
SHERLOCK: Beginning of descendent Person classes
Tattoo has some different Sprite methods, and since Person descends
from Sprite, need to create descendents from it. And this has also
necessitated some refactoring of People class's _data array
Diffstat (limited to 'engines/sherlock/tattoo/tattoo_people.cpp')
-rw-r--r-- | engines/sherlock/tattoo/tattoo_people.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/engines/sherlock/tattoo/tattoo_people.cpp b/engines/sherlock/tattoo/tattoo_people.cpp index 61f79c471c..cc50a32b7b 100644 --- a/engines/sherlock/tattoo/tattoo_people.cpp +++ b/engines/sherlock/tattoo/tattoo_people.cpp @@ -28,6 +28,20 @@ namespace Sherlock { namespace Tattoo { +void TattooPerson::adjustSprite() { + // TODO + warning("TODO: TattooPerson::adjustSprite"); +} + +/*----------------------------------------------------------------*/ + +TattooPeople::TattooPeople(SherlockEngine *vm) : People(vm) { + for (int idx = 0; idx < 6; ++idx) + _data.push_back(new TattooPerson()); +} + + + void TattooPeople::setListenSequence(int speaker, int sequenceNum) { Scene &scene = *_vm->_scene; @@ -45,7 +59,7 @@ void TattooPeople::setListenSequence(int speaker, int sequenceNum) { obj.setObjTalkSequence(sequenceNum); } else if (objNum != -1) { objNum -= 256; - Person &person = _data[objNum]; + Person &person = *_data[objNum]; int newDir = person._sequenceNumber; switch (person._sequenceNumber) { @@ -203,8 +217,8 @@ void TattooPeople::setTalkSequence(int speaker, int sequenceNum) { void TattooPeople::synchronize(Serializer &s) { s.syncAsByte(_holmesOn); - for (int idx = 0; idx < MAX_CHARACTERS; ++idx) { - Person &p = _data[idx]; + for (uint idx = 0; idx < _data.size(); ++idx) { + Person &p = *_data[idx]; s.syncAsSint32LE(p._position.x); s.syncAsSint32LE(p._position.y); s.syncAsSint16LE(p._sequenceNumber); @@ -217,8 +231,8 @@ void TattooPeople::synchronize(Serializer &s) { s.syncAsSint16LE(_holmesQuotient); if (s.isLoading()) { - _hSavedPos = _player._position; - _hSavedFacing = _player._sequenceNumber; + _hSavedPos = _data[PLAYER]->_position; + _hSavedFacing = _data[PLAYER]->_sequenceNumber; } } |