[Scummvm-cvs-logs] scummvm master -> e310e9832db8759ba3aeac2ee0f98204ce65f86d

Strangerke Strangerke at scummvm.org
Thu Mar 13 07:06:58 CET 2014


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
e310e9832d VOYEUR: Make checkForKey() less verbose


Commit: e310e9832db8759ba3aeac2ee0f98204ce65f86d
    https://github.com/scummvm/scummvm/commit/e310e9832db8759ba3aeac2ee0f98204ce65f86d
Author: Strangerke (strangerke at scummvm.org)
Date: 2014-03-13T07:05:06+01:00

Commit Message:
VOYEUR: Make checkForKey() less verbose

Changed paths:
    engines/voyeur/data.cpp



diff --git a/engines/voyeur/data.cpp b/engines/voyeur/data.cpp
index d8324ca..cc0b81a 100644
--- a/engines/voyeur/data.cpp
+++ b/engines/voyeur/data.cpp
@@ -279,7 +279,8 @@ void SVoy::reviewComputerEvent(int eventIndex) {
 }
 
 bool SVoy::checkForKey() {
-	_vm->_controlPtr->_state->_victimEvidenceIndex = 0;
+	StateResource *state = _vm->_controlPtr->_state;
+	state->_victimEvidenceIndex = 0;
 	if (_vm->_voy->_victimMurdered)
 		return false;
 
@@ -288,25 +289,25 @@ bool SVoy::checkForKey() {
 
 		switch (e._type) {
 		case EVTYPE_VIDEO:
-			switch (_vm->_controlPtr->_state->_victimIndex) {
+			switch (state->_victimIndex) {
 			case 1:
 				if (e._audioVideoId == 33 && e._computerOn < 2 && e._computerOff >= 38)
-					_vm->_controlPtr->_state->_victimEvidenceIndex = 1;
+					state->_victimEvidenceIndex = 1;
 				break;
 
 			case 2:
 				if (e._audioVideoId == 47 && e._computerOn < 2 && e._computerOff >= 9)
-					_vm->_controlPtr->_state->_victimEvidenceIndex = 2;
+					state->_victimEvidenceIndex = 2;
 				break;
 
 			case 3:
 				if (e._audioVideoId == 46 && e._computerOn < 2 && e._computerOff > 2)
-					_vm->_controlPtr->_state->_victimEvidenceIndex = 3;
+					state->_victimEvidenceIndex = 3;
 				break;
 
 			case 4:
 				if (e._audioVideoId == 40 && e._computerOn < 2 && e._computerOff > 6)
-					_vm->_controlPtr->_state->_victimEvidenceIndex = 4;
+					state->_victimEvidenceIndex = 4;
 				break;
 			
 			default:
@@ -315,17 +316,17 @@ bool SVoy::checkForKey() {
 			break;
 
 		case EVTYPE_AUDIO:
-			switch (_vm->_controlPtr->_state->_victimIndex) {
+			switch (state->_victimIndex) {
 			case 1:
 				if (e._audioVideoId == 8 && e._computerOn < 2 && e._computerOff > 26)
-					_vm->_controlPtr->_state->_victimEvidenceIndex = 1;
+					state->_victimEvidenceIndex = 1;
 				break;
 	
 			case 3:
 				if (e._audioVideoId == 20 && e._computerOn < 2 && e._computerOff > 28)
-					_vm->_controlPtr->_state->_victimEvidenceIndex = 3;
+					state->_victimEvidenceIndex = 3;
 				if (e._audioVideoId == 35 && e._computerOn < 2 && e._computerOff > 18)
-					_vm->_controlPtr->_state->_victimEvidenceIndex = 3;
+					state->_victimEvidenceIndex = 3;
 				break;
 
 			default:
@@ -334,10 +335,10 @@ bool SVoy::checkForKey() {
 			break;
 
 		case EVTYPE_EVID:
-			switch (_vm->_controlPtr->_state->_victimIndex) {
+			switch (state->_victimIndex) {
 			case 4:
 				if (e._audioVideoId == 0x2400 && e._computerOn == 0x4f00 && e._computerOff == 17)
-					_vm->_controlPtr->_state->_victimEvidenceIndex = 4;
+					state->_victimEvidenceIndex = 4;
 
 			default:
 				break;
@@ -345,10 +346,10 @@ bool SVoy::checkForKey() {
 			break;
 
 		case EVTYPE_COMPUTER:
-			switch (_vm->_controlPtr->_state->_victimIndex) {
+			switch (state->_victimIndex) {
 			case 2:
 				if (e._computerOn == 13 && e._computerOff > 76)
-					_vm->_controlPtr->_state->_victimEvidenceIndex = 2;
+					state->_victimEvidenceIndex = 2;
 				break;
 
 			default:
@@ -360,7 +361,7 @@ bool SVoy::checkForKey() {
 			break;
 		}
 
-		if (_vm->_controlPtr->_state->_victimEvidenceIndex == _vm->_controlPtr->_state->_victimIndex)
+		if (state->_victimEvidenceIndex == state->_victimIndex)
 			return true;
 	}
 






More information about the Scummvm-git-logs mailing list