aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/tattoo/tattoo_people.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2015-06-12 19:37:53 -0400
committerPaul Gilbert2015-06-12 19:37:53 -0400
commited29691b2facecdfac934f90841f69e81c12e697 (patch)
tree9d4338c4e740edbade693dbc0dea075a42619fec /engines/sherlock/tattoo/tattoo_people.cpp
parentcbafff20c22764295e93d86280e9825d7c6f5032 (diff)
downloadscummvm-rg350-ed29691b2facecdfac934f90841f69e81c12e697.tar.gz
scummvm-rg350-ed29691b2facecdfac934f90841f69e81c12e697.tar.bz2
scummvm-rg350-ed29691b2facecdfac934f90841f69e81c12e697.zip
SHERLOCK: RT: Move RT fields added to Person to TattooPerson
Diffstat (limited to 'engines/sherlock/tattoo/tattoo_people.cpp')
-rw-r--r--engines/sherlock/tattoo/tattoo_people.cpp53
1 files changed, 52 insertions, 1 deletions
diff --git a/engines/sherlock/tattoo/tattoo_people.cpp b/engines/sherlock/tattoo/tattoo_people.cpp
index 6558231149..bea105fee0 100644
--- a/engines/sherlock/tattoo/tattoo_people.cpp
+++ b/engines/sherlock/tattoo/tattoo_people.cpp
@@ -31,6 +31,20 @@ namespace Tattoo {
#define FACING_PLAYER 16
+TattooPerson::TattooPerson() : Person() {
+ Common::fill(&_npcPath[0], &_npcPath[MAX_NPC_PATH], 0);
+ _tempX = _tempScaleVal = 0;
+ _npcIndex = 0;
+ _npcStack = 0;
+ _npcMoved = false;
+ _npcFacing = -1;
+ _resetNPCPath = true;
+ _savedNpcSequence = 0;
+ _savedNpcFrame = 0;
+ _updateNPCPath = false;
+ _npcPause = false;
+}
+
void TattooPerson::adjustSprite() {
People &people = *_vm->_people;
TattooScene &scene = *(TattooScene *)_vm->_scene;
@@ -104,7 +118,7 @@ void TattooPerson::adjustSprite() {
}
void TattooPerson::gotoStand() {
- People &people = *_vm->_people;
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
// If the misc field is set, then we're running a special talk sequence, so don't interrupt it.
if (_misc)
@@ -232,6 +246,16 @@ void TattooPerson::setWalking() {
error("TODO: setWalking");
}
+void TattooPerson::clearNPC() {
+ Common::fill(&_npcPath[0], &_npcPath[MAX_NPC_PATH], 0);
+ _npcIndex = _npcStack = 0;
+ _npcName = "";
+}
+
+void TattooPerson::updateNPC() {
+ // TODO
+}
+
/*----------------------------------------------------------------*/
TattooPeople::TattooPeople(SherlockEngine *vm) : People(vm) {
@@ -413,6 +437,33 @@ void TattooPeople::setTalkSequence(int speaker, int sequenceNum) {
}
}
+
+int TattooPeople::findSpeaker(int speaker) {
+ int result = People::findSpeaker(speaker);
+ const char *portrait = _characters[speaker]._portrait;
+
+ // Fallback that Rose Tattoo uses if no speaker was found
+ if (result == -1) {
+ bool flag = _vm->readFlags(76);
+
+ if (_data[PLAYER]->_type == CHARACTER && ((speaker == 0 && flag) || (speaker == 1 && !flag)))
+ return -1;
+
+ for (uint idx = 1; idx < _data.size(); ++idx) {
+ TattooPerson &p = (*this)[idx];
+
+ if (p._type == CHARACTER) {
+ Common::String name(p._name.c_str(), p._name.c_str() + 4);
+
+ if (name.equalsIgnoreCase(portrait) && p._npcName[4] >= '0' && p._npcName[4] <= '9')
+ return idx + 256;
+ }
+ }
+ }
+
+ return -1;
+}
+
void TattooPeople::synchronize(Serializer &s) {
s.syncAsByte(_holmesOn);