aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2013-12-25 19:26:49 +1100
committerPaul Gilbert2013-12-25 19:26:49 +1100
commit0c82fc1bafce8dc6e6a0852c4bd65e92005eaf39 (patch)
tree9373037da4f7308c1915562f36e17818c0412c69
parent6e801e246be36d8efa9003a316bbd1424d51d4ae (diff)
downloadscummvm-rg350-0c82fc1bafce8dc6e6a0852c4bd65e92005eaf39.tar.gz
scummvm-rg350-0c82fc1bafce8dc6e6a0852c4bd65e92005eaf39.tar.bz2
scummvm-rg350-0c82fc1bafce8dc6e6a0852c4bd65e92005eaf39.zip
VOYEUR: Implemented checkForMurder
-rw-r--r--engines/voyeur/voyeur_game.cpp49
1 files changed, 48 insertions, 1 deletions
diff --git a/engines/voyeur/voyeur_game.cpp b/engines/voyeur/voyeur_game.cpp
index 811f386835..617b48c8d5 100644
--- a/engines/voyeur/voyeur_game.cpp
+++ b/engines/voyeur/voyeur_game.cpp
@@ -597,7 +597,54 @@ void VoyeurEngine::doTapePlaying() {
}
bool VoyeurEngine::checkForMurder() {
- warning("TODO");
+ int v = READ_LE_UINT32(_controlPtr->_ptr + 12);
+
+ for (int idx = 0; idx < _voy._eventCount; ++idx) {
+ VoyeurEvent &evt = _voy._events[idx];
+
+ if (evt._type == EVTYPE_VIDEO) {
+ switch (READ_LE_UINT32(_controlPtr->_ptr + 4)) {
+ case 1:
+ if (evt._field8 == 41 && evt._computerOn <= 15 &&
+ (evt._computerOff + evt._computerOn) >= 16) {
+ WRITE_LE_UINT32(_controlPtr->_ptr + 12, 1);
+ }
+ break;
+
+ case 2:
+ if (evt._field8 == 53 && evt._computerOn <= 19 &&
+ (evt._computerOff + evt._computerOn) >= 21) {
+ WRITE_LE_UINT32(_controlPtr->_ptr + 12, 2);
+ }
+ break;
+
+ case 3:
+ if (evt._field8 == 50 && evt._computerOn <= 28 &&
+ (evt._computerOff + evt._computerOn) >= 29) {
+ WRITE_LE_UINT32(_controlPtr->_ptr + 12, 3);
+ }
+ break;
+
+ case 4:
+ if (evt._field8 == 43 && evt._computerOn <= 10 &&
+ (evt._computerOff + evt._computerOn) >= 14) {
+ WRITE_LE_UINT32(_controlPtr->_ptr + 12, 4);
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if (READ_LE_UINT32(_controlPtr->_ptr + 12) == READ_LE_UINT32(_controlPtr->_ptr + 4)) {
+ _voy._videoEventId = idx;
+ return true;
+ }
+ }
+
+ WRITE_LE_UINT32(_controlPtr->_ptr + 12, v);
+ _voy._videoEventId = -1;
return false;
}