aboutsummaryrefslogtreecommitdiff
path: root/engines/voyeur
diff options
context:
space:
mode:
authorPaul Gilbert2013-12-26 09:35:27 +1100
committerPaul Gilbert2013-12-26 09:35:27 +1100
commit906f2546b497b7662dc40d2b6628ca27d91b9178 (patch)
treefca5597fef62fff00bb7a8217f6a5cd7ebff1736 /engines/voyeur
parent88c9dac8c0695ad328bf354ad54e5bb3fa5ba1de (diff)
downloadscummvm-rg350-906f2546b497b7662dc40d2b6628ca27d91b9178.tar.gz
scummvm-rg350-906f2546b497b7662dc40d2b6628ca27d91b9178.tar.bz2
scummvm-rg350-906f2546b497b7662dc40d2b6628ca27d91b9178.zip
VOYEUR: Implemented getChooseButton
Diffstat (limited to 'engines/voyeur')
-rw-r--r--engines/voyeur/voyeur.h2
-rw-r--r--engines/voyeur/voyeur_game.cpp55
2 files changed, 54 insertions, 3 deletions
diff --git a/engines/voyeur/voyeur.h b/engines/voyeur/voyeur.h
index 7f900df001..0d2ea7e589 100644
--- a/engines/voyeur/voyeur.h
+++ b/engines/voyeur/voyeur.h
@@ -90,7 +90,6 @@ private:
bool checkForMurder();
bool checkForIncriminate();
void playAVideoEvent(int eventIndex);
- void playAVideoDuration(int v1, int v2);
int getChooseButton();
protected:
// Engine APIs
@@ -145,6 +144,7 @@ public:
void playRL2Video(const Common::String &filename);
void doTransitionCard(const Common::String &time, const Common::String &location);
void playAVideo(int id);
+ void playAVideoDuration(int v1, int v2);
/**
* Saves the last time the game was played
diff --git a/engines/voyeur/voyeur_game.cpp b/engines/voyeur/voyeur_game.cpp
index fc0168d68a..9dec623e0f 100644
--- a/engines/voyeur/voyeur_game.cpp
+++ b/engines/voyeur/voyeur_game.cpp
@@ -689,6 +689,7 @@ bool VoyeurEngine::checkForIncriminate() {
}
_voy._videoEventId = -1;
+ return false;
}
void VoyeurEngine::playAVideoEvent(int eventIndex) {
@@ -702,8 +703,58 @@ void VoyeurEngine::playAVideoEvent(int eventIndex) {
}
int VoyeurEngine::getChooseButton() {
- warning("TODO");
- return 0;
+ int prevIndex = -2;
+ Common::Array<Common::Rect> &hotspots = _bVoy->boltEntry(_playStamp1
+ + 6)._rectResource->_entries;
+ int selectedIndex = -1;
+
+ (*_graphicsManager._vPort)->setupViewPort(_graphicsManager._backgroundPage);
+ _graphicsManager._backColors->_steps = 0;
+ _graphicsManager._backColors->startFade();
+ flipPageAndWait();
+
+ _voy._viewBounds = _bVoy->boltEntry(_playStamp1 + 7)._rectResource;
+ PictureResource *cursorPic = _bVoy->boltEntry(_playStamp1 + 2)._picResource;
+
+ do {
+ do {
+ if (_playStamp2 != -1 && !_soundManager.getVOCStatus())
+ _soundManager.startVOCPlay(_playStamp2);
+
+ _eventsManager.getMouseInfo();
+ selectedIndex = -1;
+ Common::Point pt = _eventsManager.getMousePos();
+
+ for (uint idx = 0; idx < hotspots.size(); ++idx) {
+ if (hotspots[idx].contains(pt)) {
+ if (!_voy._field4F0 || (idx + 1) != READ_LE_UINT32(_controlPtr->_ptr + 4)) {
+ selectedIndex = idx;
+ if (selectedIndex != prevIndex) {
+ PictureResource *btnPic = _bVoy->boltEntry(_playStamp1 + 8 + idx)._picResource;
+ _graphicsManager.sDrawPic(btnPic, *_graphicsManager._vPort,
+ Common::Point(106, 200));
+
+ cursorPic = _bVoy->boltEntry(_playStamp1 + 4)._picResource;
+ }
+ }
+ }
+ }
+
+ if (selectedIndex == -1) {
+ cursorPic = _bVoy->boltEntry(_playStamp1 + 2)._picResource;
+ PictureResource *btnPic = _bVoy->boltEntry(_playStamp1 + 12)._picResource;
+ _graphicsManager.sDrawPic(btnPic, *_graphicsManager._vPort,
+ Common::Point(106, 200));
+ }
+
+ _graphicsManager.sDrawPic(cursorPic, *_graphicsManager._vPort,
+ Common::Point(pt.x + 13, pt.y - 12));
+
+ flipPageAndWait();
+ } while (!shouldQuit() && !_voy._incriminate);
+ } while (!shouldQuit() && selectedIndex == -1 && !_voy._fadeFunc);
+
+ return selectedIndex;
}
void VoyeurEngine::makeViewFinder() {