Skip to content

Commit

Permalink
VOYEUR: Workaround original game using invalid hotspot Ids
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Aug 7, 2017
1 parent da4d4d8 commit 659fdfa
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions engines/voyeur/data.cpp
Expand Up @@ -43,7 +43,7 @@ SVoy::SVoy(VoyeurEngine *vm):_vm(vm) {
_abortInterface = false;
_isAM = false;
Common::fill(&_phoneCallsReceived[0], &_phoneCallsReceived[5], false);
Common::fill(&_roomHotspotsEnabled[0], &_roomHotspotsEnabled[20], false);
Common::fill(&_roomHotspotsEnabled[0], &_roomHotspotsEnabled[32], false);
_victimMurdered = false;

_audioVisualStartTime = 0;
Expand Down Expand Up @@ -118,7 +118,8 @@ void SVoy::synchronize(Common::Serializer &s) {
_audioHotspotTimes.synchronize(s);
_evidenceHotspotTimes.synchronize(s);

for (int idx = 0; idx < 20; ++idx) {
int count = s.getVersion() == 1 ? 20 : 32;
for (int idx = 0; idx < count; ++idx) {
s.syncAsByte(_roomHotspotsEnabled[idx]);
}

Expand Down
2 changes: 1 addition & 1 deletion engines/voyeur/data.h
Expand Up @@ -113,7 +113,7 @@ class SVoy {
bool _abortInterface;
bool _isAM;
bool _phoneCallsReceived[5];
bool _roomHotspotsEnabled[20];
bool _roomHotspotsEnabled[32];
bool _victimMurdered;

int _aptLoadMode;
Expand Down
2 changes: 2 additions & 0 deletions engines/voyeur/voyeur.cpp
Expand Up @@ -793,6 +793,7 @@ void VoyeurEngine::loadGame(int slot) {
header._thumbnail->free();
delete header._thumbnail;

serializer.setVersion(header._version);
synchronize(serializer);

delete saveFile;
Expand Down Expand Up @@ -821,6 +822,7 @@ Common::Error VoyeurEngine::saveGameState(int slot, const Common::String &desc)
Common::Serializer serializer(NULL, saveFile);

// Synchronise the data
serializer.setVersion(VOYEUR_SAVEGAME_VERSION);
synchronize(serializer);

saveFile->finalize();
Expand Down
2 changes: 1 addition & 1 deletion engines/voyeur/voyeur.h
Expand Up @@ -296,7 +296,7 @@ class VoyeurEngine : public Engine {
void showEndingNews();
};

#define VOYEUR_SAVEGAME_VERSION 1
#define VOYEUR_SAVEGAME_VERSION 2

/**
* Header for Voyeur savegame files
Expand Down

0 comments on commit 659fdfa

Please sign in to comment.