aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2014-02-02 22:38:27 -0500
committerPaul Gilbert2014-02-02 22:38:27 -0500
commit4ef57db61a7730d0ff1fc19658cb8726ee35b9ca (patch)
tree21925bc8aafca9441d5e7fee7ee77f64ab58de23
parentf88985dc649b81e13490d7f3f949838a9b6680c9 (diff)
downloadscummvm-rg350-4ef57db61a7730d0ff1fc19658cb8726ee35b9ca.tar.gz
scummvm-rg350-4ef57db61a7730d0ff1fc19658cb8726ee35b9ca.tar.bz2
scummvm-rg350-4ef57db61a7730d0ff1fc19658cb8726ee35b9ca.zip
VOYEUR: General field renaming and comments
-rw-r--r--engines/voyeur/data.cpp14
-rw-r--r--engines/voyeur/data.h4
-rw-r--r--engines/voyeur/files.h37
-rw-r--r--engines/voyeur/files_threads.cpp47
-rw-r--r--engines/voyeur/voyeur.cpp14
-rw-r--r--engines/voyeur/voyeur.h2
-rw-r--r--engines/voyeur/voyeur_game.cpp36
7 files changed, 93 insertions, 61 deletions
diff --git a/engines/voyeur/data.cpp b/engines/voyeur/data.cpp
index 8bcf32fb2f..3d91b7daa6 100644
--- a/engines/voyeur/data.cpp
+++ b/engines/voyeur/data.cpp
@@ -77,13 +77,13 @@ void SVoy::synchronize(Common::Serializer &s) {
s.syncAsSint16LE(_field468);
s.syncAsSint16LE(_field46A);
s.syncAsSint16LE(_vocSecondsOffset);
- s.syncAsSint16LE(_field46E);
+ s.syncAsSint16LE(_abortInterface);
s.syncAsSint16LE(_field470);
s.syncAsSint16LE(_aptLoadMode);
s.syncAsSint16LE(_transitionId);
s.syncAsSint16LE(_RTVLimit);
s.syncAsSint16LE(_eventFlags);
- s.syncAsSint16LE(_field47A);
+ s.syncAsSint16LE(_boltGroupId2);
s.syncAsSint16LE(_field4AC);
s.syncAsSint16LE(_field4B8);
@@ -157,7 +157,7 @@ void SVoy::addEvidEventStart(int v) {
e._isAM = _isAM;
e._type = EVTYPE_EVID;
e._audioVideoId = _vm->_playStampGroupId;
- e._computerOn = _field47A;
+ e._computerOn = _boltGroupId2;
e._computerOff = v;
}
@@ -188,7 +188,7 @@ void SVoy::addComputerEventEnd(int v) {
void SVoy::reviewAnEvidEvent(int eventIndex) {
VoyeurEvent &e = _events[eventIndex];
_vm->_playStampGroupId = e._audioVideoId;
- _field47A = e._computerOn;
+ _boltGroupId2 = e._computerOn;
int frameOff = e._computerOff;
if (_vm->_bVoy->getBoltGroup(_vm->_playStampGroupId)) {
@@ -201,9 +201,9 @@ void SVoy::reviewAnEvidEvent(int eventIndex) {
_vm->_bVoy->freeBoltGroup(_vm->_playStampGroupId);
_vm->_playStampGroupId = -1;
- if (_field47A != -1) {
- _vm->_bVoy->freeBoltGroup(_field47A);
- _field47A = -1;
+ if (_boltGroupId2 != -1) {
+ _vm->_bVoy->freeBoltGroup(_boltGroupId2);
+ _boltGroupId2 = -1;
}
}
}
diff --git a/engines/voyeur/data.h b/engines/voyeur/data.h
index 2dc1221b9c..a829d7c795 100644
--- a/engines/voyeur/data.h
+++ b/engines/voyeur/data.h
@@ -116,13 +116,13 @@ public:
int _field468;
int _field46A;
int _vocSecondsOffset;
- bool _field46E;
+ bool _abortInterface;
int _field470;
int _aptLoadMode;
int _transitionId;
int _RTVLimit;
int _eventFlags;
- int _field47A;
+ int _boltGroupId2;
PictureResource *_evPicPtrs[6];
CMapResource *_evCmPtrs[6];
int _field4AC;
diff --git a/engines/voyeur/files.h b/engines/voyeur/files.h
index 604b30334a..358d1626c3 100644
--- a/engines/voyeur/files.h
+++ b/engines/voyeur/files.h
@@ -505,7 +505,7 @@ private:
byte *getDataOffset();
void getButtonsText();
void getButtonsFlags();
- void getField1CE();
+ void getButtonsUnused();
void performOpenCard();
const byte *getRecordOffset(const byte *p);
const byte *getNextRecord(const byte *p);
@@ -554,26 +554,50 @@ public:
byte *_threadInfoPtr;
byte _buttonFlags[64];
const byte *_field8E[64];
- byte _field18E[64];
- const byte *_field1CE[48];
+ byte _buttonIds[64];
+ const byte *_buttonUnused[48];
byte *_ctlPtr;
byte *_playCommandsPtr;
public:
ThreadResource(BoltFilesState &state, const byte *src);
virtual ~ThreadResource() {}
+ /**
+ * Initialise the thread
+ */
void initThreadStruct(int idx, int id);
+
+ /**
+ * Loads the specified stack
+ */
bool loadAStack(int stackId);
+
+ /**
+ * Unloads the specified stack
+ */
void unloadAStack(int stackId);
+
+ /**
+ * Initialises data for the thread based on the current state
+ */
bool doState();
bool chooseSTAMPButton(int buttonId);
+
+ /**
+ * Parses the script commands from the currently active stack
+ */
void parsePlayCommands();
/**
* Do the camera view looking at the mansion
*/
int doInterface();
+
+ /**
+ * Do the display of a room that has one or more evidence hotspots
+ * available for display
+ */
void doRoom();
/**
@@ -586,7 +610,14 @@ public:
*/
void loadTheApt();
+ /**
+ * Check for whether a murder has been recorded
+ */
void checkForMurder();
+
+ /**
+ * Check for whether incriminating evidence has been recorded
+ */
void checkForIncriminate();
/**
diff --git a/engines/voyeur/files_threads.cpp b/engines/voyeur/files_threads.cpp
index e99a19f94f..1d66483ffe 100644
--- a/engines/voyeur/files_threads.cpp
+++ b/engines/voyeur/files_threads.cpp
@@ -94,9 +94,9 @@ bool ThreadResource::doState() {
return false;
getButtonsFlags();
- getField1CE();
+ getButtonsUnused();
- _vm->_glGoScene = -1;
+ _vm->_glGoState = -1;
_vm->_glGoStack = -1;
performOpenCard();
@@ -168,7 +168,7 @@ void ThreadResource::getButtonsFlags() {
_stateFlags |= 2;
_buttonFlags[idx] = *p++;
- _field18E[idx] = *p++;
+ _buttonIds[idx] = *p++;
if (_buttonFlags[idx] & 0x80)
p += 4;
@@ -178,13 +178,13 @@ void ThreadResource::getButtonsFlags() {
}
}
-void ThreadResource::getField1CE() {
+void ThreadResource::getButtonsUnused() {
int idx = 0;
for (const byte *p = _threadInfoPtr; *p++ != 0x4A; p = getNextRecord(p)) {
assert(idx < 47);
- _field1CE[idx++] = getRecordOffset(p);
- _field1CE[idx] = NULL;
+ _buttonUnused[idx++] = getRecordOffset(p);
+ _buttonUnused[idx] = nullptr;
p += 4;
}
}
@@ -300,11 +300,11 @@ void ThreadResource::doSTAMPCardAction() {
}
void ThreadResource::cardAction(const byte *card) {
- _vm->_glGoScene = -1;
+ _vm->_glGoState = -1;
_vm->_glGoStack = -1;
// Loop to perform card commands
- while (!_vm->shouldQuit() && *card < 70 && _vm->_glGoScene == -1) {
+ while (!_vm->shouldQuit() && *card < 70 && _vm->_glGoState == -1) {
card = cardPerform(card);
}
}
@@ -313,19 +313,19 @@ bool ThreadResource::chooseSTAMPButton(int buttonId) {
_flags &= ~1;
for (int idx = 0; idx < _stateCount; ++idx) {
- if (_field18E[idx] == buttonId) {
+ if (_buttonIds[idx] == buttonId) {
const byte *card = getSTAMPCard(idx);
cardAction(card);
bool flag = true;
while (!_vm->shouldQuit() && _vm->_glGoStack != -1 && flag) {
doSTAMPCardAction();
- flag = goToStateID(_vm->_glGoStack, _vm->_glGoScene);
+ flag = goToStateID(_vm->_glGoStack, _vm->_glGoState);
}
- while (!_vm->shouldQuit() && _vm->_glGoScene != -1 && flag) {
+ while (!_vm->shouldQuit() && _vm->_glGoState != -1 && flag) {
doSTAMPCardAction();
- flag = goToState(-1, _vm->_glGoScene);
+ flag = goToState(-1, _vm->_glGoState);
}
return flag;
@@ -339,7 +339,7 @@ void ThreadResource::parsePlayCommands() {
_vm->_voy._field470 = -1;
_vm->_voy._field468 = 0;
_vm->_voy._field46A = 0;
- _vm->_voy._field47A = -1;
+ _vm->_voy._boltGroupId2 = -1;
_vm->_voy._computerTextId = -1;
_vm->_voy._eventFlags &= ~EVTFLAG_8;
_vm->_eventsManager._videoDead = -1;
@@ -507,6 +507,7 @@ void ThreadResource::parsePlayCommands() {
break;
case 5:
+ // Load the time information for the new time period
v2 = READ_LE_UINT16(dataP);
if (v2 == 0 || READ_LE_UINT16(_vm->_controlPtr->_ptr + 4) == 0) {
_vm->_voy._field470 = 5;
@@ -617,7 +618,7 @@ void ThreadResource::parsePlayCommands() {
v2 = READ_LE_UINT16(dataP);
if (v2 == 0 || READ_LE_UINT16(_vm->_controlPtr->_ptr + 4) == 0) {
- _vm->_voy._field47A = _vm->_resolvePtr[READ_LE_UINT16(dataP + 2)];
+ _vm->_voy._boltGroupId2 = _vm->_resolvePtr[READ_LE_UINT16(dataP + 2)];
_vm->_voy._roomHotspotsEnabled[READ_LE_UINT16(dataP + 4) - 1] = true;
}
@@ -798,18 +799,18 @@ const byte *ThreadResource::cardPerform(const byte *card) {
break;
case 17:
- _vm->_glGoScene = READ_LE_UINT16(card);
+ _vm->_glGoState = READ_LE_UINT16(card);
card += 2;
_vm->_glGoStack = -1;
break;
case 18:
v2 = READ_LE_UINT32(_vm->_controlPtr->_ptr + (*card++ << 2));
- _vm->_glGoScene = getStateFromID(v2);
+ _vm->_glGoState = getStateFromID(v2);
break;
case 19:
- _vm->_glGoScene = READ_LE_UINT32(card);
+ _vm->_glGoState = READ_LE_UINT32(card);
card += 4;
_vm->_glGoStack = READ_LE_UINT16(card);
card += 2;
@@ -888,7 +889,7 @@ const byte *ThreadResource::cardPerform(const byte *card) {
break;
case 46:
- _vm->_glGoScene = _newStateId;
+ _vm->_glGoState = _newStateId;
_vm->_glGoStack = _newStackId;
_newStateId = -1;
_newStackId = -1;
@@ -1259,9 +1260,9 @@ void ThreadResource::doRoom() {
voy._field437E = 0;
vm.makeViewFinderP();
- if (voy._field47A != -1) {
- vm._bVoy->freeBoltGroup(voy._field47A, 1);
- voy._field47A = -1;
+ if (voy._boltGroupId2 != -1) {
+ vm._bVoy->freeBoltGroup(voy._boltGroupId2, 1);
+ voy._boltGroupId2 = -1;
}
if (vm._playStampGroupId != -1) {
@@ -1283,8 +1284,8 @@ int ThreadResource::doInterface() {
Common::Point pt;
_vm->_voy._eventFlags |= EVTFLAG_TIME_DISABLED;
- if (_vm->_voy._field46E) {
- _vm->_voy._field46E = false;
+ if (_vm->_voy._abortInterface) {
+ _vm->_voy._abortInterface = false;
return -2;
}
diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp
index 27a45d8fcf..74f03ff652 100644
--- a/engines/voyeur/voyeur.cpp
+++ b/engines/voyeur/voyeur.cpp
@@ -678,11 +678,11 @@ void VoyeurEngine::flipPageAndWaitForFade() {
void VoyeurEngine::showEndingNews() {
_playStampGroupId = (_voy._field4382 - 1) * 256 + 0x7700;
- _voy._field47A = (READ_LE_UINT16(_controlPtr->_ptr + 4)
+ _voy._boltGroupId2 = (READ_LE_UINT16(_controlPtr->_ptr + 4)
- 1) * 256 + 0x7B00;
_bVoy->getBoltGroup(_playStampGroupId);
- _bVoy->getBoltGroup(_voy._field47A);
+ _bVoy->getBoltGroup(_voy._boltGroupId2);
PictureResource *pic = _bVoy->boltEntry(_playStampGroupId)._picResource;
CMapResource *pal = _bVoy->boltEntry(_playStampGroupId + 1)._cMapResource;
@@ -695,8 +695,8 @@ void VoyeurEngine::showEndingNews() {
for (int idx = 1; idx < 4; ++idx) {
if (idx == 3) {
- pic = _bVoy->boltEntry(_voy._field47A)._picResource;
- pal = _bVoy->boltEntry(_voy._field47A + 1)._cMapResource;
+ pic = _bVoy->boltEntry(_voy._boltGroupId2)._picResource;
+ pal = _bVoy->boltEntry(_voy._boltGroupId2 + 1)._cMapResource;
} else {
pic = _bVoy->boltEntry(_playStampGroupId + idx * 2)._picResource;
pal = _bVoy->boltEntry(_playStampGroupId + idx * 2 + 1)._cMapResource;
@@ -728,9 +728,9 @@ void VoyeurEngine::showEndingNews() {
}
_bVoy->freeBoltGroup(_playStampGroupId);
- _bVoy->freeBoltGroup(_voy._field47A);
+ _bVoy->freeBoltGroup(_voy._boltGroupId2);
_playStampGroupId = -1;
- _voy._field47A = -1;
+ _voy._boltGroupId2 = -1;
}
/*------------------------------------------------------------------------*/
@@ -820,7 +820,7 @@ Common::Error VoyeurEngine::saveGameState(int slot, const Common::String &desc)
}
void VoyeurEngine::synchronize(Common::Serializer &s) {
- s.syncAsSint16LE(_glGoScene);
+ s.syncAsSint16LE(_glGoState);
s.syncAsSint16LE(_glGoStack);
s.syncAsSint16LE(_stampFlags);
s.syncAsSint16LE(_playStampGroupId);
diff --git a/engines/voyeur/voyeur.h b/engines/voyeur/voyeur.h
index a0d2e95948..bc63d56ddb 100644
--- a/engines/voyeur/voyeur.h
+++ b/engines/voyeur/voyeur.h
@@ -170,7 +170,7 @@ public:
ControlResource *_controlPtr;
byte *_stampData;
BoltGroup *_stackGroupPtr;
- int _glGoScene;
+ int _glGoState;
int _glGoStack;
int _stampFlags;
int _playStampGroupId;
diff --git a/engines/voyeur/voyeur_game.cpp b/engines/voyeur/voyeur_game.cpp
index 634e79c31c..1ebfdff9f8 100644
--- a/engines/voyeur/voyeur_game.cpp
+++ b/engines/voyeur/voyeur_game.cpp
@@ -41,7 +41,7 @@ void VoyeurEngine::playStamp() {
_voy._isAM = false;
_gameHour = 9;
_gameMinute = 0;
- _voy._field46E = true;
+ _voy._abortInterface = true;
int buttonId;
bool breakFlag = false;
@@ -66,14 +66,14 @@ void VoyeurEngine::playStamp() {
break;
case 1:
_voy._eventFlags &= ~EVTFLAG_TIME_DISABLED;
- _voy._field46E = true;
+ _voy._abortInterface = true;
_mainThread->chooseSTAMPButton(22);
_voy._aptLoadMode = 143;
break;
case 2:
_voy._eventFlags &= ~EVTFLAG_TIME_DISABLED;
reviewTape();
- _voy._field46E = true;
+ _voy._abortInterface = true;
_voy._aptLoadMode = 142;
break;
case 3:
@@ -85,7 +85,7 @@ void VoyeurEngine::playStamp() {
break;
case 5:
doGossip();
- _voy._field46E = true;
+ _voy._abortInterface = true;
_voy._aptLoadMode = 141;
_voy._eventFlags &= ~EVTFLAG_100;
break;
@@ -115,7 +115,7 @@ void VoyeurEngine::playStamp() {
break;
case 2:
reviewTape();
- _voy._field46E = true;
+ _voy._abortInterface = true;
break;
case 4:
flag = true;
@@ -165,7 +165,7 @@ void VoyeurEngine::playStamp() {
_mainThread->chooseSTAMPButton(buttonId);
} else {
_mainThread->chooseSTAMPButton(buttonId);
- _voy._field46E = true;
+ _voy._abortInterface = true;
}
}
break;
@@ -184,9 +184,9 @@ void VoyeurEngine::playStamp() {
_audioVideoId = -1;
- if (_voy._field47A != -1) {
- _bVoy->freeBoltGroup(_voy._field47A);
- _voy._field47A = -1;
+ if (_voy._boltGroupId2 != -1) {
+ _bVoy->freeBoltGroup(_voy._boltGroupId2);
+ _voy._boltGroupId2 = -1;
}
if (_playStampGroupId != -1) {
@@ -1344,27 +1344,27 @@ void VoyeurEngine::doEvidDisplay(int evidId, int eventId) {
_soundManager.stopVOCPlay();
}
- _bVoy->getBoltGroup(_voy._field47A);
- PictureResource *pic = _bVoy->boltEntry(_voy._field47A + evidId * 2)._picResource;
+ _bVoy->getBoltGroup(_voy._boltGroupId2);
+ PictureResource *pic = _bVoy->boltEntry(_voy._boltGroupId2 + evidId * 2)._picResource;
_graphicsManager.sDrawPic(pic, *_graphicsManager._vPort, Common::Point(
(384 - pic->_bounds.width()) / 2, (240 - pic->_bounds.height()) / 2));
- _bVoy->freeBoltMember(_voy._field47A + evidId * 2);
+ _bVoy->freeBoltMember(_voy._boltGroupId2 + evidId * 2);
- CMapResource *pal = _bVoy->boltEntry(_voy._field47A + evidId * 2 + 1)._cMapResource;
+ CMapResource *pal = _bVoy->boltEntry(_voy._boltGroupId2 + evidId * 2 + 1)._cMapResource;
pal->startFade();
while (!shouldQuit() && (_eventsManager._fadeStatus & 1))
_eventsManager.delay(1);
- _bVoy->freeBoltMember(_voy._field47A + evidId * 2 + 1);
+ _bVoy->freeBoltMember(_voy._boltGroupId2 + evidId * 2 + 1);
Common::Array<RectEntry> &hotspots = _bVoy->boltEntry(_playStampGroupId + 4)._rectResource->_entries;
int count = hotspots[evidId]._count;
if (count > 0) {
for (int idx = 1; idx <= count; ++idx) {
- _voy._evPicPtrs[idx - 1] = _bVoy->boltEntry(_voy._field47A +
+ _voy._evPicPtrs[idx - 1] = _bVoy->boltEntry(_voy._boltGroupId2 +
(evidId + idx) * 2)._picResource;
- _voy._evCmPtrs[idx - 1] = _bVoy->boltEntry(_voy._field47A +
+ _voy._evCmPtrs[idx - 1] = _bVoy->boltEntry(_voy._boltGroupId2 +
(evidId + idx) * 2 + 1)._cMapResource;
}
}
@@ -1416,8 +1416,8 @@ void VoyeurEngine::doEvidDisplay(int evidId, int eventId) {
_voy.addEvidEventEnd(evidIdx);
for (int idx = 1; idx <= hotspots[evidId]._count; ++idx) {
- _bVoy->freeBoltMember(_voy._field47A + (evidId + idx) * 2);
- _bVoy->freeBoltMember(_voy._field47A + (evidId + idx) * 2 + 1);
+ _bVoy->freeBoltMember(_voy._boltGroupId2 + (evidId + idx) * 2);
+ _bVoy->freeBoltMember(_voy._boltGroupId2 + (evidId + idx) * 2 + 1);
}
}