diff options
author | Filippos Karapetis | 2011-12-11 21:46:17 +0200 |
---|---|---|
committer | Filippos Karapetis | 2011-12-11 21:46:17 +0200 |
commit | 6f6d137726d8d80f158f92ff5d8f868a0df267dd (patch) | |
tree | 17d13f082bf866fb2d00aae69103f0a9ebe1ab6a /engines/dreamweb | |
parent | 21885f062144aade626610c164cbaa5a0bf6e8a5 (diff) | |
download | scummvm-rg350-6f6d137726d8d80f158f92ff5d8f868a0df267dd.tar.gz scummvm-rg350-6f6d137726d8d80f158f92ff5d8f868a0df267dd.tar.bz2 scummvm-rg350-6f6d137726d8d80f158f92ff5d8f868a0df267dd.zip |
DREAMWEB: Port 'uselighter' to C++
Diffstat (limited to 'engines/dreamweb')
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 30 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 1 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 1 | ||||
-rw-r--r-- | engines/dreamweb/use.cpp | 20 |
4 files changed, 21 insertions, 31 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index de0ac54a51..c8d31f7f2e 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -4125,36 +4125,6 @@ void DreamGenContext::drawItAll() { showIcon(); } -void DreamGenContext::useLighter() { - STACK_CHECK; - _cmp(data.byte(kWithobject), 255); - if (!flags.z()) - goto gotlighterwith; - withWhat(); - return; -gotlighterwith: - al = data.byte(kWithobject); - ah = data.byte(kWithtype); - cl = 'S'; - ch = 'M'; - dl = 'K'; - dh = 'E'; - compare(); - if (flags.z()) - goto cigarette; - showFirstUse(); - putBackObStuff(); - return; -cigarette: - cx = 300; - al = 9; - showPuzText(); - al = data.byte(kWithobject); - getExAd(); - es.byte(bx+2) = 255; - data.byte(kGetback) = 1; -} - void DreamGenContext::useCashCard() { STACK_CHECK; getRidOfReels(); diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 848bd53726..b61a9809f8 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -526,7 +526,6 @@ public: void useWire(); void identifyOb(); - void useLighter(); void runEndSeq(); void useOpenBox(); void clearBuffers(); diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index e9e642ca6e..e0b9b3ec95 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -333,6 +333,7 @@ void useRailing(); void useWindow(); void useHatch(); + void useLighter(); void wheelSound(); void callHotelLift(); void useShield(); diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 68f4aed1c0..9126b7e885 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1116,6 +1116,26 @@ void DreamGenContext::useCardReader3() { } } +void DreamGenContext::useLighter() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char id[4] = { 'S', 'M', 'K', 'E' }; // TODO: convert to string with trailing zero + if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { + showFirstUse(); + putBackObStuff(); + } else { + cx = 300; + al = 9; + showPuzText(); + getExAd(data.byte(kWithobject)); + es.byte(bx + 2) = 255; + data.byte(kGetback) = 1; + } +} + void DreamGenContext::openTomb() { data.byte(kProgresspoints)++; showFirstUse(); |