aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2014-02-03 01:23:27 -0500
committerPaul Gilbert2014-02-03 01:23:27 -0500
commit8385a0ef8e77903d48f0ff443d3a5feb8536c2fa (patch)
tree82acebe181ef58372b8f8ed8ad682b05bf48310e
parente0a142ed4caed07fd5a9bdc9468f4702d6f79339 (diff)
downloadscummvm-rg350-8385a0ef8e77903d48f0ff443d3a5feb8536c2fa.tar.gz
scummvm-rg350-8385a0ef8e77903d48f0ff443d3a5feb8536c2fa.tar.bz2
scummvm-rg350-8385a0ef8e77903d48f0ff443d3a5feb8536c2fa.zip
VOYEUR: Implemented checkForKey
-rw-r--r--engines/voyeur/data.cpp88
-rw-r--r--engines/voyeur/data.h6
-rw-r--r--engines/voyeur/events.cpp4
-rw-r--r--engines/voyeur/events.h1
-rw-r--r--engines/voyeur/voyeur_game.cpp2
5 files changed, 95 insertions, 6 deletions
diff --git a/engines/voyeur/data.cpp b/engines/voyeur/data.cpp
index 3d91b7daa6..ef072e8737 100644
--- a/engines/voyeur/data.cpp
+++ b/engines/voyeur/data.cpp
@@ -230,4 +230,92 @@ void SVoy::reviewComputerEvent(int eventIndex) {
}
}
+bool SVoy::checkForKey() {
+ WRITE_LE_UINT32(_vm->_controlPtr->_ptr + 8, 0);
+ if (_vm->_voy._field4F0)
+ return false;
+
+ for (int eventIdx = 0; eventIdx < _eventCount; ++eventIdx) {
+ VoyeurEvent &e = _events[eventIdx];
+ int v1;
+
+ switch (e._type) {
+ case EVTYPE_VIDEO:
+ switch (READ_LE_UINT32(_vm->_controlPtr->_ptr + 4)) {
+ case 1:
+ if (e._audioVideoId == 33 && e._computerOn < 1 && e._computerOff > 40)
+ WRITE_LE_UINT32(_vm->_controlPtr->_ptr + 8, 1);
+ break;
+
+ case 2:
+ if (e._audioVideoId == 47 && e._computerOn < 1 && e._computerOff > 11)
+ WRITE_LE_UINT32(_vm->_controlPtr->_ptr + 8, 2);
+ break;
+
+ case 3:
+ if (e._audioVideoId == 46 && e._computerOn < 2 && e._computerOff > 2)
+ WRITE_LE_UINT32(_vm->_controlPtr->_ptr + 8, 3);
+ break;
+
+ case 4:
+ if (e._audioVideoId == 40 && e._computerOn < 2 && e._computerOff > 7)
+ WRITE_LE_UINT32(_vm->_controlPtr->_ptr + 8, 4);
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case EVTYPE_AUDIO:
+ switch (READ_LE_UINT32(_vm->_controlPtr->_ptr + 4)) {
+ case 1:
+ if (e._audioVideoId == 8 && e._computerOn < 2 && e._computerOff > 28)
+ WRITE_LE_UINT32(_vm->_controlPtr->_ptr + 8, 1);
+ break;
+
+ case 3:
+ if (e._audioVideoId == 20 && e._computerOn < 2 && e._computerOff > 30)
+ WRITE_LE_UINT32(_vm->_controlPtr->_ptr + 8, 3);
+ if (e._audioVideoId == 35 && e._computerOn < 2 && e._computerOff > 20)
+ WRITE_LE_UINT32(_vm->_controlPtr->_ptr + 8, 3);
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case EVTYPE_EVID:
+ switch (READ_LE_UINT32(_vm->_controlPtr->_ptr + 4)) {
+ case 4:
+ if (e._audioVideoId == 0x2400 && e._computerOn == 0x4f00 && e._computerOff == 17)
+ WRITE_LE_UINT32(_vm->_controlPtr->_ptr + 8, 4);
+
+ default:
+ break;
+ }
+ break;
+
+ case EVTYPE_COMPUTER:
+ switch (READ_LE_UINT32(_vm->_controlPtr->_ptr + 4)) {
+ case 2:
+ if (e._computerOn == 13 && e._computerOff > 76)
+ WRITE_LE_UINT32(_vm->_controlPtr->_ptr + 8, 2);
+ break;
+
+ default:
+ break;
+ }
+ break;
+ }
+
+ if (READ_LE_UINT32(_vm->_controlPtr->_ptr + 8) ==
+ READ_LE_UINT32(_vm->_controlPtr->_ptr + 4))
+ return true;
+ }
+
+ return false;
+}
+
} // End of namespace Voyeur
diff --git a/engines/voyeur/data.h b/engines/voyeur/data.h
index a829d7c795..c21fcf01fd 100644
--- a/engines/voyeur/data.h
+++ b/engines/voyeur/data.h
@@ -216,6 +216,12 @@ public:
* Review a previously recorded computer event
*/
void reviewComputerEvent(int eventIndex);
+
+ /**
+ * Checks for key information in determining what kind of murder
+ * should take place
+ */
+ bool checkForKey();
};
} // End of namespace Voyeur
diff --git a/engines/voyeur/events.cpp b/engines/voyeur/events.cpp
index ded81f7992..9904c9ecc8 100644
--- a/engines/voyeur/events.cpp
+++ b/engines/voyeur/events.cpp
@@ -590,10 +590,6 @@ void EventsManager::getMouseInfo() {
_vm->_eventsManager._mouseUnk = false;
}
-void EventsManager::checkForKey() {
- warning("TODO: checkForKey");
-}
-
void EventsManager::startCursorBlink() {
if (_vm->_voy._eventFlags & EVTFLAG_RECORDING) {
_vm->_graphicsManager.setOneColor(128, 55, 5, 5);
diff --git a/engines/voyeur/events.h b/engines/voyeur/events.h
index ec9c12ec92..a7f9641904 100644
--- a/engines/voyeur/events.h
+++ b/engines/voyeur/events.h
@@ -150,7 +150,6 @@ public:
Common::Point getMousePos() { return _mousePos; }
uint32 getGameCounter() const { return _gameCounter; }
void getMouseInfo();
- void checkForKey();
void startCursorBlink();
void incrementTime(int amt);
diff --git a/engines/voyeur/voyeur_game.cpp b/engines/voyeur/voyeur_game.cpp
index 1ebfdff9f8..826c4d14cd 100644
--- a/engines/voyeur/voyeur_game.cpp
+++ b/engines/voyeur/voyeur_game.cpp
@@ -161,7 +161,7 @@ void VoyeurEngine::playStamp() {
if (buttonId != 4) {
_voy._field470 = 131;
- _eventsManager.checkForKey();
+ _voy.checkForKey();
_mainThread->chooseSTAMPButton(buttonId);
} else {
_mainThread->chooseSTAMPButton(buttonId);