diff options
author | Filippos Karapetis | 2011-12-19 23:47:06 +0200 |
---|---|---|
committer | Filippos Karapetis | 2011-12-19 23:48:13 +0200 |
commit | 5a3deea58ebab2a443e48c91cfff7ca5ecab349c (patch) | |
tree | 7ae715e70c19c3d72b8cfb5b48080dd0b99a3e61 /engines/dreamweb/object.cpp | |
parent | bdf14ed5985a318c3e07477d7bd108500e2c5043 (diff) | |
download | scummvm-rg350-5a3deea58ebab2a443e48c91cfff7ca5ecab349c.tar.gz scummvm-rg350-5a3deea58ebab2a443e48c91cfff7ca5ecab349c.tar.bz2 scummvm-rg350-5a3deea58ebab2a443e48c91cfff7ca5ecab349c.zip |
DREAMWEB: More work on inToInv and outOfInv
Diffstat (limited to 'engines/dreamweb/object.cpp')
-rw-r--r-- | engines/dreamweb/object.cpp | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/engines/dreamweb/object.cpp b/engines/dreamweb/object.cpp index 9fe94c4bd4..1cdbca0907 100644 --- a/engines/dreamweb/object.cpp +++ b/engines/dreamweb/object.cpp @@ -568,21 +568,19 @@ void DreamGenContext::inToInv() { return; } - findInvPos(); - ax = es.word(bx); + uint16 subject = getSegment(data.word(kBuffers)).word(findInvPosCPP()); - if (al != 255) { + if ((subject & 0xFF) != 255) { swapWithInv(); return; } - al = data.byte(kItemframe); - ah = data.byte(kObjecttype); + subject = (data.byte(kObjecttype) << 8) | data.byte(kItemframe); - if (ax == data.word(kOldsubject) && data.byte(kCommandtype) != 220) + if (subject == data.word(kOldsubject) && data.byte(kCommandtype) != 220) data.byte(kCommandtype) = 220; - data.word(kOldsubject) = ax; + data.word(kOldsubject) = subject; commandWithOb(35, data.byte(kObjecttype), data.byte(kItemframe)); if (data.word(kMousebutton) == data.word(kOldbutton) || !(data.word(kMousebutton) & 1)) @@ -603,10 +601,9 @@ void DreamGenContext::inToInv() { } void DreamGenContext::outOfInv() { - findInvPos(); - ax = es.word(bx); + uint16 subject = getSegment(data.word(kBuffers)).word(findInvPosCPP()); - if (al == 255) { + if ((subject & 0xFF) == 255) { blank(); return; } @@ -616,11 +613,13 @@ void DreamGenContext::outOfInv() { return; } - if (ax == data.word(kOldsubject) && data.byte(kCommandtype) != 221) + if (subject == data.word(kOldsubject) && data.byte(kCommandtype) != 221) data.byte(kCommandtype) = 221; - data.word(kOldsubject) = ax; - commandWithOb(36, ah, al); + data.word(kOldsubject) = subject; + byte type = subject >> 8; + byte frame = subject & 0xFF; + commandWithOb(36, type, frame); if (data.word(kMousebutton) == data.word(kOldbutton)) return; // notletgo @@ -630,10 +629,9 @@ void DreamGenContext::outOfInv() { delPointer(); data.byte(kPickup) = 1; - findInvPos(); - ax = es.word(bx); - data.byte(kItemframe) = al; - data.byte(kObjecttype) = ah; + subject = getSegment(data.word(kBuffers)).word(findInvPosCPP()); + data.byte(kObjecttype) = subject >> 8; + data.byte(kItemframe) = subject & 0xFF; DynObject *object = getExAd(data.byte(kItemframe)); object->mapad[0] = 20; object->mapad[1] = 255; |