aboutsummaryrefslogtreecommitdiff
path: root/engines/agos
diff options
context:
space:
mode:
authorTravis Howell2006-10-22 00:55:17 +0000
committerTravis Howell2006-10-22 00:55:17 +0000
commitbce0a11065570c7bb2373c6330071143f0489815 (patch)
treeff9f9f816191b022bfdddabeb3ca3a6ca8006a3d /engines/agos
parent7ca5752fbc6e54abcc1b2529edb5dbee71f4d22f (diff)
downloadscummvm-rg350-bce0a11065570c7bb2373c6330071143f0489815.tar.gz
scummvm-rg350-bce0a11065570c7bb2373c6330071143f0489815.tar.bz2
scummvm-rg350-bce0a11065570c7bb2373c6330071143f0489815.zip
Add extra picture opcode code for ELvira 1/2
svn-id: r24426
Diffstat (limited to 'engines/agos')
-rw-r--r--engines/agos/agos.cpp1
-rw-r--r--engines/agos/agos.h2
-rw-r--r--engines/agos/icons.cpp8
-rw-r--r--engines/agos/input.cpp3
-rw-r--r--engines/agos/menus.cpp8
-rw-r--r--engines/agos/script.cpp44
6 files changed, 43 insertions, 23 deletions
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index b0fa6c6205..ad7884e31a 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -324,6 +324,7 @@ AGOSEngine::AGOSEngine(OSystem *syst)
_classMode1 = 0;
_classMode2 = 0;
_superRoomNumber = 0;
+ _wallOn = 0;
_boxLineCount = 0;
_boxCR = 0;
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index f8576b0f5e..a302760b29 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -318,6 +318,7 @@ protected:
int _agosMenu;
byte _textMenu[10];
uint _superRoomNumber;
+ uint _wallOn;
uint16 _hyperLink, _newLines;
uint16 _oracleMaxScrollY, _noOracleScroll;
@@ -797,6 +798,7 @@ protected:
void animate(uint windowNum, uint zoneNum, uint vgaSpriteId, uint x, uint y, uint palette, bool setZone = true);
void setImage(uint16 vga_res_id, bool setZone);
void setWindowImage(uint16 mode, uint16 vga_res_id);
+ void setWindowImageEx(uint16 mode, uint16 vga_res);
void playSpeech(uint speech_id, uint vga_sprite_id);
void skipSpeech();
diff --git a/engines/agos/icons.cpp b/engines/agos/icons.cpp
index 7738c8cf25..b2926d4856 100644
--- a/engines/agos/icons.cpp
+++ b/engines/agos/icons.cpp
@@ -568,7 +568,7 @@ void AGOSEngine::defineArrowBoxes(WindowBlock *window) {
ha->priority = 100;
ha->window = window;
ha->verb = 1;
- setWindowImage(6, 103);
+ setWindowImageEx(6, 103);
} else if (getGameType() == GType_ELVIRA2) {
ha->x = 54;
ha->y = 178;
@@ -579,7 +579,7 @@ void AGOSEngine::defineArrowBoxes(WindowBlock *window) {
ha->priority = 100;
ha->window = window;
ha->verb = 1;
- setWindowImage(6, 106);
+ setWindowImageEx(6, 106);
} else {
ha->x = 30 * 8;
ha->y = 170;
@@ -705,10 +705,10 @@ void AGOSEngine::removeArrows(WindowBlock *window, uint num) {
stopAnimateSimon1(128);
} else if (getGameType() == GType_WW) {
setBitFlag(22, false);
- setWindowImage(6, 103);
+ setWindowImageEx(6, 103);
} else if (getGameType() == GType_ELVIRA2) {
setBitFlag(21, false);
- setWindowImage(6, 106);
+ setWindowImageEx(6, 106);
}
}
diff --git a/engines/agos/input.cpp b/engines/agos/input.cpp
index c07cae713a..d00bbe10b3 100644
--- a/engines/agos/input.cpp
+++ b/engines/agos/input.cpp
@@ -183,7 +183,8 @@ startOver:
if (getGameType() != GType_FF && getGameType() != GType_PP && _keyPressed == 35)
displayBoxStars();
if (processSpecialKeys() != 0) {
- goto out_of_here;
+ if (getGameType() == GType_WW || getGameType() == GType_PP)
+ goto out_of_here;
}
if (_lastHitArea3 == (HitArea *) -1)
goto startOver;
diff --git a/engines/agos/menus.cpp b/engines/agos/menus.cpp
index 9168bb6021..6ef180b4f8 100644
--- a/engines/agos/menus.cpp
+++ b/engines/agos/menus.cpp
@@ -161,9 +161,9 @@ void AGOSEngine::clearMenuStrip() {
disableBox(i);
if (getGameType() == GType_WW) {
- setWindowImage(2, 101);
+ setWindowImageEx(2, 101);
} else {
- setWindowImage(2, 102);
+ setWindowImageEx(2, 102);
}
}
@@ -205,9 +205,9 @@ void AGOSEngine::doMenuStrip(uint menuNum) {
_variableArray[var + 4] = id - 111;
if (getGameType() == GType_WW) {
- setWindowImage(2, 102);
+ setWindowImageEx(2, 102);
} else {
- setWindowImage(2, 103);
+ setWindowImageEx(2, 103);
}
}
diff --git a/engines/agos/script.cpp b/engines/agos/script.cpp
index 22225165f2..90e014b28a 100644
--- a/engines/agos/script.cpp
+++ b/engines/agos/script.cpp
@@ -655,20 +655,7 @@ void AGOSEngine::o_picture() {
uint mode = getVarOrByte();
_picture8600 = (vga_res == 8600);
-
- if (mode == 4) {
- vc29_stopAllSounds();
-
- if (!_initMouse) {
- _initMouse = 1;
- vc33_setMouseOn();
- }
- }
-
- if (_lockWord & 0x10)
- error("o_picture: _lockWord & 0x10");
-
- setWindowImage(mode, vga_res);
+ setWindowImageEx(mode, vga_res);
}
void AGOSEngine::o_loadZone() {
@@ -1541,4 +1528,33 @@ void AGOSEngine::stopAnimateSimon2(uint a, uint b) {
_lockWord &= ~0x8000;
}
+void AGOSEngine::setWindowImageEx(uint16 mode, uint16 vga_res) {
+ if (!_initMouse) {
+ _initMouse = 1;
+ vc33_setMouseOn();
+ }
+
+ if (mode == 4) {
+ vc29_stopAllSounds();
+
+ if (getGameType() == GType_ELVIRA1) {
+ if (_variableArray[299] == 0) {
+ _variableArray[293] = 0;
+ _wallOn = 0;
+ }
+ } else if (getGameType() == GType_ELVIRA1) {
+ if (_variableArray[70] == 0) {
+ _variableArray[71] = 0;
+ _wallOn = 0;
+ }
+ }
+
+ }
+
+ if (_lockWord & 0x10)
+ error("setWindowImageEx: _lockWord & 0x10");
+
+ setWindowImage(mode, vga_res);
+}
+
} // End of namespace AGOS