aboutsummaryrefslogtreecommitdiff
path: root/engines/voyeur
diff options
context:
space:
mode:
authorPaul Gilbert2013-12-28 15:09:44 +1100
committerPaul Gilbert2013-12-28 15:09:44 +1100
commit84752aa27227bc3dde6005f818d4b2a9b21b8b5b (patch)
treecf9e16c26f1ba974efe92d52fc4ff11c9c5fbd58 /engines/voyeur
parent19c208a05d47562181c64833f25ada59751e5c88 (diff)
downloadscummvm-rg350-84752aa27227bc3dde6005f818d4b2a9b21b8b5b.tar.gz
scummvm-rg350-84752aa27227bc3dde6005f818d4b2a9b21b8b5b.tar.bz2
scummvm-rg350-84752aa27227bc3dde6005f818d4b2a9b21b8b5b.zip
VOYEUR: Refactored code fragments to use flipPageAndWait
Diffstat (limited to 'engines/voyeur')
-rw-r--r--engines/voyeur/files_threads.cpp34
-rw-r--r--engines/voyeur/voyeur_game.cpp53
2 files changed, 20 insertions, 67 deletions
diff --git a/engines/voyeur/files_threads.cpp b/engines/voyeur/files_threads.cpp
index 3a626d4801..2d389c014c 100644
--- a/engines/voyeur/files_threads.cpp
+++ b/engines/voyeur/files_threads.cpp
@@ -456,10 +456,7 @@ void ThreadResource::parsePlayCommands() {
if (_vm->_eventsManager._videoDead != -1) {
_vm->_bVoy->freeBoltGroup(0xE00);
_vm->_eventsManager._videoDead = -1;
- (*_vm->_graphicsManager._vPort)->_flags |= 8;
-
- _vm->_graphicsManager.flipPage();
- _vm->_eventsManager.sWaitFlip();
+ _vm->flipPageAndWait();
}
_vm->_eventsManager._videoDead = -1;
@@ -1108,9 +1105,7 @@ int ThreadResource::doApt() {
_vm->_playStamp1 + 3)._picResource;
_vm->_graphicsManager.sDrawPic(pic, *_vm->_graphicsManager._vPort, pt);
- (*_vm->_graphicsManager._vPort)->_flags |= 8;
- _vm->_graphicsManager.flipPage();
- _vm->_eventsManager.sWaitFlip();
+ _vm->flipPageAndWait();
} while (!_vm->shouldQuit() && (!_vm->_voy._mouseClicked || hotspotId == -1));
@@ -1250,9 +1245,7 @@ void ThreadResource::doRoom() {
vm._eventsManager.startCursorBlink();
if (i4e4 == 999) {
- (*_vm->_graphicsManager._vPort)->_flags |= 8;
- _vm->_graphicsManager.flipPage();
- _vm->_eventsManager.sWaitFlip();
+ _vm->flipPageAndWait();
if (vm._playStamp2 != -1) {
voy._vocSecondsOffset = voy._RTVNum -
@@ -1261,10 +1254,8 @@ void ThreadResource::doRoom() {
}
vm.getComputerBrush();
+ _vm->flipPageAndWait();
- (*vm._graphicsManager._vPort)->_flags |= 8;
- vm._graphicsManager.flipPage();
- vm._eventsManager.sWaitFlip();
vm._eventsManager.addComputerEventStart();
voy._incriminate = false;
@@ -1294,9 +1285,7 @@ void ThreadResource::doRoom() {
vm._playStamp1)._picResource;
vm._graphicsManager._backColors->startFade();
- (*vm._graphicsManager._vPort)->_flags |= 8;
- vm._graphicsManager.flipPage();
- vm._eventsManager.sWaitFlip();
+ _vm->flipPageAndWait();
while (!vm.shouldQuit() && (vm._eventsManager._fadeStatus & 1))
vm._eventsManager.delay(1);
@@ -1318,9 +1307,7 @@ void ThreadResource::doRoom() {
vm._eventsManager.delay(1);
}
- (*vm._graphicsManager._vPort)->_flags |= 8;
- vm._graphicsManager.flipPage();
- vm._eventsManager.sWaitFlip();
+ _vm->flipPageAndWait();
vm._graphicsManager.fadeUpICF1(0);
voy._field478 &= 0x10;
@@ -1496,9 +1483,7 @@ int ThreadResource::doInterface() {
}
_vm->_voy._RTANum = 0;
- (*_vm->_graphicsManager._vPort)->_flags |= 8;
- _vm->_graphicsManager.flipPage();
- _vm->_eventsManager.sWaitFlip();
+ _vm->flipPageAndWait();
pt = _vm->_eventsManager.getMousePos();
if ((_vm->_voy._field476 <= _vm->_voy._RTVNum) || ((_vm->_voy._field478 & 0x80) &&
@@ -1736,10 +1721,7 @@ void ThreadResource::doAptAnim(int mode) {
(*_vm->_graphicsManager._vPort)->setupViewPort(pic);
pal->startFade();
- (*_vm->_graphicsManager._vPort)->_flags |= 8;
- _vm->_graphicsManager.flipPage();
- _vm->_eventsManager.sWaitFlip();
-
+ _vm->flipPageAndWait();
_vm->_eventsManager.delay(5);
}
diff --git a/engines/voyeur/voyeur_game.cpp b/engines/voyeur/voyeur_game.cpp
index badea5912f..8bb1bded9c 100644
--- a/engines/voyeur/voyeur_game.cpp
+++ b/engines/voyeur/voyeur_game.cpp
@@ -251,11 +251,7 @@ void VoyeurEngine::reviewTape() {
(*_graphicsManager._vPort)->setupViewPort(_graphicsManager._backgroundPage);
_graphicsManager._backColors->startFade();
- (*_graphicsManager._vPort)->_flags |= 8;
- _graphicsManager.flipPage();
- _eventsManager.sWaitFlip();
- while (!shouldQuit() && (_eventsManager._fadeStatus & 1))
- _eventsManager.delay(1);
+ flipPageAndWaitForFade();
_graphicsManager.setColor(1, 32, 32, 32);
_graphicsManager.setColor(2, 96, 96, 96);
@@ -292,9 +288,7 @@ void VoyeurEngine::reviewTape() {
if (var1E) {
var1E = false;
- (*_graphicsManager._vPort)->_flags |= 8;
- _graphicsManager.flipPage();
- _eventsManager.sWaitFlip();
+ flipPageAndWait();
_graphicsManager._drawPtr->_penColor = 0;
_graphicsManager._drawPtr->_pos = Common::Point(tempRect.left, tempRect.top);
@@ -324,9 +318,7 @@ void VoyeurEngine::reviewTape() {
(*_graphicsManager._vPort)->addSaveRect(
(*_graphicsManager._vPort)->_lastPage, tempRect);
- (*_graphicsManager._vPort)->_flags |= 8;
- _graphicsManager.flipPage();
- _eventsManager.sWaitFlip();
+ flipPageAndWait();
(*_graphicsManager._vPort)->addSaveRect(
(*_graphicsManager._vPort)->_lastPage, tempRect);
@@ -334,9 +326,7 @@ void VoyeurEngine::reviewTape() {
_graphicsManager.sDrawPic(cursor, *_graphicsManager._vPort,
_eventsManager.getMousePos());
- (*_graphicsManager._vPort)->_flags |= 8;
- _graphicsManager.flipPage();
- _eventsManager.sWaitFlip();
+ flipPageAndWait();
_eventsManager.getMouseInfo();
foundIndex = -1;
@@ -366,9 +356,7 @@ void VoyeurEngine::reviewTape() {
_eventsManager.setCursorColor(128, 2);
var20 = foundIndex;
- (*_graphicsManager._vPort)->_flags |= 8;
- _graphicsManager.flipPage();
- _eventsManager.sWaitFlip();
+ flipPageAndWait();
_graphicsManager._drawPtr->_penColor = 0;
_graphicsManager._drawPtr->_pos = Common::Point(tempRect.left, tempRect.top);
@@ -398,15 +386,11 @@ void VoyeurEngine::reviewTape() {
(*_graphicsManager._vPort)->addSaveRect(
(*_graphicsManager._vPort)->_lastPage, tempRect);
- (*_graphicsManager._vPort)->_flags |= 8;
- _graphicsManager.flipPage();
- _eventsManager.sWaitFlip();
+ flipPageAndWait();
(*_graphicsManager._vPort)->addSaveRect(
(*_graphicsManager._vPort)->_lastPage, tempRect);
- (*_graphicsManager._vPort)->_flags |= 8;
- _graphicsManager.flipPage();
- _eventsManager.sWaitFlip();
+ flipPageAndWait();
_eventsManager.getMouseInfo();
foundIndex = 999;
@@ -492,9 +476,7 @@ void VoyeurEngine::reviewTape() {
_bVoy->freeBoltGroup(0x900);
(*_graphicsManager._vPort)->fillPic(0);
- (*_graphicsManager._vPort)->_flags |= 8;
- _graphicsManager.flipPage();
- _eventsManager.sWaitFlip();
+ flipPageAndWait();
}
void VoyeurEngine::doGossip() {
@@ -796,12 +778,7 @@ void VoyeurEngine::makeViewFinder() {
doTimeBar(true);
pal->startFade();
- (*_graphicsManager._vPort)->_flags |= 8;
- _graphicsManager.flipPage();
- _eventsManager.sWaitFlip();
-
- while (!shouldQuit() && (_eventsManager._fadeStatus & 1))
- _eventsManager.delay(1);
+ flipPageAndWaitForFade();
_graphicsManager.setColor(241, 105, 105, 105);
_graphicsManager.setColor(242, 105, 105, 105);
@@ -1010,9 +987,7 @@ bool VoyeurEngine::doComputerText(int maxLen) {
_eventsManager.delay(4);
}
- (*_graphicsManager._vPort)->_flags |= 8;
- _graphicsManager.flipPage();
- _eventsManager.sWaitFlip();
+ flipPageAndWait();
_eventsManager.getMouseInfo();
++totalChars;
@@ -1021,9 +996,7 @@ bool VoyeurEngine::doComputerText(int maxLen) {
_voy._field4EE = 0;
}
- (*_graphicsManager._vPort)->_flags |= 8;
- _graphicsManager.flipPage();
- _eventsManager.sWaitFlip();
+ flipPageAndWait();
_graphicsManager._fontPtr->_curFont = _bVoy->boltEntry(0x101)._fontResource;
return totalChars;
@@ -1102,9 +1075,7 @@ void VoyeurEngine::checkPhoneCall() {
void VoyeurEngine::doEvidDisplay(int v1, int v2) {
_eventsManager.getMouseInfo();
- (*_graphicsManager._vPort)->_flags |= 8;
- _graphicsManager.flipPage();
- _eventsManager.sWaitFlip();
+ flipPageAndWait();
if (_playStamp2 != -1) {
_voy._vocSecondsOffset = _voy._RTVNum - _voy._field4AC;