aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2013-12-19 09:25:40 -0500
committerPaul Gilbert2013-12-19 09:25:40 -0500
commita73ea5c3dc0bfd8c5ad6909fcf74cb51fffe3702 (patch)
treec4e93468fddaeb5cfe62922166613dd30d676180 /engines
parent72c21cf0a77519e71febcfe0a2aef0fc44a3af87 (diff)
downloadscummvm-rg350-a73ea5c3dc0bfd8c5ad6909fcf74cb51fffe3702.tar.gz
scummvm-rg350-a73ea5c3dc0bfd8c5ad6909fcf74cb51fffe3702.tar.bz2
scummvm-rg350-a73ea5c3dc0bfd8c5ad6909fcf74cb51fffe3702.zip
VOYEUR: Beginnings of camera spy screen
Diffstat (limited to 'engines')
-rw-r--r--engines/voyeur/files.cpp23
-rw-r--r--engines/voyeur/files.h4
-rw-r--r--engines/voyeur/files_threads.cpp2
-rw-r--r--engines/voyeur/graphics.cpp42
-rw-r--r--engines/voyeur/voyeur.cpp3
-rw-r--r--engines/voyeur/voyeur.h5
-rw-r--r--engines/voyeur/voyeur_game.cpp80
7 files changed, 143 insertions, 16 deletions
diff --git a/engines/voyeur/files.cpp b/engines/voyeur/files.cpp
index 31f6362d53..6f44806acd 100644
--- a/engines/voyeur/files.cpp
+++ b/engines/voyeur/files.cpp
@@ -941,8 +941,8 @@ void ViewPortResource::setupViewPort() {
&GraphicsManager::restoreMCGASaveRect);
}
-void ViewPortResource::setupViewPort(PictureResource *pic) {
- setupViewPort(pic, NULL,
+void ViewPortResource::setupViewPort(PictureResource *pic, Common::Rect *clipRect) {
+ setupViewPort(pic, clipRect,
&GraphicsManager::setupMCGASaveRect, &GraphicsManager::addRectOptSaveRect,
&GraphicsManager::restoreMCGASaveRect);
}
@@ -1045,7 +1045,7 @@ int ViewPortResource::drawText(const Common::String &msg) {
if (fontInfo._fontFlags & DISPFLAG_1) {
gfxManager._drawPtr->_pos = Common::Point(_fontRect.left, _fontRect.top);
gfxManager._drawPtr->_penColor = fontInfo._backColor;
- sFillBox(_fontRect.width());
+ sFillBox(_fontRect.width(), _fontRect.height());
}
bool saveBack = gfxManager._saveBack;
@@ -1160,10 +1160,23 @@ int ViewPortResource::textWidth(const Common::String &msg) {
void ViewPortResource::addSaveRect(int pageIndex, const Common::Rect &r) {
// TODO
+ warning("TODO: addSaveRect");
}
-void ViewPortResource::sFillBox(int width) {
- // TODO
+void ViewPortResource::sFillBox(int width, int height) {
+ bool saveBack = _state._vm->_graphicsManager._saveBack;
+ _state._vm->_graphicsManager._saveBack = false;
+
+ PictureResource pr;
+ pr._flags = 1;
+ pr._select = 0xff;
+ pr._pick = 0;
+ pr._onOff = _state._vm->_graphicsManager._drawPtr->_penColor;
+ pr._bounds = Common::Rect(0, 0, width, height);
+
+ _state._vm->_graphicsManager.sDrawPic(&pr, this,
+ _state._vm->_graphicsManager._drawPtr->_pos);
+ _state._vm->_graphicsManager._saveBack = saveBack;
}
void ViewPortResource::fillPic(byte onOff) {
diff --git a/engines/voyeur/files.h b/engines/voyeur/files.h
index f25f56f0bc..a48dbaa3e5 100644
--- a/engines/voyeur/files.h
+++ b/engines/voyeur/files.h
@@ -303,11 +303,11 @@ public:
virtual ~ViewPortResource();
void setupViewPort();
- void setupViewPort(PictureResource *pic);
+ void setupViewPort(PictureResource *pic, Common::Rect *clipRect = NULL);
int drawText(const Common::String &msg);
int textWidth(const Common::String &msg);
void addSaveRect(int pageIndex, const Common::Rect &r);
- void sFillBox(int width);
+ void sFillBox(int width, int height);
void fillPic(byte onOff = 0);
void drawIfaceTime();
};
diff --git a/engines/voyeur/files_threads.cpp b/engines/voyeur/files_threads.cpp
index 3aada4c89a..16924056e0 100644
--- a/engines/voyeur/files_threads.cpp
+++ b/engines/voyeur/files_threads.cpp
@@ -1230,7 +1230,7 @@ int ThreadResource::doInterface() {
_vm->_voy._field478 &= ~1;
do {
- _vm->doTimeBar(1);
+ _vm->doTimeBar(true);
_vm->_eventsManager.getMouseInfo();
pt = _vm->_eventsManager.getMousePos();
diff --git a/engines/voyeur/graphics.cpp b/engines/voyeur/graphics.cpp
index dad1d6e652..185f51be54 100644
--- a/engines/voyeur/graphics.cpp
+++ b/engines/voyeur/graphics.cpp
@@ -554,7 +554,8 @@ error("TODO: var22/var24/var2C not initialised before use?");
}
void GraphicsManager::drawANumber(DisplayResource *display, int num, const Common::Point &pt) {
- warning("TODO: drawANumber");
+ PictureResource *pic = _vm->_bVoy->boltEntry(num + 261)._picResource;
+ sDrawPic(pic, display, pt);
}
void GraphicsManager::fillPic(DisplayResource *display, byte onOff) {
@@ -692,7 +693,44 @@ void GraphicsManager::screenReset() {
}
void GraphicsManager::doScroll(const Common::Point &pt) {
- error("TODO: doScroll");
+ Common::Rect clipRect(72, 47, 240, 148);
+ (*_vm->_graphicsManager._vPort)->setupViewPort(NULL, &clipRect);
+
+ PictureResource *pic;
+ int base = 0;
+ switch (_vm->_voy._transitionId) {
+ case 0:
+ break;
+ case 1:
+ case 2:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ case 9:
+ base = 0xB00;
+ break;
+ case 3:
+ base = 0xC00;
+ break;
+ default:
+ base = 0xD00;
+ }
+
+ if (base) {
+ pic = _vm->_bVoy->boltEntry(base + 3)._picResource;
+ sDrawPic(pic, *_vPort, Common::Point(784 - pt.x + 712, 150 - pt.y - 104));
+ pic = _vm->_bVoy->boltEntry(base + 4)._picResource;
+ sDrawPic(pic, *_vPort, Common::Point(784 - pt.x + 712, 150 - pt.y - 44));
+ pic = _vm->_bVoy->boltEntry(base + 5)._picResource;
+ sDrawPic(pic, *_vPort, Common::Point(784 - pt.x + 712, 150 - pt.y + 16));
+ pic = _vm->_bVoy->boltEntry(base + 6)._picResource;
+ sDrawPic(pic, *_vPort, Common::Point(784 - pt.x + 712, 150 - pt.y + 76));
+ pic = _vm->_bVoy->boltEntry(base + 7)._picResource;
+ sDrawPic(pic, *_vPort, Common::Point(784 - pt.x + 712, 150 - pt.y + 136));
+ }
+
+ (*_vPort)->setupViewPort();
}
void GraphicsManager::fadeDownICF1(int steps) {
diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp
index 1c8c185f78..fe2730700f 100644
--- a/engines/voyeur/voyeur.cpp
+++ b/engines/voyeur/voyeur.cpp
@@ -47,6 +47,9 @@ VoyeurEngine::VoyeurEngine(OSystem *syst, const VoyeurGameDescription *gameDesc)
_checkTransitionId = -1;
_gameHour = 0;
_gameMinute = 0;
+ _flashTimeVal = 0;
+ _flashTimeFlag = false;
+ _timeBarVal = -1;
initialiseManagers();
}
diff --git a/engines/voyeur/voyeur.h b/engines/voyeur/voyeur.h
index f35af7d17c..b18a7c0b97 100644
--- a/engines/voyeur/voyeur.h
+++ b/engines/voyeur/voyeur.h
@@ -120,6 +120,9 @@ public:
int _checkTransitionId;
int _gameHour;
int _gameMinute;
+ int _flashTimeVal;
+ bool _flashTimeFlag;
+ int _timeBarVal;
public:
VoyeurEngine(OSystem *syst, const VoyeurGameDescription *gameDesc);
virtual ~VoyeurEngine();
@@ -149,7 +152,7 @@ public:
void makeViewFinder();
void initIFace();
void checkTransition();
- void doTimeBar(int v);
+ void doTimeBar(bool force);
void flashTimeBar();
void checkPhoneCall();
};
diff --git a/engines/voyeur/voyeur_game.cpp b/engines/voyeur/voyeur_game.cpp
index 52b727201c..bdf4ee01a0 100644
--- a/engines/voyeur/voyeur_game.cpp
+++ b/engines/voyeur/voyeur_game.cpp
@@ -295,7 +295,7 @@ void VoyeurEngine::makeViewFinder() {
}
(*_graphicsManager._vPort)->drawIfaceTime();
- doTimeBar(1);
+ doTimeBar(true);
pal->startFade();
(*_graphicsManager._vPort)->_flags |= 8;
@@ -315,7 +315,40 @@ void VoyeurEngine::makeViewFinder() {
}
void VoyeurEngine::initIFace(){
- error("TODO: initIFace");
+ int playStamp1 = _playStamp1;
+ switch (_voy._transitionId) {
+ case 0:
+ break;
+ case 1:
+ case 2:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ case 9:
+ _playStamp1 = 0xB00;
+ break;
+ case 3:
+ _playStamp1 = 0xC00;
+ break;
+ default:
+ _playStamp1 = 0xD00;
+ break;
+ }
+ if (playStamp1 != -1)
+ _bVoy->freeBoltGroup(playStamp1, true);
+
+ _bVoy->getBoltGroup(_playStamp1);
+ CMapResource *pal = _bVoy->boltEntry(_playStamp1 + 2)._cMapResource;
+ pal->startFade();
+
+ _graphicsManager.doScroll(_eventsManager.getMousePos());
+
+ _voy._field4386 = _bVoy->memberAddr(_playStamp1);
+
+ // Note: the original did two loops to preload members here, which is
+ // redundant for ScummVM, since computers are faster these days, and
+ // getting resources as needed will be fast enough.
}
void VoyeurEngine::checkTransition(){
@@ -356,12 +389,49 @@ void VoyeurEngine::checkTransition(){
}
}
-void VoyeurEngine::doTimeBar(int v) {
- error("TODO: doTimeBar");
+void VoyeurEngine::doTimeBar(bool force) {
+ flashTimeBar();
+
+ if ((force || _timeBarVal != _voy._RTVNum) && _voy._field476 > 0) {
+ if (_voy._RTVNum > _voy._field476 || _voy._RTVNum < 0)
+ _voy._RTVNum = _voy._field476 - 1;
+
+ _timeBarVal = _voy._RTVNum;
+ int height = ((_voy._field476 - _voy._RTVNum) * 59) / _voy._field476;
+ int fullHeight = MAX(151 - height, 93);
+
+ _graphicsManager._drawPtr->_penColor = 134;
+ _graphicsManager._drawPtr->_pos = Common::Point(39, 92);
+
+ (*_graphicsManager._vPort)->sFillBox(6, fullHeight - 92);
+ if (height > 0) {
+ _graphicsManager.setColor(215, 238, 238, 238);
+ _eventsManager._intPtr.field38 = 1;
+ _eventsManager._intPtr._hasPalette = true;
+
+ _graphicsManager._drawPtr->_penColor = 215;
+ _graphicsManager._drawPtr->_pos = Common::Point(39, fullHeight);
+ (*_graphicsManager._vPort)->sFillBox(6, height);
+ }
+ }
}
void VoyeurEngine::flashTimeBar(){
- error("TODO: flashTimeBar");
+ if (_voy._RTVNum >= 0 && (_voy._field476 - _voy._RTVNum) < 11 &&
+ (_eventsManager._intPtr.field1A >= (_flashTimeVal + 15) ||
+ _eventsManager._intPtr.field1A < _flashTimeVal)) {
+ // Within time range
+ _flashTimeVal = _eventsManager._intPtr.field1A;
+
+ if (_flashTimeFlag)
+ _graphicsManager.setColor(240, 220, 20, 20);
+ else
+ _graphicsManager.setColor(240, 220, 220, 220);
+
+ _eventsManager._intPtr.field38 = 1;
+ _eventsManager._intPtr._hasPalette = true;
+ _flashTimeFlag = !_flashTimeFlag;
+ }
}
void VoyeurEngine::checkPhoneCall() {