diff options
author | Willem Jan Palenstijn | 2011-11-14 20:25:18 +0100 |
---|---|---|
committer | Willem Jan Palenstijn | 2011-11-14 21:43:36 +0100 |
commit | 65e1eeb99051b4acfb88cf9fae352c83e34d9f67 (patch) | |
tree | 0cc541ca1c53d1555807ae92e72ed213329596b9 /engines/dreamweb/object.cpp | |
parent | ae2c4bcaf0a0362e5eaba70c021e7a44a7a46b49 (diff) | |
download | scummvm-rg350-65e1eeb99051b4acfb88cf9fae352c83e34d9f67.tar.gz scummvm-rg350-65e1eeb99051b4acfb88cf9fae352c83e34d9f67.tar.bz2 scummvm-rg350-65e1eeb99051b4acfb88cf9fae352c83e34d9f67.zip |
DREAMWEB: Move 'inventory' from dreamgen
Diffstat (limited to 'engines/dreamweb/object.cpp')
-rw-r--r-- | engines/dreamweb/object.cpp | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/engines/dreamweb/object.cpp b/engines/dreamweb/object.cpp index 1c58559dcd..446278252c 100644 --- a/engines/dreamweb/object.cpp +++ b/engines/dreamweb/object.cpp @@ -179,6 +179,126 @@ void DreamGenContext::examineob(bool examineAgain) { data.byte(kOpenedob) = 255; } +void DreamGenContext::inventory() { + STACK_CHECK; + _cmp(data.byte(kMandead), 1); + if (flags.z()) + goto iswatchinv; + _cmp(data.word(kWatchingtime), 0); + if (flags.z()) + goto notwatchinv; +iswatchinv: + blank(); + return; +notwatchinv: + _cmp(data.byte(kCommandtype), 239); + if (flags.z()) + goto alreadyopinv; + data.byte(kCommandtype) = 239; + al = 32; + commandonly(); +alreadyopinv: + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) + return /* (cantopinv) */; + _and(ax, 1); + if (!flags.z()) + goto doopeninv; + return; +doopeninv: + data.word(kTimecount) = 0; + data.byte(kPointermode) = 0; + data.byte(kInmaparea) = 0; + animpointer(); + createpanel(); + showpanel(); + examicon(); + showman(); + showexit(); + undertextline(); + data.byte(kPickup) = 0; + data.byte(kInvopen) = 2; + openinv(); + readmouse(); + showpointer(); + worktoscreen(); + delpointer(); + data.byte(kOpenedob) = 255; + goto waitexam; + return; +/*continuing to unbounded code: examineagain from examineob:3-69*/ +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: + 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: + data.byte(kInvopen) = 0; + data.byte(kOpenedob) = 255; +} + } /*namespace dreamgen */ |