aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2013-12-18 22:01:16 -0500
committerPaul Gilbert2013-12-18 22:01:16 -0500
commit72c21cf0a77519e71febcfe0a2aef0fc44a3af87 (patch)
tree7da83dbbda9dec89f4e7ec4a386f7b3e4bc3e724 /engines
parentf588211815d6383665072cb7637d40c8c4b5582a (diff)
downloadscummvm-rg350-72c21cf0a77519e71febcfe0a2aef0fc44a3af87.tar.gz
scummvm-rg350-72c21cf0a77519e71febcfe0a2aef0fc44a3af87.tar.bz2
scummvm-rg350-72c21cf0a77519e71febcfe0a2aef0fc44a3af87.zip
VOYEUR: Implemented drawIfaceTime
Diffstat (limited to 'engines')
-rw-r--r--engines/voyeur/events.h2
-rw-r--r--engines/voyeur/files.cpp20
-rw-r--r--engines/voyeur/files.h1
-rw-r--r--engines/voyeur/files_threads.cpp30
-rw-r--r--engines/voyeur/graphics.cpp2
-rw-r--r--engines/voyeur/graphics.h2
-rw-r--r--engines/voyeur/voyeur_game.cpp65
7 files changed, 97 insertions, 25 deletions
diff --git a/engines/voyeur/events.h b/engines/voyeur/events.h
index 9313ba3a56..0db1281706 100644
--- a/engines/voyeur/events.h
+++ b/engines/voyeur/events.h
@@ -81,7 +81,7 @@ public:
int _field46E;
int _field470;
int _field472;
- int _checkTransitionId;
+ int _transitionId;
int _field476;
int _field478;
int _field47A;
diff --git a/engines/voyeur/files.cpp b/engines/voyeur/files.cpp
index 28f4763877..31f6362d53 100644
--- a/engines/voyeur/files.cpp
+++ b/engines/voyeur/files.cpp
@@ -1170,6 +1170,26 @@ void ViewPortResource::fillPic(byte onOff) {
_state._vm->_graphicsManager.fillPic(this, onOff);
}
+void ViewPortResource::drawIfaceTime() {
+ // Hour display
+ _state._vm->_graphicsManager.drawANumber(*_state._vm->_graphicsManager._vPort,
+ (_state._vm->_gameHour / 10) == 0 ? 10 : _state._vm->_gameHour / 10,
+ Common::Point(161, 25));
+ _state._vm->_graphicsManager.drawANumber(*_state._vm->_graphicsManager._vPort,
+ _state._vm->_gameHour % 10, Common::Point(172, 25));
+
+ // Minute display
+ _state._vm->_graphicsManager.drawANumber(*_state._vm->_graphicsManager._vPort,
+ _state._vm->_gameMinute / 10, Common::Point(190, 25));
+ _state._vm->_graphicsManager.drawANumber(*_state._vm->_graphicsManager._vPort,
+ _state._vm->_gameMinute % 10, Common::Point(201, 25));
+
+ // AM/PM indicator
+ PictureResource *pic = _state._vm->_bVoy->boltEntry(_state._vm->_voy._isAM ? 272 : 273)._picResource;
+ _state._vm->_graphicsManager.sDrawPic(pic, *_state._vm->_graphicsManager._vPort,
+ Common::Point(215, 27));
+}
+
/*------------------------------------------------------------------------*/
ViewPortListResource::ViewPortListResource(BoltFilesState &state, const byte *src) {
diff --git a/engines/voyeur/files.h b/engines/voyeur/files.h
index 0a7df284cc..f25f56f0bc 100644
--- a/engines/voyeur/files.h
+++ b/engines/voyeur/files.h
@@ -309,6 +309,7 @@ public:
void addSaveRect(int pageIndex, const Common::Rect &r);
void sFillBox(int width);
void fillPic(byte onOff = 0);
+ void drawIfaceTime();
};
class ViewPortPalEntry {
diff --git a/engines/voyeur/files_threads.cpp b/engines/voyeur/files_threads.cpp
index e774674351..3aada4c89a 100644
--- a/engines/voyeur/files_threads.cpp
+++ b/engines/voyeur/files_threads.cpp
@@ -557,11 +557,11 @@ void ThreadResource::parsePlayCommands() {
int count = READ_LE_UINT16(dataP + 2);
_vm->_voy._field476 = READ_LE_UINT16(dataP + 4);
- if (_vm->_voy._checkTransitionId != count) {
- if (_vm->_voy._checkTransitionId > 1)
+ if (_vm->_voy._transitionId != count) {
+ if (_vm->_voy._transitionId > 1)
_vm->_voy._field478 &= ~0x100;
- _vm->_voy._checkTransitionId = count;
+ _vm->_voy._transitionId = count;
_vm->_gameMinute = LEVEL_M[count - 1];
_vm->_gameHour = LEVEL_H[count - 1];
//_vm->_v2A0A2 = 0;
@@ -569,7 +569,7 @@ void ThreadResource::parsePlayCommands() {
_vm->_voy._RTANum = 255;
}
- _vm->_voy._isAM = (_vm->_voy._checkTransitionId == 6) ? 1 : 0;
+ _vm->_voy._isAM = (_vm->_voy._transitionId == 6) ? 1 : 0;
}
dataP += 6;
@@ -788,7 +788,7 @@ void ThreadResource::parsePlayCommands() {
break;
case 23:
- _vm->_voy._checkTransitionId = 17;
+ _vm->_voy._transitionId = 17;
_vm->_voy._field472 = -1;
loadTheApt();
_vm->_voy._field472 = 144;
@@ -1158,7 +1158,7 @@ int ThreadResource::doApt() {
}
freeTheApt();
- if (_vm->_voy._checkTransitionId == 1 && hotspotId == 0)
+ if (_vm->_voy._transitionId == 1 && hotspotId == 0)
_vm->checkTransition();
if (!hotspotId)
@@ -1191,7 +1191,7 @@ int ThreadResource::doInterface() {
if (_vm->_voy._RTVNum >= _vm->_voy._field476 || _vm->_voy._RTVNum < 0)
_vm->_voy._RTVNum = _vm->_voy._field476 - 1;
- if (_vm->_voy._checkTransitionId < 15 && (_vm->_voy._field476 - 3) < _vm->_voy._RTVNum) {
+ if (_vm->_voy._transitionId < 15 && (_vm->_voy._field476 - 3) < _vm->_voy._RTVNum) {
_vm->_voy._RTVNum = _vm->_voy._field476;
_vm->makeViewFinder();
@@ -1298,16 +1298,16 @@ int ThreadResource::doInterface() {
if (_vm->_voy._RTVNum & 2) {
_vm->_graphicsManager.drawANumber(*_vm->_graphicsManager._vPort,
- 10 / _vm->_gameMinute, 0x1900BE);
+ 10 / _vm->_gameMinute, Common::Point(190, 25));
_vm->_graphicsManager.drawANumber(*_vm->_graphicsManager._vPort,
- 10 % _vm->_gameMinute, 0x1900BE);
+ 10 % _vm->_gameMinute, Common::Point(190, 25));
if (_vm->_voy._RTANum & 4) {
int v = 10 / _vm->_gameHour;
_vm->_graphicsManager.drawANumber(*_vm->_graphicsManager._vPort,
- v == 0 ? 10 : v, 0x1900BE);
+ v == 0 ? 10 : v, Common::Point(190, 25));
_vm->_graphicsManager.drawANumber(*_vm->_graphicsManager._vPort,
- _vm->_gameHour % 10, 0x1900AC);
+ _vm->_gameHour % 10, Common::Point(172, 25));
pic = _vm->_bVoy->boltEntry(274)._picResource;
_vm->_graphicsManager.sDrawPic(pic, *_vm->_graphicsManager._vPort,
@@ -1325,9 +1325,9 @@ int ThreadResource::doInterface() {
(_vm->_voy._fadeFunc != NULL) && (pt.x == 0))) {
_vm->_eventsManager.getMouseInfo();
- if (_vm->_voy._checkTransitionId == 15) {
+ if (_vm->_voy._transitionId == 15) {
var8 = 20;
- _vm->_voy._checkTransitionId = 17;
+ _vm->_voy._transitionId = 17;
_vm->_soundManager.stopVOCPlay();
_vm->checkTransition();
_vm->_voy._mouseClicked = true;
@@ -1433,7 +1433,7 @@ void ThreadResource::clearButtonFlag(int idx, byte bits) {
}
void ThreadResource::loadTheApt() {
- switch (_vm->_voy._checkTransitionId) {
+ switch (_vm->_voy._transitionId) {
case 1:
case 2:
case 5:
@@ -1551,7 +1551,7 @@ void ThreadResource::doAptAnim(int mode) {
}
int id2 = (id == 0x6C00 || id == 0x6F00) ? 1 : 2;
- switch (_vm->_voy._checkTransitionId) {
+ switch (_vm->_voy._transitionId) {
case 3:
id += id2 << 8;
break;
diff --git a/engines/voyeur/graphics.cpp b/engines/voyeur/graphics.cpp
index 25f63a99a2..dad1d6e652 100644
--- a/engines/voyeur/graphics.cpp
+++ b/engines/voyeur/graphics.cpp
@@ -553,7 +553,7 @@ error("TODO: var22/var24/var2C not initialised before use?");
}
}
-void GraphicsManager::drawANumber(DisplayResource *display, int num, int offset) {
+void GraphicsManager::drawANumber(DisplayResource *display, int num, const Common::Point &pt) {
warning("TODO: drawANumber");
}
diff --git a/engines/voyeur/graphics.h b/engines/voyeur/graphics.h
index 549d05f911..1017726a0b 100644
--- a/engines/voyeur/graphics.h
+++ b/engines/voyeur/graphics.h
@@ -104,7 +104,7 @@ public:
void sDrawPic(DisplayResource *srcDisplay, DisplayResource *destDisplay, const Common::Point &initialOffset);
void fillPic(DisplayResource *display, byte onOff = 0);
void sDisplayPic(PictureResource *pic);
- void drawANumber(DisplayResource *display, int num, int offset);
+ void drawANumber(DisplayResource *display, int num, const Common::Point &pt);
void flipPage();
void clearPalette();
void setPalette(const byte *palette, int start, int count);
diff --git a/engines/voyeur/voyeur_game.cpp b/engines/voyeur/voyeur_game.cpp
index 54ff56863f..52b727201c 100644
--- a/engines/voyeur/voyeur_game.cpp
+++ b/engines/voyeur/voyeur_game.cpp
@@ -111,7 +111,7 @@ void VoyeurEngine::playStamp() {
break;
case 16:
- _voy._checkTransitionId = 17;
+ _voy._transitionId = 17;
buttonId = threadP->doApt();
switch (buttonId) {
@@ -134,7 +134,7 @@ void VoyeurEngine::playStamp() {
case 17:
doTapePlaying();
- if (!checkForMurder() && _voy._checkTransitionId <= 15)
+ if (!checkForMurder() && _voy._transitionId <= 15)
checkForIncriminate();
if (_voy._videoEventId != -1)
@@ -260,7 +260,58 @@ int VoyeurEngine::getChooseButton() {
}
void VoyeurEngine::makeViewFinder() {
- error("TODO:makeViewFinder");
+ _graphicsManager._backgroundPage = _bVoy->boltEntry(0x103)._picResource;
+ _graphicsManager.sDrawPic(_graphicsManager._backgroundPage,
+ *_graphicsManager._vPort, Common::Point(0, 0));
+ CMapResource *pal = _bVoy->boltEntry(0x104)._cMapResource;
+
+ int palOffset = 0;
+ switch (_voy._transitionId) {
+ case 1:
+ case 2:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ case 9:
+ case 17:
+ palOffset = 0;
+ break;
+ case 3:
+ palOffset = 1;
+ break;
+ case 4:
+ case 10:
+ case 11:
+ case 12:
+ case 13:
+ case 14:
+ case 15:
+ case 16:
+ palOffset = 2;
+ break;
+ default:
+ break;
+ }
+
+ (*_graphicsManager._vPort)->drawIfaceTime();
+ doTimeBar(1);
+ pal->startFade();
+
+ (*_graphicsManager._vPort)->_flags |= 8;
+ _graphicsManager.flipPage();
+ _eventsManager.sWaitFlip();
+
+ while (!shouldQuit() && (_eventsManager._fadeStatus & 1))
+ _eventsManager.delay(1);
+
+ _graphicsManager.setColor(241, 105, 105, 105);
+ _graphicsManager.setColor(242, 105, 105, 105);
+ _graphicsManager.setColor(243, 105, 105, 105);
+ _graphicsManager.setColor(palOffset + 241, 219, 235, 235);
+
+ _eventsManager._intPtr.field38 = 1;
+ _eventsManager._intPtr._hasPalette = true;
}
void VoyeurEngine::initIFace(){
@@ -270,8 +321,8 @@ void VoyeurEngine::initIFace(){
void VoyeurEngine::checkTransition(){
Common::String time, day;
- if (_voy._checkTransitionId != _checkTransitionId) {
- switch (_voy._checkTransitionId) {
+ if (_voy._transitionId != _checkTransitionId) {
+ switch (_voy._transitionId) {
case 0:
break;
case 1:
@@ -291,7 +342,7 @@ void VoyeurEngine::checkTransition(){
if (!day.empty()) {
_graphicsManager.fadeDownICF(6);
- if (_voy._checkTransitionId != 17) {
+ if (_voy._transitionId != 17) {
const char *amPm = _voy._isAM ? AM : PM;
time = Common::String::format("%d:%02d%s",
_gameHour, _gameMinute, amPm);
@@ -301,7 +352,7 @@ void VoyeurEngine::checkTransition(){
_eventsManager.delay(180);
}
- _checkTransitionId = _voy._checkTransitionId;
+ _checkTransitionId = _voy._transitionId;
}
}