diff options
author | Bertrand Augereau | 2011-12-01 14:55:38 +0100 |
---|---|---|
committer | Bertrand Augereau | 2011-12-01 15:23:38 +0100 |
commit | 270eb8773c0ba4b57ac4038e25aa5b60b2c9c3f8 (patch) | |
tree | 2b079f67cef09567ce5ddc6a4cde8c68eba83dca /engines | |
parent | ed30ee8e383150f40f92250524befc018c364687 (diff) | |
download | scummvm-rg350-270eb8773c0ba4b57ac4038e25aa5b60b2c9c3f8.tar.gz scummvm-rg350-270eb8773c0ba4b57ac4038e25aa5b60b2c9c3f8.tar.bz2 scummvm-rg350-270eb8773c0ba4b57ac4038e25aa5b60b2c9c3f8.zip |
DREAMWEB: 'drinker' ported to C++
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 22 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 2 | ||||
-rw-r--r-- | engines/dreamweb/sprite.cpp | 17 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 1 |
4 files changed, 16 insertions, 26 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 8143c8f4b2..260e6d5edd 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -908,28 +908,6 @@ notboss: data.byte(kTalkedtoboss) = 1; } -void DreamGenContext::gamer() { - STACK_CHECK; - checkspeed(); - if (!flags.z()) - goto gamerfin; -gameragain: - randomnum1(); - _and(al, 7); - _cmp(al, 5); - if (!flags.c()) - goto gameragain; - _add(al, 20); - _cmp(al, es.byte(bx+3)); - if (flags.z()) - goto gameragain; - ah = 0; - es.word(bx+3) = ax; -gamerfin: - showgamereel(); - addtopeoplelist(); -} - void DreamGenContext::carparkdrip() { STACK_CHECK; checkspeed(); diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 0e472e284c..a5fba4de30 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -457,7 +457,6 @@ public: static const uint16 addr_candles1 = 0xc08c; static const uint16 addr_keeper = 0xc088; static const uint16 addr_carparkdrip = 0xc084; - static const uint16 addr_gamer = 0xc07c; static const uint16 addr_bossman = 0xc078; static const uint16 addr_heavy = 0xc074; static const uint16 addr_security = 0xc070; @@ -1363,7 +1362,6 @@ public: void afterintroroom(); void buttonnine(); void findallopen(); - void gamer(); void readfromfile(); void initialinv(); void quitsymbol(); diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp index 584fa18dc2..f8c865da6c 100644 --- a/engines/dreamweb/sprite.cpp +++ b/engines/dreamweb/sprite.cpp @@ -568,7 +568,7 @@ void DreamGenContext::showrain() { } static void (DreamGenContext::*reelCallbacks[57])() = { - &DreamGenContext::gamer, NULL, + NULL, NULL, &DreamGenContext::eden, &DreamGenContext::edeninbath, &DreamGenContext::sparky, &DreamGenContext::smokebloke, &DreamGenContext::manasleep, &DreamGenContext::drunk, @@ -600,7 +600,7 @@ static void (DreamGenContext::*reelCallbacks[57])() = { }; static void (DreamGenContext::*reelCallbacksCPP[57])(ReelRoutine &) = { - /*&DreamGenContext::gamer*/NULL, &DreamGenContext::sparkydrip, + &DreamGenContext::gamer, &DreamGenContext::sparkydrip, /*&DreamGenContext::eden*/NULL, /*&DreamGenContext::edeninbath*/NULL, /*&DreamGenContext::sparky*/NULL, /*&DreamGenContext::smokebloke*/NULL, /*&DreamGenContext::manasleep*/NULL, /*&DreamGenContext::drunk*/NULL, @@ -1087,5 +1087,18 @@ void DreamGenContext::othersmoker(ReelRoutine &routine) { addtopeoplelist(&routine); } +void DreamGenContext::gamer(ReelRoutine &routine) { + if (checkspeed(&routine)) { + uint8 v; + do { + v = 20 + engine->randomNumber() % 5; + } while (v == routine.reelPointer()); + routine.setReelPointer(v); + } + + showgamereel(&routine); + addtopeoplelist(&routine); +} + } /*namespace dreamgen */ diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 1512c30000..b1f2b8a693 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -379,4 +379,5 @@ void checkspeed(); void sparkydrip(ReelRoutine &routine); void othersmoker(ReelRoutine &routine); + void gamer(ReelRoutine &routine); |