aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock
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
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')
-rw-r--r--engines/sherlock/objects.cpp15
-rw-r--r--engines/sherlock/people.cpp41
-rw-r--r--engines/sherlock/people.h35
-rw-r--r--engines/sherlock/scalpel/scalpel_people.h3
-rw-r--r--engines/sherlock/scene.cpp21
-rw-r--r--engines/sherlock/scene.h7
-rw-r--r--engines/sherlock/talk.cpp3
-rw-r--r--engines/sherlock/tattoo/tattoo_people.cpp53
-rw-r--r--engines/sherlock/tattoo/tattoo_people.h35
-rw-r--r--engines/sherlock/tattoo/tattoo_scene.cpp42
-rw-r--r--engines/sherlock/tattoo/tattoo_scene.h7
-rw-r--r--engines/sherlock/tattoo/tattoo_talk.cpp60
12 files changed, 167 insertions, 155 deletions
diff --git a/engines/sherlock/objects.cpp b/engines/sherlock/objects.cpp
index 9ef1accb80..09fa98f819 100644
--- a/engines/sherlock/objects.cpp
+++ b/engines/sherlock/objects.cpp
@@ -1187,21 +1187,6 @@ void Object::setObjTalkSequence(int seq) {
assert(_type != CHARACTER);
- // If the object passed in is an NPC, set it's sequence through the sequence number rather
- // than adjusting the frame number to a specific sub-sequence
- /*
- s = (SpriteType *)bg;
- if (s->seqto)
- {
- // reset to previous value
- s->WalkSeqs[s->fs]->Seq[s->fn] = s->seqto;
- s->seqto = 0;
- }
- s->fs = s->GotoSeq;
- s->fn = 0;
- CheckWalkGraphics(s);
- */
-
talk.pushTalkSequence(this);
int talkSeqNum = seq;
diff --git a/engines/sherlock/people.cpp b/engines/sherlock/people.cpp
index 5684a94e9b..de0e6ae116 100644
--- a/engines/sherlock/people.cpp
+++ b/engines/sherlock/people.cpp
@@ -64,32 +64,12 @@ const char *const WALK_LIB_NAMES[NUM_IN_WALK_LIB] = {
/*----------------------------------------------------------------*/
-Person::Person() : Sprite(), _walkLoaded(false), _npcIndex(0), _npcStack(0), _npcPause(false) {
- 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;
+Person::Person() : Sprite() {
+ _walkLoaded = false;
_oldWalkSequence = -1;
_srcZone = _destZone = 0;
}
-void Person::clearNPC() {
- Common::fill(&_npcPath[0], &_npcPath[MAX_NPC_PATH], 0);
- _npcIndex = _npcStack = 0;
- _npcName = "";
-}
-
-void Person::updateNPC() {
- // TODO
-}
-
void Person::goAllTheWay() {
People &people = *_vm->_people;
Scene &scene = *_vm->_scene;
@@ -418,23 +398,6 @@ int People::findSpeaker(int speaker) {
}
}
- // Fallback in Rose Tattoo
- if (IS_ROSE_TATTOO) {
- 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) {
- if (_data[idx]->_type == CHARACTER) {
- Common::String name(_data[idx]->_name.c_str(), _data[idx]->_name.c_str() + 4);
-
- if (name.equalsIgnoreCase(portrait) && _data[idx]->_npcName[4] >= '0' && _data[idx]->_npcName[4] <= '9')
- return idx + 256;
- }
- }
- }
-
return -1;
}
diff --git a/engines/sherlock/people.h b/engines/sherlock/people.h
index d9624d827f..27b7dc41cf 100644
--- a/engines/sherlock/people.h
+++ b/engines/sherlock/people.h
@@ -63,21 +63,6 @@ public:
bool _walkLoaded;
Common::String _portrait;
- // NPC related fields
- int _npcIndex;
- int _npcStack;
- bool _npcPause;
- byte _npcPath[MAX_NPC_PATH];
- Common::String _npcName;
- bool _npcMoved;
- int _npcFacing;
- bool _resetNPCPath;
- int _savedNpcSequence;
- int _savedNpcFrame;
- int _tempX;
- int _tempScaleVal;
- bool _updateNPCPath;
-
// Rose Tattoo fields
Common::String _walkVGSName; // Name of walk library person is using
public:
@@ -90,16 +75,6 @@ public:
* of steps to walk to get to that position.
*/
void goAllTheWay();
-
- /**
- * Clear the NPC related data
- */
- void clearNPC();
-
- /**
- * Update the NPC
- */
- void updateNPC();
};
class SherlockEngine;
@@ -158,16 +133,16 @@ public:
void walkToCoords(const Point32 &destPos, int destDir);
/**
- * Finds the scene background object corresponding to a specified speaker
- */
- int findSpeaker(int speaker);
-
- /**
* Turn off any currently active portraits, and removes them from being drawn
*/
void clearTalking();
/**
+ * Finds the scene background object corresponding to a specified speaker
+ */
+ virtual int findSpeaker(int speaker);
+
+ /**
* Synchronize the data for a savegame
*/
virtual void synchronize(Serializer &s) = 0;
diff --git a/engines/sherlock/scalpel/scalpel_people.h b/engines/sherlock/scalpel/scalpel_people.h
index cd6deac909..eec6eeb3a3 100644
--- a/engines/sherlock/scalpel/scalpel_people.h
+++ b/engines/sherlock/scalpel/scalpel_people.h
@@ -68,6 +68,9 @@ public:
ScalpelPeople(SherlockEngine *vm);
virtual ~ScalpelPeople() {}
+ ScalpelPerson &operator[](PeopleId id) { return *(ScalpelPerson *)_data[id]; }
+ ScalpelPerson &operator[](int idx) { return *(ScalpelPerson *)_data[idx]; }
+
/**
* Setup the data for an animating speaker portrait at the top of the screen
*/
diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp
index 60d3c631ee..a1039d9174 100644
--- a/engines/sherlock/scene.cpp
+++ b/engines/sherlock/scene.cpp
@@ -1203,27 +1203,6 @@ void Scene::synchronize(Serializer &s) {
}
}
-void Scene::setNPCPath(int npc) {
- People &people = *_vm->_people;
- Talk &talk = *_vm->_talk;
-
- people[npc].clearNPC();
- people[npc]._name = Common::String::format("WATS%.2dA", _currentScene);
-
- // If we're in the middle of a script that will continue once the scene is loaded,
- // return without calling the path script
- if (talk._scriptMoreFlag == 1 || talk._scriptMoreFlag == 3)
- return;
-
- // Turn off all the NPCs, since the talk script will turn them back on as needed
- for (uint idx = 0; idx < MAX_NPC; ++idx)
- people[idx + 1]._type = INVALID;
-
- // Call the path script for the scene
- Common::String pathFile = Common::String::format("PATH%.2dA", _currentScene);
- talk.talkTo(pathFile);
-}
-
void Scene::checkBgShapes() {
People &people = *_vm->_people;
Person &holmes = people[PLAYER];
diff --git a/engines/sherlock/scene.h b/engines/sherlock/scene.h
index f6e9ce1b77..a3542026e6 100644
--- a/engines/sherlock/scene.h
+++ b/engines/sherlock/scene.h
@@ -283,13 +283,6 @@ public:
* Synchronize the data for a savegame
*/
void synchronize(Serializer &s);
-
- /**
- * Resets the NPC path information when entering a new scene.
- * @remarks The default talk file for the given NPC is set to WATS##A, where ## is
- * the scene number being entered
- */
- void setNPCPath(int npc);
public:
/**
* Draw all objects and characters.
diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp
index bfb5a40ade..b27ff3ac9a 100644
--- a/engines/sherlock/talk.cpp
+++ b/engines/sherlock/talk.cpp
@@ -26,6 +26,7 @@
#include "sherlock/scalpel/scalpel_people.h"
#include "sherlock/scalpel/scalpel_talk.h"
#include "sherlock/scalpel/scalpel_user_interface.h"
+#include "sherlock/tattoo/tattoo_people.h"
#include "sherlock/tattoo/tattoo_talk.h"
namespace Sherlock {
@@ -966,7 +967,7 @@ void Talk::doScript(const Common::String &script) {
if (IS_ROSE_TATTOO) {
for (int idx = 0; idx < MAX_CHARACTERS; ++idx) {
- Person &p = people[idx];
+ Tattoo::TattooPerson &p = (*(Tattoo::TattooPeople *)_vm->_people)[idx];
p._savedNpcSequence = p._sequenceNumber;
p._savedNpcFrame = p._frameNumber;
}
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);
diff --git a/engines/sherlock/tattoo/tattoo_people.h b/engines/sherlock/tattoo/tattoo_people.h
index 9022c42929..83821fa6ca 100644
--- a/engines/sherlock/tattoo/tattoo_people.h
+++ b/engines/sherlock/tattoo/tattoo_people.h
@@ -75,10 +75,34 @@ class TattooPerson: public Person {
private:
bool checkCollision() const;
public:
- TattooPerson() : Person() {}
+ int _npcIndex;
+ int _npcStack;
+ bool _npcPause;
+ byte _npcPath[MAX_NPC_PATH];
+ Common::String _npcName;
+ bool _npcMoved;
+ int _npcFacing;
+ bool _resetNPCPath;
+ int _savedNpcSequence;
+ int _savedNpcFrame;
+ int _tempX;
+ int _tempScaleVal;
+ bool _updateNPCPath;
+public:
+ TattooPerson();
virtual ~TattooPerson() {}
/**
+ * Clear the NPC related data
+ */
+ void clearNPC();
+
+ /**
+ * Update the NPC
+ */
+ void updateNPC();
+
+ /**
* This adjusts the sprites position, as well as it's animation sequence:
*/
virtual void adjustSprite();
@@ -100,6 +124,9 @@ public:
TattooPeople(SherlockEngine *vm);
virtual ~TattooPeople() {}
+ TattooPerson &operator[](PeopleId id) { return *(TattooPerson *)_data[id]; }
+ TattooPerson &operator[](int idx) { return *(TattooPerson *)_data[idx]; }
+
/**
* If the specified speaker is a background object, it will set it so that it uses
* the Listen Sequence (specified by the sequence number). If the current sequence
@@ -111,6 +138,12 @@ public:
*/
void setListenSequence(int speaker, int sequenceNum);
+
+ /**
+ * Finds the scene background object corresponding to a specified speaker
+ */
+ virtual int findSpeaker(int speaker);
+
/**
* Synchronize the data for a savegame
*/
diff --git a/engines/sherlock/tattoo/tattoo_scene.cpp b/engines/sherlock/tattoo/tattoo_scene.cpp
index 7ac2c18aea..a896fbea34 100644
--- a/engines/sherlock/tattoo/tattoo_scene.cpp
+++ b/engines/sherlock/tattoo/tattoo_scene.cpp
@@ -21,8 +21,9 @@
*/
#include "sherlock/tattoo/tattoo_scene.h"
-#include "sherlock/tattoo/tattoo.h"
+#include "sherlock/tattoo/tattoo_people.h"
#include "sherlock/tattoo/tattoo_user_interface.h"
+#include "sherlock/tattoo/tattoo.h"
#include "sherlock/events.h"
#include "sherlock/people.h"
@@ -32,11 +33,11 @@ namespace Tattoo {
struct ShapeEntry {
Object *_shape;
- Person *_person;
+ TattooPerson *_person;
bool _isAnimation;
int _yp;
- ShapeEntry(Person *person, int yp) : _shape(nullptr), _person(person), _yp(yp), _isAnimation(false) {}
+ ShapeEntry(TattooPerson *person, int yp) : _shape(nullptr), _person(person), _yp(yp), _isAnimation(false) {}
ShapeEntry(Object *shape, int yp) : _shape(shape), _person(nullptr), _yp(yp), _isAnimation(false) {}
ShapeEntry(int yp) : _shape(nullptr), _person(nullptr), _yp(yp), _isAnimation(true) {}
int personNum;
@@ -105,7 +106,7 @@ bool TattooScene::loadScene(const Common::String &filename) {
}
void TattooScene::drawAllShapes() {
- People &people = *_vm->_people;
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
Screen &screen = *_vm->_screen;
TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
ShapeList shapeList;
@@ -182,7 +183,7 @@ void TattooScene::drawAllShapes() {
(_activeCAnim._flags & 4) >> 1, 0, _activeCAnim._scaleVal);
} else {
// Drawing person
- Person &p = *se._person;
+ TattooPerson &p = *se._person;
p._tempX = p._position.x / FIXED_INT_MULTIPLIER;
p._tempScaleVal = getScaleVal(p._position);
@@ -418,7 +419,7 @@ void TattooScene::doBgAnimEraseBackground() {
void TattooScene::doBgAnim() {
TattooEngine &vm = *(TattooEngine *)_vm;
Events &events = *_vm->_events;
- People &people = *_vm->_people;
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
Screen &screen = *_vm->_screen;
Talk &talk = *_vm->_talk;
TattooUserInterface &ui = *((TattooUserInterface *)_vm->_ui);
@@ -528,7 +529,7 @@ void TattooScene::doBgAnimUpdateBgObjectsAndAnim() {
}
void TattooScene::updateBackground() {
- People &people = *_vm->_people;
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
Screen &screen = *_vm->_screen;
TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
@@ -573,7 +574,7 @@ void TattooScene::updateBackground() {
screen._flushScreen = true;
for (int idx = 0; idx < MAX_CHARACTERS; ++idx) {
- Person &p = people[idx];
+ TattooPerson &p = people[idx];
if (p._type != INVALID) {
if (_goToScene == -1 || _cAnim.size() == 0) {
@@ -636,12 +637,12 @@ void TattooScene::updateBackground() {
}
void TattooScene::doBgAnimDrawSprites() {
- People &people = *_vm->_people;
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
Screen &screen = *_vm->_screen;
TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
for (int idx = 0; idx < MAX_CHARACTERS; ++idx) {
- Person &person = people[idx];
+ TattooPerson &person = people[idx];
if (person._type != INVALID) {
if (_goToScene == -1 || _cAnim.size() == 0) {
@@ -806,6 +807,27 @@ int TattooScene::startCAnim(int cAnimNum, int playRate) {
error("TODO: startCAnim");
}
+void TattooScene::setNPCPath(int npc) {
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
+ Talk &talk = *_vm->_talk;
+
+ people[npc].clearNPC();
+ people[npc]._name = Common::String::format("WATS%.2dA", _currentScene);
+
+ // If we're in the middle of a script that will continue once the scene is loaded,
+ // return without calling the path script
+ if (talk._scriptMoreFlag == 1 || talk._scriptMoreFlag == 3)
+ return;
+
+ // Turn off all the NPCs, since the talk script will turn them back on as needed
+ for (uint idx = 0; idx < MAX_NPC; ++idx)
+ people[idx + 1]._type = INVALID;
+
+ // Call the path script for the scene
+ Common::String pathFile = Common::String::format("PATH%.2dA", _currentScene);
+ talk.talkTo(pathFile);
+}
+
} // End of namespace Tattoo
} // End of namespace Sherlock
diff --git a/engines/sherlock/tattoo/tattoo_scene.h b/engines/sherlock/tattoo/tattoo_scene.h
index c3b238438e..7c432b4268 100644
--- a/engines/sherlock/tattoo/tattoo_scene.h
+++ b/engines/sherlock/tattoo/tattoo_scene.h
@@ -74,6 +74,13 @@ private:
* Makes a greyscale translation table for each palette entry in the table
*/
void setupBGArea(const byte cMap[PALETTE_SIZE]);
+
+ /**
+ * Resets the NPC path information when entering a new scene.
+ * @remarks The default talk file for the given NPC is set to WATS##A, where ## is
+ * the scene number being entered
+ */
+ void setNPCPath(int npc);
protected:
/**
* Loads the data associated for a given scene. The room resource file's format is:
diff --git a/engines/sherlock/tattoo/tattoo_talk.cpp b/engines/sherlock/tattoo/tattoo_talk.cpp
index ea1f16db48..0d2e1a99cc 100644
--- a/engines/sherlock/tattoo/tattoo_talk.cpp
+++ b/engines/sherlock/tattoo/tattoo_talk.cpp
@@ -254,7 +254,7 @@ OpcodeReturn TattooTalk::cmdWalkHolmesToCoords(const byte *&str) {
OpcodeReturn TattooTalk::cmdGotoScene(const byte *&str) {
Map &map = *_vm->_map;
- People &people = *_vm->_people;
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
Scene &scene = *_vm->_scene;
scene._goToScene = str[1] - 1;
@@ -307,8 +307,8 @@ OpcodeReturn TattooTalk::cmdNextSong(const byte *&str) {
OpcodeReturn TattooTalk::cmdNPCLabelGoto(const byte *&str) {
int npcNum = *++str;
- People &people = *_vm->_people;
- Person &person = people[npcNum];
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
+ TattooPerson &person = people[npcNum];
if (person._resetNPCPath) {
person._npcIndex = person._resetNPCPath = person._npcPause = 0;
@@ -325,8 +325,8 @@ OpcodeReturn TattooTalk::cmdNPCLabelGoto(const byte *&str) {
OpcodeReturn TattooTalk::cmdNPCLabelIfFlagGoto(const byte *&str) {
int npcNum = *++str;
- People &people = *_vm->_people;
- Person &person = people[npcNum];
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
+ TattooPerson &person = people[npcNum];
if (person._resetNPCPath) {
person._npcIndex = person._resetNPCPath = person._npcPause = 0;
@@ -345,8 +345,8 @@ OpcodeReturn TattooTalk::cmdNPCLabelIfFlagGoto(const byte *&str) {
OpcodeReturn TattooTalk::cmdNPCLabelSet(const byte *&str) {
int npcNum = *++str;
- People &people = *_vm->_people;
- Person &person = people[npcNum];
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
+ TattooPerson &person = people[npcNum];
if (person._resetNPCPath) {
person._npcIndex = person._resetNPCPath = person._npcPause = 0;
@@ -366,8 +366,8 @@ OpcodeReturn TattooTalk::cmdPlaySong(const byte *&str) { error("TODO: script opc
OpcodeReturn TattooTalk::cmdRestorePeopleSequence(const byte *&str) {
int npcNum = *++str - 1;
- People &people = *_vm->_people;
- Person &person = people[npcNum];
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
+ TattooPerson &person = people[npcNum];
person._misc = 0;
if (person._seqTo) {
@@ -384,7 +384,7 @@ OpcodeReturn TattooTalk::cmdRestorePeopleSequence(const byte *&str) {
OpcodeReturn TattooTalk::cmdSetNPCDescOnOff(const byte *&str) {
int npcNum = *++str;
++str;
- People &people = *_vm->_people;
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
Person &person = people[npcNum];
// Copy over the NPC examine text until we reach a stop marker, which is
@@ -404,8 +404,8 @@ OpcodeReturn TattooTalk::cmdSetNPCDescOnOff(const byte *&str) {
OpcodeReturn TattooTalk::cmdSetNPCInfoLine(const byte *&str) {
int npcNum = *++str;
- People &people = *_vm->_people;
- Person &person = people[npcNum];
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
+ TattooPerson &person = people[npcNum];
person._description = "";
int len = *++str;
@@ -417,7 +417,7 @@ OpcodeReturn TattooTalk::cmdSetNPCInfoLine(const byte *&str) {
}
OpcodeReturn TattooTalk::cmdSetNPCOff(const byte *&str) {
- People &people = *_vm->_people;
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
int npcNum = *++str;
people[npcNum]._type = REMOVE;
@@ -425,7 +425,7 @@ OpcodeReturn TattooTalk::cmdSetNPCOff(const byte *&str) {
}
OpcodeReturn TattooTalk::cmdSetNPCOn(const byte *&str) {
- People &people = *_vm->_people;
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
int npcNum = *++str;
people[npcNum]._type = CHARACTER;
@@ -434,8 +434,8 @@ OpcodeReturn TattooTalk::cmdSetNPCOn(const byte *&str) {
OpcodeReturn TattooTalk::cmdSetNPCPathDest(const byte *&str) {
int npcNum = *++str;
- People &people = *_vm->_people;
- Person &person = people[npcNum];
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
+ TattooPerson &person = people[npcNum];
if (person._resetNPCPath) {
person._npcIndex = person._resetNPCPath = person._npcPause = 0;
@@ -455,8 +455,8 @@ OpcodeReturn TattooTalk::cmdSetNPCPathDest(const byte *&str) {
OpcodeReturn TattooTalk::cmdSetNPCPathPause(const byte *&str) {
int npcNum = *++str;
- People &people = *_vm->_people;
- Person &person = people[npcNum];
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
+ TattooPerson &person = people[npcNum];
if (person._resetNPCPath) {
person._npcIndex = person._resetNPCPath = person._npcPause = 0;
@@ -475,8 +475,8 @@ OpcodeReturn TattooTalk::cmdSetNPCPathPause(const byte *&str) {
OpcodeReturn TattooTalk::cmdSetNPCPathPauseTakingNotes(const byte *&str) {
int npcNum = *++str;
- People &people = *_vm->_people;
- Person &person = people[npcNum];
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
+ TattooPerson &person = people[npcNum];
if (person._resetNPCPath) {
person._npcIndex = person._resetNPCPath = person._npcPause = 0;
@@ -495,8 +495,8 @@ OpcodeReturn TattooTalk::cmdSetNPCPathPauseTakingNotes(const byte *&str) {
OpcodeReturn TattooTalk::cmdSetNPCPathPauseLookingHolmes(const byte *&str) {
int npcNum = *++str;
- People &people = *_vm->_people;
- Person &person = people[npcNum];
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
+ TattooPerson &person = people[npcNum];
if (person._resetNPCPath) {
person._npcIndex = person._resetNPCPath = person._npcPause = 0;
@@ -516,7 +516,7 @@ OpcodeReturn TattooTalk::cmdSetNPCPathPauseLookingHolmes(const byte *&str) {
OpcodeReturn TattooTalk::cmdSetNPCPosition(const byte *&str) {
int npcNum = *++str - 1;
++str;
- People &people = *_vm->_people;
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
Person &person = people[npcNum];
int32 posX = (str[0] - 1) * 256 + str[1] - 1;
if (posX > 16384)
@@ -557,8 +557,8 @@ OpcodeReturn TattooTalk::cmdSetNPCPosition(const byte *&str) {
OpcodeReturn TattooTalk::cmdSetNPCTalkFile(const byte *&str) {
int npcNum = *++str;
- People &people = *_vm->_people;
- Person &person = people[npcNum];
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
+ TattooPerson &person = people[npcNum];
if (person._resetNPCPath) {
person._npcIndex = person._resetNPCPath = person._npcPause = 0;
@@ -578,7 +578,7 @@ OpcodeReturn TattooTalk::cmdSetNPCTalkFile(const byte *&str) {
OpcodeReturn TattooTalk::cmdSetNPCVerb(const byte *&str) {
int npcNum = *++str;
int verbNum = *++str - 1;
- People &people = *_vm->_people;
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
Common::String &verb = people[npcNum]._use[verbNum]._verb;
for (int x = 0; x < 12; x++) {
@@ -604,7 +604,7 @@ OpcodeReturn TattooTalk::cmdSetNPCVerb(const byte *&str) {
OpcodeReturn TattooTalk::cmdSetNPCVerbCAnimation(const byte *&str) {
int npcNum = *++str;
int verbNum = *++str - 1;
- People &people = *_vm->_people;
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
UseType &useType = people[npcNum]._use[verbNum];
useType._cAnimNum = (str[1] - 1) & 127;
@@ -617,7 +617,7 @@ OpcodeReturn TattooTalk::cmdSetNPCVerbCAnimation(const byte *&str) {
OpcodeReturn TattooTalk::cmdSetNPCVerbScript(const byte *&str) {
int npcNum = *++str;
int verbNum = *++str - 1;
- People &people = *_vm->_people;
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
UseType &useType = people[npcNum]._use[verbNum];
Common::String &name = useType._names[0];
name.setChar('*', 0);
@@ -641,7 +641,7 @@ OpcodeReturn TattooTalk::cmdSetNPCVerbScript(const byte *&str) {
OpcodeReturn TattooTalk::cmdSetNPCVerbTarget(const byte *&str) {
int npcNum = *++str;
int verbNum = *++str - 1;
- People &people = *_vm->_people;
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
Common::String &target = people[npcNum]._use[verbNum]._target;
for (int x = 0; x < 12; x++) {
@@ -664,7 +664,7 @@ OpcodeReturn TattooTalk::cmdSetNPCVerbTarget(const byte *&str) {
OpcodeReturn TattooTalk::cmdSetNPCWalkGraphics(const byte *&str) {
int npcNum = *++str - 1;
- People &people = *_vm->_people;
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
Person &person = people[npcNum];
// Build up walk library name for the given NPC