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::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
|
|
|
|
2013-12-18 21:26:26 -05:00
|
|
|
_voy._isAM = 0;
|
|
|
|
_gameHour = 9;
|
|
|
|
_gameMinute = 0;
|
2013-12-07 20:44:28 -05:00
|
|
|
_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);
|
|
|
|
}
|
2013-12-21 11:52:53 -05:00
|
|
|
|
|
|
|
flag = true;
|
2013-12-09 22:22:32 -05:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 6:
|
|
|
|
threadP->doRoom();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 16:
|
2013-12-18 22:01:16 -05:00
|
|
|
_voy._transitionId = 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-18 22:01:16 -05:00
|
|
|
if (!checkForMurder() && _voy._transitionId <= 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-18 22:01:16 -05:00
|
|
|
_graphicsManager._backgroundPage = _bVoy->boltEntry(0x103)._picResource;
|
|
|
|
_graphicsManager.sDrawPic(_graphicsManager._backgroundPage,
|
|
|
|
*_graphicsManager._vPort, Common::Point(0, 0));
|
|
|
|
CMapResource *pal = _bVoy->boltEntry(0x104)._cMapResource;
|
|
|
|
|
|
|
|
int palOffset = 0;
|
|
|
|
switch (_voy._transitionId) {
|
|
|
|
case 1:
|
|
|
|
case 2:
|
|
|
|
case 5:
|
|
|
|
case 6:
|
|
|
|
case 7:
|
|
|
|
case 8:
|
|
|
|
case 9:
|
|
|
|
case 17:
|
|
|
|
palOffset = 0;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
palOffset = 1;
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
case 10:
|
|
|
|
case 11:
|
|
|
|
case 12:
|
|
|
|
case 13:
|
|
|
|
case 14:
|
|
|
|
case 15:
|
|
|
|
case 16:
|
|
|
|
palOffset = 2;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
(*_graphicsManager._vPort)->drawIfaceTime();
|
2013-12-19 09:25:40 -05:00
|
|
|
doTimeBar(true);
|
2013-12-18 22:01:16 -05:00
|
|
|
pal->startFade();
|
|
|
|
|
|
|
|
(*_graphicsManager._vPort)->_flags |= 8;
|
|
|
|
_graphicsManager.flipPage();
|
|
|
|
_eventsManager.sWaitFlip();
|
|
|
|
|
|
|
|
while (!shouldQuit() && (_eventsManager._fadeStatus & 1))
|
|
|
|
_eventsManager.delay(1);
|
|
|
|
|
|
|
|
_graphicsManager.setColor(241, 105, 105, 105);
|
|
|
|
_graphicsManager.setColor(242, 105, 105, 105);
|
|
|
|
_graphicsManager.setColor(243, 105, 105, 105);
|
|
|
|
_graphicsManager.setColor(palOffset + 241, 219, 235, 235);
|
|
|
|
|
|
|
|
_eventsManager._intPtr.field38 = 1;
|
|
|
|
_eventsManager._intPtr._hasPalette = true;
|
2013-12-14 11:39:15 -05:00
|
|
|
}
|
|
|
|
|
2013-12-20 22:51:31 -05:00
|
|
|
void VoyeurEngine::makeViewFinderP() {
|
|
|
|
_graphicsManager.screenReset();
|
|
|
|
}
|
|
|
|
|
2013-12-14 11:39:15 -05:00
|
|
|
void VoyeurEngine::initIFace(){
|
2013-12-19 09:25:40 -05:00
|
|
|
int playStamp1 = _playStamp1;
|
|
|
|
switch (_voy._transitionId) {
|
|
|
|
case 0:
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
case 2:
|
|
|
|
case 5:
|
|
|
|
case 6:
|
|
|
|
case 7:
|
|
|
|
case 8:
|
|
|
|
case 9:
|
|
|
|
_playStamp1 = 0xB00;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
_playStamp1 = 0xC00;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
_playStamp1 = 0xD00;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (playStamp1 != -1)
|
|
|
|
_bVoy->freeBoltGroup(playStamp1, true);
|
|
|
|
|
|
|
|
_bVoy->getBoltGroup(_playStamp1);
|
|
|
|
CMapResource *pal = _bVoy->boltEntry(_playStamp1 + 2)._cMapResource;
|
|
|
|
pal->startFade();
|
|
|
|
|
2013-12-24 10:32:41 +11:00
|
|
|
doScroll(_eventsManager.getMousePos());
|
2013-12-19 09:25:40 -05:00
|
|
|
|
|
|
|
_voy._field4386 = _bVoy->memberAddr(_playStamp1);
|
|
|
|
|
|
|
|
// Note: the original did two loops to preload members here, which is
|
|
|
|
// redundant for ScummVM, since computers are faster these days, and
|
|
|
|
// getting resources as needed will be fast enough.
|
2013-12-14 11:39:15 -05:00
|
|
|
}
|
|
|
|
|
2013-12-24 10:32:41 +11:00
|
|
|
void VoyeurEngine::doScroll(const Common::Point &pt) {
|
|
|
|
Common::Rect clipRect(72, 47, 72 + 240, 47 + 148);
|
|
|
|
(*_graphicsManager._vPort)->setupViewPort(NULL, &clipRect);
|
|
|
|
|
|
|
|
PictureResource *pic;
|
|
|
|
int base = 0;
|
|
|
|
switch (_voy._transitionId) {
|
|
|
|
case 0:
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
case 2:
|
|
|
|
case 5:
|
|
|
|
case 6:
|
|
|
|
case 7:
|
|
|
|
case 8:
|
|
|
|
case 9:
|
|
|
|
base = 0xB00;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
base = 0xC00;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
base = 0xD00;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (base) {
|
|
|
|
pic = _bVoy->boltEntry(base + 3)._picResource;
|
|
|
|
_graphicsManager.sDrawPic(pic, *_graphicsManager._vPort, Common::Point(784 - pt.x - 712, 150 - pt.y - 104));
|
|
|
|
pic = _bVoy->boltEntry(base + 4)._picResource;
|
|
|
|
_graphicsManager.sDrawPic(pic, *_graphicsManager._vPort, Common::Point(784 - pt.x - 712, 150 - pt.y - 44));
|
|
|
|
pic = _bVoy->boltEntry(base + 5)._picResource;
|
|
|
|
_graphicsManager.sDrawPic(pic, *_graphicsManager._vPort, Common::Point(784 - pt.x - 712, 150 - pt.y + 16));
|
|
|
|
pic = _bVoy->boltEntry(base + 6)._picResource;
|
|
|
|
_graphicsManager.sDrawPic(pic, *_graphicsManager._vPort, Common::Point(784 - pt.x - 712, 150 - pt.y + 76));
|
|
|
|
pic = _bVoy->boltEntry(base + 7)._picResource;
|
|
|
|
_graphicsManager.sDrawPic(pic, *_graphicsManager._vPort, Common::Point(784 - pt.x - 712, 150 - pt.y + 136));
|
|
|
|
}
|
|
|
|
|
|
|
|
(*_graphicsManager._vPort)->setupViewPort();
|
|
|
|
}
|
|
|
|
|
2013-12-14 11:39:15 -05:00
|
|
|
void VoyeurEngine::checkTransition(){
|
2013-12-18 21:26:26 -05:00
|
|
|
Common::String time, day;
|
|
|
|
|
2013-12-18 22:01:16 -05:00
|
|
|
if (_voy._transitionId != _checkTransitionId) {
|
|
|
|
switch (_voy._transitionId) {
|
2013-12-18 21:26:26 -05:00
|
|
|
case 0:
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
case 2:
|
|
|
|
case 3:
|
|
|
|
case 4:
|
|
|
|
day = SATURDAY;
|
|
|
|
break;
|
|
|
|
case 17:
|
|
|
|
day = MONDAY;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
day = SUNDAY;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!day.empty()) {
|
|
|
|
_graphicsManager.fadeDownICF(6);
|
|
|
|
|
2013-12-18 22:01:16 -05:00
|
|
|
if (_voy._transitionId != 17) {
|
2013-12-18 21:26:26 -05:00
|
|
|
const char *amPm = _voy._isAM ? AM : PM;
|
|
|
|
time = Common::String::format("%d:%02d%s",
|
|
|
|
_gameHour, _gameMinute, amPm);
|
|
|
|
}
|
|
|
|
|
|
|
|
doTransitionCard(day, time);
|
|
|
|
_eventsManager.delay(180);
|
|
|
|
}
|
|
|
|
|
2013-12-18 22:01:16 -05:00
|
|
|
_checkTransitionId = _voy._transitionId;
|
2013-12-18 21:26:26 -05:00
|
|
|
}
|
2013-12-14 11:39:15 -05:00
|
|
|
}
|
|
|
|
|
2013-12-24 16:32:50 +11:00
|
|
|
bool VoyeurEngine::doComputerText(int maxLen) {
|
|
|
|
FontInfoResource &font = *_graphicsManager._fontPtr;
|
|
|
|
int totalChars = 0;
|
|
|
|
|
|
|
|
font._curFont = _bVoy->boltEntry(0x4910)._fontResource;
|
|
|
|
font._foreColor = 129;
|
|
|
|
font._fontSaveBack = false;
|
|
|
|
font._fontFlags = 0;
|
|
|
|
if (_voy._vocSecondsOffset > 60)
|
|
|
|
_voy._vocSecondsOffset = 0;
|
|
|
|
|
|
|
|
if (_voy._RTVNum > _voy._field4EE && maxLen == 9999) {
|
|
|
|
if (_playStamp2 != -1)
|
|
|
|
_soundManager.startVOCPlay(_playStamp2);
|
|
|
|
font._justify = ALIGN_LEFT;
|
|
|
|
font._justifyWidth = 384;
|
|
|
|
font._justifyHeight = 100;
|
|
|
|
font._pos = Common::Point(128, 100);
|
|
|
|
(*_graphicsManager._vPort)->drawText(END_OF_MESSAGE);
|
|
|
|
} else if (_voy._RTVNum < _voy._field4EC && maxLen == 9999) {
|
|
|
|
if (_playStamp2 != -1)
|
|
|
|
_soundManager.startVOCPlay(_playStamp2);
|
|
|
|
font._justify = ALIGN_LEFT;
|
|
|
|
font._justifyWidth = 384;
|
|
|
|
font._justifyHeight = 100;
|
|
|
|
font._pos = Common::Point(120, 100);
|
|
|
|
(*_graphicsManager._vPort)->drawText(START_OF_MESSAGE);
|
|
|
|
} else {
|
|
|
|
char *msg = (char *)_bVoy->memberAddr(0x4900 + _voy._computerTextId);
|
|
|
|
font._pos = Common::Point(96, 60);
|
|
|
|
|
|
|
|
bool showEnd = true;
|
|
|
|
int yp = 60;
|
|
|
|
do {
|
|
|
|
if (_playStamp2 != -1 && !_soundManager.getVOCStatus()) {
|
|
|
|
if (_voy._vocSecondsOffset > 60)
|
|
|
|
_voy._vocSecondsOffset = 0;
|
|
|
|
_soundManager.startVOCPlay(_playStamp2);
|
|
|
|
}
|
|
|
|
|
|
|
|
char c = *msg++;
|
|
|
|
if (c == '\0') {
|
|
|
|
if (showEnd) {
|
|
|
|
_eventsManager.delay(90);
|
|
|
|
_graphicsManager._drawPtr->_pos = Common::Point(54, 96);
|
|
|
|
_graphicsManager._drawPtr->_penColor = 254;
|
|
|
|
(*_graphicsManager._vPort)->sFillBox(196, 124);
|
|
|
|
_graphicsManager._fontPtr->_justify = ALIGN_LEFT;
|
|
|
|
_graphicsManager._fontPtr->_justifyWidth = 384;
|
|
|
|
_graphicsManager._fontPtr->_justifyHeight = 100;
|
|
|
|
_graphicsManager._fontPtr->_pos = Common::Point(128, 100);
|
|
|
|
(*_graphicsManager._vPort)->drawText(END_OF_MESSAGE);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (c == '~' || c == '^') {
|
|
|
|
if (c == '^') {
|
|
|
|
yp += 10;
|
|
|
|
} else {
|
|
|
|
_eventsManager.delay(90);
|
|
|
|
_graphicsManager._drawPtr->_pos = Common::Point(54, 96);
|
|
|
|
_graphicsManager._drawPtr->_penColor = 255;
|
|
|
|
(*_graphicsManager._vPort)->sFillBox(196, 124);
|
|
|
|
yp = 60;
|
|
|
|
}
|
|
|
|
|
|
|
|
_graphicsManager._fontPtr->_pos = Common::Point(96, yp);
|
|
|
|
} else if (c == '_') {
|
|
|
|
showEnd = false;
|
|
|
|
} else {
|
|
|
|
_graphicsManager._fontPtr->_justify = ALIGN_LEFT;
|
|
|
|
_graphicsManager._fontPtr->_justifyWidth = 0;
|
|
|
|
_graphicsManager._fontPtr->_justifyHeight = 0;
|
|
|
|
(*_graphicsManager._vPort)->drawText(Common::String(c));
|
|
|
|
_eventsManager.delay(4);
|
|
|
|
}
|
|
|
|
|
|
|
|
(*_graphicsManager._vPort)->_flags |= 8;
|
|
|
|
_graphicsManager.flipPage();
|
|
|
|
_eventsManager.sWaitFlip();
|
|
|
|
_eventsManager.getMouseInfo();
|
|
|
|
++totalChars;
|
|
|
|
|
|
|
|
} while (!shouldQuit() && !_voy._incriminate && totalChars < maxLen);
|
|
|
|
|
|
|
|
_voy._field4EE = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
(*_graphicsManager._vPort)->_flags |= 8;
|
|
|
|
_graphicsManager.flipPage();
|
|
|
|
_eventsManager.sWaitFlip();
|
|
|
|
|
|
|
|
_graphicsManager._fontPtr->_curFont = _bVoy->boltEntry(0x101)._fontResource;
|
|
|
|
return totalChars;
|
2013-12-20 22:51:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void VoyeurEngine::getComputerBrush() {
|
|
|
|
error("TODO: getComputerBrush");
|
2013-12-24 16:32:50 +11:00
|
|
|
// if (_bVoy->getBoltGroup(0x4900)) {
|
|
|
|
// }
|
2013-12-20 22:51:31 -05:00
|
|
|
}
|
|
|
|
|
2013-12-19 09:25:40 -05:00
|
|
|
void VoyeurEngine::doTimeBar(bool force) {
|
|
|
|
flashTimeBar();
|
|
|
|
|
|
|
|
if ((force || _timeBarVal != _voy._RTVNum) && _voy._field476 > 0) {
|
|
|
|
if (_voy._RTVNum > _voy._field476 || _voy._RTVNum < 0)
|
|
|
|
_voy._RTVNum = _voy._field476 - 1;
|
|
|
|
|
|
|
|
_timeBarVal = _voy._RTVNum;
|
|
|
|
int height = ((_voy._field476 - _voy._RTVNum) * 59) / _voy._field476;
|
|
|
|
int fullHeight = MAX(151 - height, 93);
|
|
|
|
|
|
|
|
_graphicsManager._drawPtr->_penColor = 134;
|
|
|
|
_graphicsManager._drawPtr->_pos = Common::Point(39, 92);
|
|
|
|
|
|
|
|
(*_graphicsManager._vPort)->sFillBox(6, fullHeight - 92);
|
|
|
|
if (height > 0) {
|
|
|
|
_graphicsManager.setColor(215, 238, 238, 238);
|
|
|
|
_eventsManager._intPtr.field38 = 1;
|
|
|
|
_eventsManager._intPtr._hasPalette = true;
|
|
|
|
|
|
|
|
_graphicsManager._drawPtr->_penColor = 215;
|
|
|
|
_graphicsManager._drawPtr->_pos = Common::Point(39, fullHeight);
|
|
|
|
(*_graphicsManager._vPort)->sFillBox(6, height);
|
|
|
|
}
|
|
|
|
}
|
2013-12-14 11:39:15 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void VoyeurEngine::flashTimeBar(){
|
2013-12-19 09:25:40 -05:00
|
|
|
if (_voy._RTVNum >= 0 && (_voy._field476 - _voy._RTVNum) < 11 &&
|
|
|
|
(_eventsManager._intPtr.field1A >= (_flashTimeVal + 15) ||
|
|
|
|
_eventsManager._intPtr.field1A < _flashTimeVal)) {
|
|
|
|
// Within time range
|
|
|
|
_flashTimeVal = _eventsManager._intPtr.field1A;
|
|
|
|
|
|
|
|
if (_flashTimeFlag)
|
|
|
|
_graphicsManager.setColor(240, 220, 20, 20);
|
|
|
|
else
|
|
|
|
_graphicsManager.setColor(240, 220, 220, 220);
|
|
|
|
|
|
|
|
_eventsManager._intPtr.field38 = 1;
|
|
|
|
_eventsManager._intPtr._hasPalette = true;
|
|
|
|
_flashTimeFlag = !_flashTimeFlag;
|
|
|
|
}
|
2013-12-14 20:40:19 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void VoyeurEngine::checkPhoneCall() {
|
2013-12-20 22:51:31 -05:00
|
|
|
if ((_voy._field476 - _voy._RTVNum) >= 36 && _voy._field4B8 < 5 &&
|
|
|
|
_playStamp2 <= 151 && _playStamp2 > 146) {
|
|
|
|
if ((_voy._switchBGNum < _checkPhoneVal || _checkPhoneVal > 180) &&
|
|
|
|
!_soundManager.getVOCStatus()) {
|
|
|
|
int soundIndex;
|
|
|
|
do {
|
|
|
|
soundIndex = getRandomNumber(4);
|
|
|
|
} while (_voy._field4AE[soundIndex]);
|
|
|
|
_playStamp2 = 154 + soundIndex;
|
|
|
|
|
|
|
|
_soundManager.stopVOCPlay();
|
|
|
|
_soundManager.startVOCPlay(_playStamp2);
|
|
|
|
_checkPhoneVal = _voy._switchBGNum;
|
|
|
|
++_voy._field4AE[soundIndex];
|
|
|
|
++_voy._field4B8;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void VoyeurEngine::doEvidDisplay(int v1, int v2) {
|
2013-12-24 16:32:50 +11:00
|
|
|
_eventsManager.getMouseInfo();
|
|
|
|
(*_graphicsManager._vPort)->_flags |= 8;
|
|
|
|
_graphicsManager.flipPage();
|
|
|
|
_eventsManager.sWaitFlip();
|
|
|
|
|
|
|
|
if (_playStamp2 != -1) {
|
|
|
|
_voy._vocSecondsOffset = _voy._RTVNum - _voy._field4AC;
|
|
|
|
_soundManager.stopVOCPlay();
|
|
|
|
}
|
|
|
|
|
2013-12-20 22:51:31 -05:00
|
|
|
error("TODO: doEvidDisplay");
|
2013-12-14 11:39:15 -05:00
|
|
|
}
|
|
|
|
|
2013-12-05 21:49:12 -05:00
|
|
|
} // End of namespace Voyeur
|