aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2006-10-16 11:20:20 +0000
committerTravis Howell2006-10-16 11:20:20 +0000
commita833a2fb8e68e994d35f37317ac74da0dd931656 (patch)
treee10cbaaa73820c18406dfcf4ceeacdf2f9fcd3d5
parenta965e8140c166940f691b85d62c69272a6efefe2 (diff)
downloadscummvm-rg350-a833a2fb8e68e994d35f37317ac74da0dd931656.tar.gz
scummvm-rg350-a833a2fb8e68e994d35f37317ac74da0dd931656.tar.bz2
scummvm-rg350-a833a2fb8e68e994d35f37317ac74da0dd931656.zip
Enable menus in Elvira 2
svn-id: r24349
-rw-r--r--engines/agos/agos.cpp13
-rw-r--r--engines/agos/agos.h6
-rw-r--r--engines/agos/game.cpp3
-rw-r--r--engines/agos/menus.cpp52
-rw-r--r--engines/agos/verb.cpp3
5 files changed, 59 insertions, 18 deletions
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 855eed5af2..d5158290c3 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -712,6 +712,7 @@ void AGOSEngine::setupGame() {
_stringIdLocalMin = 1;
+ _agosMenu = 1;
_superRoomNumber = 1;
for (int i = 0; i < 20; i++) {
@@ -1173,6 +1174,9 @@ void AGOSEngine::setup_cond_c_helper() {
_noRightClick = 1;
+ if (getGameType() == GType_WW)
+ clearMenuStrip();
+
if (getGameType() == GType_FF) {
int cursor = 5;
int animMax = 16;
@@ -1423,8 +1427,10 @@ startOver:
break;
}
- if (getGameType() == GType_WW)
- doMenuStrip(menuFor(ha->item_ptr, id));
+ if (getGameType() == GType_ELVIRA2)
+ doMenuStrip(menuFor_e2(ha->item_ptr, id));
+ else if (getGameType() == GType_WW)
+ doMenuStrip(menuFor_ww(ha->item_ptr, id));
} else {
// else 1
if (ha->verb == 0) {
@@ -1443,6 +1449,9 @@ startOver:
}
}
+ if (getGameType() == GType_ELVIRA2 || getGameType() == GType_WW)
+ clearMenuStrip();
+
_needHitAreaRecalc++;
}
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index 7433324465..426365acfc 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -655,11 +655,11 @@ protected:
TextLocation *getTextLocation(uint a);
void setup_cond_c_helper();
- void drawMenuStrip(uint windowNum, uint menuNum);
-
- uint menuFor(Item *item, uint id);
+ uint menuFor_e2(Item *item, uint id);
+ uint menuFor_ww(Item *item, uint id);
void clearMenuStrip();
void doMenuStrip(uint menuNum);
+ void drawMenuStrip(uint windowNum, uint menuNum);
void checkLinkBox();
void hyperLinkOn(uint16 x);
diff --git a/engines/agos/game.cpp b/engines/agos/game.cpp
index a5f56c7ccf..971d92eac6 100644
--- a/engines/agos/game.cpp
+++ b/engines/agos/game.cpp
@@ -198,6 +198,7 @@ static const ADGameFileDescription ELVIRA1DOS_FR_GameFiles[] = {
static const ADGameFileDescription ELVIRA2AMIGA_GameFiles[] = {
{ "gameamiga", GAME_BASEFILE, "4aa163967f5d2bd319f8350d6af03186"},
{ "icon.dat", GAME_ICONFILE, "a88b1c02e13ab04dd790ec30502c323d"},
+ { "menus.dat", GAME_MENUFILE, "a2fdc88a77c8bdffec6b36cbeda4d955"},
{ "stripped.txt", GAME_STRFILE, "41c975a9c1106cb5298a0bc3df0a266e"},
{ "tbllist", GAME_TBLFILE, "177f5f2640e80ef92d1421d32de06a5e"},
};
@@ -213,6 +214,7 @@ static const ADGameFileDescription ELVIRA2ST_GameFiles[] = {
static const ADGameFileDescription ELVIRA2DOS_GameFiles[] = {
{ "gamepc", GAME_BASEFILE, "3313254722031b22d833a2cf45a91fd7"},
{ "icon.dat", GAME_ICONFILE, "83a7278bff55c82fbb3aef92981866c9"},
+ { "menus.dat", GAME_MENUFILE, "a2fdc88a77c8bdffec6b36cbeda4d955"},
{ "stripped.txt", GAME_STRFILE, "c2533277b7ff11f5495967d55355ea17"},
{ "tbllist", GAME_TBLFILE, "8252660df0edbdbc3e6377e155bbd0c5"},
};
@@ -220,6 +222,7 @@ static const ADGameFileDescription ELVIRA2DOS_GameFiles[] = {
static const ADGameFileDescription ELVIRA2DOS_FR_GameFiles[] = {
{ "gamepc", GAME_BASEFILE, "4bf28ab00f5324fd938e632595742382"},
{ "icon.dat", GAME_ICONFILE, "83a7278bff55c82fbb3aef92981866c9"},
+ { "menus.dat", GAME_MENUFILE, "a2fdc88a77c8bdffec6b36cbeda4d955"},
{ "stripped.txt", GAME_STRFILE, "c3a8f644551a27c8a2fec0f8070b46b7"},
{ "tbllist", GAME_TBLFILE, "8252660df0edbdbc3e6377e155bbd0c5"},
};
diff --git a/engines/agos/menus.cpp b/engines/agos/menus.cpp
index 4159ae3c50..daefa4dc18 100644
--- a/engines/agos/menus.cpp
+++ b/engines/agos/menus.cpp
@@ -123,15 +123,35 @@ void AGOSEngine::drawMenuStrip(uint windowNum, uint menuNum) {
mouseOn();
}
-// Waxworks specific?
-uint AGOSEngine::menuFor(Item *item, uint id) {
- if (id != 0xFFFF && id < 10 && _textMenu[id] != 0) {
+// Elvira 2 specific
+uint AGOSEngine::menuFor_e2(Item *item, uint id) {
+ if (id = 0 || id == 2462 || id == 2480)
+ return 0xFFFF;
+
+ SubObject *subObject = (SubObject *)findChildOfType(item, 2);
+ if (subObject != NULL && subObject->objectFlags & kOFMenu) {
+ uint offs = getOffsetOfChild2Param(subObject, kOFMenu);
+ return subObject->objectFlagValue[offs];
+ }
+
+ return _agosMenu;
+}
+
+// Waxworks specific
+uint AGOSEngine::menuFor_ww(Item *item, uint id) {
+ if (id != 0xFFFF && id < 10 && _textMenu[id] != 0)
return _textMenu[id];
- } else {
- // TODO
+
+ if (item == NULL || itemPtrToID(item) == 542 || itemPtrToID(item) == 558)
+ return _agosMenu;
+
+ SubObject *subObject = (SubObject *)findChildOfType(item, 2);
+ if (subObject != NULL && subObject->objectFlags & kOFMenu) {
+ uint offs = getOffsetOfChild2Param(subObject, kOFMenu);
+ return subObject->objectFlagValue[offs];
}
- return 0;
+ return _agosMenu;
}
void AGOSEngine::clearMenuStrip() {
@@ -143,13 +163,15 @@ void AGOSEngine::clearMenuStrip() {
set_video_mode_internal(2, 101);
}
+// Elvira 2 and Waxworks specific
void AGOSEngine::doMenuStrip(uint menuNum) {
- int i;
+ uint i;
+ const uint var = (getGameType() == GType_WW) ? 11 : 1;
for (i = 111; i != 115; i++)
disableBox(i);
- for (i = 11; i != 16; i++)
+ for (i = var; i != (var + 5); i++)
_variableArray[i] = 0;
byte *srcPtr = _menuBase;
@@ -160,11 +182,11 @@ void AGOSEngine::doMenuStrip(uint menuNum) {
}
uint id = 111;
- uint var = 11;
+ uint v = var;
while (READ_BE_UINT16(srcPtr) != 0) {
uint verb = READ_BE_UINT16(srcPtr);
- _variableArray[var] = verb;
+ _variableArray[v] = verb;
HitArea *ha = findBox(id);
if (ha != NULL) {
@@ -174,11 +196,15 @@ void AGOSEngine::doMenuStrip(uint menuNum) {
id++;
srcPtr += 2;
- var++;
+ v++;
}
- _variableArray[15] = id - 111;
- set_video_mode_internal(2, 102);
+ _variableArray[var + 4] = id - 111;
+ if (getGameType() == GType_WW) {
+ set_video_mode_internal(2, 102);
+ } else {
+ set_video_mode_internal(2, 103);
+ }
}
} // End of namespace AGOS
diff --git a/engines/agos/verb.cpp b/engines/agos/verb.cpp
index b21cfcbdbf..ea4c631c30 100644
--- a/engines/agos/verb.cpp
+++ b/engines/agos/verb.cpp
@@ -462,6 +462,9 @@ void AGOSEngine::defineBox(int id, int x, int y, int width, int height, int flag
}
void AGOSEngine::resetVerbs() {
+ if (getGameType() == GType_ELVIRA1 || getGameType() == GType_ELVIRA2)
+ return;
+
if (getGameType() == GType_PP) {
_verbHitArea = 300;
} else if (getGameType() == GType_FF) {