aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction
diff options
context:
space:
mode:
authorNicola Mettifogo2010-06-19 04:50:44 +0000
committerNicola Mettifogo2010-06-19 04:50:44 +0000
commitd7a165b9f256244ed5b4e7f48cea82a540cf1698 (patch)
treefc9fb09744e2f5c17f553f5b8956b75be9962509 /engines/parallaction
parent5b3075bd653f888d814abd32b878870c2388668c (diff)
downloadscummvm-rg350-d7a165b9f256244ed5b4e7f48cea82a540cf1698.tar.gz
scummvm-rg350-d7a165b9f256244ed5b4e7f48cea82a540cf1698.tar.bz2
scummvm-rg350-d7a165b9f256244ed5b4e7f48cea82a540cf1698.zip
Implemented PART command for BRA, largely based on patch #3005434 by fuzzie.
svn-id: r50039
Diffstat (limited to 'engines/parallaction')
-rw-r--r--engines/parallaction/exec_br.cpp2
-rw-r--r--engines/parallaction/parallaction.h3
-rw-r--r--engines/parallaction/parallaction_br.cpp22
3 files changed, 22 insertions, 5 deletions
diff --git a/engines/parallaction/exec_br.cpp b/engines/parallaction/exec_br.cpp
index e145c0da94..76e6f0dfe0 100644
--- a/engines/parallaction/exec_br.cpp
+++ b/engines/parallaction/exec_br.cpp
@@ -293,7 +293,7 @@ DECLARE_COMMAND_OPCODE(text) {
DECLARE_COMMAND_OPCODE(part) {
- warning("Parallaction_br::cmdOp_part not yet implemented");
+ _vm->_nextPart = ctxt._cmd->_counterValue;
}
diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h
index 151bfd958d..7bbdf79f1c 100644
--- a/engines/parallaction/parallaction.h
+++ b/engines/parallaction/parallaction.h
@@ -548,6 +548,9 @@ public:
const char **_audioCommandsNamesRes;
static const char *_partNames[];
int _part;
+ int _nextPart;
+
+
#if 0 // disabled since I couldn't find any references to lip sync in the scripts
int16 _lipSyncVal;
uint _subtitleLipSync;
diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp
index c752c85d4f..5023a05d85 100644
--- a/engines/parallaction/parallaction_br.cpp
+++ b/engines/parallaction/parallaction_br.cpp
@@ -86,6 +86,7 @@ Common::Error Parallaction_br::init() {
_walker = new PathWalker_BR;
_part = -1;
+ _nextPart = -1;
_subtitle[0] = 0;
_subtitle[1] = 0;
@@ -260,6 +261,8 @@ void Parallaction_br::cleanupGame() {
_globalFlagsNames = 0;
_objectsNames = 0;
_countersNames = 0;
+
+ memset(_zoneFlags, 0, sizeof(_zoneFlags));
}
@@ -272,13 +275,23 @@ void Parallaction_br::changeLocation() {
strcpy(location, _newLocationName.c_str());
char *partStr = strrchr(location, '.');
- if (partStr) {
+ if (partStr || _nextPart != -1) {
cleanupGame();
- int n = partStr - location;
- location[n] = '\0';
+ // more cleanup needed for part changes (see also saveload)
+ _globalFlags = 0;
+ cleanInventory(true);
+ strcpy(_characterName1, "null");
+
+ if (partStr) {
+ int n = partStr - location;
+ location[n] = '\0';
+
+ _part = atoi(++partStr);
+ } else {
+ _part = _nextPart;
+ }
- _part = atoi(++partStr);
if (getFeatures() & GF_DEMO) {
assert(_part == 1);
} else {
@@ -357,6 +370,7 @@ void Parallaction_br::changeLocation() {
_engineFlags &= ~kEngineChangeLocation;
_newLocationName.clear();
+ _nextPart = -1;
}
// FIXME: Parallaction_br::parseLocation() is now a verbatim copy of the same routine from Parallaction_ns.