diff options
author | Filippos Karapetis | 2011-12-19 03:23:16 +0200 |
---|---|---|
committer | Filippos Karapetis | 2011-12-19 03:24:03 +0200 |
commit | f0eee81d327957cddb85c5a1ffe7a308a377f636 (patch) | |
tree | f20adcca018b6c96304d6fb87436edf97c165313 /engines/dreamweb/object.cpp | |
parent | 9916d2e99ced884a4f79277dc17367cb1a4b7375 (diff) | |
download | scummvm-rg350-f0eee81d327957cddb85c5a1ffe7a308a377f636.tar.gz scummvm-rg350-f0eee81d327957cddb85c5a1ffe7a308a377f636.tar.bz2 scummvm-rg350-f0eee81d327957cddb85c5a1ffe7a308a377f636.zip |
DREAMWEB: Port 'intoinv', 'outofinv' to C++
Diffstat (limited to 'engines/dreamweb/object.cpp')
-rw-r--r-- | engines/dreamweb/object.cpp | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/engines/dreamweb/object.cpp b/engines/dreamweb/object.cpp index 384e001b5e..9fe94c4bd4 100644 --- a/engines/dreamweb/object.cpp +++ b/engines/dreamweb/object.cpp @@ -562,5 +562,87 @@ void DreamBase::removeObFromInv() { deleteExObject(data.byte(kCommand)); } +void DreamGenContext::inToInv() { + if (!data.byte(kPickup)) { + outOfInv(); + return; + } + + findInvPos(); + ax = es.word(bx); + + if (al != 255) { + swapWithInv(); + return; + } + + al = data.byte(kItemframe); + ah = data.byte(kObjecttype); + + if (ax == data.word(kOldsubject) && data.byte(kCommandtype) != 220) + data.byte(kCommandtype) = 220; + + data.word(kOldsubject) = ax; + commandWithOb(35, data.byte(kObjecttype), data.byte(kItemframe)); + + if (data.word(kMousebutton) == data.word(kOldbutton) || !(data.word(kMousebutton) & 1)) + return; // notletgo2 + + delPointer(); + DynObject *object = getExAd(data.byte(kItemframe)); + object->mapad[0] = 4; + object->mapad[1] = 255; + object->mapad[2] = data.byte(kLastinvpos); + data.byte(kPickup) = 0; + fillRyan(); + readMouse(); + showPointer(); + outOfInv(); + workToScreen(); + delPointer(); +} + +void DreamGenContext::outOfInv() { + findInvPos(); + ax = es.word(bx); + + if (al == 255) { + blank(); + return; + } + + if (data.word(kMousebutton) == 2) { + reExFromInv(); + return; + } + + if (ax == data.word(kOldsubject) && data.byte(kCommandtype) != 221) + data.byte(kCommandtype) = 221; + + data.word(kOldsubject) = ax; + commandWithOb(36, ah, al); + + if (data.word(kMousebutton) == data.word(kOldbutton)) + return; // notletgo + + if (!(data.word(kMousebutton) & 1)) + return; + + delPointer(); + data.byte(kPickup) = 1; + findInvPos(); + ax = es.word(bx); + data.byte(kItemframe) = al; + data.byte(kObjecttype) = ah; + DynObject *object = getExAd(data.byte(kItemframe)); + object->mapad[0] = 20; + object->mapad[1] = 255; + fillRyan(); + readMouse(); + showPointer(); + inToInv(); + workToScreen(); + delPointer(); +} } // End of namespace DreamGen |