DREAMWEB: Convert 'examineob'

This commit is contained in:
Willem Jan Palenstijn 2011-11-14 20:22:45 +01:00
parent ceb36fe0d6
commit ae2c4bcaf0
2 changed files with 63 additions and 69 deletions

View File

@ -110,77 +110,71 @@ void DreamGenContext::obicons() {
}
}
void DreamGenContext::examineob() {
STACK_CHECK;
void DreamGenContext::examineob(bool examineAgain) {
data.byte(kPointermode) = 0;
data.word(kTimecount) = 0;
examineagain:
data.byte(kInmaparea) = 0;
data.byte(kExamagain) = 0;
data.byte(kOpenedob) = 255;
data.byte(kOpenedtype) = 255;
data.byte(kInvopen) = 0;
al = data.byte(kCommandtype);
data.byte(kObjecttype) = al;
data.byte(kItemframe) = 0;
data.byte(kPointerframe) = 0;
createpanel();
showpanel();
showman();
showexit();
obicons();
obpicture();
describeob();
undertextline();
data.byte(kCommandtype) = 255;
readmouse();
showpointer();
worktoscreen();
delpointer();
waitexam:
readmouse();
showpointer();
vsync();
dumppointer();
dumptextline();
delpointer();
data.byte(kGetback) = 0;
bx = offset_examlist;
_cmp(data.byte(kInvopen), 0);
if (flags.z())
goto notuseinv;
bx = offset_invlist1;
_cmp(data.byte(kInvopen), 1);
if (flags.z())
goto notuseinv;
bx = offset_withlist1;
notuseinv:
checkcoords();
_cmp(data.byte(kQuitrequested), 0);
if (!flags.z())
goto stopwaiting;
_cmp(data.byte(kExamagain), 0);
if (flags.z())
goto norex;
goto examineagain;
norex:
_cmp(data.byte(kGetback), 0);
if (flags.z())
goto waitexam;
stopwaiting:
while (true) {
if (examineAgain) {
data.byte(kInmaparea) = 0;
data.byte(kExamagain) = 0;
data.byte(kOpenedob) = 255;
data.byte(kOpenedtype) = 255;
data.byte(kInvopen) = 0;
al = data.byte(kCommandtype);
data.byte(kObjecttype) = al;
data.byte(kItemframe) = 0;
data.byte(kPointerframe) = 0;
createpanel();
showpanel();
showman();
showexit();
obicons();
obpicture();
describeob();
undertextline();
data.byte(kCommandtype) = 255;
readmouse();
showpointer();
worktoscreen();
delpointer();
examineAgain = false;
}
readmouse();
showpointer();
vsync();
dumppointer();
dumptextline();
delpointer();
data.byte(kGetback) = 0;
switch (data.byte(kInvopen)) {
case 0:
bx = offset_examlist;
checkcoords();
break;
case 1:
bx = offset_invlist1;
checkcoords();
break;
default:
bx = offset_withlist1;
checkcoords();
break;
}
if (data.byte(kQuitrequested) != 0)
break;
if (data.byte(kExamagain) != 0)
examineAgain = true;
else if (data.byte(kGetback) != 0)
break;
}
data.byte(kPickup) = 0;
_cmp(data.word(kWatchingtime), 0);
if (!flags.z())
goto iswatching;
_cmp(data.byte(kNewlocation), 255);
if (!flags.z())
goto justgetback;
iswatching:
makemainscreen();
data.byte(kInvopen) = 0;
data.byte(kOpenedob) = 255;
return;
justgetback:
if (data.word(kWatchingtime) != 0 || data.byte(kNewlocation) == 255) {
// iswatching
makemainscreen();
}
data.byte(kInvopen) = 0;
data.byte(kOpenedob) = 255;
}

View File

@ -249,5 +249,5 @@
void showcity();
uint16 getpersframe(uint8 index);
void convicons();
void examineob();
void examineob(bool examineAgain = true);