aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/voyeur/data.cpp7
-rw-r--r--engines/voyeur/data.h2
-rw-r--r--engines/voyeur/files_threads.cpp40
-rw-r--r--engines/voyeur/voyeur.cpp9
-rw-r--r--engines/voyeur/voyeur_game.cpp8
5 files changed, 38 insertions, 28 deletions
diff --git a/engines/voyeur/data.cpp b/engines/voyeur/data.cpp
index 1e40ff7096..77e33371b0 100644
--- a/engines/voyeur/data.cpp
+++ b/engines/voyeur/data.cpp
@@ -88,7 +88,12 @@ void SVoy::synchronize(Common::Serializer &s) {
s.syncAsSint16LE(_vocSecondsOffset);
s.syncAsSint16LE(_field46E);
s.syncAsSint16LE(_field470);
- s.syncAsSint16LE(_field472);
+
+ s.syncAsSint16LE(_aptLoadMode);
+ if (s.isLoading())
+ // Reset apartment loading mode to initial game value
+ _aptLoadMode = 140;
+
s.syncAsSint16LE(_transitionId);
s.syncAsSint16LE(_RTVLimit);
s.syncAsSint16LE(_field478);
diff --git a/engines/voyeur/data.h b/engines/voyeur/data.h
index 4fadf5b29b..53c6ebebbb 100644
--- a/engines/voyeur/data.h
+++ b/engines/voyeur/data.h
@@ -70,7 +70,7 @@ public:
int _vocSecondsOffset;
bool _field46E;
int _field470;
- int _field472;
+ int _aptLoadMode;
int _transitionId;
int _RTVLimit;
int _field478;
diff --git a/engines/voyeur/files_threads.cpp b/engines/voyeur/files_threads.cpp
index 58ce373b75..fac44c7fbc 100644
--- a/engines/voyeur/files_threads.cpp
+++ b/engines/voyeur/files_threads.cpp
@@ -734,31 +734,31 @@ void ThreadResource::parsePlayCommands() {
break;
case 19:
- _vm->_voy._field472 = 140;
+ _vm->_voy._aptLoadMode = 140;
loadTheApt();
- _vm->_voy._field472 = 141;
+ _vm->_voy._aptLoadMode = 141;
freeTheApt();
break;
case 20:
- _vm->_voy._field472 = -1;
+ _vm->_voy._aptLoadMode = -1;
loadTheApt();
- _vm->_voy._field472 = 141;
+ _vm->_voy._aptLoadMode = 141;
freeTheApt();
break;
case 21:
- _vm->_voy._field472 = -1;
+ _vm->_voy._aptLoadMode = -1;
loadTheApt();
- _vm->_voy._field472 = 140;
+ _vm->_voy._aptLoadMode = 140;
freeTheApt();
break;
case 23:
_vm->_voy._transitionId = 17;
- _vm->_voy._field472 = -1;
+ _vm->_voy._aptLoadMode = -1;
loadTheApt();
- _vm->_voy._field472 = 144;
+ _vm->_voy._aptLoadMode = 144;
freeTheApt();
break;
@@ -1118,18 +1118,18 @@ int ThreadResource::doApt() {
switch (hotspotId) {
case 0:
- _vm->_voy._field472 = 140;
+ _vm->_voy._aptLoadMode = 140;
break;
case 1:
- _vm->_voy._field472 = 143;
+ _vm->_voy._aptLoadMode = 143;
break;
case 2:
- _vm->_voy._field472 = 142;
+ _vm->_voy._aptLoadMode = 142;
case 5:
- _vm->_voy._field472 = 141;
+ _vm->_voy._aptLoadMode = 141;
break;
default:
- _vm->_voy._field472 = -1;
+ _vm->_voy._aptLoadMode = -1;
break;
}
@@ -1650,13 +1650,13 @@ void ThreadResource::loadTheApt() {
break;
}
- if (_vm->_voy._field472 == 143)
- _vm->_voy._field472 = -1;
+ if (_vm->_voy._aptLoadMode == 143)
+ _vm->_voy._aptLoadMode = -1;
- if (_vm->_voy._field472 != -1) {
+ if (_vm->_voy._aptLoadMode != -1) {
doAptAnim(1);
_vm->_bVoy->getBoltGroup(_vm->_playStampGroupId);
- _vm->_voy._field472 = -1;
+ _vm->_voy._aptLoadMode = -1;
_vm->_graphicsManager._backgroundPage = _vm->_bVoy->boltEntry(
_vm->_playStampGroupId + 5)._picResource;
(*_vm->_graphicsManager._vPort)->setupViewPort(
@@ -1686,13 +1686,13 @@ void ThreadResource::freeTheApt() {
_vm->_currentVocId = -1;
}
- if (_vm->_voy._field472 == -1) {
+ if (_vm->_voy._aptLoadMode == -1) {
_vm->_graphicsManager.fadeDownICF(6);
} else {
doAptAnim(2);
}
- if (_vm->_voy._field472 == 140) {
+ if (_vm->_voy._aptLoadMode == 140) {
_vm->_graphicsManager.screenReset();
_vm->_graphicsManager.resetPalette();
}
@@ -1708,7 +1708,7 @@ void ThreadResource::doAptAnim(int mode) {
// Figure out the resource to use
int id = 0;
- switch (_vm->_voy._field472) {
+ switch (_vm->_voy._aptLoadMode) {
case 140:
id = 0x5A00;
break;
diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp
index 889b6fdeaa..06617be585 100644
--- a/engines/voyeur/voyeur.cpp
+++ b/engines/voyeur/voyeur.cpp
@@ -123,7 +123,7 @@ void VoyeurEngine::globalInitBolt() {
_voy._field478 = 1;
_voy._field4376 = _voy._field4378 = 127;
_voy._field4F2 = 9999;
- _voy._field472 = -1;
+ _voy._aptLoadMode = -1;
_voy._field478 = 256;
_voy._curICF0 = _graphicsManager._palFlag ? 0xFFFFA5E0 : 0x5F90;
@@ -204,7 +204,7 @@ bool VoyeurEngine::doHeadTitle() {
}
}
- _voy._field472 = 140;
+ _voy._aptLoadMode = 140;
return true;
}
@@ -687,8 +687,13 @@ void VoyeurEngine::loadGame(int slot) {
return;
Common::Serializer serializer(saveFile, NULL);
+
+ // Store the current time index before the game is loaded
_checkTransitionId = _voy._transitionId;
+ // Stop any playing sound
+ _soundManager.stopVOCPlay();
+
// Read in the savegame header
VoyeurSavegameHeader header;
if (!header.read(saveFile))
diff --git a/engines/voyeur/voyeur_game.cpp b/engines/voyeur/voyeur_game.cpp
index fe53e26252..9863695e54 100644
--- a/engines/voyeur/voyeur_game.cpp
+++ b/engines/voyeur/voyeur_game.cpp
@@ -62,19 +62,19 @@ void VoyeurEngine::playStamp() {
if (buttonId == -2) {
switch (_mainThread->doApt()) {
case 0:
- _voy._field472 = 140;
+ _voy._aptLoadMode = 140;
break;
case 1:
_voy._field478 &= ~1;
_voy._field46E = true;
_mainThread->chooseSTAMPButton(22);
- _voy._field472 = 143;
+ _voy._aptLoadMode = 143;
break;
case 2:
_voy._field478 &= ~1;
reviewTape();
_voy._field46E = true;
- _voy._field472 = 142;
+ _voy._aptLoadMode = 142;
break;
case 3:
_voy._field478 &= ~1;
@@ -86,7 +86,7 @@ void VoyeurEngine::playStamp() {
case 5:
doGossip();
_voy._field46E = true;
- _voy._field472 = 141;
+ _voy._aptLoadMode = 141;
_voy._field478 &= ~0x100;
break;
default: