aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2006-10-16 08:41:50 +0000
committerTravis Howell2006-10-16 08:41:50 +0000
commit45400860f0d7cc54a6dd36e533f74951dc617a77 (patch)
tree45346a4a48ae7991f8f2734e33d475fd8db9e0e1
parent6388455615f313190bdcc2d5e93fd7fc74786775 (diff)
downloadscummvm-rg350-45400860f0d7cc54a6dd36e533f74951dc617a77.tar.gz
scummvm-rg350-45400860f0d7cc54a6dd36e533f74951dc617a77.tar.bz2
scummvm-rg350-45400860f0d7cc54a6dd36e533f74951dc617a77.zip
Enable menus in WW, allows more progress
svn-id: r24347
-rw-r--r--engines/agos/agos.cpp39
-rw-r--r--engines/agos/agos.h4
-rw-r--r--engines/agos/menus.cpp57
-rw-r--r--engines/agos/rooms.cpp4
4 files changed, 98 insertions, 6 deletions
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 3b6682f781..46ff3e21cd 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -1329,7 +1329,10 @@ void AGOSEngine::hitarea_stuff() {
_hitAreaSubjectItem = NULL;
_hitAreaObjectItem = NULL;
- resetVerbs();
+ if (getGameType() == GType_WW)
+ clearMenuStrip();
+ else
+ resetVerbs();
startOver:
for (;;) {
@@ -1368,6 +1371,33 @@ startOver:
setVerb(ha);
_defaultVerb = 0;
} else {
+ if (getGameType() == GType_WW) {
+ if (ha->id == 98) {
+ loadSprite(2, 0, 110, 0, 0, 0);
+ waitForSync(34);
+ } else if (ha->id == 108) {
+ loadSprite(2, 0, 106, 0, 0, 0);
+ waitForSync(34);
+ } else if (ha->id == 109) {
+ loadSprite(2, 0, 107, 0, 0, 0);
+ waitForSync(34);
+ } else if (ha->id == 115) {
+ loadSprite(2, 0, 109, 0, 0, 0);
+ waitForSync(34);
+ } else if (ha->id == 116) {
+ loadSprite(2, 0, 113, 0, 0, 0);
+ waitForSync(34);
+ } else if (ha->id == 117) {
+ loadSprite(2, 0, 112, 0, 0, 0);
+ waitForSync(34);
+ } else if (ha->id == 118) {
+ loadSprite(2, 0, 108, 0, 0, 0);
+ waitForSync(34);
+ } else if (ha->id == 119) {
+ loadSprite(2, 0, 111, 0, 0, 0);
+ waitForSync(34);
+ }
+ }
if ((_verbHitArea != 0 || _hitAreaSubjectItem != ha->item_ptr && ha->flags & kBFBoxItem) &&
ha->item_ptr) {
if_1:;
@@ -1388,8 +1418,13 @@ startOver:
else
_variableArray[60] = id;
displayName(ha);
- if (_verbHitArea != 0)
+
+ if (_verbHitArea != 0) {
break;
+ }
+
+ if (getGameType() == GType_WW)
+ doMenuStrip(menuFor(ha->item_ptr, id));
} else {
// else 1
if (ha->verb == 0) {
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index 09d4850e37..ca35d71e26 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -657,6 +657,10 @@ protected:
void drawMenuStrip(uint windowNum, uint menuNum);
+ uint menuFor(Item *item, uint id);
+ void clearMenuStrip();
+ void doMenuStrip(uint menuNum);
+
void checkLinkBox();
void hyperLinkOn(uint16 x);
void hyperLinkOff();
diff --git a/engines/agos/menus.cpp b/engines/agos/menus.cpp
index f7bcfa1188..4159ae3c50 100644
--- a/engines/agos/menus.cpp
+++ b/engines/agos/menus.cpp
@@ -123,5 +123,62 @@ 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) {
+ return _textMenu[id];
+ } else {
+ // TODO
+ }
+
+ return 0;
+}
+
+void AGOSEngine::clearMenuStrip() {
+ int i;
+
+ for (i = 111; i != 115; i++)
+ disableBox(i);
+
+ set_video_mode_internal(2, 101);
+}
+
+void AGOSEngine::doMenuStrip(uint menuNum) {
+ int i;
+
+ for (i = 111; i != 115; i++)
+ disableBox(i);
+
+ for (i = 11; i != 16; i++)
+ _variableArray[i] = 0;
+
+ byte *srcPtr = _menuBase;
+ while (menuNum--) {
+ while (READ_BE_UINT16(srcPtr) != 0)
+ srcPtr += 2;
+ srcPtr += 2;
+ }
+
+ uint id = 111;
+ uint var = 11;
+
+ while (READ_BE_UINT16(srcPtr) != 0) {
+ uint verb = READ_BE_UINT16(srcPtr);
+ _variableArray[var] = verb;
+
+ HitArea *ha = findBox(id);
+ if (ha != NULL) {
+ ha->flags &= ~kBFBoxDead;
+ ha->verb = verb;
+ }
+
+ id++;
+ srcPtr += 2;
+ var++;
+ }
+
+ _variableArray[15] = id - 111;
+ set_video_mode_internal(2, 102);
+}
} // End of namespace AGOS
diff --git a/engines/agos/rooms.cpp b/engines/agos/rooms.cpp
index 2c2ad348cd..9977e66ea4 100644
--- a/engines/agos/rooms.cpp
+++ b/engines/agos/rooms.cpp
@@ -312,10 +312,6 @@ bool AGOSEngine::loadRoomItems(uint item) {
while ((i = in.readUint16BE()) != 0) {
_itemArrayPtr[i + 2] = (Item *)allocateItem(sizeof(Item));
readItemFromGamePc(&in, _itemArrayPtr[i + 2]);
-
- Item *tmp = _itemArrayPtr[i + 2];
- tmp->child = 0;
- tmp->parent = 0;
}
in.close();