aboutsummaryrefslogtreecommitdiff
path: root/engines/voyeur
diff options
context:
space:
mode:
Diffstat (limited to 'engines/voyeur')
-rw-r--r--engines/voyeur/events.h1
-rw-r--r--engines/voyeur/files.h4
-rw-r--r--engines/voyeur/files_threads.cpp88
-rw-r--r--engines/voyeur/graphics.cpp4
-rw-r--r--engines/voyeur/graphics.h1
-rw-r--r--engines/voyeur/voyeur.cpp1
-rw-r--r--engines/voyeur/voyeur.h5
-rw-r--r--engines/voyeur/voyeur_game.cpp20
8 files changed, 120 insertions, 4 deletions
diff --git a/engines/voyeur/events.h b/engines/voyeur/events.h
index 97927e7d7d..9fe3464431 100644
--- a/engines/voyeur/events.h
+++ b/engines/voyeur/events.h
@@ -201,6 +201,7 @@ public:
void setVm(VoyeurEngine *vm) { _vm = vm; }
void resetMouse();
+ void setMousePos(const Common::Point &p) { _mousePos = p; }
void startMainClockInt();
void vStopCycle();
void sWaitFlip();
diff --git a/engines/voyeur/files.h b/engines/voyeur/files.h
index 98e0aa206c..03862838cc 100644
--- a/engines/voyeur/files.h
+++ b/engines/voyeur/files.h
@@ -421,6 +421,10 @@ public:
static CMapResource *_cmd14Pal;
static void initUseCount();
static void unloadAllStacks(VoyeurEngine *vm);
+ static int _currentMouseX;
+ static int _currentMouseY;
+
+ static void init();
private:
bool getStateInfo();
byte *getDataOffset();
diff --git a/engines/voyeur/files_threads.cpp b/engines/voyeur/files_threads.cpp
index 893e5e9d58..aacc619f6b 100644
--- a/engines/voyeur/files_threads.cpp
+++ b/engines/voyeur/files_threads.cpp
@@ -27,10 +27,21 @@
namespace Voyeur {
-int ThreadResource::_stampFlags = 0;
+int ThreadResource::_stampFlags;
int ThreadResource::_useCount[8];
-byte *ThreadResource::_threadDataPtr = NULL;
-CMapResource *ThreadResource::_cmd14Pal = NULL;
+byte *ThreadResource::_threadDataPtr;
+CMapResource *ThreadResource::_cmd14Pal;
+int ThreadResource::_currentMouseX;
+int ThreadResource::_currentMouseY;
+
+void ThreadResource::init() {
+ _stampFlags = 0;
+ Common::fill(&_useCount[0], &_useCount[8], 0);
+ _threadDataPtr = nullptr;
+ _cmd14Pal = nullptr;
+ _currentMouseX = 392;
+ _currentMouseY = 57;
+}
ThreadResource::ThreadResource(BoltFilesState &state, const byte *src):
_vm(state._vm) {
@@ -1050,7 +1061,76 @@ void ThreadResource::doRoom() {
}
int ThreadResource::doInterface() {
- warning("TODO: doInterface");
+ int varA = -1;
+ int var8 = 0;
+
+ if (_vm->_voy._field478 != _vm->_voy._field46E) {
+ _vm->_voy._field46E = 0;
+ return -1;
+ }
+
+ _vm->_voy._field478 &= ~0x100;
+ _vm->_playStamp1 = -1;
+ _vm->_eventsManager._intPtr.field1E = 1;
+ _vm->_eventsManager._intPtr.field1A = 0;
+
+ if (_vm->_voy._RTVNum >= _vm->_voy._field476 || _vm->_voy._RTVNum < 0)
+ _vm->_voy._RTVNum = _vm->_voy._field476 - 1;
+
+ if (_vm->_voy._field474 < 15 && (_vm->_voy._field476 - 3) < _vm->_voy._RTVNum) {
+ _vm->_voy._RTVNum = _vm->_voy._field476;
+ _vm->makeViewFinder();
+
+ _vm->_eventsManager.setMousePos(Common::Point(_currentMouseX, _currentMouseY));
+ _vm->initIFace();
+ _vm->_voy._RTVNum = _vm->_voy._field476 - 4;
+ _vm->_voy._field478 &= ~1;
+
+ while (!_vm->shouldQuit() && _vm->_voy._RTVNum < _vm->_voy._field476) {
+ _vm->flashTimeBar();
+ }
+
+ _vm->_voy._field478 = 1;
+ chooseSTAMPButton(20);
+ parsePlayCommands();
+ }
+
+ _vm->checkTransition();
+ _vm->makeViewFinder();
+ _vm->_eventsManager.getMouseInfo();
+ _vm->_eventsManager.setMousePos(Common::Point(_currentMouseX, _currentMouseY));
+ _vm->initIFace();
+
+ byte *dataP = _vm->_bVoy->memberAddr(_vm->_playStamp1);
+ _vm->_playStamp2 = 151 - _vm->getRandomNumber(5);
+ _vm->_voy._vocSecondsOffset = _vm->getRandomNumber(29);
+
+ Common::String fname = _vm->_soundManager.getVOCFileName(_vm->_playStamp2);
+ _vm->_soundManager.startVOCPlay(fname);
+ _vm->_eventsManager.getMouseInfo();
+ _vm->_eventsManager.setMousePos(Common::Point(_currentMouseX, _currentMouseY));
+
+ _vm->_graphicsManager.setColor(240, 220, 220, 220);
+ _vm->_eventsManager._intPtr.field38 = true;
+ _vm->_eventsManager._intPtr._hasPalette = true;
+ _vm->_voy._field478 &= ~1;
+
+ for (;;) {
+ _vm->doTimeBar(1);
+ _vm->_eventsManager.getMouseInfo();
+
+ const Common::Point &pt = _vm->_eventsManager.getMousePos();
+ if (pt.x != _currentMouseX || pt.y != _currentMouseY || var8 != varA) {
+ varA = var8;
+ _vm->_graphicsManager.doScroll(pt);
+
+ _currentMouseX = pt.x;
+ _currentMouseY = pt.y;
+ }
+
+ // TODO
+ }
+
return 0;
}
diff --git a/engines/voyeur/graphics.cpp b/engines/voyeur/graphics.cpp
index 9b9ebe462b..c8b554c0ed 100644
--- a/engines/voyeur/graphics.cpp
+++ b/engines/voyeur/graphics.cpp
@@ -658,4 +658,8 @@ void GraphicsManager::screenReset() {
_vm->_eventsManager.sWaitFlip();
}
+void GraphicsManager::doScroll(const Common::Point &pt) {
+ error("TODO: doScroll");
+}
+
} // End of namespace Voyeur
diff --git a/engines/voyeur/graphics.h b/engines/voyeur/graphics.h
index 518ec1a459..10dab5bd2a 100644
--- a/engines/voyeur/graphics.h
+++ b/engines/voyeur/graphics.h
@@ -110,6 +110,7 @@ public:
void resetPalette();
void setColor(int idx, byte r, byte g, byte b);
void screenReset();
+ void doScroll(const Common::Point &pt);
};
} // End of namespace Voyeur
diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp
index b8f0babb6f..84aa0c440b 100644
--- a/engines/voyeur/voyeur.cpp
+++ b/engines/voyeur/voyeur.cpp
@@ -117,6 +117,7 @@ void VoyeurEngine::initialiseManagers() {
}
void VoyeurEngine::ESP_Init() {
+ ThreadResource::init();
}
void VoyeurEngine::globalInitBolt() {
diff --git a/engines/voyeur/voyeur.h b/engines/voyeur/voyeur.h
index 9712f2b4f2..264c20346d 100644
--- a/engines/voyeur/voyeur.h
+++ b/engines/voyeur/voyeur.h
@@ -146,6 +146,11 @@ public:
void saveLastInplay();
void loadTheApt();
void freeTheApt();
+ void makeViewFinder();
+ void initIFace();
+ void checkTransition();
+ void doTimeBar(int v);
+ void flashTimeBar();
};
} // End of namespace Voyeur
diff --git a/engines/voyeur/voyeur_game.cpp b/engines/voyeur/voyeur_game.cpp
index 8c765b2687..505f79483d 100644
--- a/engines/voyeur/voyeur_game.cpp
+++ b/engines/voyeur/voyeur_game.cpp
@@ -272,4 +272,24 @@ void VoyeurEngine::freeTheApt() {
error("TODO: freeTheApt");
}
+void VoyeurEngine::makeViewFinder() {
+ error("TODO");
+}
+
+void VoyeurEngine::initIFace(){
+ error("TODO");
+}
+
+void VoyeurEngine::checkTransition(){
+ error("TODO");
+}
+
+void VoyeurEngine::doTimeBar(int v) {
+ error("TODO");
+}
+
+void VoyeurEngine::flashTimeBar(){
+ error("TODO");
+}
+
} // End of namespace Voyeur