From 3b5794890fb36d0d93e8eff7d1a30c9bfd611618 Mon Sep 17 00:00:00 2001 From: Bertrand Augereau Date: Tue, 6 Dec 2011 00:54:50 +0100 Subject: DREAMWEB: Ported 'candles' to C++ --- engines/dreamweb/dreamgen.cpp | 17 ----------------- engines/dreamweb/dreamgen.h | 5 ++--- engines/dreamweb/people.cpp | 14 ++++++++++++-- engines/dreamweb/stubs.h | 1 + 4 files changed, 15 insertions(+), 22 deletions(-) (limited to 'engines/dreamweb') diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index c099e82b85..fca8abc615 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -785,23 +785,6 @@ smallcandlef: showGameReel(); } -void DreamGenContext::candles() { - STACK_CHECK; - checkSpeed(); - if (!flags.z()) - goto candlesfin; - ax = es.word(bx+3); - _inc(ax); - _cmp(ax, 167); - if (!flags.z()) - goto gotcandles; - ax = 162; -gotcandles: - es.word(bx+3) = ax; -candlesfin: - showGameReel(); -} - void DreamGenContext::candles2() { STACK_CHECK; checkSpeed(); diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index f30c8e6d3a..39af176d38 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -541,6 +541,7 @@ public: void useWire(); void getNamePos(); + void clearChanges(); void identifyOb(); void useLighter(); void runEndSeq(); @@ -609,14 +610,12 @@ public: void findFirstPath(); void useSLab(); void useAltar(); - void manAsleep2(); void moreTalk(); void startTalk(); void getAnyAd(); void endGame(); void usePipe(); void getUnderZoom(); - void candles(); void rollEndCredits2(); void reminders(); void selectSlot2(); @@ -827,7 +826,7 @@ public: void incRyanPage(); void edenInBath(); void findExObject(); - void clearChanges(); + void manAsleep2(); void useChurchHole(); void searchForFiles(); void monkSpeaking(); diff --git a/engines/dreamweb/people.cpp b/engines/dreamweb/people.cpp index b1f509d3c8..e69fd66ee4 100644 --- a/engines/dreamweb/people.cpp +++ b/engines/dreamweb/people.cpp @@ -46,7 +46,7 @@ static void (DreamGenContext::*reelCallbacks[57])() = { NULL, NULL, &DreamGenContext::introMagic2, &DreamGenContext::candles2, &DreamGenContext::gates, &DreamGenContext::introMagic3, - &DreamGenContext::introMonks1, &DreamGenContext::candles, + &DreamGenContext::introMonks1, NULL, &DreamGenContext::introMonks2, &DreamGenContext::handClap, &DreamGenContext::monkAndRyan, &DreamGenContext::endGameSeq, &DreamGenContext::priest, NULL, @@ -78,7 +78,7 @@ static void (DreamGenContext::*reelCallbacksCPP[57])(ReelRoutine &) = { &DreamGenContext::introMagic1, &DreamGenContext::introMusic, /*&DreamGenContext::introMagic2*/NULL, /*&DreamGenContext::candles2*/NULL, /*&DreamGenContext::gates*/NULL, /*&DreamGenContext::introMagic3*/NULL, - /*&DreamGenContext::intromonks1*/NULL, /*&DreamGenContext::candles*/NULL, + /*&DreamGenContext::intromonks1*/NULL, &DreamGenContext::candles, /*&DreamGenContext::intromonks2*/NULL, /*&DreamGenContext::handClap*/NULL, /*&DreamGenContext::monkAndRyan*/NULL, /*&DreamGenContext::endGameSeq*/NULL, /*&DreamGenContext::priest*/NULL, &DreamGenContext::madman, @@ -378,6 +378,16 @@ void DreamGenContext::introMagic1(ReelRoutine &routine) { void DreamGenContext::introMusic(ReelRoutine &routine) { } +void DreamGenContext::candles(ReelRoutine &routine) { + if (checkSpeed(routine)) { + uint16 nextReelPointer = routine.reelPointer() + 1; + if (nextReelPointer == 167) + nextReelPointer = 162; + routine.setReelPointer(nextReelPointer); + } + showGameReel(&routine); +} + void DreamGenContext::security(ReelRoutine &routine) { if (routine.reelPointer() == 32) { if (data.byte(kLastweapon) == 1) { diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index ac2fd401a2..b9f2fed85d 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -412,6 +412,7 @@ void drunk(ReelRoutine &routine); void introMagic1(ReelRoutine &routine); void introMusic(ReelRoutine &routine); + void candles(ReelRoutine &routine); void security(ReelRoutine &routine); void singleKey(uint8 key, uint16 x, uint16 y); void loadSaveBox(); -- cgit v1.2.3