Enable menus in WW, allows more progress

svn-id: r24347
This commit is contained in:
Travis Howell 2006-10-16 08:41:50 +00:00
parent 6388455615
commit 45400860f0
4 changed files with 98 additions and 6 deletions

View File

@ -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) {

View File

@ -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();

View File

@ -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

View File

@ -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();