VOYEUR: Remove setVm from SVoy

This commit is contained in:
Strangerke 2014-02-26 22:44:30 +01:00
parent 55b76f7d16
commit ccde2d5b76
10 changed files with 365 additions and 368 deletions

View File

@ -38,7 +38,7 @@ void VoyeurEvent::synchronize(Common::Serializer &s) {
/*------------------------------------------------------------------------*/
SVoy::SVoy() {
SVoy::SVoy(VoyeurEngine *vm):_vm(vm) {
// Initialize all the data fields
_abortInterface = false;
_isAM = false;
@ -92,10 +92,6 @@ SVoy::SVoy() {
}
}
void SVoy::setVm(VoyeurEngine *vm) {
_vm = vm;
}
void SVoy::addEvent(int hour, int minute, VoyeurEventType type, int audioVideoId,
int on, int off, int dead) {
VoyeurEvent &e = _events[_eventCount++];
@ -282,7 +278,7 @@ void SVoy::reviewComputerEvent(int eventIndex) {
bool SVoy::checkForKey() {
_vm->_controlPtr->_state->_victimEvidenceIndex = 0;
if (_vm->_voy._victimMurdered)
if (_vm->_voy->_victimMurdered)
return false;
for (int eventIdx = 0; eventIdx < _eventCount; ++eventIdx) {

View File

@ -154,8 +154,7 @@ public:
CMapResource *_evCmPtrs[6];
VoyeurEvent _events[TOTAL_EVENTS];
SVoy();
void setVm(VoyeurEngine *vm);
SVoy(VoyeurEngine *vm);
/**
* Synchronize the data

View File

@ -53,7 +53,7 @@ bool Debugger::Cmd_Time(int argc, const char **argv) {
dtString += " " + timeString;
DebugPrintf("Time period = %d, date/time is: %s, time is %s\n",
_vm->_voy._transitionId, dtString.c_str(), _isTimeActive ? "on" : "off");
_vm->_voy->_transitionId, dtString.c_str(), _isTimeActive ? "on" : "off");
DebugPrintf("Format: %s [on | off | 1..17 | val <amount>]\n\n", argv[0]);
} else {
if (!strcmp(argv[1], "on")) {
@ -64,10 +64,10 @@ bool Debugger::Cmd_Time(int argc, const char **argv) {
DebugPrintf("Time is now off\n\n");
} else if (!strcmp(argv[1], "val")) {
if (argc < 3) {
DebugPrintf("Time expired is currently %d.\n", _vm->_voy._RTVNum);
DebugPrintf("Time expired is currently %d.\n", _vm->_voy->_RTVNum);
} else {
_vm->_voy._RTVNum = atoi(argv[2]);
DebugPrintf("Time expired is now %d.\n", _vm->_voy._RTVNum);
_vm->_voy->_RTVNum = atoi(argv[2]);
DebugPrintf("Time expired is now %d.\n", _vm->_voy->_RTVNum);
}
} else {
int timeId = atoi(argv[1]);
@ -104,27 +104,27 @@ bool Debugger::Cmd_Hotspots(int argc, const char **argv) {
hotspots[hotspotIdx].right, hotspots[hotspotIdx].bottom);
for (int arrIndex = 0; arrIndex < 3; ++arrIndex) {
if (_vm->_voy._audioHotspotTimes._min[arrIndex][hotspotIdx] != 9999) {
if (_vm->_voy->_audioHotspotTimes._min[arrIndex][hotspotIdx] != 9999) {
DebugPrintf("Hotspot %d %s Audio slot %d, time: %d to %d\n",
hotspotIdx, pos.c_str(), arrIndex,
_vm->_voy._audioHotspotTimes._min[arrIndex][hotspotIdx],
_vm->_voy._audioHotspotTimes._max[arrIndex][hotspotIdx]);
_vm->_voy->_audioHotspotTimes._min[arrIndex][hotspotIdx],
_vm->_voy->_audioHotspotTimes._max[arrIndex][hotspotIdx]);
}
if (_vm->_voy._evidenceHotspotTimes._min[arrIndex][hotspotIdx] != 9999) {
if (_vm->_voy->_evidenceHotspotTimes._min[arrIndex][hotspotIdx] != 9999) {
DebugPrintf("Hotspot %d %s Evidence slot %d, time: %d to %d\n",
hotspotIdx, pos.c_str(), arrIndex,
_vm->_voy._evidenceHotspotTimes._min[arrIndex][hotspotIdx],
_vm->_voy._evidenceHotspotTimes._max[arrIndex][hotspotIdx]);
_vm->_voy->_evidenceHotspotTimes._min[arrIndex][hotspotIdx],
_vm->_voy->_evidenceHotspotTimes._max[arrIndex][hotspotIdx]);
}
}
for (int arrIndex = 0; arrIndex < 8; ++arrIndex) {
if (_vm->_voy._videoHotspotTimes._min[arrIndex][hotspotIdx] != 9999) {
if (_vm->_voy->_videoHotspotTimes._min[arrIndex][hotspotIdx] != 9999) {
DebugPrintf("Hotspot %d %s Video slot %d, time: %d to %d\n",
hotspotIdx, pos.c_str(), arrIndex,
_vm->_voy._videoHotspotTimes._min[arrIndex][hotspotIdx],
_vm->_voy._videoHotspotTimes._max[arrIndex][hotspotIdx]);
_vm->_voy->_videoHotspotTimes._min[arrIndex][hotspotIdx],
_vm->_voy->_videoHotspotTimes._max[arrIndex][hotspotIdx]);
}
}
}

View File

@ -93,17 +93,17 @@ void EventsManager::startMainClockInt() {
}
void EventsManager::mainVoyeurIntFunc() {
if (!(_vm->_voy._eventFlags & EVTFLAG_TIME_DISABLED)) {
++_vm->_voy._switchBGNum;
if (!(_vm->_voy->_eventFlags & EVTFLAG_TIME_DISABLED)) {
++_vm->_voy->_switchBGNum;
if (_vm->_debugger._isTimeActive) {
// Increase camera discharge
++_vm->_voy._RTVNum;
++_vm->_voy->_RTVNum;
// If the murder threshold has been set, and is passed, then flag the victim
// as murdered, which prevents sending the tape from succeeding
if (_vm->_voy._RTVNum >= _vm->_voy._murderThreshold)
_vm->_voy._victimMurdered = true;
if (_vm->_voy->_RTVNum >= _vm->_voy->_murderThreshold)
_vm->_voy->_victimMurdered = true;
}
}
}
@ -476,30 +476,30 @@ void EventsManager::vDoCycleInt() {
void EventsManager::fadeIntFunc() {
switch (_vm->_voy._fadingType) {
switch (_vm->_voy->_fadingType) {
case 1:
if (_vm->_voy._fadingAmount1 < 63)
_vm->_voy._fadingAmount1 += _vm->_voy._fadingStep1;
if (_vm->_voy._fadingAmount2 < 63)
_vm->_voy._fadingAmount2 += _vm->_voy._fadingStep2;
if (_vm->_voy._fadingAmount1 > 63)
_vm->_voy._fadingAmount1 = 63;
if (_vm->_voy._fadingAmount2 > 63)
_vm->_voy._fadingAmount2 = 63;
if ((_vm->_voy._fadingAmount1 == 63) && (_vm->_voy._fadingAmount2 == 63))
_vm->_voy._fadingType = 0;
if (_vm->_voy->_fadingAmount1 < 63)
_vm->_voy->_fadingAmount1 += _vm->_voy->_fadingStep1;
if (_vm->_voy->_fadingAmount2 < 63)
_vm->_voy->_fadingAmount2 += _vm->_voy->_fadingStep2;
if (_vm->_voy->_fadingAmount1 > 63)
_vm->_voy->_fadingAmount1 = 63;
if (_vm->_voy->_fadingAmount2 > 63)
_vm->_voy->_fadingAmount2 = 63;
if ((_vm->_voy->_fadingAmount1 == 63) && (_vm->_voy->_fadingAmount2 == 63))
_vm->_voy->_fadingType = 0;
break;
case 2:
if (_vm->_voy._fadingAmount1 > 0)
_vm->_voy._fadingAmount1 -= _vm->_voy._fadingStep1;
if (_vm->_voy._fadingAmount2 > 0)
_vm->_voy._fadingAmount2 -= _vm->_voy._fadingStep2;
if (_vm->_voy._fadingAmount1 < 0)
_vm->_voy._fadingAmount1 = 0;
if (_vm->_voy._fadingAmount2 < 0)
_vm->_voy._fadingAmount2 = 0;
if ((_vm->_voy._fadingAmount1 == 0) && (_vm->_voy._fadingAmount2 == 0))
_vm->_voy._fadingType = 0;
if (_vm->_voy->_fadingAmount1 > 0)
_vm->_voy->_fadingAmount1 -= _vm->_voy->_fadingStep1;
if (_vm->_voy->_fadingAmount2 > 0)
_vm->_voy->_fadingAmount2 -= _vm->_voy->_fadingStep2;
if (_vm->_voy->_fadingAmount1 < 0)
_vm->_voy->_fadingAmount1 = 0;
if (_vm->_voy->_fadingAmount2 < 0)
_vm->_voy->_fadingAmount2 = 0;
if ((_vm->_voy->_fadingAmount1 == 0) && (_vm->_voy->_fadingAmount2 == 0))
_vm->_voy->_fadingType = 0;
break;
default:
break;
@ -560,7 +560,7 @@ void EventsManager::hideCursor() {
void EventsManager::getMouseInfo() {
pollEvents();
if (_vm->_voy._eventFlags & EVTFLAG_RECORDING) {
if (_vm->_voy->_eventFlags & EVTFLAG_RECORDING) {
if ((_gameCounter - _recordBlinkCounter) > 8) {
_recordBlinkCounter = _gameCounter;
@ -586,7 +586,7 @@ void EventsManager::getMouseInfo() {
}
void EventsManager::startCursorBlink() {
if (_vm->_voy._eventFlags & EVTFLAG_RECORDING) {
if (_vm->_voy->_eventFlags & EVTFLAG_RECORDING) {
_vm->_graphicsManager.setOneColor(128, 55, 5, 5);
_vm->_graphicsManager.setColor(128, 220, 20, 20);
_intPtr._hasPalette = true;
@ -606,8 +606,8 @@ void EventsManager::stopEvidDim() {
}
Common::String EventsManager::getEvidString(int eventIndex) {
assert(eventIndex <= _vm->_voy._eventCount);
VoyeurEvent &e = _vm->_voy._events[eventIndex];
assert(eventIndex <= _vm->_voy->_eventCount);
VoyeurEvent &e = _vm->_voy->_events[eventIndex];
return Common::String::format("%03d %.2d:%.2d %s %s", eventIndex + 1,
e._hour, e._minute, e._isAM ? AM : PM, EVENT_TYPE_STRINGS[e._type - 1]);
}

View File

@ -1365,7 +1365,7 @@ void ViewPortResource::drawIfaceTime() {
_state._vm->_gameMinute % 10, Common::Point(201, 25));
// AM/PM indicator
PictureResource *pic = _state._vm->_bVoy->boltEntry(_state._vm->_voy._isAM ? 272 : 273)._picResource;
PictureResource *pic = _state._vm->_bVoy->boltEntry(_state._vm->_voy->_isAM ? 272 : 273)._picResource;
_state._vm->_graphicsManager.sDrawPic(pic, *_state._vm->_graphicsManager._vPort,
Common::Point(215, 27));
}

View File

@ -321,19 +321,19 @@ bool ThreadResource::chooseSTAMPButton(int buttonId) {
}
void ThreadResource::parsePlayCommands() {
_vm->_voy._playStampMode = -1;
_vm->_voy._audioVisualStartTime = 0;
_vm->_voy._audioVisualDuration = 0;
_vm->_voy._boltGroupId2 = -1;
_vm->_voy._computerTextId = -1;
_vm->_voy._eventFlags &= ~EVTFLAG_8;
_vm->_voy->_playStampMode = -1;
_vm->_voy->_audioVisualStartTime = 0;
_vm->_voy->_audioVisualDuration = 0;
_vm->_voy->_boltGroupId2 = -1;
_vm->_voy->_computerTextId = -1;
_vm->_voy->_eventFlags &= ~EVTFLAG_8;
_vm->_eventsManager._videoDead = -1;
// Reset hotspot data
_vm->_voy._videoHotspotTimes.reset();
_vm->_voy._audioHotspotTimes.reset();
_vm->_voy._evidenceHotspotTimes.reset();
Common::fill(&_vm->_voy._roomHotspotsEnabled[0], &_vm->_voy._roomHotspotsEnabled[20], false);
_vm->_voy->_videoHotspotTimes.reset();
_vm->_voy->_audioHotspotTimes.reset();
_vm->_voy->_evidenceHotspotTimes.reset();
Common::fill(&_vm->_voy->_roomHotspotsEnabled[0], &_vm->_voy->_roomHotspotsEnabled[20], false);
byte *dataP = _playCommandsPtr;
int v2, v3;
PictureResource *pic;
@ -357,21 +357,21 @@ void ThreadResource::parsePlayCommands() {
if (v2 == 0 || _vm->_controlPtr->_state->_victimIndex == v2) {
_vm->_audioVideoId = READ_LE_UINT16(dataP + 2) - 1;
_vm->_voy._audioVisualStartTime = READ_LE_UINT16(dataP + 4);
_vm->_voy._audioVisualDuration = READ_LE_UINT16(dataP + 6);
_vm->_voy->_audioVisualStartTime = READ_LE_UINT16(dataP + 4);
_vm->_voy->_audioVisualDuration = READ_LE_UINT16(dataP + 6);
if (_vm->_voy._RTVNum < _vm->_voy._audioVisualStartTime ||
(_vm->_voy._audioVisualStartTime + _vm->_voy._audioVisualDuration) < _vm->_voy._RTVNum) {
if (_vm->_voy->_RTVNum < _vm->_voy->_audioVisualStartTime ||
(_vm->_voy->_audioVisualStartTime + _vm->_voy->_audioVisualDuration) < _vm->_voy->_RTVNum) {
_vm->_audioVideoId = -1;
} else {
_vm->_voy._vocSecondsOffset = _vm->_voy._RTVNum - _vm->_voy._audioVisualStartTime;
_vm->_voy.addAudioEventStart();
_vm->_voy->_vocSecondsOffset = _vm->_voy->_RTVNum - _vm->_voy->_audioVisualStartTime;
_vm->_voy->addAudioEventStart();
// Play the audio
assert(_vm->_audioVideoId < 38);
_vm->playAudio(_vm->_audioVideoId);
_vm->_voy.addAudioEventEnd();
_vm->_voy->addAudioEventEnd();
_vm->_eventsManager.incrementTime(1);
_vm->_eventsManager.incrementTime(1);
_vm->_audioVideoId = -1;
@ -388,22 +388,22 @@ void ThreadResource::parsePlayCommands() {
if (v2 == 0 || _vm->_controlPtr->_state->_victimIndex == v2) {
_vm->_audioVideoId = READ_LE_UINT16(dataP + 2) - 1;
_vm->_voy._audioVisualStartTime = READ_LE_UINT16(dataP + 4);
_vm->_voy._audioVisualDuration = READ_LE_UINT16(dataP + 6);
_vm->_voy->_audioVisualStartTime = READ_LE_UINT16(dataP + 4);
_vm->_voy->_audioVisualDuration = READ_LE_UINT16(dataP + 6);
if (_vm->_voy._RTVNum < _vm->_voy._audioVisualStartTime ||
(_vm->_voy._audioVisualStartTime + _vm->_voy._audioVisualDuration) < _vm->_voy._RTVNum) {
if (_vm->_voy->_RTVNum < _vm->_voy->_audioVisualStartTime ||
(_vm->_voy->_audioVisualStartTime + _vm->_voy->_audioVisualDuration) < _vm->_voy->_RTVNum) {
_vm->_audioVideoId = -1;
} else {
_vm->_voy._vocSecondsOffset = _vm->_voy._RTVNum - _vm->_voy._audioVisualStartTime;
_vm->_voy.addVideoEventStart();
_vm->_voy._eventFlags &= ~EVTFLAG_TIME_DISABLED;
_vm->_voy._eventFlags |= EVTFLAG_RECORDING;
_vm->_voy->_vocSecondsOffset = _vm->_voy->_RTVNum - _vm->_voy->_audioVisualStartTime;
_vm->_voy->addVideoEventStart();
_vm->_voy->_eventFlags &= ~EVTFLAG_TIME_DISABLED;
_vm->_voy->_eventFlags |= EVTFLAG_RECORDING;
_vm->playAVideo(_vm->_audioVideoId);
_vm->_voy._eventFlags &= ~EVTFLAG_RECORDING;
_vm->_voy._eventFlags |= EVTFLAG_TIME_DISABLED;
_vm->_voy.addVideoEventEnd();
_vm->_voy->_eventFlags &= ~EVTFLAG_RECORDING;
_vm->_voy->_eventFlags |= EVTFLAG_TIME_DISABLED;
_vm->_voy->addVideoEventEnd();
_vm->_eventsManager.incrementTime(1);
_vm->_audioVideoId = -1;
@ -417,10 +417,10 @@ void ThreadResource::parsePlayCommands() {
_vm->_eventsManager._videoDead = -1;
if (_stateCount == 2 && _vm->_eventsManager._mouseClicked == 0) {
_vm->_voy._playStampMode = 132;
_vm->_voy->_playStampMode = 132;
parseIndex = 999;
} else {
_vm->_voy._playStampMode = 129;
_vm->_voy->_playStampMode = 129;
}
}
}
@ -440,11 +440,11 @@ void ThreadResource::parsePlayCommands() {
_vm->_playStampGroupId = _vm->_resolvePtr[resolveIndex];
}
_vm->_voy._vocSecondsOffset = 0;
_vm->_voy._audioVisualStartTime = _vm->_voy._RTVNum;
_vm->_voy._eventFlags &= ~(EVTFLAG_TIME_DISABLED | EVTFLAG_RECORDING);
_vm->_voy->_vocSecondsOffset = 0;
_vm->_voy->_audioVisualStartTime = _vm->_voy->_RTVNum;
_vm->_voy->_eventFlags &= ~(EVTFLAG_TIME_DISABLED | EVTFLAG_RECORDING);
_vm->playAVideo(_vm->_audioVideoId);
_vm->_voy._eventFlags |= EVTFLAG_TIME_DISABLED;
_vm->_voy->_eventFlags |= EVTFLAG_TIME_DISABLED;
if (id != 22) {
_vm->_audioVideoId = -1;
@ -498,30 +498,30 @@ void ThreadResource::parsePlayCommands() {
// if so, load the time information for the new time period
v2 = READ_LE_UINT16(dataP);
if (v2 == 0 || _vm->_controlPtr->_state->_victimIndex == v2) {
_vm->_voy._playStampMode = 5;
_vm->_voy->_playStampMode = 5;
int count = READ_LE_UINT16(dataP + 2);
_vm->_voy._RTVLimit = READ_LE_UINT16(dataP + 4);
_vm->_voy->_RTVLimit = READ_LE_UINT16(dataP + 4);
if (_vm->_voy._transitionId != count) {
if (_vm->_voy._transitionId > 1)
_vm->_voy._eventFlags &= ~EVTFLAG_100;
if (_vm->_voy->_transitionId != count) {
if (_vm->_voy->_transitionId > 1)
_vm->_voy->_eventFlags &= ~EVTFLAG_100;
_vm->_voy._transitionId = count;
_vm->_voy->_transitionId = count;
_vm->_gameMinute = LEVEL_M[count - 1];
_vm->_gameHour = LEVEL_H[count - 1];
//_vm->_v2A0A2 = 0;
_vm->_voy._RTVNum = 0;
_vm->_voy._RTANum = 255;
_vm->_voy->_RTVNum = 0;
_vm->_voy->_RTANum = 255;
}
_vm->_voy._isAM = (_vm->_voy._transitionId == 6);
_vm->_voy->_isAM = (_vm->_voy->_transitionId == 6);
}
dataP += 6;
break;
case 6:
_vm->_voy._playStampMode = 6;
_vm->_voy->_playStampMode = 6;
v2 = READ_LE_UINT16(dataP);
_vm->_playStampGroupId = _vm->_resolvePtr[v2];
dataP += 2;
@ -534,12 +534,12 @@ void ThreadResource::parsePlayCommands() {
if (v2 == 0 || _vm->_controlPtr->_state->_victimIndex == v2) {
int idx = 0;
while (_vm->_voy._videoHotspotTimes._min[idx][v3] != 9999)
while (_vm->_voy->_videoHotspotTimes._min[idx][v3] != 9999)
++idx;
v2 = READ_LE_UINT16(dataP + 4);
_vm->_voy._videoHotspotTimes._min[idx][v3] = v2;
_vm->_voy._videoHotspotTimes._max[idx][v3] = v2 + READ_LE_UINT16(dataP + 6) - 2;
_vm->_voy->_videoHotspotTimes._min[idx][v3] = v2;
_vm->_voy->_videoHotspotTimes._max[idx][v3] = v2 + READ_LE_UINT16(dataP + 6) - 2;
}
dataP += 8;
@ -552,12 +552,12 @@ void ThreadResource::parsePlayCommands() {
if (v2 == 0 || _vm->_controlPtr->_state->_victimIndex == v2) {
int idx = 0;
while (_vm->_voy._audioHotspotTimes._min[idx][v3] != 9999)
while (_vm->_voy->_audioHotspotTimes._min[idx][v3] != 9999)
++idx;
v2 = READ_LE_UINT16(dataP + 4);
_vm->_voy._audioHotspotTimes._min[idx][v3] = v2;
_vm->_voy._audioHotspotTimes._max[idx][v3] = v2 + READ_LE_UINT16(dataP + 6) - 2;
_vm->_voy->_audioHotspotTimes._min[idx][v3] = v2;
_vm->_voy->_audioHotspotTimes._max[idx][v3] = v2 + READ_LE_UINT16(dataP + 6) - 2;
}
dataP += 8;
@ -570,12 +570,12 @@ void ThreadResource::parsePlayCommands() {
if (v2 == 0 || _vm->_controlPtr->_state->_victimIndex == v2) {
int idx = 0;
while (_vm->_voy._evidenceHotspotTimes._min[idx][v3] != 9999)
while (_vm->_voy->_evidenceHotspotTimes._min[idx][v3] != 9999)
++idx;
v2 = READ_LE_UINT16(dataP + 4);
_vm->_voy._evidenceHotspotTimes._min[idx][v3] = v2;
_vm->_voy._evidenceHotspotTimes._max[idx][v3] = v2 + READ_LE_UINT16(dataP + 6) - 2;
_vm->_voy->_evidenceHotspotTimes._min[idx][v3] = v2;
_vm->_voy->_evidenceHotspotTimes._max[idx][v3] = v2 + READ_LE_UINT16(dataP + 6) - 2;
}
dataP += 8;
@ -590,13 +590,13 @@ void ThreadResource::parsePlayCommands() {
int randomVal;
do {
randomVal = _vm->getRandomNumber(3) + 1;
} while (randomVal == _vm->_voy._victimNumber);
} while (randomVal == _vm->_voy->_victimNumber);
_vm->_voy._victimNumber = randomVal;
_vm->_voy->_victimNumber = randomVal;
_vm->_controlPtr->_state->_victimIndex = randomVal;
} else {
// Player has seen something that locks in the character to die
_vm->_voy._victimNumber = _vm->_iForceDeath;
_vm->_voy->_victimNumber = _vm->_iForceDeath;
_vm->_controlPtr->_state->_victimIndex = _vm->_iForceDeath;
}
@ -604,15 +604,15 @@ void ThreadResource::parsePlayCommands() {
break;
case 11:
_vm->_voy._eventFlags |= EVTFLAG_2;
_vm->_voy->_eventFlags |= EVTFLAG_2;
break;
case 12:
v2 = READ_LE_UINT16(dataP);
if (v2 == 0 || _vm->_controlPtr->_state->_victimIndex == v2) {
_vm->_voy._boltGroupId2 = _vm->_resolvePtr[READ_LE_UINT16(dataP + 2)];
_vm->_voy._roomHotspotsEnabled[READ_LE_UINT16(dataP + 4) - 1] = true;
_vm->_voy->_boltGroupId2 = _vm->_resolvePtr[READ_LE_UINT16(dataP + 2)];
_vm->_voy->_roomHotspotsEnabled[READ_LE_UINT16(dataP + 4) - 1] = true;
}
dataP += 6;
@ -622,14 +622,14 @@ void ThreadResource::parsePlayCommands() {
v2 = READ_LE_UINT16(dataP);
if (v2 == 0 || _vm->_controlPtr->_state->_victimIndex == v2) {
_vm->_voy._computerTextId = READ_LE_UINT16(dataP + 2);
_vm->_voy._computerTimeMin = READ_LE_UINT16(dataP + 4);
_vm->_voy._computerTimeMax = READ_LE_UINT16(dataP + 6);
_vm->_voy->_computerTextId = READ_LE_UINT16(dataP + 2);
_vm->_voy->_computerTimeMin = READ_LE_UINT16(dataP + 4);
_vm->_voy->_computerTimeMax = READ_LE_UINT16(dataP + 6);
_vm->_voy._rect4E4.left = COMP_BUT_TABLE[_vm->_voy._computerTextId * 4];
_vm->_voy._rect4E4.top = COMP_BUT_TABLE[_vm->_voy._computerTextId * 4 + 1];
_vm->_voy._rect4E4.right = COMP_BUT_TABLE[_vm->_voy._computerTextId * 4 + 2];
_vm->_voy._rect4E4.bottom = COMP_BUT_TABLE[_vm->_voy._computerTextId * 4 + 3];
_vm->_voy->_rect4E4.left = COMP_BUT_TABLE[_vm->_voy->_computerTextId * 4];
_vm->_voy->_rect4E4.top = COMP_BUT_TABLE[_vm->_voy->_computerTextId * 4 + 1];
_vm->_voy->_rect4E4.right = COMP_BUT_TABLE[_vm->_voy->_computerTextId * 4 + 2];
_vm->_voy->_rect4E4.bottom = COMP_BUT_TABLE[_vm->_voy->_computerTextId * 4 + 3];
}
dataP += 8;
@ -637,7 +637,7 @@ void ThreadResource::parsePlayCommands() {
case 14:
_vm->_playStampGroupId = 2048;
_vm->_voy._playStampMode = 130;
_vm->_voy->_playStampMode = 130;
break;
case 15:
@ -645,11 +645,11 @@ void ThreadResource::parsePlayCommands() {
break;
case 16:
_vm->_voy._playStampMode = 16;
_vm->_voy->_playStampMode = 16;
break;
case 17:
_vm->_voy._playStampMode = 17;
_vm->_voy->_playStampMode = 17;
break;
case 18:
@ -659,37 +659,37 @@ void ThreadResource::parsePlayCommands() {
v3 = READ_LE_UINT16(dataP + 2);
if (v2 == 0 || _vm->_controlPtr->_state->_victimIndex == v2)
_vm->_voy._murderThreshold = v3;
_vm->_voy->_murderThreshold = v3;
dataP += 4;
break;
case 19:
_vm->_voy._aptLoadMode = 140;
_vm->_voy->_aptLoadMode = 140;
loadTheApt();
_vm->_voy._aptLoadMode = 141;
_vm->_voy->_aptLoadMode = 141;
freeTheApt();
break;
case 20:
_vm->_voy._aptLoadMode = -1;
_vm->_voy->_aptLoadMode = -1;
loadTheApt();
_vm->_voy._aptLoadMode = 141;
_vm->_voy->_aptLoadMode = 141;
freeTheApt();
break;
case 21:
_vm->_voy._aptLoadMode = -1;
_vm->_voy->_aptLoadMode = -1;
loadTheApt();
_vm->_voy._aptLoadMode = 140;
_vm->_voy->_aptLoadMode = 140;
freeTheApt();
break;
case 23:
_vm->_voy._transitionId = 17;
_vm->_voy._aptLoadMode = -1;
_vm->_voy->_transitionId = 17;
_vm->_voy->_aptLoadMode = -1;
loadTheApt();
_vm->_voy._aptLoadMode = 144;
_vm->_voy->_aptLoadMode = 144;
freeTheApt();
break;
@ -954,7 +954,7 @@ int ThreadResource::doApt() {
loadTheApt();
_vm->_currentVocId = 151;
_vm->_voy._viewBounds = _vm->_bVoy->boltEntry(_vm->_playStampGroupId)._rectResource;
_vm->_voy->_viewBounds = _vm->_bVoy->boltEntry(_vm->_playStampGroupId)._rectResource;
Common::Array<RectEntry> &hotspots = _vm->_bVoy->boltEntry(
_vm->_playStampGroupId + 1)._rectResource->_entries;
_vm->_eventsManager.getMouseInfo();
@ -966,7 +966,7 @@ int ThreadResource::doApt() {
_vm->_currentVocId = 153;
}
if (_vm->_voy._playStampMode == 16) {
if (_vm->_voy->_playStampMode == 16) {
hotspots[0].left = 999;
hotspots[3].left = 999;
_aptPos.x = hotspots[4].left + 28;
@ -1015,7 +1015,7 @@ int ThreadResource::doApt() {
// Cursor is within hotspot area
// Don't allow the camera to be highlighted on Monday morning.
if (idx == 0 && _vm->_voy._transitionId == 17)
if (idx == 0 && _vm->_voy->_transitionId == 17)
continue;
// Set the highlighted hotspot Id
@ -1024,7 +1024,7 @@ int ThreadResource::doApt() {
if (hotspotId != prevHotspotId) {
// Check for whether to replace hotspot Id for "Watch TV" for
// "Review the Tape" if player has already watched the TV
if ((_vm->_voy._eventFlags & EVTFLAG_100) && (hotspotId == 2))
if ((_vm->_voy->_eventFlags & EVTFLAG_100) && (hotspotId == 2))
hotspotId = 5;
// Draw the text description for the highlighted hotspot
@ -1063,23 +1063,23 @@ int ThreadResource::doApt() {
switch (hotspotId) {
case 0:
_vm->_voy._aptLoadMode = 140;
_vm->_voy->_aptLoadMode = 140;
break;
case 1:
_vm->_voy._aptLoadMode = 143;
_vm->_voy->_aptLoadMode = 143;
break;
case 2:
_vm->_voy._aptLoadMode = 142;
_vm->_voy->_aptLoadMode = 142;
case 5:
_vm->_voy._aptLoadMode = 141;
_vm->_voy->_aptLoadMode = 141;
break;
default:
_vm->_voy._aptLoadMode = -1;
_vm->_voy->_aptLoadMode = -1;
break;
}
freeTheApt();
if (_vm->_voy._transitionId == 1 && hotspotId == 0)
if (_vm->_voy->_transitionId == 1 && hotspotId == 0)
_vm->checkTransition();
if (!hotspotId)
@ -1090,7 +1090,7 @@ int ThreadResource::doApt() {
void ThreadResource::doRoom() {
VoyeurEngine &vm = *_vm;
SVoy &voy = vm._voy;
SVoy voy = *vm._voy;
vm.makeViewFinderP();
voy._fadingType = 0;
@ -1198,14 +1198,14 @@ void ThreadResource::doRoom() {
vm.getComputerBrush();
_vm->flipPageAndWait();
vm._voy.addComputerEventStart();
vm._voy->addComputerEventStart();
vm._eventsManager._mouseClicked = false;
vm._eventsManager.startCursorBlink();
int totalChars = vm.doComputerText(9999);
if (totalChars)
vm._voy.addComputerEventEnd(totalChars);
vm._voy->addComputerEventEnd(totalChars);
vm._bVoy->freeBoltGroup(0x4900);
} else {
@ -1285,35 +1285,35 @@ int ThreadResource::doInterface() {
PictureResource *pic;
Common::Point pt;
_vm->_voy._eventFlags |= EVTFLAG_TIME_DISABLED;
if (_vm->_voy._abortInterface) {
_vm->_voy._abortInterface = false;
_vm->_voy->_eventFlags |= EVTFLAG_TIME_DISABLED;
if (_vm->_voy->_abortInterface) {
_vm->_voy->_abortInterface = false;
return -2;
}
_vm->_voy._eventFlags &= ~EVTFLAG_100;
_vm->_voy->_eventFlags &= ~EVTFLAG_100;
_vm->_playStampGroupId = -1;
_vm->_eventsManager._intPtr._flashStep = 1;
_vm->_eventsManager._intPtr._flashTimer = 0;
if (_vm->_voy._RTVNum >= _vm->_voy._RTVLimit || _vm->_voy._RTVNum < 0)
_vm->_voy._RTVNum = _vm->_voy._RTVLimit - 1;
if (_vm->_voy->_RTVNum >= _vm->_voy->_RTVLimit || _vm->_voy->_RTVNum < 0)
_vm->_voy->_RTVNum = _vm->_voy->_RTVLimit - 1;
if (_vm->_voy._transitionId < 15 && _vm->_debugger._isTimeActive &&
(_vm->_voy._RTVLimit - 3) < _vm->_voy._RTVNum) {
_vm->_voy._RTVNum = _vm->_voy._RTVLimit;
if (_vm->_voy->_transitionId < 15 && _vm->_debugger._isTimeActive &&
(_vm->_voy->_RTVLimit - 3) < _vm->_voy->_RTVNum) {
_vm->_voy->_RTVNum = _vm->_voy->_RTVLimit;
_vm->makeViewFinder();
_vm->initIFace();
_vm->_voy._RTVNum = _vm->_voy._RTVLimit - 4;
_vm->_voy._eventFlags &= ~EVTFLAG_TIME_DISABLED;
_vm->_voy->_RTVNum = _vm->_voy->_RTVLimit - 4;
_vm->_voy->_eventFlags &= ~EVTFLAG_TIME_DISABLED;
while (!_vm->shouldQuit() && _vm->_voy._RTVNum < _vm->_voy._RTVLimit) {
while (!_vm->shouldQuit() && _vm->_voy->_RTVNum < _vm->_voy->_RTVLimit) {
_vm->flashTimeBar();
_vm->_eventsManager.delayClick(1);
}
_vm->_voy._eventFlags |= EVTFLAG_TIME_DISABLED;
_vm->_voy->_eventFlags |= EVTFLAG_TIME_DISABLED;
chooseSTAMPButton(20);
parsePlayCommands();
}
@ -1326,7 +1326,7 @@ int ThreadResource::doInterface() {
Common::Array<RectEntry> *hotspots = &_vm->_bVoy->boltEntry(
_vm->_playStampGroupId + 1)._rectResource->_entries;
_vm->_currentVocId = 151 - _vm->getRandomNumber(5);
_vm->_voy._vocSecondsOffset = _vm->getRandomNumber(29);
_vm->_voy->_vocSecondsOffset = _vm->getRandomNumber(29);
Common::String fname = _vm->_soundManager.getVOCFileName(_vm->_currentVocId);
_vm->_soundManager.startVOCPlay(fname);
@ -1334,7 +1334,7 @@ int ThreadResource::doInterface() {
_vm->_graphicsManager.setColor(240, 220, 220, 220);
_vm->_eventsManager._intPtr._hasPalette = true;
_vm->_voy._eventFlags &= ~EVTFLAG_TIME_DISABLED;
_vm->_voy->_eventFlags &= ~EVTFLAG_TIME_DISABLED;
// Set the cusor
PictureResource *crosshairsCursor = _vm->_bVoy->boltEntry(0x112)._picResource;
@ -1376,13 +1376,13 @@ int ThreadResource::doInterface() {
if ((*hotspots)[hotspotIdx].contains(pt)) {
// Rect check done
for (int arrIndex = 0; arrIndex < 3; ++arrIndex) {
if (_vm->_voy._audioHotspotTimes.isInRange(arrIndex, hotspotIdx, _vm->_voy._RTVNum)) {
if (_vm->_voy->_audioHotspotTimes.isInRange(arrIndex, hotspotIdx, _vm->_voy->_RTVNum)) {
// Set the ear cursor for an audio event
_vm->_eventsManager.setCursor(listenCursor);
regionIndex = hotspotIdx;
}
if (_vm->_voy._evidenceHotspotTimes.isInRange(arrIndex, hotspotIdx, _vm->_voy._RTVNum)) {
if (_vm->_voy->_evidenceHotspotTimes.isInRange(arrIndex, hotspotIdx, _vm->_voy->_RTVNum)) {
// Set the magnifier cursor for an evidence event
_vm->_eventsManager.setCursor(mangifyCursor);
regionIndex = hotspotIdx;
@ -1390,7 +1390,7 @@ int ThreadResource::doInterface() {
}
for (int arrIndex = 0; arrIndex < 8; ++arrIndex) {
if (_vm->_voy._videoHotspotTimes.isInRange(arrIndex, hotspotIdx, _vm->_voy._RTVNum)) {
if (_vm->_voy->_videoHotspotTimes.isInRange(arrIndex, hotspotIdx, _vm->_voy->_RTVNum)) {
// Set the eye cursor for a video event
_vm->_eventsManager.setCursor(eyeCursor);
regionIndex = hotspotIdx;
@ -1405,42 +1405,42 @@ int ThreadResource::doInterface() {
}
// Regularly update the time display
if (_vm->_voy._RTANum & 2) {
if (_vm->_voy->_RTANum & 2) {
_vm->_graphicsManager.drawANumber(*_vm->_graphicsManager._vPort,
_vm->_gameMinute / 10, Common::Point(190, 25));
_vm->_graphicsManager.drawANumber(*_vm->_graphicsManager._vPort,
_vm->_gameMinute % 10, Common::Point(201, 25));
if (_vm->_voy._RTANum & 4) {
if (_vm->_voy->_RTANum & 4) {
int v = _vm->_gameHour / 10;
_vm->_graphicsManager.drawANumber(*_vm->_graphicsManager._vPort,
v == 0 ? 10 : v, Common::Point(161, 25));
_vm->_graphicsManager.drawANumber(*_vm->_graphicsManager._vPort,
_vm->_gameHour % 10, Common::Point(172, 25));
pic = _vm->_bVoy->boltEntry(_vm->_voy._isAM ? 272 : 273)._picResource;
pic = _vm->_bVoy->boltEntry(_vm->_voy->_isAM ? 272 : 273)._picResource;
_vm->_graphicsManager.sDrawPic(pic, *_vm->_graphicsManager._vPort,
Common::Point(215, 27));
}
}
_vm->_voy._RTANum = 0;
_vm->_voy->_RTANum = 0;
_vm->flipPageAndWait();
pt = _vm->_eventsManager.getMousePos();
if ((_vm->_voy._RTVNum >= _vm->_voy._RTVLimit) || ((_vm->_voy._eventFlags & 0x80) &&
if ((_vm->_voy->_RTVNum >= _vm->_voy->_RTVLimit) || ((_vm->_voy->_eventFlags & 0x80) &&
_vm->_eventsManager._rightClick && (pt.x == 0))) {
// Time to transition to the next time period
_vm->_eventsManager.getMouseInfo();
if (_vm->_voy._transitionId == 15) {
if (_vm->_voy->_transitionId == 15) {
regionIndex = 20;
_vm->_voy._transitionId = 17;
_vm->_voy->_transitionId = 17;
_vm->_soundManager.stopVOCPlay();
_vm->checkTransition();
_vm->_eventsManager._leftClick = true;
} else {
_vm->_voy._eventFlags |= EVTFLAG_TIME_DISABLED;
_vm->_voy->_eventFlags |= EVTFLAG_TIME_DISABLED;
chooseSTAMPButton(20);
parsePlayCommands();
@ -1452,7 +1452,7 @@ int ThreadResource::doInterface() {
hotspots = &_vm->_bVoy->boltEntry(_vm->_playStampGroupId + 1)._rectResource->_entries;
_vm->_eventsManager.getMouseInfo();
_vm->_voy._eventFlags &= ~EVTFLAG_TIME_DISABLED;
_vm->_voy->_eventFlags &= ~EVTFLAG_TIME_DISABLED;
_vm->_eventsManager._intPtr._flashStep = 1;
_vm->_eventsManager._intPtr._flashTimer = 0;
}
@ -1461,7 +1461,7 @@ int ThreadResource::doInterface() {
(!_vm->_eventsManager._leftClick || regionIndex == -1));
_vm->_eventsManager.hideCursor();
_vm->_voy._eventFlags |= EVTFLAG_TIME_DISABLED;
_vm->_voy->_eventFlags |= EVTFLAG_TIME_DISABLED;
_vm->_bVoy->freeBoltGroup(_vm->_playStampGroupId);
if (_vm->_currentVocId != -1)
_vm->_soundManager.stopVOCPlay();
@ -1550,7 +1550,7 @@ void ThreadResource::clearButtonFlag(int idx, byte bits) {
}
void ThreadResource::loadTheApt() {
switch (_vm->_voy._transitionId) {
switch (_vm->_voy->_transitionId) {
case 1:
case 2:
case 5:
@ -1578,13 +1578,13 @@ void ThreadResource::loadTheApt() {
break;
}
if (_vm->_voy._aptLoadMode == 143)
_vm->_voy._aptLoadMode = -1;
if (_vm->_voy->_aptLoadMode == 143)
_vm->_voy->_aptLoadMode = -1;
if (_vm->_voy._aptLoadMode != -1) {
if (_vm->_voy->_aptLoadMode != -1) {
doAptAnim(1);
_vm->_bVoy->getBoltGroup(_vm->_playStampGroupId);
_vm->_voy._aptLoadMode = -1;
_vm->_voy->_aptLoadMode = -1;
_vm->_graphicsManager._backgroundPage = _vm->_bVoy->boltEntry(
_vm->_playStampGroupId + 5)._picResource;
(*_vm->_graphicsManager._vPort)->setupViewPort(
@ -1614,13 +1614,13 @@ void ThreadResource::freeTheApt() {
_vm->_currentVocId = -1;
}
if (_vm->_voy._aptLoadMode == -1) {
if (_vm->_voy->_aptLoadMode == -1) {
_vm->_graphicsManager.fadeDownICF(6);
} else {
doAptAnim(2);
}
if (_vm->_voy._aptLoadMode == 140) {
if (_vm->_voy->_aptLoadMode == 140) {
_vm->_graphicsManager.screenReset();
_vm->_graphicsManager.resetPalette();
}
@ -1628,7 +1628,7 @@ void ThreadResource::freeTheApt() {
(*_vm->_graphicsManager._vPort)->setupViewPort(nullptr);
_vm->_bVoy->freeBoltGroup(_vm->_playStampGroupId);
_vm->_playStampGroupId = -1;
_vm->_voy._viewBounds = nullptr;
_vm->_voy->_viewBounds = nullptr;
}
void ThreadResource::doAptAnim(int mode) {
@ -1636,7 +1636,7 @@ void ThreadResource::doAptAnim(int mode) {
// Figure out the resource to use
int id = 0;
switch (_vm->_voy._aptLoadMode) {
switch (_vm->_voy->_aptLoadMode) {
case 140:
id = 0x5A00;
break;
@ -1657,7 +1657,7 @@ void ThreadResource::doAptAnim(int mode) {
}
int id2 = (id == 0x6C00 || id == 0x6F00) ? 1 : 2;
switch (_vm->_voy._transitionId) {
switch (_vm->_voy->_transitionId) {
case 3:
id += id2 << 8;
break;

View File

@ -999,45 +999,45 @@ void GraphicsManager::screenReset() {
void GraphicsManager::fadeDownICF1(int steps) {
if (steps > 0) {
int stepAmount = _vm->_voy._fadingAmount2 / steps;
int stepAmount = _vm->_voy->_fadingAmount2 / steps;
for (int idx = 0; idx < steps; ++idx) {
_vm->_voy._fadingAmount2 -= stepAmount;
_vm->_voy->_fadingAmount2 -= stepAmount;
_vm->_eventsManager.delay(1);
}
}
_vm->_voy._fadingAmount2 = 0;
_vm->_voy->_fadingAmount2 = 0;
}
void GraphicsManager::fadeUpICF1(int steps) {
if (steps > 0) {
int stepAmount = (63 - _vm->_voy._fadingAmount2) / steps;
int stepAmount = (63 - _vm->_voy->_fadingAmount2) / steps;
for (int idx = 0; idx < steps; ++idx) {
_vm->_voy._fadingAmount2 += stepAmount;
_vm->_voy->_fadingAmount2 += stepAmount;
_vm->_eventsManager.delay(1);
}
}
_vm->_voy._fadingAmount2 = 63;
_vm->_voy->_fadingAmount2 = 63;
}
void GraphicsManager::fadeDownICF(int steps) {
if (steps > 0) {
_vm->_eventsManager.hideCursor();
int stepAmount1 = _vm->_voy._fadingAmount1 / steps;
int stepAmount2 = _vm->_voy._fadingAmount2 / steps;
int stepAmount1 = _vm->_voy->_fadingAmount1 / steps;
int stepAmount2 = _vm->_voy->_fadingAmount2 / steps;
for (int idx = 0; idx < steps; ++idx) {
_vm->_voy._fadingAmount1 -= stepAmount1;
_vm->_voy._fadingAmount2 -= stepAmount2;
_vm->_voy->_fadingAmount1 -= stepAmount1;
_vm->_voy->_fadingAmount2 -= stepAmount2;
_vm->_eventsManager.delay(1);
}
}
_vm->_voy._fadingAmount1 = 0;
_vm->_voy._fadingAmount2 = 0;
_vm->_voy->_fadingAmount1 = 0;
_vm->_voy->_fadingAmount2 = 0;
}
void GraphicsManager::drawDot() {

View File

@ -39,6 +39,7 @@ VoyeurEngine::VoyeurEngine(OSystem *syst, const VoyeurGameDescription *gameDesc)
_gameDescription(gameDesc), _randomSource("Voyeur"), _soundManager(_mixer),
_defaultFontInfo(3, 0xff, 0xff, 0, 0, ALIGN_LEFT, 0, Common::Point(), 1, 1,
Common::Point(1, 1), 1, 0, 0) {
_voy = nullptr;
_bVoy = NULL;
_iForceDeath = ConfMan.getInt("boot_param");
@ -66,6 +67,7 @@ VoyeurEngine::VoyeurEngine(OSystem *syst, const VoyeurGameDescription *gameDesc)
VoyeurEngine::~VoyeurEngine() {
delete _bVoy;
delete _voy;
}
Common::Error VoyeurEngine::run() {
@ -75,7 +77,7 @@ Common::Error VoyeurEngine::run() {
// The original allows the victim to be explicitly specified via the command line.
// This is possible in ScummVM by using a boot parameter.
if (_iForceDeath >= 1 && _iForceDeath <= 4)
_voy._eventFlags |= EVTFLAG_VICTIM_PRESET;
_voy->_eventFlags |= EVTFLAG_VICTIM_PRESET;
if (doHeadTitle()) {
playStamp();
@ -97,7 +99,7 @@ void VoyeurEngine::initializeManagers() {
_filesManager.setVm(this);
_graphicsManager.setVm(this);
_soundManager.setVm(this);
_voy.setVm(this);
_voy = new SVoy(this);
}
void VoyeurEngine::ESP_Init() {
@ -119,7 +121,7 @@ void VoyeurEngine::globalInitBolt() {
assert(_graphicsManager._fontPtr->_curFont);
// Setup default flags
_voy._viewBounds = nullptr;
_voy->_viewBounds = nullptr;
_eventsManager.addFadeInt();
}
@ -176,21 +178,21 @@ bool VoyeurEngine::doHeadTitle() {
doTransitionCard("Saturday Afternoon", "Player's Apartment");
_eventsManager.delayClick(90);
if (_voy._eventFlags & EVTFLAG_VICTIM_PRESET) {
if (_voy->_eventFlags & EVTFLAG_VICTIM_PRESET) {
// Preset victim turned on, so add a default set of incriminating videos
_voy.addEvent(18, 1, EVTYPE_VIDEO, 33, 0, 998, -1);
_voy.addEvent(18, 2, EVTYPE_VIDEO, 41, 0, 998, -1);
_voy.addEvent(18, 3, EVTYPE_VIDEO, 47, 0, 998, -1);
_voy.addEvent(18, 4, EVTYPE_VIDEO, 53, 0, 998, -1);
_voy.addEvent(18, 5, EVTYPE_VIDEO, 46, 0, 998, -1);
_voy.addEvent(18, 6, EVTYPE_VIDEO, 50, 0, 998, -1);
_voy.addEvent(18, 7, EVTYPE_VIDEO, 40, 0, 998, -1);
_voy.addEvent(18, 8, EVTYPE_VIDEO, 43, 0, 998, -1);
_voy.addEvent(19, 1, EVTYPE_AUDIO, 20, 0, 998, -1);
_voy->addEvent(18, 1, EVTYPE_VIDEO, 33, 0, 998, -1);
_voy->addEvent(18, 2, EVTYPE_VIDEO, 41, 0, 998, -1);
_voy->addEvent(18, 3, EVTYPE_VIDEO, 47, 0, 998, -1);
_voy->addEvent(18, 4, EVTYPE_VIDEO, 53, 0, 998, -1);
_voy->addEvent(18, 5, EVTYPE_VIDEO, 46, 0, 998, -1);
_voy->addEvent(18, 6, EVTYPE_VIDEO, 50, 0, 998, -1);
_voy->addEvent(18, 7, EVTYPE_VIDEO, 40, 0, 998, -1);
_voy->addEvent(18, 8, EVTYPE_VIDEO, 43, 0, 998, -1);
_voy->addEvent(19, 1, EVTYPE_AUDIO, 20, 0, 998, -1);
}
}
_voy._aptLoadMode = 140;
_voy->_aptLoadMode = 140;
return true;
}
@ -229,7 +231,7 @@ bool VoyeurEngine::doLock() {
byte *wrongVoc = _filesManager.fload("wrong.voc", &wrongVocSize);
if (_bVoy->getBoltGroup(0x700)) {
_voy._viewBounds = _bVoy->boltEntry(0x704)._rectResource;
_voy->_viewBounds = _bVoy->boltEntry(0x704)._rectResource;
Common::String password = "3333";
PictureResource *cursorPic = _bVoy->getPictureResource(0x702);
@ -374,7 +376,7 @@ bool VoyeurEngine::doLock() {
flipPageAndWait();
_graphicsManager.resetPalette();
_voy._viewBounds = nullptr;
_voy->_viewBounds = nullptr;
_bVoy->freeBoltGroup(0x700);
}
@ -438,17 +440,17 @@ void VoyeurEngine::doOpening() {
PictureResource *textPic = nullptr;
Common::Point textPos;
_voy._vocSecondsOffset = 0;
_voy._RTVNum = 0;
_voy._audioVisualStartTime = _voy._RTVNum;
_voy._eventFlags |= EVTFLAG_RECORDING;
_voy->_vocSecondsOffset = 0;
_voy->_RTVNum = 0;
_voy->_audioVisualStartTime = _voy->_RTVNum;
_voy->_eventFlags |= EVTFLAG_RECORDING;
_gameHour = 4;
_gameMinute = 0;
_audioVideoId = 1;
_eventsManager._videoDead = -1;
_voy.addVideoEventStart();
_voy->addVideoEventStart();
_voy._eventFlags &= ~EVTFLAG_TIME_DISABLED;
_voy->_eventFlags &= ~EVTFLAG_TIME_DISABLED;
for (int i = 0; i < 256; ++i)
_graphicsManager.setColor(i, 8, 8, 8);
@ -500,12 +502,12 @@ void VoyeurEngine::doOpening() {
g_system->delayMillis(10);
}
if ((_voy._RTVNum - _voy._audioVisualStartTime) < 2)
if ((_voy->_RTVNum - _voy->_audioVisualStartTime) < 2)
_eventsManager.delay(60);
_voy._eventFlags |= EVTFLAG_TIME_DISABLED;
_voy.addVideoEventEnd();
_voy._eventFlags &= ~EVTFLAG_RECORDING;
_voy->_eventFlags |= EVTFLAG_TIME_DISABLED;
_voy->addVideoEventEnd();
_voy->_eventFlags &= ~EVTFLAG_RECORDING;
_bVoy->freeBoltGroup(0x200);
}
@ -552,7 +554,7 @@ void VoyeurEngine::playAVideoDuration(int videoId, int duration) {
RL2Decoder decoder;
decoder.loadVideo(videoId);
decoder.seek(Audio::Timestamp(_voy._vocSecondsOffset * 1000));
decoder.seek(Audio::Timestamp(_voy->_vocSecondsOffset * 1000));
decoder.start();
int endFrame = decoder.getCurFrame() + totalFrames;
@ -566,7 +568,7 @@ void VoyeurEngine::playAVideoDuration(int videoId, int duration) {
Common::copy((const byte *)frame->getPixels(), (const byte *)frame->getPixels() + 320 * 200,
(byte *)_graphicsManager._screenSurface.getPixels());
if (_voy._eventFlags & EVTFLAG_RECORDING)
if (_voy->_eventFlags & EVTFLAG_RECORDING)
_graphicsManager.drawDot();
}
@ -582,14 +584,14 @@ void VoyeurEngine::playAVideoDuration(int videoId, int duration) {
// RL2 finished
_graphicsManager.screenReset();
_voy._eventFlags &= ~EVTFLAG_RECORDING;
_voy->_eventFlags &= ~EVTFLAG_RECORDING;
if (_voy._eventFlags & EVTFLAG_8) {
if (_voy->_eventFlags & EVTFLAG_8) {
assert(pic);
byte *imgData = (*_graphicsManager._vPort)->_currentPic->_imgData;
(*_graphicsManager._vPort)->_currentPic->_imgData = pic->_imgData;
pic->_imgData = imgData;
_voy._eventFlags &= ~EVTFLAG_8;
_voy->_eventFlags &= ~EVTFLAG_8;
}
}
@ -604,26 +606,26 @@ void VoyeurEngine::playAudio(int audioId) {
_graphicsManager._backColors->startFade();
flipPageAndWaitForFade();
_voy._eventFlags &= ~EVTFLAG_TIME_DISABLED;
_soundManager.setVOCOffset(_voy._vocSecondsOffset);
_voy->_eventFlags &= ~EVTFLAG_TIME_DISABLED;
_soundManager.setVOCOffset(_voy->_vocSecondsOffset);
Common::String filename = _soundManager.getVOCFileName(
audioId + 159);
_soundManager.startVOCPlay(filename);
_voy._eventFlags |= EVTFLAG_RECORDING;
_voy->_eventFlags |= EVTFLAG_RECORDING;
_eventsManager.startCursorBlink();
while (!shouldQuit() && !_eventsManager._mouseClicked &&
_soundManager.getVOCStatus())
_eventsManager.delayClick(1);
_voy._eventFlags |= EVTFLAG_TIME_DISABLED;
_voy->_eventFlags |= EVTFLAG_TIME_DISABLED;
_soundManager.stopVOCPlay();
_bVoy->freeBoltGroup(0x7F00);
(*_graphicsManager._vPort)->setupViewPort(NULL);
_voy._eventFlags &= ~EVTFLAG_RECORDING;
_voy._playStampMode = 129;
_voy->_eventFlags &= ~EVTFLAG_RECORDING;
_voy->_playStampMode = 129;
}
void VoyeurEngine::doTransitionCard(const Common::String &time, const Common::String &location) {
@ -680,11 +682,11 @@ void VoyeurEngine::flipPageAndWaitForFade() {
}
void VoyeurEngine::showEndingNews() {
_playStampGroupId = (_voy._incriminatedVictimNumber - 1) * 256 + 0x7700;
_voy._boltGroupId2 = (_controlPtr->_state->_victimIndex - 1) * 256 + 0x7B00;
_playStampGroupId = (_voy->_incriminatedVictimNumber - 1) * 256 + 0x7700;
_voy->_boltGroupId2 = (_controlPtr->_state->_victimIndex - 1) * 256 + 0x7B00;
_bVoy->getBoltGroup(_playStampGroupId);
_bVoy->getBoltGroup(_voy._boltGroupId2);
_bVoy->getBoltGroup(_voy->_boltGroupId2);
PictureResource *pic = _bVoy->boltEntry(_playStampGroupId)._picResource;
CMapResource *pal = _bVoy->boltEntry(_playStampGroupId + 1)._cMapResource;
@ -697,8 +699,8 @@ void VoyeurEngine::showEndingNews() {
for (int idx = 1; idx < 4; ++idx) {
if (idx == 3) {
pic = _bVoy->boltEntry(_voy._boltGroupId2)._picResource;
pal = _bVoy->boltEntry(_voy._boltGroupId2 + 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;
@ -730,9 +732,9 @@ void VoyeurEngine::showEndingNews() {
}
_bVoy->freeBoltGroup(_playStampGroupId);
_bVoy->freeBoltGroup(_voy._boltGroupId2);
_bVoy->freeBoltGroup(_voy->_boltGroupId2);
_playStampGroupId = -1;
_voy._boltGroupId2 = -1;
_voy->_boltGroupId2 = -1;
}
/*------------------------------------------------------------------------*/
@ -772,7 +774,7 @@ void VoyeurEngine::loadGame(int slot) {
Common::Serializer serializer(saveFile, NULL);
// Store the current time index before the game is loaded
_checkTransitionId = _voy._transitionId;
_checkTransitionId = _voy->_transitionId;
// Stop any playing sound
_soundManager.stopVOCPlay();
@ -838,7 +840,7 @@ void VoyeurEngine::synchronize(Common::Serializer &s) {
s.syncAsSint16LE(_checkPhoneVal);
// Sub-systems
_voy.synchronize(s);
_voy->synchronize(s);
_graphicsManager.synchronize(s);
_mainThread->synchronize(s);
_controlPtr->_state->synchronize(s);

View File

@ -162,7 +162,7 @@ public:
FilesManager _filesManager;
GraphicsManager _graphicsManager;
SoundManager _soundManager;
SVoy _voy;
SVoy *_voy;
BoltFile *_stampLibPtr;
BoltGroup *_controlGroupPtr;

View File

@ -41,10 +41,10 @@ void VoyeurEngine::playStamp() {
_mainThread = threadsList->_entries[0]->_threadResource;
_mainThread->initThreadStruct(0, 0);
_voy._isAM = false;
_voy->_isAM = false;
_gameHour = 9;
_gameMinute = 0;
_voy._abortInterface = true;
_voy->_abortInterface = true;
int buttonId;
bool breakFlag = false;
@ -56,31 +56,31 @@ void VoyeurEngine::playStamp() {
_mainThread->parsePlayCommands();
bool flag = breakFlag = (_voy._eventFlags & EVTFLAG_2) != 0;
bool flag = breakFlag = (_voy->_eventFlags & EVTFLAG_2) != 0;
switch (_voy._playStampMode) {
switch (_voy->_playStampMode) {
case 5:
buttonId = _mainThread->doInterface();
if (buttonId == -2) {
switch (_mainThread->doApt()) {
case 0:
_voy._aptLoadMode = 140;
_voy->_aptLoadMode = 140;
break;
case 1:
_voy._eventFlags &= ~EVTFLAG_TIME_DISABLED;
_voy._abortInterface = true;
_voy->_eventFlags &= ~EVTFLAG_TIME_DISABLED;
_voy->_abortInterface = true;
_mainThread->chooseSTAMPButton(22);
_voy._aptLoadMode = 143;
_voy->_aptLoadMode = 143;
break;
case 2:
_voy._eventFlags &= ~EVTFLAG_TIME_DISABLED;
_voy->_eventFlags &= ~EVTFLAG_TIME_DISABLED;
reviewTape();
_voy._abortInterface = true;
_voy._aptLoadMode = 142;
_voy->_abortInterface = true;
_voy->_aptLoadMode = 142;
break;
case 3:
_voy._eventFlags &= ~EVTFLAG_TIME_DISABLED;
_voy->_eventFlags &= ~EVTFLAG_TIME_DISABLED;
_mainThread->chooseSTAMPButton(21);
break;
case 4:
@ -88,9 +88,9 @@ void VoyeurEngine::playStamp() {
break;
case 5:
doGossip();
_voy._abortInterface = true;
_voy._aptLoadMode = 141;
_voy._eventFlags &= ~EVTFLAG_100;
_voy->_abortInterface = true;
_voy->_aptLoadMode = 141;
_voy->_eventFlags &= ~EVTFLAG_100;
break;
default:
break;
@ -108,7 +108,7 @@ void VoyeurEngine::playStamp() {
break;
case 16:
_voy._transitionId = 17;
_voy->_transitionId = 17;
buttonId = _mainThread->doApt();
switch (buttonId) {
@ -118,7 +118,7 @@ void VoyeurEngine::playStamp() {
break;
case 2:
reviewTape();
_voy._abortInterface = true;
_voy->_abortInterface = true;
break;
case 4:
flag = true;
@ -132,13 +132,13 @@ void VoyeurEngine::playStamp() {
case 17:
// Called the police, showing the tape
doTapePlaying();
if (!checkForMurder() && _voy._transitionId <= 15)
if (!checkForMurder() && _voy->_transitionId <= 15)
checkForIncriminate();
if (_voy._videoEventId != -1) {
if (_voy->_videoEventId != -1) {
// Show the found video that is of interest to the police
playAVideoEvent(_voy._videoEventId);
_voy._eventFlags &= ~EVTFLAG_RECORDING;
playAVideoEvent(_voy->_videoEventId);
_voy->_eventFlags &= ~EVTFLAG_RECORDING;
}
// Handle response
@ -163,12 +163,12 @@ void VoyeurEngine::playStamp() {
flag = true;
if (buttonId != 4) {
_voy._playStampMode = 131;
_voy.checkForKey();
_voy->_playStampMode = 131;
_voy->checkForKey();
_mainThread->chooseSTAMPButton(buttonId);
} else {
_mainThread->chooseSTAMPButton(buttonId);
_voy._abortInterface = true;
_voy->_abortInterface = true;
}
}
break;
@ -187,9 +187,9 @@ void VoyeurEngine::playStamp() {
_audioVideoId = -1;
if (_voy._boltGroupId2 != -1) {
_bVoy->freeBoltGroup(_voy._boltGroupId2);
_voy._boltGroupId2 = -1;
if (_voy->_boltGroupId2 != -1) {
_bVoy->freeBoltGroup(_voy->_boltGroupId2);
_voy->_boltGroupId2 = -1;
}
if (_playStampGroupId != -1) {
@ -211,7 +211,7 @@ void VoyeurEngine::playStamp() {
} while (flag);
}
_voy._viewBounds = nullptr;
_voy->_viewBounds = nullptr;
closeStamp();
_stampLibPtr->freeBoltGroup(0);
delete _stampLibPtr;
@ -429,15 +429,15 @@ void VoyeurEngine::reviewTape() {
_bVoy->getBoltGroup(0x900);
PictureResource *cursor = _bVoy->boltEntry(0x903)._picResource;
if ((_voy._eventCount - 8) != 0)
eventStart = MAX(_voy._eventCount - 8, 0);
if ((_voy->_eventCount - 8) != 0)
eventStart = MAX(_voy->_eventCount - 8, 0);
if ((eventStart + _voy._eventCount) <= 7)
eventLine = eventStart + _voy._eventCount - 1;
if ((eventStart + _voy->_eventCount) <= 7)
eventLine = eventStart + _voy->_eventCount - 1;
bool breakFlag = false;
while (!shouldQuit() && !breakFlag) {
_voy._viewBounds = _bVoy->boltEntry(0x907)._rectResource;
_voy->_viewBounds = _bVoy->boltEntry(0x907)._rectResource;
Common::Array<RectEntry> &hotspots = _bVoy->boltEntry(0x906)._rectResource->_entries;
_graphicsManager._backColors = _bVoy->boltEntry(0x902)._cMapResource;
@ -470,11 +470,11 @@ void VoyeurEngine::reviewTape() {
}
_currentVocId = 151;
_voy._vocSecondsOffset = 0;
_voy->_vocSecondsOffset = 0;
bool needRedraw = true;
do {
if (_currentVocId != -1 && !_soundManager.getVOCStatus()) {
_voy._musicStartTime = _voy._RTVNum;
_voy->_musicStartTime = _voy->_RTVNum;
_soundManager.startVOCPlay(_currentVocId);
}
@ -488,7 +488,7 @@ void VoyeurEngine::reviewTape() {
int yp = 45;
int eventNum = eventStart;
for (int lineNum = 0; lineNum < 8 && eventNum < _voy._eventCount; ++lineNum, ++eventNum) {
for (int lineNum = 0; lineNum < 8 && eventNum < _voy->_eventCount; ++lineNum, ++eventNum) {
_graphicsManager._fontPtr->_picFlags = 0;
_graphicsManager._fontPtr->_picSelect = 0xff;
_graphicsManager._fontPtr->_picPick = 7;
@ -532,7 +532,7 @@ void VoyeurEngine::reviewTape() {
if (tempPos.x >= 68 && tempPos.x <= 277 && tempPos.y >= 31 && tempPos.y <= 154) {
tempPos.y -= 2;
foundIndex = (tempPos.y - 31) / 15;
if ((tempPos.y - 31) % 15 >= 12 || (eventStart + foundIndex) >= _voy._eventCount) {
if ((tempPos.y - 31) % 15 >= 12 || (eventStart + foundIndex) >= _voy->_eventCount) {
_eventsManager.setCursorColor(128, 0);
foundIndex = 999;
} else if (!_eventsManager._leftClick) {
@ -550,7 +550,7 @@ void VoyeurEngine::reviewTape() {
int yp = 45;
int eventNum = eventStart;
for (int idx = 0; idx < 8 && eventNum < _voy._eventCount; ++idx, ++eventNum) {
for (int idx = 0; idx < 8 && eventNum < _voy->_eventCount; ++idx, ++eventNum) {
_graphicsManager._fontPtr->_picFlags = 0;
_graphicsManager._fontPtr->_picSelect = 0xff;
_graphicsManager._fontPtr->_picPick = 7;
@ -577,11 +577,11 @@ void VoyeurEngine::reviewTape() {
_eventsManager.getMouseInfo();
foundIndex = -1;
}
} else if ((_voy._eventFlags & EVTFLAG_40) && _voy._viewBounds->left == pt.x &&
_voy._viewBounds->bottom == pt.y) {
} else if ((_voy->_eventFlags & EVTFLAG_40) && _voy->_viewBounds->left == pt.x &&
_voy->_viewBounds->bottom == pt.y) {
foundIndex = 999;
} else if ((_voy._eventFlags & EVTFLAG_40) && _voy._viewBounds->left == pt.x &&
_voy._viewBounds->top == pt.y) {
} else if ((_voy->_eventFlags & EVTFLAG_40) && _voy->_viewBounds->left == pt.x &&
_voy->_viewBounds->top == pt.y) {
foundIndex = 998;
} else {
_eventsManager.setCursorColor(128, (foundIndex == -1) ? 0 : 1);
@ -610,7 +610,7 @@ void VoyeurEngine::reviewTape() {
break;
case 4:
if ((_voy._eventCount - 8) > eventStart) {
if ((_voy->_eventCount - 8) > eventStart) {
++eventStart;
needRedraw = true;
}
@ -618,10 +618,10 @@ void VoyeurEngine::reviewTape() {
break;
case 5:
if (_voy._eventCount >= 8 && (_voy._eventCount - 8) != eventStart) {
if (_voy->_eventCount >= 8 && (_voy->_eventCount - 8) != eventStart) {
eventStart += 8;
if ((_voy._eventCount - 8) < eventStart)
eventStart = _voy._eventCount - 8;
if ((_voy->_eventCount - 8) < eventStart)
eventStart = _voy->_eventCount - 8;
needRedraw = true;
}
foundIndex = -1;
@ -631,13 +631,13 @@ void VoyeurEngine::reviewTape() {
break;
}
while (eventLine > 0 && (eventLine + eventStart) >= _voy._eventCount)
while (eventLine > 0 && (eventLine + eventStart) >= _voy->_eventCount)
--eventLine;
}
pt = _eventsManager.getMousePos();
if (_eventsManager._mouseClicked && _voy._viewBounds->left == pt.x &&
(_voy._eventFlags & EVTFLAG_40) && _eventsManager._rightClick) {
if (_eventsManager._mouseClicked && _voy->_viewBounds->left == pt.x &&
(_voy->_eventFlags & EVTFLAG_40) && _eventsManager._rightClick) {
_controlPtr->_state->_victimIndex = (pt.y / 60) + 1;
foundIndex = -1;
_eventsManager._rightClick = 0;
@ -649,12 +649,12 @@ void VoyeurEngine::reviewTape() {
} while (!shouldQuit() && (!_eventsManager._mouseClicked || foundIndex == -1));
newY = _eventsManager.getMousePos().y;
_voy._fadingType = 0;
_voy._viewBounds = nullptr;
_voy->_fadingType = 0;
_voy->_viewBounds = nullptr;
(*_graphicsManager._vPort)->setupViewPort(NULL);
if (_currentVocId != -1) {
_voy._vocSecondsOffset = _voy._RTVNum - _voy._musicStartTime;
_voy->_vocSecondsOffset = _voy->_RTVNum - _voy->_musicStartTime;
_soundManager.stopVOCPlay();
}
@ -663,7 +663,7 @@ void VoyeurEngine::reviewTape() {
break;
int eventIndex = eventStart + eventLine;
VoyeurEvent &e = _voy._events[eventIndex];
VoyeurEvent &e = _voy->_events[eventIndex];
switch (e._type) {
case EVTYPE_VIDEO:
playAVideoEvent(eventIndex);
@ -671,7 +671,7 @@ void VoyeurEngine::reviewTape() {
case EVTYPE_AUDIO: {
_audioVideoId = e._audioVideoId;
_voy._vocSecondsOffset = e._computerOn;
_voy->_vocSecondsOffset = e._computerOn;
_bVoy->getBoltGroup(0x7F00);
_graphicsManager._backgroundPage = _bVoy->boltEntry(0x7F00 +
@ -685,10 +685,10 @@ void VoyeurEngine::reviewTape() {
_eventsManager._intPtr._flashStep = 1;
_eventsManager._intPtr._flashTimer = 0;
_voy._eventFlags &= ~EVTFLAG_TIME_DISABLED;
_voy->_eventFlags &= ~EVTFLAG_TIME_DISABLED;
// Play suond for the given duration
_soundManager.setVOCOffset(_voy._vocSecondsOffset);
_soundManager.setVOCOffset(_voy->_vocSecondsOffset);
_soundManager.startVOCPlay(_audioVideoId + 159);
uint32 secondsDuration = e._computerOff;
@ -699,24 +699,24 @@ void VoyeurEngine::reviewTape() {
_eventsManager.delay(10);
}
_voy._eventFlags |= EVTFLAG_TIME_DISABLED;
_voy->_eventFlags |= EVTFLAG_TIME_DISABLED;
_soundManager.stopVOCPlay();
_bVoy->freeBoltGroup(0x7F00);
break;
}
case EVTYPE_EVID:
_voy.reviewAnEvidEvent(eventIndex);
_voy->reviewAnEvidEvent(eventIndex);
_voy._vocSecondsOffset = _voy._RTVNum - _voy._musicStartTime;
_voy->_vocSecondsOffset = _voy->_RTVNum - _voy->_musicStartTime;
_soundManager.stopVOCPlay();
_bVoy->getBoltGroup(0x900);
break;
case EVTYPE_COMPUTER:
_voy.reviewComputerEvent(eventIndex);
_voy->reviewComputerEvent(eventIndex);
_voy._vocSecondsOffset = _voy._RTVNum - _voy._musicStartTime;
_voy->_vocSecondsOffset = _voy->_RTVNum - _voy->_musicStartTime;
_soundManager.stopVOCPlay();
_bVoy->getBoltGroup(0x900);
break;
@ -809,8 +809,8 @@ void VoyeurEngine::doTapePlaying() {
bool VoyeurEngine::checkForMurder() {
int oldMurderIndex = _controlPtr->_state->_victimMurderIndex;
for (int idx = 0; idx < _voy._eventCount; ++idx) {
VoyeurEvent &evt = _voy._events[idx];
for (int idx = 0; idx < _voy->_eventCount; ++idx) {
VoyeurEvent &evt = _voy->_events[idx];
if (evt._type == EVTYPE_VIDEO) {
switch (_controlPtr->_state->_victimIndex) {
@ -848,70 +848,70 @@ bool VoyeurEngine::checkForMurder() {
}
if (_controlPtr->_state->_victimMurderIndex == _controlPtr->_state->_victimIndex) {
_voy._videoEventId = idx;
_voy->_videoEventId = idx;
return true;
}
}
_controlPtr->_state->_victimMurderIndex = oldMurderIndex;
_voy._videoEventId = -1;
_voy->_videoEventId = -1;
return false;
}
bool VoyeurEngine::checkForIncriminate() {
_voy._incriminatedVictimNumber = 0;
_voy->_incriminatedVictimNumber = 0;
for (int idx = 0; idx < _voy._eventCount; ++idx) {
VoyeurEvent &evt = _voy._events[idx];
for (int idx = 0; idx < _voy->_eventCount; ++idx) {
VoyeurEvent &evt = _voy->_events[idx];
if (evt._type == EVTYPE_VIDEO) {
if (evt._audioVideoId == 44 && evt._computerOn <= 40 &&
(evt._computerOff + evt._computerOn) >= 70) {
_voy._incriminatedVictimNumber = 1;
_voy->_incriminatedVictimNumber = 1;
}
if (evt._audioVideoId == 44 && evt._computerOn <= 79 &&
(evt._computerOff + evt._computerOn) >= 129) {
_voy._incriminatedVictimNumber = 1;
_voy->_incriminatedVictimNumber = 1;
}
if (evt._audioVideoId == 20 && evt._computerOn <= 28 &&
(evt._computerOff + evt._computerOn) >= 45) {
_voy._incriminatedVictimNumber = 2;
_voy->_incriminatedVictimNumber = 2;
}
if (evt._audioVideoId == 35 && evt._computerOn <= 17 &&
(evt._computerOff + evt._computerOn) >= 36) {
_voy._incriminatedVictimNumber = 3;
_voy->_incriminatedVictimNumber = 3;
}
if (evt._audioVideoId == 30 && evt._computerOn <= 80 &&
(evt._computerOff + evt._computerOn) >= 139) {
_voy._incriminatedVictimNumber = 4;
_voy->_incriminatedVictimNumber = 4;
}
}
if (_voy._incriminatedVictimNumber) {
if (_voy->_incriminatedVictimNumber) {
_controlPtr->_state->_victimMurderIndex = 88;
_voy._videoEventId = idx;
_voy->_videoEventId = idx;
return true;
}
}
_voy._videoEventId = -1;
_voy->_videoEventId = -1;
return false;
}
void VoyeurEngine::playAVideoEvent(int eventIndex) {
VoyeurEvent &evt = _voy._events[eventIndex];
VoyeurEvent &evt = _voy->_events[eventIndex];
_audioVideoId = evt._audioVideoId;
_voy._vocSecondsOffset = evt._computerOn;
_voy->_vocSecondsOffset = evt._computerOn;
_eventsManager._videoDead = evt._dead;
_voy._eventFlags &= ~EVTFLAG_TIME_DISABLED;
_voy->_eventFlags &= ~EVTFLAG_TIME_DISABLED;
playAVideoDuration(_audioVideoId, evt._computerOff);
_voy._eventFlags |= EVTFLAG_TIME_DISABLED;
_voy->_eventFlags |= EVTFLAG_TIME_DISABLED;
if (_eventsManager._videoDead != -1) {
_bVoy->freeBoltGroup(0xE00);
_eventsManager._videoDead = -1;
@ -938,7 +938,7 @@ int VoyeurEngine::getChooseButton() {
_graphicsManager._backColors->startFade();
flipPageAndWait();
_voy._viewBounds = _bVoy->boltEntry(_playStampGroupId + 7)._rectResource;
_voy->_viewBounds = _bVoy->boltEntry(_playStampGroupId + 7)._rectResource;
PictureResource *cursorPic = _bVoy->boltEntry(_playStampGroupId + 2)._picResource;
do {
@ -952,7 +952,7 @@ int VoyeurEngine::getChooseButton() {
for (uint idx = 0; idx < hotspots.size(); ++idx) {
if (hotspots[idx].contains(pt)) {
if (!_voy._victimMurdered || ((int)idx + 1) != _controlPtr->_state->_victimIndex) {
if (!_voy->_victimMurdered || ((int)idx + 1) != _controlPtr->_state->_victimIndex) {
selectedIndex = idx;
if (selectedIndex != prevIndex) {
PictureResource *btnPic = _bVoy->boltEntry(_playStampGroupId + 8 + idx)._picResource;
@ -989,7 +989,7 @@ void VoyeurEngine::makeViewFinder() {
CMapResource *pal = _bVoy->boltEntry(0x104)._cMapResource;
int palOffset = 0;
switch (_voy._transitionId) {
switch (_voy->_transitionId) {
case 1:
case 2:
case 5:
@ -1037,7 +1037,7 @@ void VoyeurEngine::makeViewFinderP() {
void VoyeurEngine::initIFace() {
int playStamp1 = _playStampGroupId;
switch (_voy._transitionId) {
switch (_voy->_transitionId) {
case 0:
break;
case 1:
@ -1068,7 +1068,7 @@ void VoyeurEngine::initIFace() {
(MANSION_MAX_Y - MANSION_VIEW_HEIGHT) / 2);
doScroll(_mansionViewPos);
_voy._viewBounds = _bVoy->boltEntry(_playStampGroupId)._rectResource;
_voy->_viewBounds = _bVoy->boltEntry(_playStampGroupId)._rectResource;
// Show the cursor using ScummVM functionality
_eventsManager.showCursor();
@ -1083,7 +1083,7 @@ void VoyeurEngine::doScroll(const Common::Point &pt) {
(*_graphicsManager._vPort)->setupViewPort(NULL, &clipRect);
int base = 0;
switch (_voy._transitionId) {
switch (_voy->_transitionId) {
case 0:
break;
case 1:
@ -1121,7 +1121,7 @@ void VoyeurEngine::doScroll(const Common::Point &pt) {
void VoyeurEngine::checkTransition() {
Common::String time, day;
if (_voy._transitionId != _checkTransitionId) {
if (_voy->_transitionId != _checkTransitionId) {
// Get the day
day = getDayName();
@ -1137,12 +1137,12 @@ void VoyeurEngine::checkTransition() {
_eventsManager.delayClick(180);
}
_checkTransitionId = _voy._transitionId;
_checkTransitionId = _voy->_transitionId;
}
}
Common::String VoyeurEngine::getDayName() {
switch (_voy._transitionId) {
switch (_voy->_transitionId) {
case 0:
return "";
case 1:
@ -1158,10 +1158,10 @@ Common::String VoyeurEngine::getDayName() {
}
Common::String VoyeurEngine::getTimeOfDay() {
if (_voy._transitionId == 17)
if (_voy->_transitionId == 17)
return "";
return Common::String::format("%d:%02d%s", _gameHour, _gameMinute, _voy._isAM ? AM : PM);
return Common::String::format("%d:%02d%s", _gameHour, _gameMinute, _voy->_isAM ? AM : PM);
}
int VoyeurEngine::doComputerText(int maxLen) {
@ -1172,10 +1172,10 @@ int VoyeurEngine::doComputerText(int maxLen) {
font._foreColor = 129;
font._fontSaveBack = false;
font._fontFlags = 0;
if (_voy._vocSecondsOffset > 60)
_voy._vocSecondsOffset = 0;
if (_voy->_vocSecondsOffset > 60)
_voy->_vocSecondsOffset = 0;
if (_voy._RTVNum > _voy._computerTimeMax && maxLen == 9999) {
if (_voy->_RTVNum > _voy->_computerTimeMax && maxLen == 9999) {
if (_currentVocId != -1)
_soundManager.startVOCPlay(_currentVocId);
font._justify = ALIGN_LEFT;
@ -1183,7 +1183,7 @@ int VoyeurEngine::doComputerText(int maxLen) {
font._justifyHeight = 100;
font._pos = Common::Point(128, 100);
(*_graphicsManager._vPort)->drawText(END_OF_MESSAGE);
} else if (_voy._RTVNum < _voy._computerTimeMin && maxLen == 9999) {
} else if (_voy->_RTVNum < _voy->_computerTimeMin && maxLen == 9999) {
if (_currentVocId != -1)
_soundManager.startVOCPlay(_currentVocId);
font._justify = ALIGN_LEFT;
@ -1192,15 +1192,15 @@ int VoyeurEngine::doComputerText(int maxLen) {
font._pos = Common::Point(120, 100);
(*_graphicsManager._vPort)->drawText(START_OF_MESSAGE);
} else {
char *msg = (char *)_bVoy->memberAddr(0x4900 + _voy._computerTextId);
char *msg = (char *)_bVoy->memberAddr(0x4900 + _voy->_computerTextId);
font._pos = Common::Point(96, 60);
bool showEnd = true;
int yp = 60;
do {
if (_currentVocId != -1 && !_soundManager.getVOCStatus()) {
if (_voy._vocSecondsOffset > 60)
_voy._vocSecondsOffset = 0;
if (_voy->_vocSecondsOffset > 60)
_voy->_vocSecondsOffset = 0;
_soundManager.startVOCPlay(_currentVocId);
}
@ -1248,7 +1248,7 @@ int VoyeurEngine::doComputerText(int maxLen) {
} while (!shouldQuit() && !_eventsManager._mouseClicked && totalChars < maxLen);
_voy._computerTimeMax = 0;
_voy->_computerTimeMax = 0;
}
flipPageAndWait();
@ -1273,12 +1273,12 @@ void VoyeurEngine::getComputerBrush() {
void VoyeurEngine::doTimeBar() {
flashTimeBar();
if (_voy._RTVLimit > 0) {
if (_voy._RTVNum > _voy._RTVLimit || _voy._RTVNum < 0)
_voy._RTVNum = _voy._RTVLimit - 1;
if (_voy->_RTVLimit > 0) {
if (_voy->_RTVNum > _voy->_RTVLimit || _voy->_RTVNum < 0)
_voy->_RTVNum = _voy->_RTVLimit - 1;
_timeBarVal = _voy._RTVNum;
int height = ((_voy._RTVLimit - _voy._RTVNum) * 59) / _voy._RTVLimit;
_timeBarVal = _voy->_RTVNum;
int height = ((_voy->_RTVLimit - _voy->_RTVNum) * 59) / _voy->_RTVLimit;
int fullHeight = MAX(151 - height, 93);
_graphicsManager._drawPtr->_penColor = 134;
@ -1297,7 +1297,7 @@ void VoyeurEngine::doTimeBar() {
}
void VoyeurEngine::flashTimeBar() {
if (_voy._RTVNum >= 0 && (_voy._RTVLimit - _voy._RTVNum) < 11 &&
if (_voy->_RTVNum >= 0 && (_voy->_RTVLimit - _voy->_RTVNum) < 11 &&
(_eventsManager._intPtr._flashTimer >= (_flashTimeVal + 15) ||
_eventsManager._intPtr._flashTimer < _flashTimeVal)) {
// Within camera low power range
@ -1314,21 +1314,21 @@ void VoyeurEngine::flashTimeBar() {
}
void VoyeurEngine::checkPhoneCall() {
if ((_voy._RTVLimit - _voy._RTVNum) >= 36 && _voy._totalPhoneCalls < 5 &&
if ((_voy->_RTVLimit - _voy->_RTVNum) >= 36 && _voy->_totalPhoneCalls < 5 &&
_currentVocId <= 151 && _currentVocId > 146) {
if ((_voy._switchBGNum < _checkPhoneVal || _checkPhoneVal > 180) &&
if ((_voy->_switchBGNum < _checkPhoneVal || _checkPhoneVal > 180) &&
!_soundManager.getVOCStatus()) {
int soundIndex;
do {
soundIndex = getRandomNumber(4);
} while (_voy._phoneCallsReceived[soundIndex]);
} while (_voy->_phoneCallsReceived[soundIndex]);
_currentVocId = 154 + soundIndex;
_soundManager.stopVOCPlay();
_soundManager.startVOCPlay(_currentVocId);
_checkPhoneVal = _voy._switchBGNum;
_voy._phoneCallsReceived[soundIndex] = true;
++_voy._totalPhoneCalls;
_checkPhoneVal = _voy->_switchBGNum;
_voy->_phoneCallsReceived[soundIndex] = true;
++_voy->_totalPhoneCalls;
}
}
}
@ -1338,31 +1338,31 @@ void VoyeurEngine::doEvidDisplay(int evidId, int eventId) {
flipPageAndWait();
if (_currentVocId != -1) {
_voy._vocSecondsOffset = _voy._RTVNum - _voy._musicStartTime;
_voy->_vocSecondsOffset = _voy->_RTVNum - _voy->_musicStartTime;
_soundManager.stopVOCPlay();
}
_bVoy->getBoltGroup(_voy._boltGroupId2);
PictureResource *pic = _bVoy->boltEntry(_voy._boltGroupId2 + 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._boltGroupId2 + evidId * 2);
_bVoy->freeBoltMember(_voy->_boltGroupId2 + evidId * 2);
CMapResource *pal = _bVoy->boltEntry(_voy._boltGroupId2 + 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._boltGroupId2 + 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._boltGroupId2 +
_voy->_evPicPtrs[idx - 1] = _bVoy->boltEntry(_voy->_boltGroupId2 +
(evidId + idx) * 2)._picResource;
_voy._evCmPtrs[idx - 1] = _bVoy->boltEntry(_voy._boltGroupId2 +
_voy->_evCmPtrs[idx - 1] = _bVoy->boltEntry(_voy->_boltGroupId2 +
(evidId + idx) * 2 + 1)._cMapResource;
}
}
@ -1371,7 +1371,7 @@ void VoyeurEngine::doEvidDisplay(int evidId, int eventId) {
_eventsManager.stopEvidDim();
if (eventId == 999)
_voy.addEvidEventStart(evidId);
_voy->addEvidEventStart(evidId);
_eventsManager.getMouseInfo();
@ -1382,8 +1382,8 @@ void VoyeurEngine::doEvidDisplay(int evidId, int eventId) {
_voyeurArea = AREA_EVIDENCE;
if (_currentVocId != -1 && !_soundManager.getVOCStatus()) {
if (_voy._vocSecondsOffset > 60)
_voy._vocSecondsOffset = 0;
if (_voy->_vocSecondsOffset > 60)
_voy->_vocSecondsOffset = 0;
_soundManager.startVOCPlay(_currentVocId);
}
@ -1394,11 +1394,11 @@ void VoyeurEngine::doEvidDisplay(int evidId, int eventId) {
if (count == 0 || evidIdx >= eventId)
continue;
pic = _voy._evPicPtrs[arrIndex];
pic = _voy->_evPicPtrs[arrIndex];
_graphicsManager.sDrawPic(pic, *_graphicsManager._vPort,
Common::Point((384 - pic->_bounds.width()) / 2,
(240 - pic->_bounds.height()) / 2));
_voy._evCmPtrs[arrIndex]->startFade();
_voy->_evCmPtrs[arrIndex]->startFade();
while (!shouldQuit() && (_eventsManager._fadeStatus & 1))
_eventsManager.delay(1);
@ -1411,11 +1411,11 @@ void VoyeurEngine::doEvidDisplay(int evidId, int eventId) {
}
if (eventId == 999)
_voy.addEvidEventEnd(evidIdx);
_voy->addEvidEventEnd(evidIdx);
for (int idx = 1; idx <= hotspots[evidId]._count; ++idx) {
_bVoy->freeBoltMember(_voy._boltGroupId2 + (evidId + idx) * 2);
_bVoy->freeBoltMember(_voy._boltGroupId2 + (evidId + idx) * 2 + 1);
_bVoy->freeBoltMember(_voy->_boltGroupId2 + (evidId + idx) * 2);
_bVoy->freeBoltMember(_voy->_boltGroupId2 + (evidId + idx) * 2 + 1);
}
}