aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/voyeur/events.cpp16
-rw-r--r--engines/voyeur/files.h17
-rw-r--r--engines/voyeur/files_threads.cpp42
-rw-r--r--engines/voyeur/voyeur.h8
4 files changed, 61 insertions, 22 deletions
diff --git a/engines/voyeur/events.cpp b/engines/voyeur/events.cpp
index eb793d3142..6d38dc4695 100644
--- a/engines/voyeur/events.cpp
+++ b/engines/voyeur/events.cpp
@@ -104,7 +104,12 @@ void EventsManager::startMainClockInt() {
}
void EventsManager::mainVoyeurIntFunc() {
- // TODO
+ if (!(_vm->_voy._field478 & 1)) {
+ ++_vm->_voy._switchBGNum;
+ ++_vm->_voy._RTVNum;
+ if (_vm->_voy._RTVNum >= _vm->_voy._field4F2)
+ _vm->_voy._field4F0 = 1;
+ }
}
void EventsManager::vStopCycle() {
@@ -147,6 +152,9 @@ void EventsManager::checkForNextFrameCounter() {
// Run the timer-based updates
voyeurTimer();
+ if ((_gameCounter % GAME_FRAME_RATE) == 0)
+ mainVoyeurIntFunc();
+
// Display the frame
g_system->copyRectToScreen((byte *)_vm->_graphicsManager._screenSurface.getPixels(),
SCREEN_WIDTH, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
@@ -193,6 +201,7 @@ void EventsManager::voyeurTimer() {
(this->*node._intFunc)();
}
+
}
void EventsManager::videoTimer() {
@@ -423,6 +432,8 @@ void EventsManager::hideCursor() {
}
void EventsManager::getMouseInfo() {
+ pollEvents();
+
if (_vm->_voy._field478 & 0x10) {
if ((_gameCounter - _joe) > 8) {
_joe = _gameCounter;
@@ -454,7 +465,8 @@ void EventsManager::startCursorBlink() {
}
void EventsManager::incrementTime(int amt) {
- error("TODO: incrementTime");
+ for (int i = 0; i < amt; ++i)
+ mainVoyeurIntFunc();
}
} // End of namespace Voyeur
diff --git a/engines/voyeur/files.h b/engines/voyeur/files.h
index a48dbaa3e5..61c910be49 100644
--- a/engines/voyeur/files.h
+++ b/engines/voyeur/files.h
@@ -456,8 +456,20 @@ private:
void savePrevious();
void setButtonFlag(int idx, byte bits);
void clearButtonFlag(int idx, byte bits);
+
+ /**
+ * Loads data needed for displaying the initial apartment screen
+ */
void loadTheApt();
+
+ /**
+ * Frees the apartment screen data
+ */
void freeTheApt();
+
+ /**
+ * Does any necessary animation at the start or end of showing the apartment.
+ */
void doAptAnim(int mode);
public:
VoyeurEngine *_vm;
@@ -495,7 +507,12 @@ public:
void parsePlayCommands();
int doInterface();
void doRoom();
+
+ /**
+ * Shows the apartment screen
+ */
int doApt();
+
void doTapePlaying();
void checkForMurder();
void checkForIncriminate();
diff --git a/engines/voyeur/files_threads.cpp b/engines/voyeur/files_threads.cpp
index 229d4c3fb5..be35143932 100644
--- a/engines/voyeur/files_threads.cpp
+++ b/engines/voyeur/files_threads.cpp
@@ -1208,7 +1208,7 @@ void ThreadResource::doRoom() {
voy._field478 &= ~1;
bool breakFlag = false;
- while (!breakFlag) {
+ while (!vm.shouldQuit() && !breakFlag) {
vm._graphicsManager.setColor(128, 0, 255, 0);
vm._eventsManager._intPtr.field38 = 1;
vm._eventsManager._intPtr._hasPalette = true;
@@ -1374,8 +1374,6 @@ void ThreadResource::doRoom() {
}
int ThreadResource::doInterface() {
- int varA = -1;
- int var8 = 0;
PictureResource *pic;
Common::Point pt;
@@ -1431,13 +1429,15 @@ int ThreadResource::doInterface() {
_vm->_eventsManager._intPtr._hasPalette = true;
_vm->_voy._field478 &= ~1;
+ int priorRegionIndex = -1;
+ int regionIndex = 0;
do {
_vm->doTimeBar(true);
_vm->_eventsManager.getMouseInfo();
pt = _vm->_eventsManager.getMousePos();
- if (pt.x != _currentMouseX || pt.y != _currentMouseY || var8 != varA) {
- varA = var8;
+ if (pt.x != _currentMouseX || pt.y != _currentMouseY || regionIndex != priorRegionIndex) {
+ priorRegionIndex = regionIndex;
_vm->_graphicsManager.doScroll(pt);
_currentMouseX = pt.x;
@@ -1451,6 +1451,7 @@ int ThreadResource::doInterface() {
}
pt = _vm->_eventsManager.getMousePos() + Common::Point(120, 75);
+ regionIndex = -1;
for (int idx = 0; idx < READ_LE_UINT16(dataP); ++idx) {
if (READ_LE_UINT16(dataP + (idx * 8 + 2)) <= pt.x &&
@@ -1465,7 +1466,7 @@ int ThreadResource::doInterface() {
pic = _vm->_bVoy->boltEntry(276)._picResource;
_vm->_graphicsManager.sDrawPic(pic, *_vm->_graphicsManager._vPort,
Common::Point(178, 108));
- var8 = idx;
+ regionIndex = idx;
}
if (_vm->_voy._arr5[arrIndex][idx] <= _vm->_voy._RTVNum &&
@@ -1474,44 +1475,45 @@ int ThreadResource::doInterface() {
pic = _vm->_bVoy->boltEntry(277)._picResource;
_vm->_graphicsManager.sDrawPic(pic, *_vm->_graphicsManager._vPort,
Common::Point(178, 108));
- var8 = idx;
+ regionIndex = idx;
}
}
- for (int arrIndex = 0; arrIndex < 3; ++arrIndex) {
+ for (int arrIndex = 0; arrIndex < 8; ++arrIndex) {
if (_vm->_voy._arr1[arrIndex][idx] <= _vm->_voy._RTVNum &&
_vm->_voy._arr2[arrIndex][idx] > _vm->_voy._RTVNum) {
// Draw the picture
pic = _vm->_bVoy->boltEntry(375)._picResource;
_vm->_graphicsManager.sDrawPic(pic, *_vm->_graphicsManager._vPort,
Common::Point(178, 108));
- var8 = idx;
+ regionIndex = idx;
}
}
}
}
- if (var8 == -1) {
- // Draw the default picture
+ if (regionIndex == -1) {
+ // Draw the crosshairs cursor in the center of the screen
pic = _vm->_bVoy->boltEntry(274)._picResource;
_vm->_graphicsManager.sDrawPic(pic, *_vm->_graphicsManager._vPort,
Common::Point(178, 108));
}
- if (_vm->_voy._RTVNum & 2) {
+ // Regularly update the time display
+ if (_vm->_voy._RTANum & 2) {
_vm->_graphicsManager.drawANumber(*_vm->_graphicsManager._vPort,
- 10 / _vm->_gameMinute, Common::Point(190, 25));
+ _vm->_gameMinute / 10, Common::Point(190, 25));
_vm->_graphicsManager.drawANumber(*_vm->_graphicsManager._vPort,
- 10 % _vm->_gameMinute, Common::Point(190, 25));
+ _vm->_gameMinute % 10, Common::Point(201, 25));
if (_vm->_voy._RTANum & 4) {
- int v = 10 / _vm->_gameHour;
+ int v = _vm->_gameHour / 10;
_vm->_graphicsManager.drawANumber(*_vm->_graphicsManager._vPort,
- v == 0 ? 10 : v, Common::Point(190, 25));
+ 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(274)._picResource;
+ pic = _vm->_bVoy->boltEntry(_vm->_voy._isAM ? 272 : 273)._picResource;
_vm->_graphicsManager.sDrawPic(pic, *_vm->_graphicsManager._vPort,
Common::Point(215, 27));
}
@@ -1528,7 +1530,7 @@ int ThreadResource::doInterface() {
_vm->_eventsManager.getMouseInfo();
if (_vm->_voy._transitionId == 15) {
- var8 = 20;
+ regionIndex = 20;
_vm->_voy._transitionId = 17;
_vm->_soundManager.stopVOCPlay();
_vm->checkTransition();
@@ -1556,14 +1558,14 @@ int ThreadResource::doInterface() {
}
}
} while (!_vm->_voy._fadeFunc && !_vm->shouldQuit() &&
- (!_vm->_voy._mouseClicked || var8 == -1));
+ (!_vm->_voy._mouseClicked || regionIndex == -1));
_vm->_voy._field478 |= 1;
_vm->_bVoy->freeBoltGroup(_vm->_playStamp1);
if (_vm->_playStamp2 != -1)
_vm->_soundManager.stopVOCPlay();
- return !_vm->_voy._fadeFunc ? var8 : -2;
+ return !_vm->_voy._fadeFunc ? regionIndex : -2;
}
void ThreadResource::addAudioEventStart() {
diff --git a/engines/voyeur/voyeur.h b/engines/voyeur/voyeur.h
index 31f05fb2c2..a48f9c2784 100644
--- a/engines/voyeur/voyeur.h
+++ b/engines/voyeur/voyeur.h
@@ -155,7 +155,15 @@ public:
void checkTransition();
bool doComputerText(int v);
void getComputerBrush();
+
+ /**
+ * Displays the time/charge remaining on the video camera screen
+ */
void doTimeBar(bool force);
+
+ /**
+ * If necessary, flashes the time remaining bar on the video camera screen
+ */
void flashTimeBar();
void checkPhoneCall();
void doEvidDisplay(int v1, int v2);