2013-12-05 21:49:12 -05:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "voyeur/voyeur.h"
|
2013-12-07 20:44:28 -05:00
|
|
|
#include "voyeur/staticres.h"
|
2013-12-05 21:49:12 -05:00
|
|
|
|
|
|
|
namespace Voyeur {
|
|
|
|
|
|
|
|
void VoyeurEngine::addVideoEventStart() {
|
2013-12-05 22:36:59 -05:00
|
|
|
VoyeurEvent &e = _voy._events[_voy._evidence[19]];
|
|
|
|
e._computerNum = _eventsManager._videoComputerNum;
|
|
|
|
e._computerBut[0] = _eventsManager._videoComputerBut1;
|
|
|
|
e._computerBut[1] = _voy._delaySecs;
|
|
|
|
e._computerBut[2] = 1;
|
|
|
|
e._computerBut[3] = _eventsManager._videoComputerBut4;
|
|
|
|
e._dead = _eventsManager._videoDead;
|
2013-12-05 21:49:12 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void VoyeurEngine::playStamp() {
|
2013-12-08 14:44:48 -05:00
|
|
|
_stampLibPtr = NULL;
|
|
|
|
_filesManager.openBoltLib("stampblt.blt", _stampLibPtr);
|
2013-12-07 20:44:28 -05:00
|
|
|
|
2013-12-15 15:08:25 -05:00
|
|
|
_stampLibPtr->getBoltGroup(0);
|
2013-12-10 09:19:54 -05:00
|
|
|
_resolvePtr = &RESOLVE_TABLE[0];
|
2013-12-08 14:44:48 -05:00
|
|
|
initStamp();
|
|
|
|
|
|
|
|
PtrResource *threadsList = _stampLibPtr->boltEntry(3)._ptrResource;
|
2013-12-08 16:51:50 -05:00
|
|
|
ThreadResource *threadP = threadsList->_entries[0]->_threadResource;
|
2013-12-09 22:22:32 -05:00
|
|
|
threadP->initThreadStruct(0, 0);
|
2013-12-07 20:44:28 -05:00
|
|
|
|
|
|
|
_voy._delaySecs = 0;
|
|
|
|
_eventsManager._videoComputerNum = 9;
|
|
|
|
_eventsManager._videoComputerBut1 = 0;
|
|
|
|
_eventsManager._v2A0A2 = 0;
|
2013-12-10 09:19:54 -05:00
|
|
|
_voy._field46E = 1;
|
2013-12-07 20:44:28 -05:00
|
|
|
|
2013-12-09 22:22:32 -05:00
|
|
|
int buttonId;
|
2013-12-07 20:44:28 -05:00
|
|
|
bool breakFlag = false;
|
|
|
|
while (!breakFlag && !shouldQuit()) {
|
2013-12-09 22:22:32 -05:00
|
|
|
_eventsManager.getMouseInfo();
|
|
|
|
_playStamp1 = _playStamp2 = -1;
|
|
|
|
_eventsManager._videoComputerBut4 = -1;
|
|
|
|
|
|
|
|
threadP->parsePlayCommands();
|
|
|
|
|
2013-12-10 09:19:54 -05:00
|
|
|
bool flag = breakFlag = (_voy._field478 & 2) != 0;
|
|
|
|
|
|
|
|
switch (_voy._field470) {
|
2013-12-09 22:22:32 -05:00
|
|
|
case 5:
|
|
|
|
buttonId = threadP->doInterface();
|
|
|
|
|
|
|
|
if (buttonId == -2) {
|
2013-12-14 22:27:16 -05:00
|
|
|
switch (threadP->doApt()) {
|
2013-12-09 22:22:32 -05:00
|
|
|
case 0:
|
2013-12-10 09:19:54 -05:00
|
|
|
_voy._field472 = 140;
|
2013-12-09 22:22:32 -05:00
|
|
|
break;
|
|
|
|
case 1:
|
2013-12-10 09:19:54 -05:00
|
|
|
_voy._field478 = -2;
|
|
|
|
_voy._field46E = 1;
|
2013-12-09 22:22:32 -05:00
|
|
|
threadP->chooseSTAMPButton(22);
|
2013-12-10 09:19:54 -05:00
|
|
|
_voy._field472 = 143;
|
2013-12-09 22:22:32 -05:00
|
|
|
break;
|
|
|
|
case 2:
|
2013-12-10 09:19:54 -05:00
|
|
|
_voy._field478 = -2;
|
2013-12-09 22:22:32 -05:00
|
|
|
reviewTape();
|
2013-12-10 09:19:54 -05:00
|
|
|
_voy._field46E = 1;
|
|
|
|
_voy._field472 = 142;
|
2013-12-09 22:22:32 -05:00
|
|
|
break;
|
|
|
|
case 3:
|
2013-12-10 09:19:54 -05:00
|
|
|
_voy._field478 = -2;
|
2013-12-09 22:22:32 -05:00
|
|
|
threadP->chooseSTAMPButton(21);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
breakFlag = true;
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
doGossip();
|
2013-12-10 09:19:54 -05:00
|
|
|
_voy._field46E = 1;
|
|
|
|
_voy._field472 = 141;
|
|
|
|
_voy._field478 = -1;
|
2013-12-09 22:22:32 -05:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
threadP->chooseSTAMPButton(buttonId);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 6:
|
|
|
|
threadP->doRoom();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 16:
|
2013-12-10 09:19:54 -05:00
|
|
|
_voy._field474 = 17;
|
2013-12-09 22:22:32 -05:00
|
|
|
buttonId = threadP->doApt();
|
|
|
|
|
|
|
|
switch (buttonId) {
|
|
|
|
case 1:
|
|
|
|
threadP->chooseSTAMPButton(22);
|
|
|
|
flag = true;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
reviewTape();
|
2013-12-10 09:19:54 -05:00
|
|
|
_voy._field46E = 1;
|
2013-12-09 22:22:32 -05:00
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
flag = true;
|
|
|
|
breakFlag = true;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 17:
|
|
|
|
doTapePlaying();
|
2013-12-10 09:19:54 -05:00
|
|
|
if (!checkForMurder() && _voy._field474 <= 15)
|
2013-12-09 22:22:32 -05:00
|
|
|
checkForIncriminate();
|
|
|
|
|
|
|
|
if (_voy._videoEventId != -1)
|
|
|
|
playAVideoEvent(_voy._videoEventId);
|
2013-12-10 09:19:54 -05:00
|
|
|
_voy._field478 &= 0x10;
|
2013-12-09 22:22:32 -05:00
|
|
|
threadP->chooseSTAMPButton(0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 130: {
|
|
|
|
//_tmflag = 1;
|
|
|
|
if (_bVoy->getBoltGroup(_playStamp1)) {
|
|
|
|
_graphicsManager._backgroundPage = _bVoy->boltEntry(_playStamp1)._picResource;
|
|
|
|
_graphicsManager._backColors = _bVoy->boltEntry(_playStamp1 + 1)._cMapResource;
|
|
|
|
|
2013-12-14 17:38:01 -05:00
|
|
|
buttonId = getChooseButton();
|
2013-12-09 22:22:32 -05:00
|
|
|
if (_voy._fadeFunc)
|
|
|
|
buttonId = 4;
|
|
|
|
|
|
|
|
_bVoy->freeBoltGroup(_playStamp1);
|
|
|
|
_graphicsManager.screenReset();
|
|
|
|
_playStamp1 = -1;
|
|
|
|
flag = true;
|
|
|
|
|
|
|
|
if (buttonId == 4) {
|
2013-12-10 09:19:54 -05:00
|
|
|
_voy._field470 = 131;
|
2013-12-09 22:22:32 -05:00
|
|
|
_eventsManager.checkForKey();
|
|
|
|
threadP->chooseSTAMPButton(buttonId);
|
|
|
|
flag = true;
|
|
|
|
} else {
|
|
|
|
threadP->chooseSTAMPButton(buttonId);
|
2013-12-10 09:19:54 -05:00
|
|
|
_voy._field46E = 1;
|
2013-12-09 22:22:32 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
do {
|
|
|
|
if (flag) {
|
|
|
|
if (_playStamp2 != -1) {
|
|
|
|
_soundManager.stopVOCPlay();
|
|
|
|
_playStamp2 = -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
_eventsManager._videoComputerBut4 = -1;
|
|
|
|
|
2013-12-10 09:19:54 -05:00
|
|
|
if (_voy._field47A != -1) {
|
|
|
|
_bVoy->freeBoltGroup(_voy._field47A);
|
|
|
|
_voy._field47A = -1;
|
2013-12-09 22:22:32 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
if (_playStamp1 != -1) {
|
|
|
|
_bVoy->freeBoltGroup(_playStamp1);
|
|
|
|
_playStamp1 = -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Break out of loop
|
|
|
|
flag = false;
|
|
|
|
|
2013-12-12 08:51:13 -05:00
|
|
|
} else if (threadP->_field40 & 2) {
|
2013-12-09 22:22:32 -05:00
|
|
|
_eventsManager.getMouseInfo();
|
|
|
|
threadP->chooseSTAMPButton(0);
|
|
|
|
flag = true;
|
|
|
|
} else {
|
|
|
|
threadP->chooseSTAMPButton(0);
|
|
|
|
flag = true;
|
|
|
|
}
|
|
|
|
} while (flag);
|
2013-12-07 20:44:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
_voy._field4386 = 0;
|
2013-12-08 18:23:40 -05:00
|
|
|
closeStamp();
|
2013-12-15 15:08:25 -05:00
|
|
|
_stampLibPtr->freeBoltGroup(0);
|
2013-12-08 18:23:40 -05:00
|
|
|
delete _stampLibPtr;
|
2013-12-05 21:49:12 -05:00
|
|
|
}
|
|
|
|
|
2013-12-08 14:44:48 -05:00
|
|
|
void VoyeurEngine::initStamp() {
|
2013-12-08 19:25:40 -05:00
|
|
|
ThreadResource::_stampFlags &= ~1;
|
2013-12-08 14:44:48 -05:00
|
|
|
_stackGroupPtr = _controlGroupPtr;
|
|
|
|
|
2013-12-08 16:51:50 -05:00
|
|
|
if (!_controlPtr->_entries[0])
|
2013-12-08 14:44:48 -05:00
|
|
|
error("No control entries");
|
|
|
|
|
2013-12-08 19:25:40 -05:00
|
|
|
ThreadResource::initUseCount();
|
2013-12-08 14:44:48 -05:00
|
|
|
}
|
|
|
|
|
2013-12-08 18:23:40 -05:00
|
|
|
void VoyeurEngine::closeStamp() {
|
2013-12-08 19:25:40 -05:00
|
|
|
ThreadResource::unloadAllStacks(this);
|
2013-12-08 18:23:40 -05:00
|
|
|
}
|
|
|
|
|
2013-12-09 22:22:32 -05:00
|
|
|
void VoyeurEngine::reviewTape() {
|
|
|
|
warning("TODO: reviewTape");
|
|
|
|
}
|
2013-12-08 16:51:50 -05:00
|
|
|
|
2013-12-09 22:22:32 -05:00
|
|
|
bool VoyeurEngine::doGossip() {
|
|
|
|
warning("TODO: doGossip");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void VoyeurEngine::doTapePlaying() {
|
|
|
|
warning("TODO");
|
|
|
|
}
|
|
|
|
|
|
|
|
bool VoyeurEngine::checkForMurder() {
|
|
|
|
warning("TODO");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void VoyeurEngine::checkForIncriminate() {
|
|
|
|
warning("TODO");
|
|
|
|
}
|
|
|
|
|
|
|
|
void VoyeurEngine::playAVideoEvent(int eventId) {
|
|
|
|
warning("TODO");
|
|
|
|
}
|
|
|
|
|
|
|
|
int VoyeurEngine::getChooseButton() {
|
|
|
|
warning("TODO");
|
|
|
|
return 0;
|
2013-12-08 18:23:40 -05:00
|
|
|
}
|
2013-12-08 16:51:50 -05:00
|
|
|
|
2013-12-14 11:39:15 -05:00
|
|
|
void VoyeurEngine::makeViewFinder() {
|
2013-12-14 20:40:19 -05:00
|
|
|
error("TODO:makeViewFinder");
|
2013-12-14 11:39:15 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void VoyeurEngine::initIFace(){
|
2013-12-14 20:40:19 -05:00
|
|
|
error("TODO: initIFace");
|
2013-12-14 11:39:15 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void VoyeurEngine::checkTransition(){
|
2013-12-14 20:40:19 -05:00
|
|
|
error("TODO: checkTransition");
|
2013-12-14 11:39:15 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void VoyeurEngine::doTimeBar(int v) {
|
2013-12-14 20:40:19 -05:00
|
|
|
error("TODO: doTimeBar");
|
2013-12-14 11:39:15 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void VoyeurEngine::flashTimeBar(){
|
2013-12-14 20:40:19 -05:00
|
|
|
error("TODO: flashTimeBar");
|
|
|
|
}
|
|
|
|
|
|
|
|
void VoyeurEngine::checkPhoneCall() {
|
|
|
|
error("TODO: checkPhoneCall");
|
2013-12-14 11:39:15 -05:00
|
|
|
}
|
|
|
|
|
2013-12-05 21:49:12 -05:00
|
|
|
} // End of namespace Voyeur
|