aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2013-12-28 19:53:00 +1100
committerPaul Gilbert2013-12-28 19:53:00 +1100
commitf88c4727781b6e6eea4a8a5a7dd09ae90e55ba68 (patch)
tree1b2c586f92bbf4b0155277b7ecb0ce02c640f437
parentf01ff9a938acbaaaf04b553b4b65b2a98eb0f684 (diff)
downloadscummvm-rg350-f88c4727781b6e6eea4a8a5a7dd09ae90e55ba68.tar.gz
scummvm-rg350-f88c4727781b6e6eea4a8a5a7dd09ae90e55ba68.tar.bz2
scummvm-rg350-f88c4727781b6e6eea4a8a5a7dd09ae90e55ba68.zip
VOYEUR: Fixed naming of mouse state flags
-rw-r--r--engines/voyeur/events.cpp14
-rw-r--r--engines/voyeur/events.h10
-rw-r--r--engines/voyeur/files_threads.cpp34
-rw-r--r--engines/voyeur/voyeur.cpp14
-rw-r--r--engines/voyeur/voyeur_game.cpp33
5 files changed, 52 insertions, 53 deletions
diff --git a/engines/voyeur/events.cpp b/engines/voyeur/events.cpp
index b5643e44e6..94f137e569 100644
--- a/engines/voyeur/events.cpp
+++ b/engines/voyeur/events.cpp
@@ -218,7 +218,7 @@ void EventsManager::delayClick(int cycles) {
uint32 delayEnd = g_system->getMillis() + totalMilli;
while (!_vm->shouldQuit() && g_system->getMillis() < delayEnd
- && !_vm->_voy._incriminate) {
+ && !_vm->_voy._mouseClicked) {
g_system->delayMillis(10);
pollEvents();
@@ -244,17 +244,19 @@ void EventsManager::pollEvents() {
return;
case Common::EVENT_LBUTTONDOWN:
_mouseButton = 1;
+ _vm->_voy._newLeftClick = true;
_vm->_voy._newMouseClicked = true;
- _vm->_voy._newIncriminate = true;
return;
case Common::EVENT_RBUTTONDOWN:
_mouseButton = 2;
+ _vm->_voy._newRightClick = true;
_vm->_voy._newMouseClicked = true;
return;
case Common::EVENT_LBUTTONUP:
case Common::EVENT_RBUTTONUP:
_vm->_voy._newMouseClicked = false;
- _vm->_voy._newIncriminate = false;
+ _vm->_voy._newLeftClick = false;
+ _vm->_voy._newRightClick = false;
_mouseButton = 0;
return;
case Common::EVENT_MOUSEMOVE:
@@ -456,10 +458,10 @@ void EventsManager::getMouseInfo() {
}
}
- _vm->_voy._incriminate = _vm->_voy._newIncriminate;
_vm->_voy._mouseClicked = _vm->_voy._newMouseClicked;
- _vm->_voy._fadeFunc = _vm->_voy._newFadeFunc;
- _vm->_voy._fadeICF1 = _vm->_voy._newFadeICF1;
+ _vm->_voy._leftClick = _vm->_voy._newLeftClick;
+ _vm->_voy._rightClick = _vm->_voy._newRightClick;
+ _vm->_voy._mouseUnk = _vm->_voy._newMouseUnk;
}
void EventsManager::checkForKey() {
diff --git a/engines/voyeur/events.h b/engines/voyeur/events.h
index 1e4559c65b..6b7d4e8682 100644
--- a/engines/voyeur/events.h
+++ b/engines/voyeur/events.h
@@ -125,17 +125,15 @@ public:
int _curICF0;
int _curICF1;
int _fadeICF0;
- int _fadeICF1;
- void (*_fadeFunc)();
+ bool _leftClick, _rightClick;
bool _mouseClicked;
- int _incriminate;
+ bool _mouseUnk;
int _policeEvent;
// Fields not originally in _voy, but I'm putting in for convenience
- int _newIncriminate;
bool _newMouseClicked;
- int _newFadeICF1;
- void (*_newFadeFunc)();
+ bool _newLeftClick, _newRightClick;
+ bool _newMouseUnk;
};
class IntData {
diff --git a/engines/voyeur/files_threads.cpp b/engines/voyeur/files_threads.cpp
index 944c9db558..49b271e79c 100644
--- a/engines/voyeur/files_threads.cpp
+++ b/engines/voyeur/files_threads.cpp
@@ -406,7 +406,7 @@ void ThreadResource::parsePlayCommands() {
_vm->_voy._field478 |= 16;
_vm->_eventsManager.startCursorBlink();
- while (!_vm->shouldQuit() && !_vm->_voy._incriminate &&
+ while (!_vm->shouldQuit() && !_vm->_voy._mouseClicked &&
_vm->_soundManager.getVOCStatus())
_vm->_eventsManager.delayClick(1);
@@ -460,7 +460,7 @@ void ThreadResource::parsePlayCommands() {
}
_vm->_eventsManager._videoDead = -1;
- if (_field42 == 2 && _vm->_voy._incriminate == 0) {
+ if (_field42 == 2 && _vm->_voy._mouseClicked == 0) {
_vm->_voy._field470 = 132;
parseIndex = 999;
} else {
@@ -515,7 +515,7 @@ void ThreadResource::parsePlayCommands() {
Common::String file = Common::String::format("news%d.voc", i + 1);
_vm->_soundManager.startVOCPlay(file);
- while (!_vm->shouldQuit() && !_vm->_voy._incriminate &&
+ while (!_vm->shouldQuit() && !_vm->_voy._mouseClicked &&
_vm->_soundManager.getVOCStatus()) {
_vm->_eventsManager.delayClick(1);
_vm->_eventsManager.getMouseInfo();
@@ -526,7 +526,7 @@ void ThreadResource::parsePlayCommands() {
if (i == (count - 1))
_vm->_eventsManager.delay(480);
- if (_vm->shouldQuit() || _vm->_voy._incriminate)
+ if (_vm->shouldQuit() || _vm->_voy._mouseClicked)
break;
}
@@ -706,7 +706,7 @@ void ThreadResource::parsePlayCommands() {
Common::String fname = Common::String::format("news%d.voc", idx);
- while (!_vm->shouldQuit() && !_vm->_voy._incriminate &&
+ while (!_vm->shouldQuit() && !_vm->_voy._mouseClicked &&
_vm->_soundManager.getVOCStatus())
_vm->_eventsManager.delay(1);
@@ -714,7 +714,7 @@ void ThreadResource::parsePlayCommands() {
if (idx == 3)
_vm->_eventsManager.delay(3);
- if (_vm->shouldQuit() || _vm->_voy._incriminate)
+ if (_vm->shouldQuit() || _vm->_voy._mouseClicked)
break;
}
@@ -1107,7 +1107,7 @@ int ThreadResource::doApt() {
_vm->flipPageAndWait();
- } while (!_vm->shouldQuit() && (!_vm->_voy._mouseClicked || hotspotId == -1));
+ } while (!_vm->shouldQuit() && (!_vm->_voy._leftClick || hotspotId == -1));
pt = _vm->_eventsManager.getMousePos();
_doAptPosX = pt.x;
@@ -1231,10 +1231,10 @@ void ThreadResource::doRoom() {
vm._eventsManager._intPtr._hasPalette = true;
vm._graphicsManager.flipPage();
vm._eventsManager.sWaitFlip();
- } while (!vm.shouldQuit() && !voy._incriminate);
+ } while (!vm.shouldQuit() && !voy._mouseClicked);
- if (!voy._mouseClicked || i4e4 == -1) {
- if (voy._fadeFunc)
+ if (!voy._leftClick || i4e4 == -1) {
+ if (voy._rightClick)
breakFlag = true;
Common::Point pt = vm._eventsManager.getMousePos();
@@ -1258,7 +1258,7 @@ void ThreadResource::doRoom() {
vm._eventsManager.addComputerEventStart();
- voy._incriminate = false;
+ voy._mouseClicked = false;
vm._eventsManager.startCursorBlink();
int v = vm.doComputerText(9999);
@@ -1271,7 +1271,7 @@ void ThreadResource::doRoom() {
}
voy._field478 &= ~0x10;
- if (!voy._incriminate)
+ if (!voy._mouseClicked)
vm._eventsManager.delayClick(18000);
vm._bVoy->freeBoltGroup(vm._playStamp1);
@@ -1487,7 +1487,7 @@ int ThreadResource::doInterface() {
pt = _vm->_eventsManager.getMousePos();
if ((_vm->_voy._field476 <= _vm->_voy._RTVNum) || ((_vm->_voy._field478 & 0x80) &&
- (_vm->_voy._fadeFunc != NULL) && (pt.x == 0))) {
+ (_vm->_voy._rightClick != NULL) && (pt.x == 0))) {
_vm->_eventsManager.getMouseInfo();
if (_vm->_voy._transitionId == 15) {
@@ -1495,7 +1495,7 @@ int ThreadResource::doInterface() {
_vm->_voy._transitionId = 17;
_vm->_soundManager.stopVOCPlay();
_vm->checkTransition();
- _vm->_voy._mouseClicked = true;
+ _vm->_voy._leftClick = true;
} else {
_vm->_voy._field478 = 1;
_currentMouseX = pt.x;
@@ -1518,15 +1518,15 @@ int ThreadResource::doInterface() {
_vm->_eventsManager._intPtr.field1A = 0;
}
}
- } while (!_vm->_voy._fadeFunc && !_vm->shouldQuit() &&
- (!_vm->_voy._mouseClicked || regionIndex == -1));
+ } while (!_vm->_voy._rightClick && !_vm->shouldQuit() &&
+ (!_vm->_voy._leftClick || regionIndex == -1));
_vm->_voy._field478 |= 1;
_vm->_bVoy->freeBoltGroup(_vm->_playStamp1);
if (_vm->_playStamp2 != -1)
_vm->_soundManager.stopVOCPlay();
- return !_vm->_voy._fadeFunc ? regionIndex : -2;
+ return !_vm->_voy._rightClick ? regionIndex : -2;
}
bool ThreadResource::goToStateID(int stackId, int sceneId) {
diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp
index 7778614f35..966ce77e20 100644
--- a/engines/voyeur/voyeur.cpp
+++ b/engines/voyeur/voyeur.cpp
@@ -184,12 +184,12 @@ bool VoyeurEngine::doHeadTitle() {
// showTitleScreen();
// Opening
- if (!_voy._incriminate) {
+ if (!_voy._mouseClicked) {
// doOpening();
// doTransitionCard("Saturday Afternoon", "Player's Apartment");
_eventsManager.delayClick(90);
} else {
- _voy._incriminate = false;
+ _voy._mouseClicked = false;
}
if (_voy._field478 & 0x80) {
@@ -341,8 +341,8 @@ bool VoyeurEngine::doLock() {
_eventsManager._intPtr._hasPalette = true;
_eventsManager.delay(1);
- } while (!shouldQuit() && !_voy._incriminate);
- _voy._incriminate = false;
+ } while (!shouldQuit() && !_voy._mouseClicked);
+ _voy._mouseClicked = false;
} while (!shouldQuit() && key == -1);
_soundManager.abortVOCMap();
@@ -493,7 +493,7 @@ void VoyeurEngine::doOpening() {
decoder.loadFile("a2300100.rl2");
decoder.start();
- while (!shouldQuit() && !decoder.endOfVideo() && !_voy._incriminate) {
+ while (!shouldQuit() && !decoder.endOfVideo() && !_voy._mouseClicked) {
if (decoder.hasDirtyPalette()) {
const byte *palette = decoder.getPalette();
_graphicsManager.setPalette(palette, 0, 256);
@@ -517,7 +517,7 @@ void VoyeurEngine::playRL2Video(const Common::String &filename) {
decoder.loadFile(filename);
decoder.start();
- while (!shouldQuit() && !decoder.endOfVideo() && !_voy._incriminate) {
+ while (!shouldQuit() && !decoder.endOfVideo() && !_voy._mouseClicked) {
if (decoder.hasDirtyPalette()) {
const byte *palette = decoder.getPalette();
_graphicsManager.setPalette(palette, 0, 256);
@@ -554,7 +554,7 @@ void VoyeurEngine::playAVideoDuration(int videoId, int duration) {
decoder.seek(Audio::Timestamp(_voy._vocSecondsOffset * 1000));
int endFrame = decoder.getCurFrame() + totalFrames;
- while (!shouldQuit() && !decoder.endOfVideo() && !_voy._incriminate &&
+ while (!shouldQuit() && !decoder.endOfVideo() && !_voy._mouseClicked &&
(decoder.getCurFrame() < endFrame)) {
if (decoder.hasDirtyPalette()) {
const byte *palette = decoder.getPalette();
diff --git a/engines/voyeur/voyeur_game.cpp b/engines/voyeur/voyeur_game.cpp
index f0e81e90f5..a7fab19ad1 100644
--- a/engines/voyeur/voyeur_game.cpp
+++ b/engines/voyeur/voyeur_game.cpp
@@ -143,7 +143,7 @@ void VoyeurEngine::playStamp() {
_graphicsManager._backColors = _bVoy->boltEntry(_playStamp1 + 1)._cMapResource;
buttonId = getChooseButton();
- if (_voy._fadeFunc)
+ if (_voy._rightClick)
buttonId = 4;
_bVoy->freeBoltGroup(_playStamp1);
@@ -349,7 +349,7 @@ void VoyeurEngine::reviewTape() {
if ((tempPos.y - 31) % 15 >= 12 || (si + foundIndex) >= _voy._eventCount) {
_eventsManager.setCursorColor(128, 0);
foundIndex = 999;
- } else if (!_voy._mouseClicked) {
+ } else if (!_voy._leftClick) {
_eventsManager.setCursorColor(128, 2);
foundIndex = 999;
} else {
@@ -408,7 +408,7 @@ void VoyeurEngine::reviewTape() {
_eventsManager._intPtr.field38 = true;
_eventsManager._intPtr._hasPalette = true;
- if (_voy._incriminate || _voy._fadeICF1) {
+ if (_voy._mouseClicked || _voy._mouseUnk) {
switch (foundIndex) {
case 2:
if (si > 0) {
@@ -455,17 +455,17 @@ void VoyeurEngine::reviewTape() {
}
pt = _eventsManager.getMousePos();
- if (_voy._incriminate && _voy._viewBounds->left == pt.x &&
- (_voy._field478 & 0x40) && _voy._fadeFunc) {
+ if (_voy._mouseClicked && _voy._viewBounds->left == pt.x &&
+ (_voy._field478 & 0x40) && _voy._rightClick) {
WRITE_LE_UINT32(_controlPtr->_ptr + 4, (pt.y / 60) + 1);
foundIndex = -1;
- _voy._fadeFunc = 0;
+ _voy._rightClick = 0;
}
- if (_voy._fadeFunc)
+ if (_voy._rightClick)
foundIndex = 0;
- } while (!shouldQuit() && (!_voy._incriminate || foundIndex == -1));
+ } while (!shouldQuit() && (!_voy._mouseClicked || foundIndex == -1));
@@ -503,7 +503,7 @@ void VoyeurEngine::doGossip() {
// Main playback loop
int picCtr = 0;
decoder.start();
- while (!shouldQuit() && !decoder.endOfVideo() && !_voy._incriminate) {
+ while (!shouldQuit() && !decoder.endOfVideo() && !_voy._mouseClicked) {
if (decoder.hasDirtyPalette()) {
const byte *palette = decoder.getPalette();
_graphicsManager.setPalette(palette, 0, 256);
@@ -532,7 +532,7 @@ void VoyeurEngine::doGossip() {
decoder.loadFile("a2110100.rl2");
decoder.start();
- while (!shouldQuit() && !decoder.endOfVideo() && !_voy._incriminate) {
+ while (!shouldQuit() && !decoder.endOfVideo() && !_voy._mouseClicked) {
if (decoder.hasDirtyPalette()) {
const byte *palette = decoder.getPalette();
_graphicsManager.setPalette(palette, 0, 256);
@@ -570,7 +570,7 @@ void VoyeurEngine::doTapePlaying() {
cycle->vStartCycle();
_soundManager.startVOCPlay("vcr.voc");
- while (!shouldQuit() && !_voy._incriminate && _soundManager.getVOCStatus()) {
+ while (!shouldQuit() && !_voy._mouseClicked && _soundManager.getVOCStatus()) {
_eventsManager.delayClick(2);
}
@@ -733,8 +733,8 @@ int VoyeurEngine::getChooseButton() {
Common::Point(pt.x + 13, pt.y - 12));
flipPageAndWait();
- } while (!shouldQuit() && !_voy._incriminate);
- } while (!shouldQuit() && selectedIndex == -1 && !_voy._fadeFunc);
+ } while (!shouldQuit() && !_voy._mouseClicked);
+ } while (!shouldQuit() && selectedIndex == -1 && !_voy._rightClick);
return selectedIndex;
}
@@ -991,7 +991,7 @@ bool VoyeurEngine::doComputerText(int maxLen) {
_eventsManager.getMouseInfo();
++totalChars;
- } while (!shouldQuit() && !_voy._incriminate && totalChars < maxLen);
+ } while (!shouldQuit() && !_voy._mouseClicked && totalChars < maxLen);
_voy._field4EE = 0;
}
@@ -1116,10 +1116,9 @@ void VoyeurEngine::doEvidDisplay(int evidId, int eventId) {
_eventsManager.getMouseInfo();
int arrIndex = 0;
- bool breakFlag = _voy._fadeFunc != NULL;
int evidIdx = evidId;
- while (!shouldQuit() && !breakFlag) {
+ while (!shouldQuit() && !_voy._rightClick) {
if (_playStamp2 != -1 && !_soundManager.getVOCStatus()) {
if (_voy._vocSecondsOffset > 60)
_voy._vocSecondsOffset = 0;
@@ -1128,7 +1127,7 @@ void VoyeurEngine::doEvidDisplay(int evidId, int eventId) {
}
_eventsManager.delay(600);
- if (_voy._fadeFunc)
+ if (_voy._rightClick)
break;
if (count == 0 || evidIdx >= eventId)
continue;