[Scummvm-cvs-logs] scummvm master -> 5df022d75b94aff0c5e0c623669222a1d539b0cf
bluegr
bluegr at gmail.com
Thu Jun 11 23:37:31 CEST 2015
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
92ba3d1a29 SHERLOCK: Implement the rest of the NPC path opcodes for Rose Tattoo
5df022d75b SHERLOCK: Implement the cmdRestorePeopleSequence opcode for Rose Tattoo
Commit: 92ba3d1a29fbbb4506cbaffd023e76a560f0e43d
https://github.com/scummvm/scummvm/commit/92ba3d1a29fbbb4506cbaffd023e76a560f0e43d
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-06-12T00:35:42+03:00
Commit Message:
SHERLOCK: Implement the rest of the NPC path opcodes for Rose Tattoo
This includes cmdNPCLabelGoto, cmdNPCLabelIfFlagGoto, cmdNPCLabelSet,
cmdSetNPCPathDest, cmdSetNPCPathPause, cmdSetNPCPathPauseTakingNotes,
cmdSetNPCPathPauseLookingHolmes and cmdSetNPCTalkFile
Changed paths:
engines/sherlock/people.cpp
engines/sherlock/people.h
engines/sherlock/tattoo/tattoo_talk.cpp
diff --git a/engines/sherlock/people.cpp b/engines/sherlock/people.cpp
index 18621ba..e4892b7 100644
--- a/engines/sherlock/people.cpp
+++ b/engines/sherlock/people.cpp
@@ -72,9 +72,10 @@ 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;
- _updateNPCPath = false;
_npcIndex = 0;
_npcStack = 0;
+ _npcMoved = false;
+ _resetNPCPath = true;
_savedNpcSequence = 0;
_savedNpcFrame = 0;
_updateNPCPath = false;
diff --git a/engines/sherlock/people.h b/engines/sherlock/people.h
index c15248c..cd790ea 100644
--- a/engines/sherlock/people.h
+++ b/engines/sherlock/people.h
@@ -69,6 +69,8 @@ public:
bool _npcPause;
byte _npcPath[MAX_NPC_PATH];
Common::String _npcName;
+ bool _npcMoved;
+ bool _resetNPCPath;
int _savedNpcSequence;
int _savedNpcFrame;
int _tempX;
diff --git a/engines/sherlock/tattoo/tattoo_talk.cpp b/engines/sherlock/tattoo/tattoo_talk.cpp
index 148a10a..4516dcd 100644
--- a/engines/sherlock/tattoo/tattoo_talk.cpp
+++ b/engines/sherlock/tattoo/tattoo_talk.cpp
@@ -287,9 +287,62 @@ OpcodeReturn TattooTalk::cmdNextSong(const byte *&str) {
return RET_SUCCESS;
}
-OpcodeReturn TattooTalk::cmdNPCLabelGoto(const byte *&str) { error("TODO: script opcode"); }
-OpcodeReturn TattooTalk::cmdNPCLabelIfFlagGoto(const byte *&str) { error("TODO: script opcode"); }
-OpcodeReturn TattooTalk::cmdNPCLabelSet(const byte *&str) { error("TODO: script opcode"); }
+OpcodeReturn TattooTalk::cmdNPCLabelGoto(const byte *&str) {
+ int npcNum = *++str;
+ People &people = *_vm->_people;
+ Person &person = people[npcNum];
+
+ if (person._resetNPCPath) {
+ person._npcIndex = person._resetNPCPath = person._npcPause = 0;
+ memset(person._npcPath, 0, 100);
+ }
+
+ person._npcPath[person._npcIndex] = 8;
+ person._npcPath[person._npcIndex + 1] = str[1];
+ person._npcIndex += 2;
+ str++;
+
+ return RET_SUCCESS;
+}
+
+OpcodeReturn TattooTalk::cmdNPCLabelIfFlagGoto(const byte *&str) {
+ int npcNum = *++str;
+ People &people = *_vm->_people;
+ Person &person = people[npcNum];
+
+ if (person._resetNPCPath) {
+ person._npcIndex = person._resetNPCPath = person._npcPause = 0;
+ memset(person._npcPath, 0, 100);
+ }
+
+ person._npcPath[person._npcIndex] = 9;
+ for (int i = 1; i <= 3; i++)
+ person._npcPath[person._npcIndex + i] = str[i];
+
+ person._npcIndex += 4;
+ str += 3;
+
+ return RET_SUCCESS;
+}
+
+OpcodeReturn TattooTalk::cmdNPCLabelSet(const byte *&str) {
+ int npcNum = *++str;
+ People &people = *_vm->_people;
+ Person &person = people[npcNum];
+
+ if (person._resetNPCPath) {
+ person._npcIndex = person._resetNPCPath = person._npcPause = 0;
+ memset(person._npcPath, 0, 100);
+ }
+
+ person._npcPath[person._npcIndex] = 7;
+ person._npcPath[person._npcIndex + 1] = str[1];
+ person._npcIndex += 2;
+ str++;
+
+ return RET_SUCCESS;
+}
+
OpcodeReturn TattooTalk::cmdPassword(const byte *&str) { error("TODO: script opcode"); }
OpcodeReturn TattooTalk::cmdPlaySong(const byte *&str) { error("TODO: script opcode"); }
OpcodeReturn TattooTalk::cmdRestorePeopleSequence(const byte *&str) { error("TODO: script opcode"); }
@@ -345,10 +398,86 @@ OpcodeReturn TattooTalk::cmdSetNPCOn(const byte *&str) {
return RET_SUCCESS;
}
-OpcodeReturn TattooTalk::cmdSetNPCPathDest(const byte *&str) { error("TODO: script opcode"); }
-OpcodeReturn TattooTalk::cmdSetNPCPathPause(const byte *&str) { error("TODO: script opcode"); }
-OpcodeReturn TattooTalk::cmdSetNPCPathPauseTakingNotes(const byte *&str) { error("TODO: script opcode"); }
-OpcodeReturn TattooTalk::cmdSetNPCPathPauseLookingHolmes(const byte *&str) { error("TODO: script opcode"); }
+OpcodeReturn TattooTalk::cmdSetNPCPathDest(const byte *&str) {
+ int npcNum = *++str;
+ People &people = *_vm->_people;
+ Person &person = people[npcNum];
+
+ if (person._resetNPCPath) {
+ person._npcIndex = person._resetNPCPath = person._npcPause = 0;
+ memset(person._npcPath, 0, 100);
+ }
+
+ person._npcPath[person._npcIndex] = 1;
+ for (int i = 1; i <= 4; i++)
+ person._npcPath[person._npcIndex + i] = str[i];
+ person._npcPath[person._npcIndex + 5] = DIRECTION_CONVERSION[str[5] - 1] + 1;
+
+ person._npcIndex += 6;
+ str += 5;
+
+ return RET_SUCCESS;
+}
+
+OpcodeReturn TattooTalk::cmdSetNPCPathPause(const byte *&str) {
+ int npcNum = *++str;
+ People &people = *_vm->_people;
+ Person &person = people[npcNum];
+
+ if (person._resetNPCPath) {
+ person._npcIndex = person._resetNPCPath = person._npcPause = 0;
+ memset(person._npcPath, 0, 100);
+ }
+
+ person._npcPath[person._npcIndex] = 2;
+ for (int i = 1; i <= 2; i++)
+ person._npcPath[person._npcIndex + i] = str[i];
+
+ person._npcIndex += 3;
+ str += 2;
+
+ return RET_SUCCESS;
+}
+
+OpcodeReturn TattooTalk::cmdSetNPCPathPauseTakingNotes(const byte *&str) {
+ int npcNum = *++str;
+ People &people = *_vm->_people;
+ Person &person = people[npcNum];
+
+ if (person._resetNPCPath) {
+ person._npcIndex = person._resetNPCPath = person._npcPause = 0;
+ memset(person._npcPath, 0, 100);
+ }
+
+ person._npcPath[person._npcIndex] = 5;
+ for (int i = 1; i <= 2; i++)
+ person._npcPath[person._npcIndex + i] = str[i];
+
+ person._npcIndex += 3;
+ str += 2;
+
+ return RET_SUCCESS;
+}
+
+OpcodeReturn TattooTalk::cmdSetNPCPathPauseLookingHolmes(const byte *&str) {
+ int npcNum = *++str;
+ People &people = *_vm->_people;
+ Person &person = people[npcNum];
+
+ if (person._resetNPCPath) {
+ person._npcIndex = person._resetNPCPath = person._npcPause = 0;
+ memset(person._npcPath, 0, 100);
+ }
+
+ person._npcPath[person._npcIndex] = 6;
+ for (int i = 1; i <= 2; i++)
+ person._npcPath[person._npcIndex + i] = str[i];
+
+ person._npcIndex += 3;
+ str += 2;
+
+ return RET_SUCCESS;
+}
OpcodeReturn TattooTalk::cmdSetNPCPosition(const byte *&str) {
int npcNum = *++str - 1;
@@ -392,7 +521,25 @@ OpcodeReturn TattooTalk::cmdSetNPCPosition(const byte *&str) {
return RET_SUCCESS;
}
-OpcodeReturn TattooTalk::cmdSetNPCTalkFile(const byte *&str) { error("TODO: script opcode"); }
+OpcodeReturn TattooTalk::cmdSetNPCTalkFile(const byte *&str) {
+ int npcNum = *++str;
+ People &people = *_vm->_people;
+ Person &person = people[npcNum];
+
+ if (person._resetNPCPath) {
+ person._npcIndex = person._resetNPCPath = person._npcPause = 0;
+ memset(person._npcPath, 0, 100);
+ }
+
+ person._npcPath[person._npcIndex] = 3;
+ for (int i = 1; i <= 8; i++)
+ person._npcPath[person._npcIndex + i] = str[i];
+
+ person._npcIndex += 9;
+ str += 8;
+
+ return RET_SUCCESS;
+}
OpcodeReturn TattooTalk::cmdSetNPCVerb(const byte *&str) {
int npcNum = *++str;
Commit: 5df022d75b94aff0c5e0c623669222a1d539b0cf
https://github.com/scummvm/scummvm/commit/5df022d75b94aff0c5e0c623669222a1d539b0cf
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-06-12T00:35:42+03:00
Commit Message:
SHERLOCK: Implement the cmdRestorePeopleSequence opcode for Rose Tattoo
Changed paths:
engines/sherlock/tattoo/tattoo_talk.cpp
diff --git a/engines/sherlock/tattoo/tattoo_talk.cpp b/engines/sherlock/tattoo/tattoo_talk.cpp
index 4516dcd..a46ab40 100644
--- a/engines/sherlock/tattoo/tattoo_talk.cpp
+++ b/engines/sherlock/tattoo/tattoo_talk.cpp
@@ -345,7 +345,23 @@ OpcodeReturn TattooTalk::cmdNPCLabelSet(const byte *&str) {
OpcodeReturn TattooTalk::cmdPassword(const byte *&str) { error("TODO: script opcode"); }
OpcodeReturn TattooTalk::cmdPlaySong(const byte *&str) { error("TODO: script opcode"); }
-OpcodeReturn TattooTalk::cmdRestorePeopleSequence(const byte *&str) { error("TODO: script opcode"); }
+
+OpcodeReturn TattooTalk::cmdRestorePeopleSequence(const byte *&str) {
+ int npcNum = *++str - 1;
+ People &people = *_vm->_people;
+ Person &person = people[npcNum];
+ person._misc = 0;
+
+ if (person._seqTo) {
+ person._walkSequences[person._sequenceNumber]._sequences[person._frameNumber] = person._seqTo;
+ person._seqTo = 0;
+ }
+ person._sequenceNumber = person._savedNpcSequence;
+ person._frameNumber = person._savedNpcFrame;
+ person.checkWalkGraphics();
+
+ return RET_SUCCESS;
+}
OpcodeReturn TattooTalk::cmdSetNPCDescOnOff(const byte *&str) {
int npcNum = *++str;
More information about the Scummvm-git-logs
mailing list