diff options
author | Filippos Karapetis | 2011-12-11 21:21:20 +0200 |
---|---|---|
committer | Filippos Karapetis | 2011-12-11 21:21:20 +0200 |
commit | 21885f062144aade626610c164cbaa5a0bf6e8a5 (patch) | |
tree | 33dadd0af92a33c3acd62ea8391dfdf8e64ae7f5 /engines | |
parent | b7de94dd14db4f6a02aca5fab1951e186f30e349 (diff) | |
download | scummvm-rg350-21885f062144aade626610c164cbaa5a0bf6e8a5.tar.gz scummvm-rg350-21885f062144aade626610c164cbaa5a0bf6e8a5.tar.bz2 scummvm-rg350-21885f062144aade626610c164cbaa5a0bf6e8a5.zip |
DREAMWEB: Port 'getback1', 'newplace' to C++
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 47 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 2 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 30 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 2 |
4 files changed, 32 insertions, 49 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 42660f4fa3..de0ac54a51 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -2794,34 +2794,6 @@ beforethistext: goto shuffletextads; } -void DreamGenContext::getBack1() { - STACK_CHECK; - _cmp(data.byte(kPickup), 0); - if (flags.z()) - goto notgotobject; - blank(); - return; -notgotobject: - _cmp(data.byte(kCommandtype), 202); - if (flags.z()) - goto alreadyget; - data.byte(kCommandtype) = 202; - al = 26; - commandOnly(); -alreadyget: - ax = data.word(kMousebutton); - _cmp(ax, data.word(kOldbutton)); - if (flags.z()) - return /* (nogetback) */; - _and(ax, 1); - if (!flags.z()) - goto dogetback; - return; -dogetback: - data.byte(kGetback) = 1; - data.byte(kPickup) = 0; -} - void DreamGenContext::startTalk() { STACK_CHECK; data.byte(kTalkmode) = 0; @@ -3015,25 +2987,6 @@ endheartalk: data.byte(kPointermode) = 0; } -void DreamGenContext::newPlace() { - STACK_CHECK; - _cmp(data.byte(kNeedtotravel), 1); - if (flags.z()) - goto istravel; - _cmp(data.byte(kAutolocation), -1); - if (!flags.z()) - goto isautoloc; - return; -isautoloc: - al = data.byte(kAutolocation); - data.byte(kNewlocation) = al; - data.byte(kAutolocation) = -1; - return; -istravel: - data.byte(kNeedtotravel) = 0; - selectLocation(); -} - void DreamGenContext::lookAtPlace() { STACK_CHECK; _cmp(data.byte(kCommandtype), 224); diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 1861732860..848bd53726 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -626,7 +626,6 @@ public: void dreamweb(); void checkInside(); void findPathOfPoint(); - void getBack1(); void getDestInfo(); void setupTimedUse(); void makeCaps(); @@ -637,7 +636,6 @@ public: void selectOpenOb(); void useGun(); void autoAppear(); - void newPlace(); void useHandle(); void showPuzText(); void incRyanPage(); diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 2caaf6c36a..3688715ea9 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -4202,4 +4202,34 @@ void DreamGenContext::cantDrop() { workToScreenM(); } +void DreamGenContext::getBack1() { + if (data.byte(kPickup) != 0) { + blank(); + } else if (data.byte(kCommandtype) != 202) { + // Not holding object + data.byte(kCommandtype) = 202; + commandOnly(26); + } else { + // Already got object + if (data.word(kMousebutton) == data.word(kOldbutton)) + return; // nogetback + + if (data.word(kMousebutton) & 1) { + // Get back + data.byte(kGetback) = 1; + data.byte(kPickup) = 0; + } + } +} + +void DreamGenContext::newPlace() { + if (data.byte(kNeedtotravel) == 1) { + data.byte(kNeedtotravel) = 0; + selectLocation(); + } else if (data.byte(kAutolocation) != 0xFF) { + data.byte(kNewlocation) = data.byte(kAutolocation); + data.byte(kAutolocation) = 0xFF; + } +} + } // End of namespace DreamGen diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 19ebfac817..e9e642ca6e 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -562,5 +562,7 @@ void checkInput(); void dropError(); void cantDrop(); + void getBack1(); + void newPlace(); #endif |