aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/script.cpp
diff options
context:
space:
mode:
authorTravis Howell2006-10-27 12:55:48 +0000
committerTravis Howell2006-10-27 12:55:48 +0000
commitf1accee70239fe3ca0d83007099bf45f27e700c2 (patch)
treec33541830be26b4a92492dbddddd8d055a010c2a /engines/agos/script.cpp
parent231d6064de45ffc589e5b913194065488579fbcf (diff)
downloadscummvm-rg350-f1accee70239fe3ca0d83007099bf45f27e700c2.tar.gz
scummvm-rg350-f1accee70239fe3ca0d83007099bf45f27e700c2.tar.bz2
scummvm-rg350-f1accee70239fe3ca0d83007099bf45f27e700c2.zip
Cleanup
svn-id: r24531
Diffstat (limited to 'engines/agos/script.cpp')
-rw-r--r--engines/agos/script.cpp62
1 files changed, 43 insertions, 19 deletions
diff --git a/engines/agos/script.cpp b/engines/agos/script.cpp
index 3cb6be087e..ef0b07a547 100644
--- a/engines/agos/script.cpp
+++ b/engines/agos/script.cpp
@@ -1135,33 +1135,57 @@ void AGOSEngine::stopAnimateSimon2(uint a, uint b) {
_lockWord &= ~0x8000;
}
-void AGOSEngine::setWindowImageEx(uint16 mode, uint16 vga_res) {
- if (!_initMouse) {
- _initMouse = 1;
- vc33_setMouseOn();
+void AGOSEngine::waitForSync(uint a) {
+ const uint maxCount = (getGameType() == GType_SIMON1) ? 500 : 1000;
+
+ if (getGameType() == GType_SIMON1 && (getFeatures() & GF_TALKIE)) {
+ if (a != 200) {
+ uint16 tmp = _lastVgaWaitFor;
+ _lastVgaWaitFor = 0;
+ if (tmp == a)
+ return;
+ }
}
- if (mode == 4) {
- vc29_stopAllSounds();
+ _vgaWaitFor = a;
+ _syncCount = 0;
+ _exitCutscene = false;
+ _rightButtonDown = false;
- if (getGameType() == GType_ELVIRA1) {
- if (_variableArray[299] == 0) {
- _variableArray[293] = 0;
- _wallOn = 0;
+ while (_vgaWaitFor != 0) {
+ if (_rightButtonDown) {
+ if (_vgaWaitFor == 200 && (getGameType() == GType_FF || !getBitFlag(14))) {
+ skipSpeech();
+ break;
}
- } else if (getGameType() == GType_ELVIRA2) {
- if (_variableArray[70] == 0) {
- _variableArray[71] = 0;
- _wallOn = 0;
+ }
+ if (_exitCutscene) {
+ if (getGameType() == GType_ELVIRA1) {
+ if (_variableArray[105] == 0) {
+ _variableArray[105] = 255;
+ break;
+ }
+ } else if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW) {
+ if (_vgaWaitFor == 51) {
+ setBitFlag(244, 1);
+ break;
+ }
+ } else {
+ if (getBitFlag(9)) {
+ endCutscene();
+ break;
+ }
}
}
+ processSpecialKeys();
- }
-
- if (_lockWord & 0x10)
- error("setWindowImageEx: _lockWord & 0x10");
+ if (_syncCount >= maxCount) {
+ warning("waitForSync: wait timed out");
+ break;
+ }
- setWindowImage(mode, vga_res);
+ delay(1);
+ }
}
} // End of namespace AGOS