From 302e49f97dd761443922793fa8c85190ea7ac0e7 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 17 Nov 2011 10:07:33 +0200 Subject: DREAMWEB: Use struct packing for the UseListEntry struct --- engines/dreamweb/use.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index d6648b556e..cdc3740d6f 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -27,11 +27,15 @@ namespace DreamGen { typedef void (DreamGenContext::*UseCallback)(void); +#include "common/pack-start.h" // START STRUCT PACKING + struct UseListEntry { uint8 id[5]; // 0-terminal because it is easier syntatically to initialize the array UseCallback callback; }; +#include "common/pack-end.h" // END STRUCT PACKING + void DreamGenContext::useroutine() { static const UseListEntry kUseList[] = { -- cgit v1.2.3 From ea8a8278e54b36273cb7bbae139a21a6c2bf50df Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 17 Nov 2011 10:42:25 +0200 Subject: DREAMWEB: Place the ID after the callback pointer in UseListEntry This keeps MSVC happy, without using struct packing --- engines/dreamweb/use.cpp | 171 +++++++++++++++++++++++------------------------ 1 file changed, 85 insertions(+), 86 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index cdc3740d6f..b090cbbca7 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -27,99 +27,98 @@ namespace DreamGen { typedef void (DreamGenContext::*UseCallback)(void); -#include "common/pack-start.h" // START STRUCT PACKING - +// Note: The callback pointer has been placed before the +// ID to keep MSVC happy (otherwise, it throws warnings +// that alignment of a member was sensitive to packing) struct UseListEntry { - uint8 id[5]; // 0-terminal because it is easier syntatically to initialize the array UseCallback callback; + const char *id; }; -#include "common/pack-end.h" // END STRUCT PACKING - void DreamGenContext::useroutine() { static const UseListEntry kUseList[] = { - { "NETW", &DreamGenContext::usemon }, - { "ELVA", &DreamGenContext::useelevator1 }, - { "ELVB", &DreamGenContext::useelevator2 }, - { "ELVC", &DreamGenContext::useelevator3 }, - { "ELVE", &DreamGenContext::useelevator4 }, - { "ELVF", &DreamGenContext::useelevator5 }, - { "CGAT", &DreamGenContext::usechurchgate }, - { "REMO", &DreamGenContext::usestereo }, - { "BUTA", &DreamGenContext::usebuttona }, - { "CBOX", &DreamGenContext::usewinch }, - { "LITE", &DreamGenContext::uselighter }, - { "PLAT", &DreamGenContext::useplate }, - { "LIFT", &DreamGenContext::usecontrol }, - { "WIRE", &DreamGenContext::usewire }, - { "HNDL", &DreamGenContext::usehandle }, - { "HACH", &DreamGenContext::usehatch }, - { "DOOR", &DreamGenContext::useelvdoor }, - { "CSHR", &DreamGenContext::usecashcard }, - { "GUNA", &DreamGenContext::usegun }, - { "CRAA", &DreamGenContext::usecardreader1 }, - { "CRBB", &DreamGenContext::usecardreader2 }, - { "CRCC", &DreamGenContext::usecardreader3 }, - { "SEAT", &DreamGenContext::sitdowninbar }, - { "MENU", &DreamGenContext::usemenu }, - { "COOK", &DreamGenContext::usecooker }, - { "ELCA", &DreamGenContext::callhotellift }, - { "EDCA", &DreamGenContext::calledenslift }, - { "DDCA", &DreamGenContext::calledensdlift }, - { "ALTR", &DreamGenContext::usealtar }, - { "LOKA", &DreamGenContext::openhoteldoor }, - { "LOKB", &DreamGenContext::openhoteldoor2 }, - { "ENTA", &DreamGenContext::openlouis }, - { "ENTB", &DreamGenContext::openryan }, - { "ENTE", &DreamGenContext::openpoolboss }, - { "ENTC", &DreamGenContext::openyourneighbour }, - { "ENTD", &DreamGenContext::openeden }, - { "ENTH", &DreamGenContext::opensarters }, - { "WWAT", &DreamGenContext::wearwatch }, - { "POOL", &DreamGenContext::usepoolreader }, - { "WSHD", &DreamGenContext::wearshades }, - { "GRAF", &DreamGenContext::grafittidoor }, - { "TRAP", &DreamGenContext::trapdoor }, - { "CDPE", &DreamGenContext::edenscdplayer }, - { "DLOK", &DreamGenContext::opentvdoor }, - { "HOLE", &DreamGenContext::usehole }, - { "DRYR", &DreamGenContext::usedryer }, - { "HOLY", &DreamGenContext::usechurchhole }, - { "WALL", &DreamGenContext::usewall }, - { "BOOK", &DreamGenContext::usediary }, - { "AXED", &DreamGenContext::useaxe }, - { "SHLD", &DreamGenContext::useshield }, - { "BCNY", &DreamGenContext::userailing }, - { "LIDC", &DreamGenContext::usecoveredbox }, - { "LIDU", &DreamGenContext::useclearbox }, - { "LIDO", &DreamGenContext::useopenbox }, - { "PIPE", &DreamGenContext::usepipe }, - { "BALC", &DreamGenContext::usebalcony }, - { "WIND", &DreamGenContext::usewindow }, - { "PAPR", &DreamGenContext::viewfolder }, - { "UWTA", &DreamGenContext::usetrainer }, - { "UWTB", &DreamGenContext::usetrainer }, - { "STAT", &DreamGenContext::entersymbol }, - { "TLID", &DreamGenContext::opentomb }, - { "SLAB", &DreamGenContext::useslab }, - { "CART", &DreamGenContext::usecart }, - { "FCAR", &DreamGenContext::usefullcart }, - { "SLBA", &DreamGenContext::slabdoora }, - { "SLBB", &DreamGenContext::slabdoorb }, - { "SLBC", &DreamGenContext::slabdoorc }, - { "SLBD", &DreamGenContext::slabdoord }, - { "SLBE", &DreamGenContext::slabdoore }, - { "SLBF", &DreamGenContext::slabdoorf }, - { "PLIN", &DreamGenContext::useplinth }, - { "LADD", &DreamGenContext::useladder }, - { "LADB", &DreamGenContext::useladderb }, - { "GUMA", &DreamGenContext::chewy }, - { "SQEE", &DreamGenContext::wheelsound }, - { "TAPP", &DreamGenContext::runtap }, - { "GUIT", &DreamGenContext::playguitar }, - { "CONT", &DreamGenContext::hotelcontrol }, - { "BELL", &DreamGenContext::hotelbell }, + { &DreamGenContext::usemon, "NETW" }, + { &DreamGenContext::useelevator1, "ELVA" }, + { &DreamGenContext::useelevator2, "ELVB" }, + { &DreamGenContext::useelevator3, "ELVC" }, + { &DreamGenContext::useelevator4, "ELVE" }, + { &DreamGenContext::useelevator5, "ELVF" }, + { &DreamGenContext::usechurchgate, "CGAT" }, + { &DreamGenContext::usestereo, "REMO" }, + { &DreamGenContext::usebuttona, "BUTA" }, + { &DreamGenContext::usewinch, "CBOX" }, + { &DreamGenContext::uselighter, "LITE" }, + { &DreamGenContext::useplate, "PLAT" }, + { &DreamGenContext::usecontrol, "LIFT" }, + { &DreamGenContext::usewire, "WIRE" }, + { &DreamGenContext::usehandle, "HNDL" }, + { &DreamGenContext::usehatch, "HACH" }, + { &DreamGenContext::useelvdoor, "DOOR" }, + { &DreamGenContext::usecashcard, "CSHR" }, + { &DreamGenContext::usegun, "GUNA" }, + { &DreamGenContext::usecardreader1, "CRAA" }, + { &DreamGenContext::usecardreader2, "CRBB" }, + { &DreamGenContext::usecardreader3, "CRCC" }, + { &DreamGenContext::sitdowninbar, "SEAT" }, + { &DreamGenContext::usemenu, "MENU" }, + { &DreamGenContext::usecooker, "COOK" }, + { &DreamGenContext::callhotellift, "ELCA" }, + { &DreamGenContext::calledenslift, "EDCA" }, + { &DreamGenContext::calledensdlift, "DDCA" }, + { &DreamGenContext::usealtar, "ALTR" }, + { &DreamGenContext::openhoteldoor, "LOKA" }, + { &DreamGenContext::openhoteldoor2, "LOKB" }, + { &DreamGenContext::openlouis, "ENTA" }, + { &DreamGenContext::openryan, "ENTB" }, + { &DreamGenContext::openpoolboss, "ENTE" }, + { &DreamGenContext::openyourneighbour, "ENTC" }, + { &DreamGenContext::openeden, "ENTD" }, + { &DreamGenContext::opensarters, "ENTH" }, + { &DreamGenContext::wearwatch, "WWAT" }, + { &DreamGenContext::usepoolreader, "POOL" }, + { &DreamGenContext::wearshades, "WSHD" }, + { &DreamGenContext::grafittidoor, "GRAF" }, + { &DreamGenContext::trapdoor, "TRAP" }, + { &DreamGenContext::edenscdplayer, "CDPE" }, + { &DreamGenContext::opentvdoor, "DLOK" }, + { &DreamGenContext::usehole, "HOLE" }, + { &DreamGenContext::usedryer, "DRYR" }, + { &DreamGenContext::usechurchhole, "HOLY" }, + { &DreamGenContext::usewall, "WALL" }, + { &DreamGenContext::usediary, "BOOK" }, + { &DreamGenContext::useaxe, "AXED" }, + { &DreamGenContext::useshield, "SHLD" }, + { &DreamGenContext::userailing, "BCNY" }, + { &DreamGenContext::usecoveredbox, "LIDC" }, + { &DreamGenContext::useclearbox, "LIDU" }, + { &DreamGenContext::useopenbox, "LIDO" }, + { &DreamGenContext::usepipe, "PIPE" }, + { &DreamGenContext::usebalcony, "BALC" }, + { &DreamGenContext::usewindow, "WIND" }, + { &DreamGenContext::viewfolder, "PAPR" }, + { &DreamGenContext::usetrainer, "UWTA" }, + { &DreamGenContext::usetrainer, "UWTB" }, + { &DreamGenContext::entersymbol, "STAT" }, + { &DreamGenContext::opentomb, "TLID" }, + { &DreamGenContext::useslab, "SLAB" }, + { &DreamGenContext::usecart, "CART" }, + { &DreamGenContext::usefullcart, "FCAR" }, + { &DreamGenContext::slabdoora, "SLBA" }, + { &DreamGenContext::slabdoorb, "SLBB" }, + { &DreamGenContext::slabdoorc, "SLBC" }, + { &DreamGenContext::slabdoord, "SLBD" }, + { &DreamGenContext::slabdoore, "SLBE" }, + { &DreamGenContext::slabdoorf, "SLBF" }, + { &DreamGenContext::useplinth, "PLIN" }, + { &DreamGenContext::useladder, "LADD" }, + { &DreamGenContext::useladderb, "LADB" }, + { &DreamGenContext::chewy, "GUMA" }, + { &DreamGenContext::wheelsound, "SQEE" }, + { &DreamGenContext::runtap, "TAPP" }, + { &DreamGenContext::playguitar, "GUIT" }, + { &DreamGenContext::hotelcontrol, "CONT" }, + { &DreamGenContext::hotelbell, "BELL" }, }; if (data.byte(kReallocation) >= 50) { -- cgit v1.2.3 From 86c9fdae4b67100bebae776d14ee5a9383e6973c Mon Sep 17 00:00:00 2001 From: Bertrand Augereau Date: Sat, 26 Nov 2011 17:19:33 +0100 Subject: DREAMWEB: 'showfirstuse' ported to C++ --- engines/dreamweb/use.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index b090cbbca7..4aeb35f70f 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -177,5 +177,13 @@ void DreamGenContext::usetext(const uint8 *string) { worktoscreenm(); } +void DreamGenContext::showfirstuse() { + uint8 *obText = getobtextstartCPP(); + findnextcolon(&obText); + findnextcolon(&obText); + usetext(obText); + hangonp(400); +} + } /*namespace dreamgen */ -- cgit v1.2.3 From aa20b8cf42cff774fd8d4031a85a4288895ae496 Mon Sep 17 00:00:00 2001 From: Bertrand Augereau Date: Sat, 26 Nov 2011 17:29:43 +0100 Subject: DREAMWEB: 'showseconduse' ported to C++ --- engines/dreamweb/use.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 4aeb35f70f..278767aa7c 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -185,5 +185,14 @@ void DreamGenContext::showfirstuse() { hangonp(400); } +void DreamGenContext::showseconduse() { + uint8 *obText = getobtextstartCPP(); + findnextcolon(&obText); + findnextcolon(&obText); + findnextcolon(&obText); + usetext(obText); + hangonp(400); +} + } /*namespace dreamgen */ -- cgit v1.2.3 From 87571f0c8c9dca4699750adf7771e85d203bf022 Mon Sep 17 00:00:00 2001 From: Bertrand Augereau Date: Mon, 28 Nov 2011 11:28:59 +0100 Subject: DREAMWEB: 'viewfolder' ported to C++ --- engines/dreamweb/use.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 278767aa7c..6e2de2e173 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -194,5 +194,39 @@ void DreamGenContext::showseconduse() { hangonp(400); } +void DreamGenContext::viewfolder() { + data.byte(kManisoffscreen) = 1; + getridofall(); + loadfolder(); + data.byte(kFolderpage) = 0; + showfolder(); + worktoscreenm(); + data.byte(kGetback) = 0; + do { + delpointer(); + readmouse(); + showpointer(); + vsync(); + dumppointer(); + dumptextline(); + RectWithCallback folderlist[] = { + { 280,320,160,200,&DreamGenContext::quitkey }, + { 143,300,6,194,&DreamGenContext::nextfolder }, + { 0,143,6,194,&DreamGenContext::lastfolder }, + { 0,320,0,200,&DreamGenContext::blank }, + { 0xFFFF,0,0,0,0 } + }; + checkcoords(folderlist); + } while (data.byte(kGetback) == 0); + data.byte(kManisoffscreen) = 0; + getridoftemp(); + getridoftemp2(); + getridoftemp3(); + getridoftempcharset(); + restoreall(); + redrawmainscrn(); + worktoscreenm(); +} + } /*namespace dreamgen */ -- cgit v1.2.3 From a2721b6c579bbf5c3b4e83c9e70cd17f88fc049e Mon Sep 17 00:00:00 2001 From: Bertrand Augereau Date: Mon, 28 Nov 2011 15:27:03 +0100 Subject: DREAMWEB: Allow quitting in the diary --- engines/dreamweb/use.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 6e2de2e173..2e32a21488 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -203,6 +203,8 @@ void DreamGenContext::viewfolder() { worktoscreenm(); data.byte(kGetback) = 0; do { + if (quitRequested()) + break; delpointer(); readmouse(); showpointer(); -- cgit v1.2.3 From 55d727219705ba859657877a9a57a1a2e2665ada Mon Sep 17 00:00:00 2001 From: Bertrand Augereau Date: Tue, 29 Nov 2011 10:27:02 +0100 Subject: DREAMWEB: 'nextfolder' ported to C++ --- engines/dreamweb/use.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 2e32a21488..b64797e0cd 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -211,14 +211,7 @@ void DreamGenContext::viewfolder() { vsync(); dumppointer(); dumptextline(); - RectWithCallback folderlist[] = { - { 280,320,160,200,&DreamGenContext::quitkey }, - { 143,300,6,194,&DreamGenContext::nextfolder }, - { 0,143,6,194,&DreamGenContext::lastfolder }, - { 0,320,0,200,&DreamGenContext::blank }, - { 0xFFFF,0,0,0,0 } - }; - checkcoords(folderlist); + checkFolderCoords(); } while (data.byte(kGetback) == 0); data.byte(kManisoffscreen) = 0; getridoftemp(); -- cgit v1.2.3 From 349cbc527f33858b6275daaa8f770cd6f7fcd42d Mon Sep 17 00:00:00 2001 From: D G Turner Date: Thu, 1 Dec 2011 19:43:43 +0000 Subject: DREAMWEB: Fix compilation due to dreamgen.* function renaming. --- engines/dreamweb/use.cpp | 278 +++++++++++++++++++++++------------------------ 1 file changed, 139 insertions(+), 139 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index b64797e0cd..fa11967ffc 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -35,90 +35,90 @@ struct UseListEntry { const char *id; }; -void DreamGenContext::useroutine() { +void DreamGenContext::useRoutine() { static const UseListEntry kUseList[] = { - { &DreamGenContext::usemon, "NETW" }, - { &DreamGenContext::useelevator1, "ELVA" }, - { &DreamGenContext::useelevator2, "ELVB" }, - { &DreamGenContext::useelevator3, "ELVC" }, - { &DreamGenContext::useelevator4, "ELVE" }, - { &DreamGenContext::useelevator5, "ELVF" }, - { &DreamGenContext::usechurchgate, "CGAT" }, - { &DreamGenContext::usestereo, "REMO" }, - { &DreamGenContext::usebuttona, "BUTA" }, - { &DreamGenContext::usewinch, "CBOX" }, - { &DreamGenContext::uselighter, "LITE" }, - { &DreamGenContext::useplate, "PLAT" }, - { &DreamGenContext::usecontrol, "LIFT" }, - { &DreamGenContext::usewire, "WIRE" }, - { &DreamGenContext::usehandle, "HNDL" }, - { &DreamGenContext::usehatch, "HACH" }, - { &DreamGenContext::useelvdoor, "DOOR" }, - { &DreamGenContext::usecashcard, "CSHR" }, - { &DreamGenContext::usegun, "GUNA" }, - { &DreamGenContext::usecardreader1, "CRAA" }, - { &DreamGenContext::usecardreader2, "CRBB" }, - { &DreamGenContext::usecardreader3, "CRCC" }, - { &DreamGenContext::sitdowninbar, "SEAT" }, - { &DreamGenContext::usemenu, "MENU" }, - { &DreamGenContext::usecooker, "COOK" }, - { &DreamGenContext::callhotellift, "ELCA" }, - { &DreamGenContext::calledenslift, "EDCA" }, - { &DreamGenContext::calledensdlift, "DDCA" }, - { &DreamGenContext::usealtar, "ALTR" }, - { &DreamGenContext::openhoteldoor, "LOKA" }, - { &DreamGenContext::openhoteldoor2, "LOKB" }, - { &DreamGenContext::openlouis, "ENTA" }, - { &DreamGenContext::openryan, "ENTB" }, - { &DreamGenContext::openpoolboss, "ENTE" }, - { &DreamGenContext::openyourneighbour, "ENTC" }, - { &DreamGenContext::openeden, "ENTD" }, - { &DreamGenContext::opensarters, "ENTH" }, - { &DreamGenContext::wearwatch, "WWAT" }, - { &DreamGenContext::usepoolreader, "POOL" }, - { &DreamGenContext::wearshades, "WSHD" }, - { &DreamGenContext::grafittidoor, "GRAF" }, - { &DreamGenContext::trapdoor, "TRAP" }, - { &DreamGenContext::edenscdplayer, "CDPE" }, - { &DreamGenContext::opentvdoor, "DLOK" }, - { &DreamGenContext::usehole, "HOLE" }, - { &DreamGenContext::usedryer, "DRYR" }, - { &DreamGenContext::usechurchhole, "HOLY" }, - { &DreamGenContext::usewall, "WALL" }, - { &DreamGenContext::usediary, "BOOK" }, - { &DreamGenContext::useaxe, "AXED" }, - { &DreamGenContext::useshield, "SHLD" }, - { &DreamGenContext::userailing, "BCNY" }, - { &DreamGenContext::usecoveredbox, "LIDC" }, - { &DreamGenContext::useclearbox, "LIDU" }, - { &DreamGenContext::useopenbox, "LIDO" }, - { &DreamGenContext::usepipe, "PIPE" }, - { &DreamGenContext::usebalcony, "BALC" }, - { &DreamGenContext::usewindow, "WIND" }, - { &DreamGenContext::viewfolder, "PAPR" }, - { &DreamGenContext::usetrainer, "UWTA" }, - { &DreamGenContext::usetrainer, "UWTB" }, - { &DreamGenContext::entersymbol, "STAT" }, - { &DreamGenContext::opentomb, "TLID" }, - { &DreamGenContext::useslab, "SLAB" }, - { &DreamGenContext::usecart, "CART" }, - { &DreamGenContext::usefullcart, "FCAR" }, - { &DreamGenContext::slabdoora, "SLBA" }, - { &DreamGenContext::slabdoorb, "SLBB" }, - { &DreamGenContext::slabdoorc, "SLBC" }, - { &DreamGenContext::slabdoord, "SLBD" }, - { &DreamGenContext::slabdoore, "SLBE" }, - { &DreamGenContext::slabdoorf, "SLBF" }, - { &DreamGenContext::useplinth, "PLIN" }, - { &DreamGenContext::useladder, "LADD" }, - { &DreamGenContext::useladderb, "LADB" }, + { &DreamGenContext::useMon, "NETW" }, + { &DreamGenContext::useElevator1, "ELVA" }, + { &DreamGenContext::useElevator2, "ELVB" }, + { &DreamGenContext::useElevator3, "ELVC" }, + { &DreamGenContext::useElevator4, "ELVE" }, + { &DreamGenContext::useElevator5, "ELVF" }, + { &DreamGenContext::useChurchGate, "CGAT" }, + { &DreamGenContext::useStereo, "REMO" }, + { &DreamGenContext::useButtonA, "BUTA" }, + { &DreamGenContext::useWinch, "CBOX" }, + { &DreamGenContext::useLighter, "LITE" }, + { &DreamGenContext::usePlate, "PLAT" }, + { &DreamGenContext::useControl, "LIFT" }, + { &DreamGenContext::useWire, "WIRE" }, + { &DreamGenContext::useHandle, "HNDL" }, + { &DreamGenContext::useHatch, "HACH" }, + { &DreamGenContext::useElvDoor, "DOOR" }, + { &DreamGenContext::useCashCard, "CSHR" }, + { &DreamGenContext::useGun, "GUNA" }, + { &DreamGenContext::useCardReader1, "CRAA" }, + { &DreamGenContext::useCardReader2, "CRBB" }, + { &DreamGenContext::useCardReader3, "CRCC" }, + { &DreamGenContext::sitDownInBar, "SEAT" }, + { &DreamGenContext::useMenu, "MENU" }, + { &DreamGenContext::useCooker, "COOK" }, + { &DreamGenContext::callHotelLift, "ELCA" }, + { &DreamGenContext::callEdensLift, "EDCA" }, + { &DreamGenContext::callEdensDLift, "DDCA" }, + { &DreamGenContext::useAltar, "ALTR" }, + { &DreamGenContext::openHotelDoor, "LOKA" }, + { &DreamGenContext::openHotelDoor2, "LOKB" }, + { &DreamGenContext::openLouis, "ENTA" }, + { &DreamGenContext::openRyan, "ENTB" }, + { &DreamGenContext::openPoolBoss, "ENTE" }, + { &DreamGenContext::openYourNeighbour, "ENTC" }, + { &DreamGenContext::openEden, "ENTD" }, + { &DreamGenContext::openSarters, "ENTH" }, + { &DreamGenContext::wearWatch, "WWAT" }, + { &DreamGenContext::usePoolReader, "POOL" }, + { &DreamGenContext::wearShades, "WSHD" }, + { &DreamGenContext::grafittiDoor, "GRAF" }, + { &DreamGenContext::trapDoor, "TRAP" }, + { &DreamGenContext::edensCDPlayer, "CDPE" }, + { &DreamGenContext::openTVDoor, "DLOK" }, + { &DreamGenContext::useHole, "HOLE" }, + { &DreamGenContext::useDryer, "DRYR" }, + { &DreamGenContext::useChurchHole, "HOLY" }, + { &DreamGenContext::useWall, "WALL" }, + { &DreamGenContext::useDiary, "BOOK" }, + { &DreamGenContext::useAxe, "AXED" }, + { &DreamGenContext::useShield, "SHLD" }, + { &DreamGenContext::useRailing, "BCNY" }, + { &DreamGenContext::useCoveredBox, "LIDC" }, + { &DreamGenContext::useClearBox, "LIDU" }, + { &DreamGenContext::useOpenBox, "LIDO" }, + { &DreamGenContext::usePipe, "PIPE" }, + { &DreamGenContext::useBalcony, "BALC" }, + { &DreamGenContext::useWindow, "WIND" }, + { &DreamGenContext::viewFolder, "PAPR" }, + { &DreamGenContext::useTrainer, "UWTA" }, + { &DreamGenContext::useTrainer, "UWTB" }, + { &DreamGenContext::enterSymbol, "STAT" }, + { &DreamGenContext::openTomb, "TLID" }, + { &DreamGenContext::useSLab, "SLAB" }, + { &DreamGenContext::useCart, "CART" }, + { &DreamGenContext::useFullCart, "FCAR" }, + { &DreamGenContext::sLabDoorA, "SLBA" }, + { &DreamGenContext::sLabDoorB, "SLBB" }, + { &DreamGenContext::sLabDoorC, "SLBC" }, + { &DreamGenContext::sLabDoorD, "SLBD" }, + { &DreamGenContext::sLabDoorE, "SLBE" }, + { &DreamGenContext::sLabDoorF, "SLBF" }, + { &DreamGenContext::usePlinth, "PLIN" }, + { &DreamGenContext::useLadder, "LADD" }, + { &DreamGenContext::useLadderB, "LADB" }, { &DreamGenContext::chewy, "GUMA" }, - { &DreamGenContext::wheelsound, "SQEE" }, - { &DreamGenContext::runtap, "TAPP" }, - { &DreamGenContext::playguitar, "GUIT" }, - { &DreamGenContext::hotelcontrol, "CONT" }, - { &DreamGenContext::hotelbell, "BELL" }, + { &DreamGenContext::wheelSound, "SQEE" }, + { &DreamGenContext::runTap, "TAPP" }, + { &DreamGenContext::playGuitar, "GUIT" }, + { &DreamGenContext::hotelControl, "CONT" }, + { &DreamGenContext::hotelBell, "BELL" }, }; if (data.byte(kReallocation) >= 50) { @@ -127,7 +127,7 @@ void DreamGenContext::useroutine() { data.byte(kPointerpower) = 0; } - getanyad(); + getAnyAd(); const uint8 *id = es.ptr(bx + 12, 4); for (size_t i = 0; i < sizeof(kUseList)/sizeof(UseListEntry); ++i) { @@ -138,89 +138,89 @@ void DreamGenContext::useroutine() { } } - delpointer(); - uint8 *obText = getobtextstartCPP(); - if (findnextcolon(&obText) != 0) { - if (findnextcolon(&obText) != 0) { + delPointer(); + uint8 *obText = getObTextStartCPP(); + if (findNextColon(&obText) != 0) { + if (findNextColon(&obText) != 0) { if (*obText != 0) { - usetext(obText); - hangonp(400); - putbackobstuff(); + useText(obText); + hangOnP(400); + putBackObStuff(); return; } } } - createpanel(); - showpanel(); - showman(); - showexit(); - obicons(); - printmessage(33, 100, 63, 241, true); - worktoscreenm(); - hangonp(50); - putbackobstuff(); + createPanel(); + showPanel(); + showMan(); + showExit(); + obIcons(); + printMessage(33, 100, 63, 241, true); + workToScreenM(); + hangOnP(50); + putBackObStuff(); data.byte(kCommandtype) = 255; } -void DreamGenContext::usetext() { - usetext(es.ptr(si, 0)); +void DreamGenContext::useText() { + useText(es.ptr(si, 0)); } -void DreamGenContext::usetext(const uint8 *string) { - createpanel(); - showpanel(); - showman(); - showexit(); - obicons(); - printdirect(string, 36, 104, 241, true); - worktoscreenm(); +void DreamGenContext::useText(const uint8 *string) { + createPanel(); + showPanel(); + showMan(); + showExit(); + obIcons(); + printDirect(string, 36, 104, 241, true); + workToScreenM(); } -void DreamGenContext::showfirstuse() { - uint8 *obText = getobtextstartCPP(); - findnextcolon(&obText); - findnextcolon(&obText); - usetext(obText); - hangonp(400); +void DreamGenContext::showFirstUse() { + uint8 *obText = getObTextStartCPP(); + findNextColon(&obText); + findNextColon(&obText); + useText(obText); + hangOnP(400); } -void DreamGenContext::showseconduse() { - uint8 *obText = getobtextstartCPP(); - findnextcolon(&obText); - findnextcolon(&obText); - findnextcolon(&obText); - usetext(obText); - hangonp(400); +void DreamGenContext::showSecondUse() { + uint8 *obText = getObTextStartCPP(); + findNextColon(&obText); + findNextColon(&obText); + findNextColon(&obText); + useText(obText); + hangOnP(400); } -void DreamGenContext::viewfolder() { +void DreamGenContext::viewFolder() { data.byte(kManisoffscreen) = 1; - getridofall(); - loadfolder(); + getRidOfAll(); + loadFolder(); data.byte(kFolderpage) = 0; - showfolder(); - worktoscreenm(); + showFolder(); + workToScreenM(); data.byte(kGetback) = 0; do { if (quitRequested()) break; - delpointer(); - readmouse(); - showpointer(); - vsync(); - dumppointer(); - dumptextline(); + delPointer(); + readMouse(); + showPointer(); + vSync(); + dumpPointer(); + dumpTextLine(); checkFolderCoords(); } while (data.byte(kGetback) == 0); data.byte(kManisoffscreen) = 0; - getridoftemp(); - getridoftemp2(); - getridoftemp3(); - getridoftempcharset(); - restoreall(); - redrawmainscrn(); - worktoscreenm(); + getRidOfTemp(); + getRidOfTemp2(); + getRidOfTemp3(); + getRidOfTempCharset(); + restoreAll(); + redrawMainScrn(); + workToScreenM(); } } /*namespace dreamgen */ -- cgit v1.2.3 From fb71a89818354e5ec1e4089805f80f0b5fdfd19d Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 5 Dec 2011 22:40:25 +0200 Subject: DREAMWEB: 'edenscdplayer', 'hotelbell', 'playguitar', 'useelevator1', 'useelevator3', 'useelevator4', 'usehatch', 'wheelsound' ported to C++ --- engines/dreamweb/use.cpp | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index fa11967ffc..39423b392c 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -223,5 +223,69 @@ void DreamGenContext::viewFolder() { workToScreenM(); } +void DreamGenContext::edensCDPlayer() { + showFirstUse(); + data.word(kWatchingtime) = 18 * 2; + data.word(kReeltowatch) = 25; + data.word(kEndwatchreel) = 42; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; +} + +void DreamGenContext::hotelBell() { + playChannel1(12); + showFirstUse(); + putBackObStuff(); +} + +void DreamGenContext::playGuitar() { + playChannel1(14); + showFirstUse(); + putBackObStuff(); +} + +void DreamGenContext::useElevator1() { + showFirstUse(); + selectLocation(); + data.byte(kGetback) = 1; +} + +void DreamGenContext::useElevator3() { + showFirstUse(); + data.byte(kCounttoclose) = 20; + data.byte(kNewlocation) = 34; + data.word(kReeltowatch) = 46; + data.word(kEndwatchreel) = 63; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.word(kWatchingtime) = 80; + data.byte(kGetback) = 1; +} + +void DreamGenContext::useElevator4() { + showFirstUse(); + data.word(kReeltowatch) = 0; + data.word(kEndwatchreel) = 11; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kCounttoclose) = 20; + data.word(kWatchingtime) = 80; + data.byte(kGetback) = 1; + data.byte(kNewlocation) = 24; +} + +void DreamGenContext::useHatch() { + showFirstUse(); + data.byte(kNewlocation) = 40; + data.byte(kGetback) = 1; +} + +void DreamGenContext::wheelSound() { + playChannel1(17); + showFirstUse(); + putBackObStuff(); +} + } /*namespace dreamgen */ -- cgit v1.2.3 From e8ea99cd8ec9a34d687081afa17ef1e4d65d2a4e Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 6 Dec 2011 01:16:38 +0200 Subject: DREAMWEB: 'callhotellift', 'carparkdrip', 'useshield' ported to C++ --- engines/dreamweb/use.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 39423b392c..4421134f9b 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -287,5 +287,30 @@ void DreamGenContext::wheelSound() { putBackObStuff(); } +void DreamGenContext::callHotelLift() { + playChannel1(12); + showFirstUse(); + data.byte(kCounttoopen) = 8; + data.byte(kGetback) = 1; + data.byte(kDestination) = 5; + data.byte(kFinaldest) = 5; + autoSetWalk(); + turnPathOn(4); +} + +void DreamGenContext::useShield() { + if (data.byte(kReallocation) != 20 || data.byte(kCombatcount) == 0) { + // Not in Sart room + showFirstUse(); + putBackObStuff(); + } else { + data.byte(kLastweapon) = 3; + showSecondUse(); + data.byte(kGetback) = 1; + data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + removeObFromInv(); + } +} + } /*namespace dreamgen */ -- cgit v1.2.3 From e1a53cc455c79ce72415581d01aeacc86ee9a2eb Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 6 Dec 2011 03:20:30 +0200 Subject: DREAMWEB: 'calledensdlift', 'calledenslift', 'sitdowninbar', 'trapdoor', 'usebalcony', 'usechurchhole', 'usecoveredbox', 'useelevator2', 'useelevator5', 'usedryer', 'userailing', 'usewindow', 'wearwatch', 'wearshades' ported to C++ --- engines/dreamweb/use.cpp | 178 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 178 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 4421134f9b..467f8673b5 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -251,6 +251,20 @@ void DreamGenContext::useElevator1() { data.byte(kGetback) = 1; } +void DreamGenContext::useElevator2() { + showFirstUse(); + + if (data.byte(kLocation) == 23) // In pool hall + data.byte(kNewlocation) = 31; + else + data.byte(kNewlocation) = 23; + + data.byte(kCounttoclose) = 20; + data.byte(kCounttoopen) = 0; + data.word(kWatchingtime) = 80; + data.byte(kGetback) = 1; +} + void DreamGenContext::useElevator3() { showFirstUse(); data.byte(kCounttoclose) = 20; @@ -275,6 +289,16 @@ void DreamGenContext::useElevator4() { data.byte(kNewlocation) = 24; } +void DreamGenContext::useElevator5() { + placeSetObject(4); + removeSetObject(0); + data.byte(kNewlocation) = 20; + data.word(kWatchingtime) = 80; + data.byte(kLiftflag) = 1; + data.byte(kCounttoclose) = 8; + data.byte(kGetback) = 1; +} + void DreamGenContext::useHatch() { showFirstUse(); data.byte(kNewlocation) = 40; @@ -312,5 +336,159 @@ void DreamGenContext::useShield() { } } +void DreamGenContext::useCoveredBox() { + data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + showFirstUse(); + data.word(kWatchingtime) = 50; + data.word(kReeltowatch) = 41; + data.word(kEndwatchreel) = 66; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; +} + +void DreamGenContext::useRailing() { + showFirstUse(); + data.word(kWatchingtime) = 80; + data.word(kReeltowatch) = 0; + data.word(kEndwatchreel) = 30; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; + data.byte(kMandead) = 4; +} + +void DreamGenContext::wearWatch() { + if (data.byte(kWatchon) == 1) { + // Already wearing watch + showSecondUse(); + putBackObStuff(); + } else { + showFirstUse(); + data.byte(kWatchon) = 1; + data.byte(kGetback) = 1; + getAnyAd(); + makeWorn(); + } +} + +void DreamGenContext::wearShades() { + if (data.byte(kShadeson) == 1) { + // Already wearing shades + showSecondUse(); + putBackObStuff(); + } else { + data.byte(kShadeson) = 1; + showFirstUse(); + data.byte(kGetback) = 1; + getAnyAd(); + makeWorn(); + } +} + +void DreamGenContext::useChurchHole() { + showFirstUse(); + data.byte(kGetback) = 1; + data.word(kWatchingtime) = 28; + data.word(kReeltowatch) = 13; + data.word(kEndwatchreel) = 26; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; +} + +void DreamGenContext::sitDownInBar() { + if (data.byte(kWatchmode) == 0xFF) { + // Sat down + showSecondUse(); + putBackObStuff(); + } else { + showFirstUse(); + data.word(kWatchingtime) = 50; + data.word(kReeltowatch) = 55; + data.word(kEndwatchreel) = 71; + data.word(kReeltohold) = 73; + data.word(kEndofholdreel) = 83; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; + } +} + +void DreamGenContext::useDryer() { + playChannel1(12); + showFirstUse(); + data.byte(kGetback) = 1; +} + +void DreamGenContext::useBalcony() { + showFirstUse(); + turnPathOn(6); + turnPathOff(0); + turnPathOff(1); + turnPathOff(2); + turnPathOff(3); + turnPathOff(4); + turnPathOff(5); + data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + data.byte(kManspath) = 6; + data.byte(kDestination) = 6; + data.byte(kFinaldest) = 6; + findXYFromPath(); + switchRyanOff(); + data.byte(kResetmanxy) = 1; + data.word(kWatchingtime) = 30 * 2; + data.word(kReeltowatch) = 183; + data.word(kEndwatchreel) = 212; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; +} + +void DreamGenContext::useWindow() { + if (data.byte(kManspath) != 6) { + // Not on balcony + showSecondUse(); + putBackObStuff(); + } else { + data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + showFirstUse(); + data.byte(kNewlocation) = 29; + data.byte(kGetback) = 1; + } +} + +void DreamGenContext::trapDoor() { + data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + showFirstUse(); + switchRyanOff(); + data.word(kWatchingtime) = 20 * 2; + data.word(kReeltowatch) = 181; + data.word(kEndwatchreel) = 197; + data.byte(kNewlocation) = 26; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; +} + +void DreamGenContext::callEdensLift() { + showFirstUse(); + data.byte(kCounttoopen) = 8; + data.byte(kGetback) = 1; + turnPathOn(2); +} + +void DreamGenContext::callEdensDLift() { + if (data.byte(kLiftflag) == 1) { + // Eden's D here + showSecondUse(); + putBackObStuff(); + } else { + showFirstUse(); + data.byte(kCounttoopen) = 8; + data.byte(kGetback) = 1; + turnPathOn(2); + } +} + } /*namespace dreamgen */ -- cgit v1.2.3 From 1bedd8bc1829e70f70fc22df298aa9c5f30c31cd Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 6 Dec 2011 04:44:54 +0200 Subject: DREAMWEB: 'openeden', 'openlouis', 'openpoolboss', 'openryan', 'opensarters', 'openyourneighbour' ported to C++ --- engines/dreamweb/use.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 467f8673b5..e8c9f508cd 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -490,5 +490,35 @@ void DreamGenContext::callEdensDLift() { } } +void DreamGenContext::openYourNeighbour() { + enterCode(255, 255, 255, 255); + data.byte(kGetback) = 1; +} + +void DreamGenContext::openRyan() { + enterCode(5, 1, 0, 6); + data.byte(kGetback) = 1; +} + +void DreamGenContext::openPoolBoss() { + enterCode(5, 2, 2, 2); + data.byte(kGetback) = 1; +} + +void DreamGenContext::openEden() { + enterCode(2, 8, 6, 5); + data.byte(kGetback) = 1; +} + +void DreamGenContext::openSarters() { + enterCode(7, 8, 3, 3); + data.byte(kGetback) = 1; +} + +void DreamGenContext::openLouis() { + enterCode(5, 2, 3, 8); + data.byte(kGetback) = 1; +} + } /*namespace dreamgen */ -- cgit v1.2.3 From 1763415fe601de16bbf41ac7d99de5def117d55a Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 6 Dec 2011 04:54:59 +0200 Subject: DREAMWEB: 'useWall' ported to C++ --- engines/dreamweb/use.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index e8c9f508cd..15e9a04cce 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -520,5 +520,49 @@ void DreamGenContext::openLouis() { data.byte(kGetback) = 1; } + +void DreamGenContext::useWall() { + showFirstUse(); + + if (data.byte(kManspath) != 3) { + data.word(kWatchingtime) = 30*2; + data.word(kReeltowatch) = 2; + data.word(kEndwatchreel) = 31; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; + turnPathOn(3); + turnPathOn(4); + turnPathOff(0); + turnPathOff(1); + turnPathOff(2); + turnPathOff(5); + data.byte(kManspath) = 3; + data.byte(kFinaldest) = 3; + findXYFromPath(); + data.byte(kResetmanxy) = 1; + switchRyanOff(); + } else { + // Go back over + data.word(kWatchingtime) = 30 * 2; + data.word(kReeltowatch) = 34; + data.word(kEndwatchreel) = 60; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; + turnPathOff(3); + turnPathOff(4); + turnPathOn(0); + turnPathOn(1); + turnPathOn(2); + turnPathOn(5); + data.byte(kManspath) = 5; + data.byte(kFinaldest) = 5; + findXYFromPath(); + data.byte(kResetmanxy) = 1; + switchRyanOff(); + } +} + } /*namespace dreamgen */ -- cgit v1.2.3 From 0d768ebe41439e6aaf013635bf32c5e6dc4092cd Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 6 Dec 2011 05:45:36 +0200 Subject: DREAMWEB: 'slabdoora', 'slabdoorc', 'slabdoord', 'slabdoore', 'slabdoorf', 'useladder', 'useladderb', ported to C++ --- engines/dreamweb/use.cpp | 129 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 128 insertions(+), 1 deletion(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 15e9a04cce..c60873c7b6 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -564,5 +564,132 @@ void DreamGenContext::useWall() { } } -} /*namespace dreamgen */ +void DreamGenContext::useLadder() { + showFirstUse(); + data.byte(kMapx) = data.byte(kMapx) - 11; + findRoomInLoc(); + data.byte(kFacing) = 6; + data.byte(kTurntoface) = 6; + data.byte(kManspath) = 0; + data.byte(kDestination) = 0; + data.byte(kFinaldest) = 0; + findXYFromPath(); + data.byte(kResetmanxy) = 1; + data.byte(kGetback) = 1; +} + +void DreamGenContext::useLadderB() { + showFirstUse(); + data.byte(kMapx) = data.byte(kMapx) + 11; + findRoomInLoc(); + data.byte(kFacing) = 2; + data.byte(kTurntoface) = 2; + data.byte(kManspath) = 1; + data.byte(kDestination) = 1; + data.byte(kFinaldest) = 1; + findXYFromPath(); + data.byte(kResetmanxy) = 1; + data.byte(kGetback) = 1; +} + +void DreamGenContext::sLabDoorA() { + showFirstUse(); + data.byte(kGetback) = 1; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.word(kReeltowatch) = 13; + if (data.byte(kDreamnumber) != 3) { + // Wrong + data.word(kWatchingtime) = 40; + data.word(kEndwatchreel) = 34; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + } else { + data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + data.word(kWatchingtime) = 60; + data.word(kEndwatchreel) = 42; + data.byte(kNewlocation) = 47; + } +} + +void DreamGenContext::sLabDoorC() { + showFirstUse(); + data.byte(kGetback) = 1; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.word(kReeltowatch) = 108; + if (data.byte(kDreamnumber) != 4) { + // Wrong + data.word(kWatchingtime) = 40; + data.word(kEndwatchreel) = 127; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + } else { + data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + data.word(kWatchingtime) = 60; + data.word(kEndwatchreel) = 135; + data.byte(kNewlocation) = 47; + } +} +void DreamGenContext::sLabDoorD() { + showFirstUse(); + data.byte(kGetback) = 1; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.word(kReeltowatch) = 75; + if (data.byte(kDreamnumber) != 0) { + // Wrong + data.word(kWatchingtime) = 40; + data.word(kEndwatchreel) = 94; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + } else { + data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + data.word(kWatchingtime) = 60; + data.word(kEndwatchreel) = 102; + data.byte(kNewlocation) = 47; + } +} + +void DreamGenContext::sLabDoorE() { + showFirstUse(); + data.byte(kGetback) = 1; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.word(kReeltowatch) = 141; + if (data.byte(kDreamnumber) != 5) { + // Wrong + data.word(kWatchingtime) = 40; + data.word(kEndwatchreel) = 160; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + } else { + data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + data.word(kWatchingtime) = 60; + data.word(kEndwatchreel) = 168; + data.byte(kNewlocation) = 47; + } +} + +void DreamGenContext::sLabDoorF() { + showFirstUse(); + data.byte(kGetback) = 1; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.word(kReeltowatch) = 171; + if (data.byte(kDreamnumber) != 2) { + // Wrong + data.word(kWatchingtime) = 40; + data.word(kEndwatchreel) = 189; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + } else { + data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + data.word(kWatchingtime) = 60; + data.word(kEndwatchreel) = 197; + data.byte(kNewlocation) = 47; + } +} + +} /*namespace dreamgen */ -- cgit v1.2.3 From c244f6e66202f22570c706eb877807fe60d0b99a Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 6 Dec 2011 13:17:28 +0200 Subject: DREAMWEB: 'usechurchgate', 'usefullcart' ported to C++ --- engines/dreamweb/use.cpp | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index c60873c7b6..5bc8a4f93b 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -692,4 +692,51 @@ void DreamGenContext::sLabDoorF() { } } +void DreamGenContext::useChurchGate() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char id[4] = { 'C', 'U', 'T', 'T' }; // TODO: convert to string with trailing zero + if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { + // Wrong item + cx = 300; + al = 14; + showPuzText(); + putBackObStuff(); + } else { + // Cut gate + showFirstUse(); + data.word(kWatchingtime) = 64 * 2; + data.word(kReeltowatch) = 4; + data.word(kEndwatchreel) = 70; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; + data.byte(kProgresspoints)++; + turnPathOn(3); + if (data.byte(kAidedead) != 0) + turnPathOn(2); // Open church + } +} + +void DreamGenContext::useFullCart() { + data.byte(kProgresspoints)++; + turnAnyPathOn(2, data.byte(kRoomnum) + 6); + data.byte(kManspath) = 4; + data.byte(kFacing) = 4; + data.byte(kTurntoface) = 4; + data.byte(kFinaldest) = 4; + findXYFromPath(); + data.byte(kResetmanxy) = 1; + showFirstUse(); + data.word(kWatchingtime) = 72 * 2; + data.word(kReeltowatch) = 58; + data.word(kEndwatchreel) = 142; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; +} + } /*namespace dreamgen */ -- cgit v1.2.3 From 1434bb35af0fc0c1896b603c05bc3eb4a9561789 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 6 Dec 2011 14:13:54 +0200 Subject: DREAMWEB: 'opentvdoor', 'useclearbox' ported to C++. Some cleanup. --- engines/dreamweb/use.cpp | 67 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 57 insertions(+), 10 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 5bc8a4f93b..d33ad97821 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -331,13 +331,13 @@ void DreamGenContext::useShield() { data.byte(kLastweapon) = 3; showSecondUse(); data.byte(kGetback) = 1; - data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + data.byte(kProgresspoints)++; removeObFromInv(); } } void DreamGenContext::useCoveredBox() { - data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + data.byte(kProgresspoints)++; showFirstUse(); data.word(kWatchingtime) = 50; data.word(kReeltowatch) = 41; @@ -429,7 +429,7 @@ void DreamGenContext::useBalcony() { turnPathOff(3); turnPathOff(4); turnPathOff(5); - data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + data.byte(kProgresspoints)++; data.byte(kManspath) = 6; data.byte(kDestination) = 6; data.byte(kFinaldest) = 6; @@ -450,7 +450,7 @@ void DreamGenContext::useWindow() { showSecondUse(); putBackObStuff(); } else { - data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + data.byte(kProgresspoints)++; showFirstUse(); data.byte(kNewlocation) = 29; data.byte(kGetback) = 1; @@ -458,7 +458,7 @@ void DreamGenContext::useWindow() { } void DreamGenContext::trapDoor() { - data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + data.byte(kProgresspoints)++; showFirstUse(); switchRyanOff(); data.word(kWatchingtime) = 20 * 2; @@ -605,7 +605,7 @@ void DreamGenContext::sLabDoorA() { data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; } else { - data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + data.byte(kProgresspoints)++; data.word(kWatchingtime) = 60; data.word(kEndwatchreel) = 42; data.byte(kNewlocation) = 47; @@ -625,7 +625,7 @@ void DreamGenContext::sLabDoorC() { data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; } else { - data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + data.byte(kProgresspoints)++; data.word(kWatchingtime) = 60; data.word(kEndwatchreel) = 135; data.byte(kNewlocation) = 47; @@ -645,7 +645,7 @@ void DreamGenContext::sLabDoorD() { data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; } else { - data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + data.byte(kProgresspoints)++; data.word(kWatchingtime) = 60; data.word(kEndwatchreel) = 102; data.byte(kNewlocation) = 47; @@ -665,7 +665,7 @@ void DreamGenContext::sLabDoorE() { data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; } else { - data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + data.byte(kProgresspoints)++; data.word(kWatchingtime) = 60; data.word(kEndwatchreel) = 168; data.byte(kNewlocation) = 47; @@ -685,7 +685,7 @@ void DreamGenContext::sLabDoorF() { data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; } else { - data.byte(kProgresspoints) = data.byte(kProgresspoints) + 1; + data.byte(kProgresspoints)++; data.word(kWatchingtime) = 60; data.word(kEndwatchreel) = 197; data.byte(kNewlocation) = 47; @@ -739,4 +739,51 @@ void DreamGenContext::useFullCart() { data.byte(kGetback) = 1; } +void DreamGenContext::useClearBox() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char id[4] = { 'R', 'A', 'I', 'L' }; // TODO: convert to string with trailing zero + if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { + // Wrong item + cx = 300; + al = 14; + showPuzText(); + putBackObStuff(); + } else { + // Open box + data.byte(kProgresspoints)++; + showFirstUse(); + data.word(kWatchingtime) = 80; + data.word(kReeltowatch) = 67; + data.word(kEndwatchreel) = 105; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; + } +} + +void DreamGenContext::openTVDoor() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char id[4] = { 'U', 'L', 'O', 'K' }; // TODO: convert to string with trailing zero + if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { + // Wrong item + cx = 300; + al = 14; + showPuzText(); + putBackObStuff(); + } else { + // Key on TV + showFirstUse(); + data.byte(kLockstatus) = 0; + data.byte(kGetback) = 1; + } +} + } /*namespace dreamgen */ -- cgit v1.2.3 From d4f845524e72bd9887eaa4fdf01f1fc12ef41860 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 6 Dec 2011 16:46:26 +0200 Subject: DREAMWEB: 'destselect', 'lastdest', 'nextdest', 'putbackobstuff', 'reexfromopen', 'useplate' ported to C++ --- engines/dreamweb/use.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index d33ad97821..18730eea7e 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -786,4 +786,38 @@ void DreamGenContext::openTVDoor() { } } +void DreamGenContext::usePlate() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char screw[4] = { 'S', 'C', 'R', 'W' }; // TODO: convert to string with trailing zero + char knife[4] = { 'K', 'N', 'F', 'E' }; // TODO: convert to string with trailing zero + if (compare(data.byte(kWithobject), data.byte(kWithtype), screw)) { + // Unscrew plate + playChannel1(20); + showFirstUse(); + placeSetObject(28); + placeSetObject(24); + removeSetObject(25); + al = 0; + placeFreeObject(); + data.byte(kProgresspoints)++; + data.byte(kGetback) = 1; + } else if (compare(data.byte(kWithobject), data.byte(kWithtype), knife)) { + // Tried knife + cx = 300; + al = 54; + showPuzText(); + putBackObStuff(); + } else { + // Wrong item + cx = 300; + al = 14; + showPuzText(); + putBackObStuff(); + } +} + } /*namespace dreamgen */ -- cgit v1.2.3 From f2829a6a6c033c981514d233119648731ee78310 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 6 Dec 2011 17:46:50 +0200 Subject: DREAMWEB: 'useelvdoor', 'useobject', 'useplinth' ported to C++ --- engines/dreamweb/use.cpp | 73 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 18730eea7e..e5a616e61d 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -820,4 +820,77 @@ void DreamGenContext::usePlate() { } } +void DreamGenContext::usePlinth() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char id[4] = { 'D', 'K', 'E', 'Y' }; // TODO: convert to string with trailing zero + if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { + // Wrong key + showFirstUse(); + putBackObStuff(); + } else { + data.byte(kProgresspoints)++; + showSecondUse(); + data.word(kWatchingtime) = 220; + data.word(kReeltowatch) = 0; + data.word(kEndwatchreel) = 104; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; + data.byte(kNewlocation) = data.byte(kRoomafterdream); + } +} + +void DreamGenContext::useElvDoor() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char id[4] = { 'A', 'X', 'E', 'D' }; // TODO: convert to string with trailing zero + if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { + // Wrong item + cx = 300; + al = 14; + showPuzText(); + putBackObStuff(); + } else { + // Axe on door + al = 15; + cx = 300; + showPuzText(); + _inc(data.byte(kProgresspoints)); + data.word(kWatchingtime) = 46*2; + data.word(kReeltowatch) = 31; + data.word(kEndwatchreel) = 77; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; + } +} + +void DreamGenContext::useObject() { + data.byte(kWithobject) = 255; + + if (data.byte(kCommandtype) != 229) { + data.byte(kCommandtype) = 229; + commandWithOb(data.byte(kCommand), data.byte(kObjecttype), 51); + } + +alreadyuse: + ax = data.word(kMousebutton); + _cmp(ax, data.word(kOldbutton)); + if (flags.z()) + return /* (nouse) */; + _and(ax, 1); + if (!flags.z()) + goto douse; + return; +douse: + useRoutine(); +} + } /*namespace dreamgen */ -- cgit v1.2.3 From bb14626630541c845e1cfea00cb6446562124ece Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 6 Dec 2011 17:55:08 +0200 Subject: DREAMWEB: Finish off useObject() --- engines/dreamweb/use.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index e5a616e61d..96df77b955 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -880,17 +880,11 @@ void DreamGenContext::useObject() { commandWithOb(data.byte(kCommand), data.byte(kObjecttype), 51); } -alreadyuse: - ax = data.word(kMousebutton); - _cmp(ax, data.word(kOldbutton)); - if (flags.z()) - return /* (nouse) */; - _and(ax, 1); - if (!flags.z()) - goto douse; - return; -douse: - useRoutine(); + if (data.word(kMousebutton) == data.word(kOldbutton)) + return; // nouse + + if (data.word(kMousebutton) & 1) + useRoutine(); } } /*namespace dreamgen */ -- cgit v1.2.3 From 6f2f8976ccbaeff14667373712adfdba526b5bf2 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 6 Dec 2011 18:33:42 +0200 Subject: DREAMWEB: Fix regression in useObject() from f2829a6 --- engines/dreamweb/use.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 96df77b955..e37e8d4e93 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -877,7 +877,7 @@ void DreamGenContext::useObject() { if (data.byte(kCommandtype) != 229) { data.byte(kCommandtype) = 229; - commandWithOb(data.byte(kCommand), data.byte(kObjecttype), 51); + commandWithOb(51, data.byte(kObjecttype), data.byte(kCommand)); } if (data.word(kMousebutton) == data.word(kOldbutton)) -- cgit v1.2.3 From 7566d2c985e497ca2bca1db700a9fee7eabf9351 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 6 Dec 2011 19:54:03 +0200 Subject: DREAMWEB: 'chewy', 'slabdoorb', 'usecart', 'usehole', 'usetrainer', 'usewinch' ported to C++ --- engines/dreamweb/use.cpp | 140 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 139 insertions(+), 1 deletion(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index e37e8d4e93..f8a3054e65 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -612,6 +612,46 @@ void DreamGenContext::sLabDoorA() { } } +void DreamGenContext::sLabDoorB() { + if (data.byte(kDreamnumber) != 1) { + // Wrong + showFirstUse(); + data.byte(kGetback) = 1; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.word(kReeltowatch) = 44; + data.word(kWatchingtime) = 40; + data.word(kEndwatchreel) = 63; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + } else { + al = 'S'; + ah = 'H'; + cl = 'L'; + ch = 'D'; + isRyanHolding(); + + if (flags.z()) { + // No crystal + al = 44; + cx = 200; + showPuzText(); + putBackObStuff(); + } else { + // Got crystal + showFirstUse(); + data.byte(kProgresspoints)++; + data.byte(kGetback) = 1; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.word(kReeltowatch) = 44; + data.word(kWatchingtime) = 60; + data.word(kEndwatchreel) = 71; + data.byte(kNewlocation) = 47; + } + } +} + void DreamGenContext::sLabDoorC() { showFirstUse(); data.byte(kGetback) = 1; @@ -863,7 +903,7 @@ void DreamGenContext::useElvDoor() { cx = 300; showPuzText(); _inc(data.byte(kProgresspoints)); - data.word(kWatchingtime) = 46*2; + data.word(kWatchingtime) = 46 * 2; data.word(kReeltowatch) = 31; data.word(kEndwatchreel) = 77; data.byte(kWatchspeed) = 1; @@ -887,4 +927,102 @@ void DreamGenContext::useObject() { useRoutine(); } + +void DreamGenContext::useWinch() { + al = 40; + ah = 1; + checkInside(); + + char id[4] = { 'F', 'U', 'S', 'E' }; // TODO: convert to string with trailing zero + if (cl == 114 || !compare(cl, 4, id)) { + // No winch + showFirstUse(); + putBackObStuff(); + return; + } + + data.word(kWatchingtime) = 217 * 2; + data.word(kReeltowatch) = 0; + data.word(kEndwatchreel) = 217; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kDestpos) = 1; + data.byte(kNewlocation) = 45; + data.byte(kDreamnumber) = 1; + data.byte(kRoomafterdream) = 44; + data.byte(kGeneraldead) = 1; + data.byte(kNewsitem) = 2; + data.byte(kGetback) = 1; + data.byte(kProgresspoints)++; +} + +void DreamGenContext::useCart() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char id[4] = { 'R', 'O', 'C', 'K' }; // TODO: convert to string with trailing zero + if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { + // Wrong item + cx = 300; + al = 14; + showPuzText(); + putBackObStuff(); + } else { + DynObject *exObject = getExAd(data.byte(kWithobject)); + exObject->mapad[0] = 0; + removeSetObject(data.byte(kCommand)); + placeSetObject(data.byte(kWithobject) + 1); + data.byte(kProgresspoints)++; + playChannel1(17); + showFirstUse(); + data.byte(kGetback) = 1; + } +} + +void DreamGenContext::useTrainer() { + // TODO: Use the C++ version of getAnyAd() + getAnyAd(); + if (es.byte(bx + 2) != 4) { + notHeldError(); + } else { + data.byte(kProgresspoints)++; + makeWorn(); + showSecondUse(); + putBackObStuff(); + } +} + +void DreamGenContext::chewy() { + showFirstUse(); + // TODO: Use the C++ version of getAnyAd() + getAnyAd(); + es.byte(bx + 2) = 255; + data.byte(kGetback) = 1; +} + +void DreamGenContext::useHole() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char id[4] = { 'H', 'N', 'D', 'A' }; // TODO: convert to string with trailing zero + if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { + // Wrong item + cx = 300; + al = 14; + showPuzText(); + putBackObStuff(); + } else { + showFirstUse(); + removeSetObject(86); + DynObject *exObject = getExAd(data.byte(kWithobject)); + exObject->mapad[0] = 255; + data.byte(kCanmovealtar) = 1; + data.byte(kGetback) = 1; + } +} + } /*namespace dreamgen */ -- cgit v1.2.3 From 16c9620dbad66d7c1f2bc5f4d172393c34b92371 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 6 Dec 2011 20:17:19 +0200 Subject: DREAMWEB: 'grafittidoor', 'hotelcontrol', 'openhoteldoor', 'openhoteldoor2', 'opentomb' ported to C++ --- engines/dreamweb/use.cpp | 80 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index f8a3054e65..c70c625969 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1025,4 +1025,84 @@ void DreamGenContext::useHole() { } } +void DreamGenContext::openHotelDoor() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char id[4] = { 'K', 'E', 'Y', 'A' }; // TODO: convert to string with trailing zero + if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { + // Wrong item + cx = 300; + al = 14; + showPuzText(); + putBackObStuff(); + } else { + playChannel1(16); + showFirstUse(); + data.byte(kLockstatus) = 0; + data.byte(kGetback) = 1; + } +} + +void DreamGenContext::openHotelDoor2() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char id[4] = { 'K', 'E', 'Y', 'A' }; // TODO: convert to string with trailing zero + if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { + // Wrong item + cx = 300; + al = 14; + showPuzText(); + putBackObStuff(); + } else { + playChannel1(16); + showFirstUse(); + putBackObStuff(); + } +} + +void DreamGenContext::grafittiDoor() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char id[4] = { 'A', 'P', 'E', 'N' }; // TODO: convert to string with trailing zero + if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { + // Wrong item + cx = 300; + al = 14; + showPuzText(); + putBackObStuff(); + } else { + showFirstUse(); + putBackObStuff(); + } +} + +void DreamGenContext::openTomb() { + data.byte(kProgresspoints)++; + showFirstUse(); + data.word(kWatchingtime) = 35 * 2; + data.word(kReeltowatch) = 1; + data.word(kEndwatchreel) = 33; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; +} + +void DreamGenContext::hotelControl() { + if (data.byte(kReallocation) != 21 || data.byte(kMapx) != 33) + showSecondUse(); // Not right control + else + showFirstUse(); + + putBackObStuff(); +} + } /*namespace dreamgen */ -- cgit v1.2.3 From 7a3360e09fbf529b17d194358c393e30ce86593f Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 6 Dec 2011 19:02:23 +0100 Subject: DREAMWEB: Fix regressions in 'intro1text', 'redrawmainscrn', 'sitdowninbar' --- engines/dreamweb/use.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index c70c625969..2f7e66c840 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -397,7 +397,7 @@ void DreamGenContext::useChurchHole() { } void DreamGenContext::sitDownInBar() { - if (data.byte(kWatchmode) == 0xFF) { + if (data.byte(kWatchmode) != 0xFF) { // Sat down showSecondUse(); putBackObStuff(); -- cgit v1.2.3 From 9194b23d5baf62e3fd549ad6d1cd31ebdc5597f3 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 6 Dec 2011 19:58:00 +0100 Subject: DREAMWEB: Fix regression in 'usecart' --- engines/dreamweb/use.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 2f7e66c840..fa23f1dc32 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -934,7 +934,7 @@ void DreamGenContext::useWinch() { checkInside(); char id[4] = { 'F', 'U', 'S', 'E' }; // TODO: convert to string with trailing zero - if (cl == 114 || !compare(cl, 4, id)) { + if (cl == kNumexobjects || !compare(cl, 4, id)) { // No winch showFirstUse(); putBackObStuff(); @@ -973,7 +973,7 @@ void DreamGenContext::useCart() { DynObject *exObject = getExAd(data.byte(kWithobject)); exObject->mapad[0] = 0; removeSetObject(data.byte(kCommand)); - placeSetObject(data.byte(kWithobject) + 1); + placeSetObject(data.byte(kCommand) + 1); data.byte(kProgresspoints)++; playChannel1(17); showFirstUse(); -- cgit v1.2.3 From e4e059b85722cdd5938fb39f56276ff7863e00cc Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 6 Dec 2011 22:24:15 +0200 Subject: DREAMWEB: Add a default use handler, thereby reducing code duplication --- engines/dreamweb/use.cpp | 246 +++++++++++++++++------------------------------ 1 file changed, 87 insertions(+), 159 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index fa23f1dc32..a2b5e7f568 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -732,33 +732,41 @@ void DreamGenContext::sLabDoorF() { } } -void DreamGenContext::useChurchGate() { +bool DreamGenContext::defaultUseHandler(const char *id) { if (data.byte(kWithobject) == 255) { withWhat(); - return; + return true; // event handled } - char id[4] = { 'C', 'U', 'T', 'T' }; // TODO: convert to string with trailing zero if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { // Wrong item cx = 300; al = 14; showPuzText(); putBackObStuff(); - } else { - // Cut gate - showFirstUse(); - data.word(kWatchingtime) = 64 * 2; - data.word(kReeltowatch) = 4; - data.word(kEndwatchreel) = 70; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; - data.byte(kProgresspoints)++; - turnPathOn(3); - if (data.byte(kAidedead) != 0) - turnPathOn(2); // Open church + return true; // event handled } + + return false; // continue with the original event +} + +void DreamGenContext::useChurchGate() { + char id[4] = { 'C', 'U', 'T', 'T' }; // TODO: convert to string with trailing zero + if (defaultUseHandler(id)) + return; + + // Cut gate + showFirstUse(); + data.word(kWatchingtime) = 64 * 2; + data.word(kReeltowatch) = 4; + data.word(kEndwatchreel) = 70; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; + data.byte(kProgresspoints)++; + turnPathOn(3); + if (data.byte(kAidedead) != 0) + turnPathOn(2); // Open church } void DreamGenContext::useFullCart() { @@ -780,50 +788,30 @@ void DreamGenContext::useFullCart() { } void DreamGenContext::useClearBox() { - if (data.byte(kWithobject) == 255) { - withWhat(); + char id[4] = { 'R', 'A', 'I', 'L' }; // TODO: convert to string with trailing zero + if (defaultUseHandler(id)) return; - } - char id[4] = { 'R', 'A', 'I', 'L' }; // TODO: convert to string with trailing zero - if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { - // Wrong item - cx = 300; - al = 14; - showPuzText(); - putBackObStuff(); - } else { - // Open box - data.byte(kProgresspoints)++; - showFirstUse(); - data.word(kWatchingtime) = 80; - data.word(kReeltowatch) = 67; - data.word(kEndwatchreel) = 105; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; - } + // Open box + data.byte(kProgresspoints)++; + showFirstUse(); + data.word(kWatchingtime) = 80; + data.word(kReeltowatch) = 67; + data.word(kEndwatchreel) = 105; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; } void DreamGenContext::openTVDoor() { - if (data.byte(kWithobject) == 255) { - withWhat(); + char id[4] = { 'U', 'L', 'O', 'K' }; // TODO: convert to string with trailing zero + if (defaultUseHandler(id)) return; - } - char id[4] = { 'U', 'L', 'O', 'K' }; // TODO: convert to string with trailing zero - if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { - // Wrong item - cx = 300; - al = 14; - showPuzText(); - putBackObStuff(); - } else { - // Key on TV - showFirstUse(); - data.byte(kLockstatus) = 0; - data.byte(kGetback) = 1; - } + // Key on TV + showFirstUse(); + data.byte(kLockstatus) = 0; + data.byte(kGetback) = 1; } void DreamGenContext::usePlate() { @@ -885,31 +873,21 @@ void DreamGenContext::usePlinth() { } void DreamGenContext::useElvDoor() { - if (data.byte(kWithobject) == 255) { - withWhat(); + char id[4] = { 'A', 'X', 'E', 'D' }; // TODO: convert to string with trailing zero + if (defaultUseHandler(id)) return; - } - char id[4] = { 'A', 'X', 'E', 'D' }; // TODO: convert to string with trailing zero - if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { - // Wrong item - cx = 300; - al = 14; - showPuzText(); - putBackObStuff(); - } else { - // Axe on door - al = 15; - cx = 300; - showPuzText(); - _inc(data.byte(kProgresspoints)); - data.word(kWatchingtime) = 46 * 2; - data.word(kReeltowatch) = 31; - data.word(kEndwatchreel) = 77; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; - } + // Axe on door + al = 15; + cx = 300; + showPuzText(); + _inc(data.byte(kProgresspoints)); + data.word(kWatchingtime) = 46 * 2; + data.word(kReeltowatch) = 31; + data.word(kEndwatchreel) = 77; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; } void DreamGenContext::useObject() { @@ -957,28 +935,18 @@ void DreamGenContext::useWinch() { } void DreamGenContext::useCart() { - if (data.byte(kWithobject) == 255) { - withWhat(); + char id[4] = { 'R', 'O', 'C', 'K' }; // TODO: convert to string with trailing zero + if (defaultUseHandler(id)) return; - } - char id[4] = { 'R', 'O', 'C', 'K' }; // TODO: convert to string with trailing zero - if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { - // Wrong item - cx = 300; - al = 14; - showPuzText(); - putBackObStuff(); - } else { - DynObject *exObject = getExAd(data.byte(kWithobject)); - exObject->mapad[0] = 0; - removeSetObject(data.byte(kCommand)); - placeSetObject(data.byte(kCommand) + 1); - data.byte(kProgresspoints)++; - playChannel1(17); - showFirstUse(); - data.byte(kGetback) = 1; - } + DynObject *exObject = getExAd(data.byte(kWithobject)); + exObject->mapad[0] = 0; + removeSetObject(data.byte(kCommand)); + placeSetObject(data.byte(kCommand) + 1); + data.byte(kProgresspoints)++; + playChannel1(17); + showFirstUse(); + data.byte(kGetback) = 1; } void DreamGenContext::useTrainer() { @@ -1003,86 +971,46 @@ void DreamGenContext::chewy() { } void DreamGenContext::useHole() { - if (data.byte(kWithobject) == 255) { - withWhat(); + char id[4] = { 'H', 'N', 'D', 'A' }; // TODO: convert to string with trailing zero + if (defaultUseHandler(id)) return; - } - char id[4] = { 'H', 'N', 'D', 'A' }; // TODO: convert to string with trailing zero - if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { - // Wrong item - cx = 300; - al = 14; - showPuzText(); - putBackObStuff(); - } else { - showFirstUse(); - removeSetObject(86); - DynObject *exObject = getExAd(data.byte(kWithobject)); - exObject->mapad[0] = 255; - data.byte(kCanmovealtar) = 1; - data.byte(kGetback) = 1; - } + showFirstUse(); + removeSetObject(86); + DynObject *exObject = getExAd(data.byte(kWithobject)); + exObject->mapad[0] = 255; + data.byte(kCanmovealtar) = 1; + data.byte(kGetback) = 1; } void DreamGenContext::openHotelDoor() { - if (data.byte(kWithobject) == 255) { - withWhat(); + char id[4] = { 'K', 'E', 'Y', 'A' }; // TODO: convert to string with trailing zero + if (defaultUseHandler(id)) return; - } - char id[4] = { 'K', 'E', 'Y', 'A' }; // TODO: convert to string with trailing zero - if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { - // Wrong item - cx = 300; - al = 14; - showPuzText(); - putBackObStuff(); - } else { - playChannel1(16); - showFirstUse(); - data.byte(kLockstatus) = 0; - data.byte(kGetback) = 1; - } + playChannel1(16); + showFirstUse(); + data.byte(kLockstatus) = 0; + data.byte(kGetback) = 1; } void DreamGenContext::openHotelDoor2() { - if (data.byte(kWithobject) == 255) { - withWhat(); + char id[4] = { 'K', 'E', 'Y', 'A' }; // TODO: convert to string with trailing zero + if (defaultUseHandler(id)) return; - } - char id[4] = { 'K', 'E', 'Y', 'A' }; // TODO: convert to string with trailing zero - if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { - // Wrong item - cx = 300; - al = 14; - showPuzText(); - putBackObStuff(); - } else { - playChannel1(16); - showFirstUse(); - putBackObStuff(); - } + playChannel1(16); + showFirstUse(); + putBackObStuff(); } void DreamGenContext::grafittiDoor() { - if (data.byte(kWithobject) == 255) { - withWhat(); + char id[4] = { 'A', 'P', 'E', 'N' }; // TODO: convert to string with trailing zero + if (defaultUseHandler(id)) return; - } - char id[4] = { 'A', 'P', 'E', 'N' }; // TODO: convert to string with trailing zero - if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { - // Wrong item - cx = 300; - al = 14; - showPuzText(); - putBackObStuff(); - } else { - showFirstUse(); - putBackObStuff(); - } + showFirstUse(); + putBackObStuff(); } void DreamGenContext::openTomb() { -- cgit v1.2.3 From 0193ef590da121ca4053510d53aad0b3d6b7052a Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 6 Dec 2011 17:43:23 +0100 Subject: DREAMWEB: Cleanup end of namespace comments --- engines/dreamweb/use.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index a2b5e7f568..96dfc26344 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -905,7 +905,6 @@ void DreamGenContext::useObject() { useRoutine(); } - void DreamGenContext::useWinch() { al = 40; ah = 1; @@ -1033,4 +1032,4 @@ void DreamGenContext::hotelControl() { putBackObStuff(); } -} /*namespace dreamgen */ +} // End of namespace DreamGen -- cgit v1.2.3 From 7445c62a713de489b3515711de579696c64239fe Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 6 Dec 2011 23:01:59 +0200 Subject: DREAMWEB: 'usecardreader1', 'usecardreader2', 'usecardreader3', 'usepoolreader' ported to C++ --- engines/dreamweb/use.cpp | 106 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 96dfc26344..34d1ed2c77 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1012,6 +1012,112 @@ void DreamGenContext::grafittiDoor() { putBackObStuff(); } +void DreamGenContext::usePoolReader() { + char id[4] = { 'M', 'E', 'M', 'B' }; // TODO: convert to string with trailing zero + if (defaultUseHandler(id)) + return; + + if (data.byte(kTalkedtoattendant) != 1) { + // Can't open pool + showSecondUse(); + putBackObStuff(); + } else { + playChannel1(17); + showFirstUse(); + data.byte(kCounttoopen) = 6; + data.byte(kGetback) = 1; + } +} + +void DreamGenContext::useCardReader1() { + char id[4] = { 'C', 'S', 'H', 'R' }; // TODO: convert to string with trailing zero + if (defaultUseHandler(id)) + return; + + if (data.byte(kTalkedtosparky) == 0) { + // Not yet + showFirstUse(); + putBackObStuff(); + } else if (data.word(kCard1money) == 0) { + // No cash + cx = 300; + al = 17; + showPuzText(); + putBackObStuff(); + return; + } else { + // Get cash + playChannel1(16); + cx = 300; + al = 18; + showPuzText(); + data.byte(kProgresspoints)++; + data.word(kCard1money) = 12432; + data.byte(kGetback) = 1; + } +} + +void DreamGenContext::useCardReader2() { + char id[4] = { 'C', 'S', 'H', 'R' }; // TODO: convert to string with trailing zero + if (defaultUseHandler(id)) + return; + + if (data.byte(kTalkedtoboss) == 0) { + // Haven't talked to boss + showFirstUse(); + putBackObStuff(); + } else if (data.byte(kCard1money) == 0) { + // No cash + cx = 300; + al = 20; + showPuzText(); + putBackObStuff(); + } else if (data.byte(kGunpassflag) == 2) { + // Already got new + cx = 300; + al = 22; + showPuzText(); + putBackObStuff(); + } else { + playChannel1(18); + cx = 300; + al = 19; + showPuzText(); + placeSetObject(94); + data.byte(kGunpassflag) = 1; + data.word(kCard1money) -= 2000; + data.byte(kProgresspoints)++; + data.byte(kGetback) = 1; + } +} + +void DreamGenContext::useCardReader3() { + char id[4] = { 'C', 'S', 'H', 'R' }; // TODO: convert to string with trailing zero + if (defaultUseHandler(id)) + return; + + if (data.byte(kTalkedtorecep) == 0) { + // Haven't talked to receptionist + showFirstUse(); + putBackObStuff(); + } else if (data.byte(kCardpassflag) != 0) { + // Already used it + cx = 300; + al = 26; + showPuzText(); + putBackObStuff(); + } else { + playChannel1(16); + cx = 300; + al = 25; + showPuzText(); + data.byte(kProgresspoints)++; + data.word(kCard1money) -= 8300; + data.byte(kCardpassflag) = 1; + data.byte(kGetback) = 1; + } +} + void DreamGenContext::openTomb() { data.byte(kProgresspoints)++; showFirstUse(); -- cgit v1.2.3 From 495114037111f4c6a91b6df6a8046916c90aba6b Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 6 Dec 2011 22:20:16 +0100 Subject: DREAMWEB: Fix regression in useCardReader1 --- engines/dreamweb/use.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 34d1ed2c77..044a4fba40 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1038,13 +1038,12 @@ void DreamGenContext::useCardReader1() { // Not yet showFirstUse(); putBackObStuff(); - } else if (data.word(kCard1money) == 0) { + } else if (data.word(kCard1money) != 0) { // No cash cx = 300; al = 17; showPuzText(); putBackObStuff(); - return; } else { // Get cash playChannel1(16); -- cgit v1.2.3 From 1d0ba8e8e6cb9cb6ec20492972d2b0b06c349c06 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 8 Dec 2011 12:18:52 +0200 Subject: DREAMWEB: Port 'showcooker' to C++ --- engines/dreamweb/use.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 044a4fba40..b56ae07864 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1137,4 +1137,17 @@ void DreamGenContext::hotelControl() { putBackObStuff(); } +void DreamGenContext::useCooker() { + al = data.byte(kCommand); + ah = data.byte(kObjecttype); + checkInside(); + + if (cl == 114) + showFirstUse(); + else + showSecondUse(); // Food inside + + putBackObStuff(); +} + } // End of namespace DreamGen -- cgit v1.2.3 From 627d3f8d4128d07b01765132b8ee39ec7f30f2b6 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 8 Dec 2011 15:21:42 +0100 Subject: DREAMWEB: Move functions to DreamBase --- engines/dreamweb/use.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index b56ae07864..f06a30d81e 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -829,8 +829,7 @@ void DreamGenContext::usePlate() { placeSetObject(28); placeSetObject(24); removeSetObject(25); - al = 0; - placeFreeObject(); + placeFreeObject(0); data.byte(kProgresspoints)++; data.byte(kGetback) = 1; } else if (compare(data.byte(kWithobject), data.byte(kWithtype), knife)) { @@ -1150,4 +1149,14 @@ void DreamGenContext::useCooker() { putBackObStuff(); } +void DreamBase::placeFreeObject(uint8 index) { + findOrMake(index, 0, 1); + getFreeAd(index)->mapad[0] = 0; +} + +void DreamBase::removeFreeObject(uint8 index) { + getFreeAd(index)->mapad[0] = 0xFF; +} + + } // End of namespace DreamGen -- cgit v1.2.3 From baf2cc8b8eaa6a4d56c0764eb7a1e1a6c8b9758e Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 9 Dec 2011 01:23:38 +0200 Subject: DREAMWEB: Port 'usediary' to C++ and remove diarylist from the blob --- engines/dreamweb/use.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index f06a30d81e..be4906c8b2 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1158,5 +1158,49 @@ void DreamBase::removeFreeObject(uint8 index) { getFreeAd(index)->mapad[0] = 0xFF; } +void DreamGenContext::useDiary() { + getRidOfReels(); + loadIntoTemp((const char *)data.ptr(kDiarygraphic, 0)); + loadTempText((const char *)data.ptr(kDiarytext, 0)); + loadTempCharset((const char *)data.ptr(kCharacterset3, 0)); + createPanel(); + showIcon(); + showDiary(); + underTextLine(); + showDiaryPage(); + readMouse(); + showPointer(); + workToScreen(); + delPointer(); + data.byte(kGetback) = 0; + + RectWithCallback diaryList[] = { + { kDiaryx+94,kDiaryx+110,kDiaryy+97,kDiaryy+113,&DreamGenContext::diaryKeyN }, + { kDiaryx+151,kDiaryx+167,kDiaryy+71,kDiaryy+87,&DreamGenContext::diaryKeyP }, + { kDiaryx+176,kDiaryx+192,kDiaryy+108,kDiaryy+124,&DreamGenContext::quitKey }, + { 0,320,0,200,&DreamGenContext::blank }, + { 0xFFFF,0,0,0,0 } + }; + + do { + delPointer(); + readMouse(); + showDiaryKeys(); + showPointer(); + vSync(); + dumpPointer(); + dumpDiaryKeys(); + dumpTextLine(); + checkCoords(diaryList); + } while (!data.byte(kGetback)); + + getRidOfTemp(); + getRidOfTempText(); + getRidOfTempCharset(); + restoreReels(); + data.byte(kManisoffscreen) = 0; + redrawMainScrn(); + workToScreenM(); +} } // End of namespace DreamGen -- cgit v1.2.3 From 2bc6af518ce6ab2d1e7cc3b87adc6dc7862c1b8d Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 9 Dec 2011 10:30:55 +0200 Subject: DREAMWEB: Move some strings used by useDiary() out of the blob --- engines/dreamweb/use.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index be4906c8b2..02a53436fe 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1160,9 +1160,9 @@ void DreamBase::removeFreeObject(uint8 index) { void DreamGenContext::useDiary() { getRidOfReels(); - loadIntoTemp((const char *)data.ptr(kDiarygraphic, 0)); - loadTempText((const char *)data.ptr(kDiarytext, 0)); - loadTempCharset((const char *)data.ptr(kCharacterset3, 0)); + loadIntoTemp("DREAMWEB.G14"); + loadTempText("DREAMWEB.T51"); + loadTempCharset("DREAMWEB.C02"); createPanel(); showIcon(); showDiary(); -- cgit v1.2.3 From 447f0c664359f62330d91be20d49d66b9fb420fb Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 9 Dec 2011 18:18:32 +0200 Subject: DREAMWEB: Use the C++ version of workScreen() in C++ code --- engines/dreamweb/use.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 02a53436fe..68f4aed1c0 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1170,7 +1170,7 @@ void DreamGenContext::useDiary() { showDiaryPage(); readMouse(); showPointer(); - workToScreen(); + workToScreenCPP(); delPointer(); data.byte(kGetback) = 0; -- cgit v1.2.3 From 6f6d137726d8d80f158f92ff5d8f868a0df267dd Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 11 Dec 2011 21:46:17 +0200 Subject: DREAMWEB: Port 'uselighter' to C++ --- engines/dreamweb/use.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'engines/dreamweb/use.cpp') 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(); -- cgit v1.2.3 From d416ea6abdad5ef487ed3b5624474e1212496233 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sun, 11 Dec 2011 22:27:05 +0100 Subject: DREAMWEB: Fix regressions in getBack1 and useLighter --- engines/dreamweb/use.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 9126b7e885..d328e1d662 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1130,8 +1130,8 @@ void DreamGenContext::useLighter() { cx = 300; al = 9; showPuzText(); - getExAd(data.byte(kWithobject)); - es.byte(bx + 2) = 255; + DynObject *withObj = getExAd(data.byte(kWithobject)); + withObj->mapad[0] = 255; data.byte(kGetback) = 1; } } -- cgit v1.2.3 From 9e1481fc07454aa10e4a32db9fe5a56bf32b834c Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 12 Dec 2011 02:46:15 +0200 Subject: DREAMWEB: Port 'showpuztext' to C++ --- engines/dreamweb/use.cpp | 52 ++++++++++++------------------------------------ 1 file changed, 13 insertions(+), 39 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index d328e1d662..76ecdc732d 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -633,9 +633,7 @@ void DreamGenContext::sLabDoorB() { if (flags.z()) { // No crystal - al = 44; - cx = 200; - showPuzText(); + showPuzText(44, 200); putBackObStuff(); } else { // Got crystal @@ -740,9 +738,7 @@ bool DreamGenContext::defaultUseHandler(const char *id) { if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { // Wrong item - cx = 300; - al = 14; - showPuzText(); + showPuzText(14, 300); putBackObStuff(); return true; // event handled } @@ -834,15 +830,11 @@ void DreamGenContext::usePlate() { data.byte(kGetback) = 1; } else if (compare(data.byte(kWithobject), data.byte(kWithtype), knife)) { // Tried knife - cx = 300; - al = 54; - showPuzText(); + showPuzText(54, 300); putBackObStuff(); } else { // Wrong item - cx = 300; - al = 14; - showPuzText(); + showPuzText(14, 300); putBackObStuff(); } } @@ -877,9 +869,7 @@ void DreamGenContext::useElvDoor() { return; // Axe on door - al = 15; - cx = 300; - showPuzText(); + showPuzText(15, 300); _inc(data.byte(kProgresspoints)); data.word(kWatchingtime) = 46 * 2; data.word(kReeltowatch) = 31; @@ -1039,16 +1029,12 @@ void DreamGenContext::useCardReader1() { putBackObStuff(); } else if (data.word(kCard1money) != 0) { // No cash - cx = 300; - al = 17; - showPuzText(); + showPuzText(17, 300); putBackObStuff(); } else { // Get cash playChannel1(16); - cx = 300; - al = 18; - showPuzText(); + showPuzText(18, 300); data.byte(kProgresspoints)++; data.word(kCard1money) = 12432; data.byte(kGetback) = 1; @@ -1066,21 +1052,15 @@ void DreamGenContext::useCardReader2() { putBackObStuff(); } else if (data.byte(kCard1money) == 0) { // No cash - cx = 300; - al = 20; - showPuzText(); + showPuzText(20, 300); putBackObStuff(); } else if (data.byte(kGunpassflag) == 2) { // Already got new - cx = 300; - al = 22; - showPuzText(); + showPuzText(22, 300); putBackObStuff(); } else { playChannel1(18); - cx = 300; - al = 19; - showPuzText(); + showPuzText(19, 300); placeSetObject(94); data.byte(kGunpassflag) = 1; data.word(kCard1money) -= 2000; @@ -1100,15 +1080,11 @@ void DreamGenContext::useCardReader3() { putBackObStuff(); } else if (data.byte(kCardpassflag) != 0) { // Already used it - cx = 300; - al = 26; - showPuzText(); + showPuzText(26, 300); putBackObStuff(); } else { playChannel1(16); - cx = 300; - al = 25; - showPuzText(); + showPuzText(25, 300); data.byte(kProgresspoints)++; data.word(kCard1money) -= 8300; data.byte(kCardpassflag) = 1; @@ -1127,9 +1103,7 @@ void DreamGenContext::useLighter() { showFirstUse(); putBackObStuff(); } else { - cx = 300; - al = 9; - showPuzText(); + showPuzText(9, 300); DynObject *withObj = getExAd(data.byte(kWithobject)); withObj->mapad[0] = 255; data.byte(kGetback) = 1; -- cgit v1.2.3 From 903ce79138c52a8ecde29a99964ed2dc3ec373ad Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 12 Dec 2011 17:59:36 +0200 Subject: DREAMWEB: Port 'usewire' to C++ --- engines/dreamweb/use.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 76ecdc732d..9778fe1f05 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1110,6 +1110,33 @@ void DreamGenContext::useLighter() { } } +void DreamGenContext::useWire() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char knife[4] = { 'K', 'N', 'F', 'E' }; // TODO: convert to string with trailing zero + if (compare(data.byte(kWithobject), data.byte(kWithtype), knife)) { + removeSetObject(51); + placeSetObject(52); + showPuzText(11, 300); + data.byte(kProgresspoints)++; + data.byte(kGetback) = 1; + return; + } + + char axe[4] = { 'A', 'X', 'E', 'D' }; // TODO: convert to string with trailing zero + if (!compare(data.byte(kWithobject), data.byte(kWithtype), axe)) { + showPuzText(16, 300); + putBackObStuff(); + return; + } + + showPuzText(14, 300); + putBackObStuff(); +} + void DreamGenContext::openTomb() { data.byte(kProgresspoints)++; showFirstUse(); -- cgit v1.2.3 From ad0ddcbb8ef1f8651e00f02fa325d4ed031e240e Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 12 Dec 2011 18:19:17 +0200 Subject: DREAMWEB: Fix typo in useWire() (thanks wjp, fuzzie) --- engines/dreamweb/use.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 9778fe1f05..0990e5ba5e 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1127,7 +1127,7 @@ void DreamGenContext::useWire() { } char axe[4] = { 'A', 'X', 'E', 'D' }; // TODO: convert to string with trailing zero - if (!compare(data.byte(kWithobject), data.byte(kWithtype), axe)) { + if (compare(data.byte(kWithobject), data.byte(kWithtype), axe)) { showPuzText(16, 300); putBackObStuff(); return; -- cgit v1.2.3 From 47c4b2b7dee13ade60c7810e0d4f216a5ee69e3a Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 12 Dec 2011 23:30:08 +0200 Subject: DREAMWEB: Port 'usecontrol' to C++ --- engines/dreamweb/use.cpp | 57 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 0990e5ba5e..eb3281150d 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1224,4 +1224,61 @@ void DreamGenContext::useDiary() { workToScreenM(); } +void DreamGenContext::useControl() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char key[4] = { 'K', 'E', 'Y', 'A' }; // TODO: convert to string with trailing zero + if (compare(data.byte(kWithobject), data.byte(kWithtype), key)) { // Right key + playChannel1(16); + if (data.byte(kLocation) == 21) { // Going down + showPuzText(3, 300); + data.byte(kNewlocation) = 30; + } else { + showPuzText(0, 300); + data.byte(kNewlocation) = 21; + } + + data.byte(kCounttoclose) = 8; + data.byte(kCounttoopen) = 0; + data.word(kWatchingtime) = 80; + data.byte(kGetback) = 1; + return; + } + + if (data.byte(kReallocation) == 21) { + char knife[4] = { 'K', 'N', 'F', 'E' }; // TODO: convert to string with trailing zero + char axe[4] = { 'A', 'X', 'E', 'D' }; // TODO: convert to string with trailing zero + + if (compare(data.byte(kWithobject), data.byte(kWithtype), knife)) { + // Jimmy controls + placeSetObject(50); + placeSetObject(51); + placeSetObject(26); + placeSetObject(30); + removeSetObject(16); + removeSetObject(17); + playChannel1(14); + showPuzText(10, 300); + data.byte(kProgresspoints)++; + data.byte(kGetback) = 1; + } else if (compare(data.byte(kWithobject), data.byte(kWithtype), axe)) { + // Axe on controls + showPuzText(16, 300); + data.byte(kProgresspoints)++; + putBackObStuff(); + } else { + // Balls + showFirstUse(); + putBackObStuff(); + } + } else { + // Balls + showFirstUse(); + putBackObStuff(); + } +} + } // End of namespace DreamGen -- cgit v1.2.3 From 27f5661dfc5d49571499501e68db96fe30d272de Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 12 Dec 2011 23:39:29 +0200 Subject: DREAMWEB: Port 'useslab' to C++ --- engines/dreamweb/use.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index eb3281150d..f6d6b2f494 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1281,4 +1281,37 @@ void DreamGenContext::useControl() { } } +void DreamGenContext::useSLab() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char id[4] = { 'J', 'E', 'W', 'L' }; // TODO: convert to string with trailing zero + if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { + showPuzText(14, 300); + putBackObStuff(); + return; + } + + DynObject *exObject = getExAd(data.byte(kWithobject)); + exObject->mapad[0] = 0; + + removeSetObject(data.byte(kCommand)); + placeSetObject(data.byte(kCommand) + 1); + if (data.byte(kCommand) + 1 == 54) { + // Last slab + turnPathOn(0); + data.word(kWatchingtime) = 22; + data.word(kReeltowatch) = 35; + data.word(kEndwatchreel) = 48; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + } + + data.byte(kProgresspoints)++; + showFirstUse(); + data.byte(kGetback) = 1; +} + } // End of namespace DreamGen -- cgit v1.2.3 From ef94b2d15a543493a7d11ed208c74c5c2c37214c Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 12 Dec 2011 23:51:40 +0200 Subject: DREAMWEB: Port 'usepipe' to C++ --- engines/dreamweb/use.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index f6d6b2f494..b8d7b7ca75 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1314,4 +1314,31 @@ void DreamGenContext::useSLab() { data.byte(kGetback) = 1; } +void DreamGenContext::usePipe() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char cupEmpty[4] = { 'C', 'U', 'P', 'E' }; // TODO: convert to string with trailing zero + char cupFull[4] = { 'C', 'U', 'P', 'F' }; // TODO: convert to string with trailing zero + + if (compare(data.byte(kWithobject), data.byte(kWithtype), cupEmpty)) { + // Fill cup + showPuzText(36, 300); + putBackObStuff(); + DynObject *exObject = getExAd(data.byte(kWithobject)); + exObject->id[3] = 'F'-'A'; // CUPE (empty cup) -> CUPF (full cup) + return; + } else if (compare(data.byte(kWithobject), data.byte(kWithtype), cupFull)) { + // Already full + showPuzText(14, 300); + showPuzText(); + putBackObStuff(); + } else { + showPuzText(35, 300); + putBackObStuff(); + } +} + } // End of namespace DreamGen -- cgit v1.2.3 From 9480b21840cd0e5e0d40ab8a88e0f7b5dac9be03 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 12 Dec 2011 23:58:20 +0200 Subject: DREAMWEB: Port 'useopenbox' to C++ --- engines/dreamweb/use.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index b8d7b7ca75..0ede2f485a 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1341,4 +1341,39 @@ void DreamGenContext::usePipe() { } } +void DreamGenContext::useOpenBox() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char cupEmpty[4] = { 'C', 'U', 'P', 'E' }; // TODO: convert to string with trailing zero + char cupFull[4] = { 'C', 'U', 'P', 'F' }; // TODO: convert to string with trailing zero + + if (compare(data.byte(kWithobject), data.byte(kWithtype), cupFull)) { + // Destroy open box + data.byte(kProgresspoints)++; + showPuzText(37, 300); + DynObject *exObject = getExAd(data.byte(kWithobject)); + exObject->id[3] = 'E'-'A'; // CUPF (full cup) -> CUPE (empty cup) + data.word(kWatchingtime) = 140; + data.word(kReeltowatch) = 105; + data.word(kEndwatchreel) = 181; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + turnPathOn(4); + data.byte(kGetback) = 1; + return; + } + + if (compare(data.byte(kWithobject), data.byte(kWithtype), cupEmpty)) { + // Open box wrong + showPuzText(38, 300); + putBackObStuff(); + return; + } + + showFirstUse(); +} + } // End of namespace DreamGen -- cgit v1.2.3 From 90c1793d4771a71af737d10dad8a2761c4696794 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 13 Dec 2011 00:11:05 +0200 Subject: DREAMWEB: Port 'useaxe', 'usekey' to C++ --- engines/dreamweb/use.cpp | 63 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 0ede2f485a..531f465010 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1376,4 +1376,67 @@ void DreamGenContext::useOpenBox() { showFirstUse(); } +void DreamGenContext::useAxe() { + if (data.byte(kReallocation) != 22) { + // Not in pool + showFirstUse(); + return; + } + + if (data.byte(kMapy) == 10) { + // Axe on door + al = 15; + cx = 300; + showPuzText(15, 300); + data.byte(kProgresspoints)++; + data.word(kWatchingtime) = 46*2; + data.word(kReeltowatch) = 31; + data.word(kEndwatchreel) = 77; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; + return; + } + + showSecondUse(); + data.byte(kProgresspoints)++; + data.byte(kLastweapon) = 2; + data.byte(kGetback) = 1; + removeObFromInv(); +} + +void DreamGenContext::useKey() { + switch(data.byte(kLocation)) { + case 5: + case 30: + if (data.byte(kMapx) == 22 && data.byte(kMapy) == 10) { + showPuzText(0, 300); + data.byte(kCounttoclose) = 100; + data.byte(kGetback) = 1; + } else { + // Wrong room + showPuzText(2, 200); + putBackObStuff(); + } + break; + case 21: + if (data.byte(kMapx) == 11 && data.byte(kMapy) == 10) { + showPuzText(3, 300); + data.byte(kNewlocation) = 30; + al = 2; + fadeScreenDown(); + showFirstUse(); + putBackObStuff(); + } else { + // Wrong room + showPuzText(2, 200); + putBackObStuff(); + } + default: + showPuzText(1, 200); + putBackObStuff(); + break; + } +} + } // End of namespace DreamGen -- cgit v1.2.3 From 6d2723400662c2b7d75bf6317807770b4d370caf Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 12 Dec 2011 23:41:45 +0100 Subject: DREAMWEB: Fix regression in usePipe --- engines/dreamweb/use.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 531f465010..f62daf9c9a 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1332,11 +1332,11 @@ void DreamGenContext::usePipe() { return; } else if (compare(data.byte(kWithobject), data.byte(kWithtype), cupFull)) { // Already full - showPuzText(14, 300); - showPuzText(); + showPuzText(35, 300); putBackObStuff(); } else { - showPuzText(35, 300); + showPuzText(14, 300); + showPuzText(); putBackObStuff(); } } @@ -1385,8 +1385,6 @@ void DreamGenContext::useAxe() { if (data.byte(kMapy) == 10) { // Axe on door - al = 15; - cx = 300; showPuzText(15, 300); data.byte(kProgresspoints)++; data.word(kWatchingtime) = 46*2; -- cgit v1.2.3 From b27a6e72ad63441c561866682bdebb0059db56a3 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 13 Dec 2011 01:02:41 +0200 Subject: DREAMWEB: Port 'runtap' to C++ --- engines/dreamweb/use.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index f62daf9c9a..c591eca826 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1376,6 +1376,36 @@ void DreamGenContext::useOpenBox() { showFirstUse(); } +void DreamGenContext::runTap() { + if (data.byte(kWithobject) == 255) { + withWhat(); + return; + } + + char cupEmpty[4] = { 'C', 'U', 'P', 'E' }; // TODO: convert to string with trailing zero + char cupFull[4] = { 'C', 'U', 'P', 'F' }; // TODO: convert to string with trailing zero + + if (compare(data.byte(kWithobject), data.byte(kWithtype), cupEmpty)) { + // Fill cup from tap + DynObject *exObject = getExAd(data.byte(kWithobject)); + exObject->id[3] = 'F'-'A'; // CUPE (empty cup) -> CUPF (full cup) + playChannel1(8); + showPuzText(57, 300); + putBackObStuff(); + return; + } + + if (compare(data.byte(kWithobject), data.byte(kWithtype), cupFull)) { + // Cup from tap full + showPuzText(58, 300); + putBackObStuff(); + return; + } + + showPuzText(56, 300); + putBackObStuff(); +} + void DreamGenContext::useAxe() { if (data.byte(kReallocation) != 22) { // Not in pool -- cgit v1.2.3 From 5af0deba87afaac279db04da52241b6ad1c6d723 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 14 Dec 2011 12:17:32 +0100 Subject: DREAMWEB: Cleanup --- engines/dreamweb/use.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index c591eca826..a144f850b6 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -139,7 +139,7 @@ void DreamGenContext::useRoutine() { } delPointer(); - uint8 *obText = getObTextStartCPP(); + const uint8 *obText = getObTextStartCPP(); if (findNextColon(&obText) != 0) { if (findNextColon(&obText) != 0) { if (*obText != 0) { @@ -178,7 +178,7 @@ void DreamGenContext::useText(const uint8 *string) { } void DreamGenContext::showFirstUse() { - uint8 *obText = getObTextStartCPP(); + const uint8 *obText = getObTextStartCPP(); findNextColon(&obText); findNextColon(&obText); useText(obText); @@ -186,7 +186,7 @@ void DreamGenContext::showFirstUse() { } void DreamGenContext::showSecondUse() { - uint8 *obText = getObTextStartCPP(); + const uint8 *obText = getObTextStartCPP(); findNextColon(&obText); findNextColon(&obText); findNextColon(&obText); -- cgit v1.2.3 From 5948b5a9e3b587fa257d7dea0ec32633060bbc38 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 14 Dec 2011 12:32:18 +0100 Subject: DREAMWEB: Allow quit from diary --- engines/dreamweb/use.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index a144f850b6..599cdf7334 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1213,7 +1213,8 @@ void DreamGenContext::useDiary() { dumpDiaryKeys(); dumpTextLine(); checkCoords(diaryList); - } while (!data.byte(kGetback)); + } while (!data.byte(kGetback) && !quitRequested()); + getRidOfTemp(); getRidOfTempText(); -- cgit v1.2.3 From ea8b6c8c6dd43ed0c645927966e4150cc987b5c6 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 15 Dec 2011 00:11:12 +0200 Subject: DREAMWEB: Port 'findsetobject' and 'findexobject' to C++ and simplify compare() --- engines/dreamweb/use.cpp | 94 ++++++++++++++++-------------------------------- 1 file changed, 30 insertions(+), 64 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 599cdf7334..f5d631aed5 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -747,8 +747,7 @@ bool DreamGenContext::defaultUseHandler(const char *id) { } void DreamGenContext::useChurchGate() { - char id[4] = { 'C', 'U', 'T', 'T' }; // TODO: convert to string with trailing zero - if (defaultUseHandler(id)) + if (defaultUseHandler("CUTT")) return; // Cut gate @@ -784,8 +783,7 @@ void DreamGenContext::useFullCart() { } void DreamGenContext::useClearBox() { - char id[4] = { 'R', 'A', 'I', 'L' }; // TODO: convert to string with trailing zero - if (defaultUseHandler(id)) + if (defaultUseHandler("RAIL")) return; // Open box @@ -800,8 +798,7 @@ void DreamGenContext::useClearBox() { } void DreamGenContext::openTVDoor() { - char id[4] = { 'U', 'L', 'O', 'K' }; // TODO: convert to string with trailing zero - if (defaultUseHandler(id)) + if (defaultUseHandler("ULOK")) return; // Key on TV @@ -816,9 +813,7 @@ void DreamGenContext::usePlate() { return; } - char screw[4] = { 'S', 'C', 'R', 'W' }; // TODO: convert to string with trailing zero - char knife[4] = { 'K', 'N', 'F', 'E' }; // TODO: convert to string with trailing zero - if (compare(data.byte(kWithobject), data.byte(kWithtype), screw)) { + if (compare(data.byte(kWithobject), data.byte(kWithtype), "SCRW")) { // Unscrew plate playChannel1(20); showFirstUse(); @@ -828,7 +823,7 @@ void DreamGenContext::usePlate() { placeFreeObject(0); data.byte(kProgresspoints)++; data.byte(kGetback) = 1; - } else if (compare(data.byte(kWithobject), data.byte(kWithtype), knife)) { + } else if (compare(data.byte(kWithobject), data.byte(kWithtype), "KNFE")) { // Tried knife showPuzText(54, 300); putBackObStuff(); @@ -845,8 +840,7 @@ void DreamGenContext::usePlinth() { return; } - char id[4] = { 'D', 'K', 'E', 'Y' }; // TODO: convert to string with trailing zero - if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { + if (!compare(data.byte(kWithobject), data.byte(kWithtype), "DKEY")) { // Wrong key showFirstUse(); putBackObStuff(); @@ -864,8 +858,7 @@ void DreamGenContext::usePlinth() { } void DreamGenContext::useElvDoor() { - char id[4] = { 'A', 'X', 'E', 'D' }; // TODO: convert to string with trailing zero - if (defaultUseHandler(id)) + if (defaultUseHandler("AXED")) return; // Axe on door @@ -899,8 +892,7 @@ void DreamGenContext::useWinch() { ah = 1; checkInside(); - char id[4] = { 'F', 'U', 'S', 'E' }; // TODO: convert to string with trailing zero - if (cl == kNumexobjects || !compare(cl, 4, id)) { + if (cl == kNumexobjects || !compare(cl, 4, "FUSE")) { // No winch showFirstUse(); putBackObStuff(); @@ -923,8 +915,7 @@ void DreamGenContext::useWinch() { } void DreamGenContext::useCart() { - char id[4] = { 'R', 'O', 'C', 'K' }; // TODO: convert to string with trailing zero - if (defaultUseHandler(id)) + if (defaultUseHandler("ROCK")) return; DynObject *exObject = getExAd(data.byte(kWithobject)); @@ -959,8 +950,7 @@ void DreamGenContext::chewy() { } void DreamGenContext::useHole() { - char id[4] = { 'H', 'N', 'D', 'A' }; // TODO: convert to string with trailing zero - if (defaultUseHandler(id)) + if (defaultUseHandler("HNDA")) return; showFirstUse(); @@ -972,8 +962,7 @@ void DreamGenContext::useHole() { } void DreamGenContext::openHotelDoor() { - char id[4] = { 'K', 'E', 'Y', 'A' }; // TODO: convert to string with trailing zero - if (defaultUseHandler(id)) + if (defaultUseHandler("KEYA")) return; playChannel1(16); @@ -983,8 +972,7 @@ void DreamGenContext::openHotelDoor() { } void DreamGenContext::openHotelDoor2() { - char id[4] = { 'K', 'E', 'Y', 'A' }; // TODO: convert to string with trailing zero - if (defaultUseHandler(id)) + if (defaultUseHandler("KEYA")) return; playChannel1(16); @@ -993,8 +981,7 @@ void DreamGenContext::openHotelDoor2() { } void DreamGenContext::grafittiDoor() { - char id[4] = { 'A', 'P', 'E', 'N' }; // TODO: convert to string with trailing zero - if (defaultUseHandler(id)) + if (defaultUseHandler("APEN")) return; showFirstUse(); @@ -1002,8 +989,7 @@ void DreamGenContext::grafittiDoor() { } void DreamGenContext::usePoolReader() { - char id[4] = { 'M', 'E', 'M', 'B' }; // TODO: convert to string with trailing zero - if (defaultUseHandler(id)) + if (defaultUseHandler("MEMB")) return; if (data.byte(kTalkedtoattendant) != 1) { @@ -1019,8 +1005,7 @@ void DreamGenContext::usePoolReader() { } void DreamGenContext::useCardReader1() { - char id[4] = { 'C', 'S', 'H', 'R' }; // TODO: convert to string with trailing zero - if (defaultUseHandler(id)) + if (defaultUseHandler("CSHR")) return; if (data.byte(kTalkedtosparky) == 0) { @@ -1042,8 +1027,7 @@ void DreamGenContext::useCardReader1() { } void DreamGenContext::useCardReader2() { - char id[4] = { 'C', 'S', 'H', 'R' }; // TODO: convert to string with trailing zero - if (defaultUseHandler(id)) + if (defaultUseHandler("CSHR")) return; if (data.byte(kTalkedtoboss) == 0) { @@ -1070,8 +1054,7 @@ void DreamGenContext::useCardReader2() { } void DreamGenContext::useCardReader3() { - char id[4] = { 'C', 'S', 'H', 'R' }; // TODO: convert to string with trailing zero - if (defaultUseHandler(id)) + if (defaultUseHandler("CSHR")) return; if (data.byte(kTalkedtorecep) == 0) { @@ -1098,8 +1081,7 @@ void DreamGenContext::useLighter() { return; } - char id[4] = { 'S', 'M', 'K', 'E' }; // TODO: convert to string with trailing zero - if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { + if (!compare(data.byte(kWithobject), data.byte(kWithtype), "SMKE")) { showFirstUse(); putBackObStuff(); } else { @@ -1116,8 +1098,7 @@ void DreamGenContext::useWire() { return; } - char knife[4] = { 'K', 'N', 'F', 'E' }; // TODO: convert to string with trailing zero - if (compare(data.byte(kWithobject), data.byte(kWithtype), knife)) { + if (compare(data.byte(kWithobject), data.byte(kWithtype), "KNFE")) { removeSetObject(51); placeSetObject(52); showPuzText(11, 300); @@ -1126,8 +1107,7 @@ void DreamGenContext::useWire() { return; } - char axe[4] = { 'A', 'X', 'E', 'D' }; // TODO: convert to string with trailing zero - if (compare(data.byte(kWithobject), data.byte(kWithtype), axe)) { + if (compare(data.byte(kWithobject), data.byte(kWithtype), "AXED")) { showPuzText(16, 300); putBackObStuff(); return; @@ -1231,8 +1211,7 @@ void DreamGenContext::useControl() { return; } - char key[4] = { 'K', 'E', 'Y', 'A' }; // TODO: convert to string with trailing zero - if (compare(data.byte(kWithobject), data.byte(kWithtype), key)) { // Right key + if (compare(data.byte(kWithobject), data.byte(kWithtype), "KEYA")) { // Right key playChannel1(16); if (data.byte(kLocation) == 21) { // Going down showPuzText(3, 300); @@ -1250,10 +1229,7 @@ void DreamGenContext::useControl() { } if (data.byte(kReallocation) == 21) { - char knife[4] = { 'K', 'N', 'F', 'E' }; // TODO: convert to string with trailing zero - char axe[4] = { 'A', 'X', 'E', 'D' }; // TODO: convert to string with trailing zero - - if (compare(data.byte(kWithobject), data.byte(kWithtype), knife)) { + if (compare(data.byte(kWithobject), data.byte(kWithtype), "KNFE")) { // Jimmy controls placeSetObject(50); placeSetObject(51); @@ -1265,7 +1241,7 @@ void DreamGenContext::useControl() { showPuzText(10, 300); data.byte(kProgresspoints)++; data.byte(kGetback) = 1; - } else if (compare(data.byte(kWithobject), data.byte(kWithtype), axe)) { + } else if (compare(data.byte(kWithobject), data.byte(kWithtype), "AXED")) { // Axe on controls showPuzText(16, 300); data.byte(kProgresspoints)++; @@ -1288,8 +1264,7 @@ void DreamGenContext::useSLab() { return; } - char id[4] = { 'J', 'E', 'W', 'L' }; // TODO: convert to string with trailing zero - if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { + if (!compare(data.byte(kWithobject), data.byte(kWithtype), "JEWL")) { showPuzText(14, 300); putBackObStuff(); return; @@ -1321,17 +1296,14 @@ void DreamGenContext::usePipe() { return; } - char cupEmpty[4] = { 'C', 'U', 'P', 'E' }; // TODO: convert to string with trailing zero - char cupFull[4] = { 'C', 'U', 'P', 'F' }; // TODO: convert to string with trailing zero - - if (compare(data.byte(kWithobject), data.byte(kWithtype), cupEmpty)) { + if (compare(data.byte(kWithobject), data.byte(kWithtype), "CUPE")) { // Fill cup showPuzText(36, 300); putBackObStuff(); DynObject *exObject = getExAd(data.byte(kWithobject)); exObject->id[3] = 'F'-'A'; // CUPE (empty cup) -> CUPF (full cup) return; - } else if (compare(data.byte(kWithobject), data.byte(kWithtype), cupFull)) { + } else if (compare(data.byte(kWithobject), data.byte(kWithtype), "CUPF")) { // Already full showPuzText(35, 300); putBackObStuff(); @@ -1348,10 +1320,7 @@ void DreamGenContext::useOpenBox() { return; } - char cupEmpty[4] = { 'C', 'U', 'P', 'E' }; // TODO: convert to string with trailing zero - char cupFull[4] = { 'C', 'U', 'P', 'F' }; // TODO: convert to string with trailing zero - - if (compare(data.byte(kWithobject), data.byte(kWithtype), cupFull)) { + if (compare(data.byte(kWithobject), data.byte(kWithtype), "CUPF")) { // Destroy open box data.byte(kProgresspoints)++; showPuzText(37, 300); @@ -1367,7 +1336,7 @@ void DreamGenContext::useOpenBox() { return; } - if (compare(data.byte(kWithobject), data.byte(kWithtype), cupEmpty)) { + if (compare(data.byte(kWithobject), data.byte(kWithtype), "CUPE")) { // Open box wrong showPuzText(38, 300); putBackObStuff(); @@ -1383,10 +1352,7 @@ void DreamGenContext::runTap() { return; } - char cupEmpty[4] = { 'C', 'U', 'P', 'E' }; // TODO: convert to string with trailing zero - char cupFull[4] = { 'C', 'U', 'P', 'F' }; // TODO: convert to string with trailing zero - - if (compare(data.byte(kWithobject), data.byte(kWithtype), cupEmpty)) { + if (compare(data.byte(kWithobject), data.byte(kWithtype), "CUPE")) { // Fill cup from tap DynObject *exObject = getExAd(data.byte(kWithobject)); exObject->id[3] = 'F'-'A'; // CUPE (empty cup) -> CUPF (full cup) @@ -1396,7 +1362,7 @@ void DreamGenContext::runTap() { return; } - if (compare(data.byte(kWithobject), data.byte(kWithtype), cupFull)) { + if (compare(data.byte(kWithobject), data.byte(kWithtype), "CUPF")) { // Cup from tap full showPuzText(58, 300); putBackObStuff(); -- cgit v1.2.3 From dd8304dd75e051460b96414ab3abac865a5af6e2 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 15 Dec 2011 00:43:08 +0200 Subject: DREAMWEB: Port 'usehandle', 'usealtar' to C++ --- engines/dreamweb/use.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index f5d631aed5..5306522c13 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1434,4 +1434,43 @@ void DreamGenContext::useKey() { } } +void DreamGenContext::useHandle() { + SetObject *object = getSetAd(findSetObject("CUTW")); + if (object->mapad[0] == 255) { + // Wire not cut + showPuzText(12, 300); + } else { + // Wire has been cut + showPuzText(13, 300); + data.byte(kNewlocation) = 22; + } + + data.byte(kGetback) = 1; +} + +void DreamGenContext::useAltar() { + if (findExObject("CNDA") == 114 || findExObject("CNDB") == 114) { + // Things on altar + showFirstUse(); + data.byte(kGetback) = 1; + return; + } + + if (data.byte(kCanmovealtar) == 1) { + // Move altar + data.byte(kProgresspoints)++; + showSecondUse(); + data.word(kWatchingtime) = 160; + data.word(kReeltowatch) = 81; + data.word(kEndwatchreel) = 174; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + DreamBase::setupTimedUse(47, 32, 98, 52, 76); + data.byte(kGetback) = 1; + } else { + showPuzText(23, 300); + data.byte(kGetback) = 1; + } +} + } // End of namespace DreamGen -- cgit v1.2.3 From 719f3ec1789005186c4cb86b10effa9ceee93866 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 15 Dec 2011 10:54:28 +0100 Subject: DREAMWEB: Convert a bunch of stuff to C++ Specifically, I started with openOb() and withWhat() which allowed to remove offset_commandline and offset_openchangesize. A clean conversion of these required a conversion of printMessage2 and getOpenedSize. --- engines/dreamweb/use.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 5306522c13..87b3640e03 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1473,4 +1473,27 @@ void DreamGenContext::useAltar() { } } +void DreamGenContext::withWhat() { + uint8 commandLine[64] = "OBJECT NAME ONE "; + + createPanel(); + showPanel(); + showMan(); + showExit(); + + copyName(data.byte(kObjecttype), data.byte(kCommand), commandLine); + printMessage2(100, 21, 63, 200, false, 2); + printDirect(commandLine, data.word(kLastxpos) + 5, 21, 220, false); + printMessage2(data.word(kLastxpos) + 5, 21, 63, 200, false, 3); + + fillRyan(); + data.byte(kCommandtype) = 255; + readMouse(); + showPointer(); + workToScreen(); + delPointer(); + data.byte(kInvopen) = 2; +} + + } // End of namespace DreamGen -- cgit v1.2.3 From d1ed87beceb68a2b33db9989e6a480bbda6a73d1 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 15 Dec 2011 14:09:53 +0100 Subject: DREAMWEB: Convert notHeldError to C++, move stuff to DreamBase --- engines/dreamweb/use.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 87b3640e03..08b96cf33a 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1495,5 +1495,16 @@ void DreamGenContext::withWhat() { data.byte(kInvopen) = 2; } +void DreamGenContext::notHeldError() { + createPanel(); + showPanel(); + showMan(); + showExit(); + obIcons(); + printMessage2(64, 100, 63, 200 + 1, true, 1); + workToScreenM(); + hangOnP(50); + putBackObStuff(); +} } // End of namespace DreamGen -- cgit v1.2.3 From f878f0453a88ee5b11cfc0c755c2bfcd2a9ad6f9 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 16 Dec 2011 16:24:41 +0100 Subject: DREAMWEB: Convert useGun to C++ --- engines/dreamweb/use.cpp | 112 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 08b96cf33a..b0666bab33 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -764,6 +764,118 @@ void DreamGenContext::useChurchGate() { turnPathOn(2); // Open church } +void DreamGenContext::useGun() { + + if (data.byte(kObjecttype) != 4) { + // gun is not taken + showSecondUse(); + putBackObStuff(); + + } else if (data.byte(kReallocation) == 22) { + // in pool room + showPuzText(34, 300); + data.byte(kLastweapon) = 1; + data.byte(kCombatcount) = 39; + data.byte(kGetback) = 1; + data.byte(kProgresspoints)++; + + } else if (data.byte(kReallocation) == 25) { + // helicopter + showPuzText(34, 300); + data.byte(kLastweapon) = 1; + data.byte(kCombatcount) = 19; + data.byte(kGetback) = 1; + data.byte(kDreamnumber) = 2; + data.byte(kRoomafterdream) = 38; + data.byte(kSartaindead) = 1; + data.byte(kProgresspoints)++; + + } else if (data.byte(kReallocation) == 27) { + // in rock room + showPuzText(46, 300); + data.byte(kPointermode) = 2; + data.byte(kRockstardead) = 1; + data.byte(kLastweapon) = 1; + data.byte(kNewsitem) = 1; + data.byte(kGetback) = 1; + data.byte(kRoomafterdream) = 32; + data.byte(kDreamnumber) = 0; + data.byte(kProgresspoints)++; + + } else if (data.byte(kReallocation) == 8 && data.byte(kMapx) == 22 && data.byte(kMapy) == 40 + && !isSetObOnMap(92) && data.byte(kManspath) != 9) { + // by studio + data.byte(kDestination) = 9; + data.byte(kFinaldest) = 9; + autoSetWalk(); + data.byte(kLastweapon) = 1; + data.byte(kGetback) = 1; + data.byte(kProgresspoints)++; + + } else if (data.byte(kReallocation) == 6 && data.byte(kMapx) == 11 && data.byte(kMapy) == 20 + && isSetObOnMap(5)) { + // sarters + data.byte(kDestination) = 1; + data.byte(kFinaldest) = 1; + autoSetWalk(); + removeSetObject(5); + placeSetObject(6); + turnAnyPathOn(1, data.byte(kRoomnum) - 1); + data.byte(kLiftflag) = 1; + data.word(kWatchingtime) = 40*2; + data.word(kReeltowatch) = 4; + data.word(kEndwatchreel) = 43; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; + data.byte(kProgresspoints)++; + + } else if (data.byte(kReallocation) == 29) { + // aide + data.byte(kGetback) = 1; + al = 13; + resetLocation(); + setLocation(12); + data.byte(kDestpos) = 12; + data.byte(kDestination) = 2; + data.byte(kFinaldest) = 2; + autoSetWalk(); + data.word(kWatchingtime) = 164*2; + data.word(kReeltowatch) = 3; + data.word(kEndwatchreel) = 164; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kAidedead) = 1; + data.byte(kDreamnumber) = 3; + data.byte(kRoomafterdream) = 33; + data.byte(kProgresspoints)++; + + } else if (data.byte(kReallocation) == 23 && data.byte(kMapx) == 0 && data.byte(kMapy) == 50) { + // with boss + if (data.byte(kManspath) != 5) { + data.byte(kDestination) = 5; + data.byte(kFinaldest) = 5; + autoSetWalk(); + } + data.byte(kLastweapon) = 1; + data.byte(kGetback) = 1; + + } else if (data.byte(kReallocation) == 8 && data.byte(kMapx) == 11 && data.byte(kMapy) == 10) { + // tv soldier + if (data.byte(kManspath) != 2) { + data.byte(kDestination) = 2; + data.byte(kFinaldest) = 2; + autoSetWalk(); + } + data.byte(kLastweapon) = 1; + data.byte(kGetback) = 1; + + } else { + showFirstUse(); + putBackObStuff(); + } +} + void DreamGenContext::useFullCart() { data.byte(kProgresspoints)++; turnAnyPathOn(2, data.byte(kRoomnum) + 6); -- cgit v1.2.3 From 202f9d18f142544339ecd70c13e30243b5325682 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 16 Dec 2011 16:38:21 +0100 Subject: DREAMWEB: Move more things to DreamBase; cleanup some code --- engines/dreamweb/use.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index b0666bab33..4e956cd016 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -975,7 +975,7 @@ void DreamGenContext::useElvDoor() { // Axe on door showPuzText(15, 300); - _inc(data.byte(kProgresspoints)); + data.byte(kProgresspoints)++; data.word(kWatchingtime) = 46 * 2; data.word(kReeltowatch) = 31; data.word(kEndwatchreel) = 77; @@ -1288,10 +1288,10 @@ void DreamGenContext::useDiary() { data.byte(kGetback) = 0; RectWithCallback diaryList[] = { - { kDiaryx+94,kDiaryx+110,kDiaryy+97,kDiaryy+113,&DreamGenContext::diaryKeyN }, - { kDiaryx+151,kDiaryx+167,kDiaryy+71,kDiaryy+87,&DreamGenContext::diaryKeyP }, - { kDiaryx+176,kDiaryx+192,kDiaryy+108,kDiaryy+124,&DreamGenContext::quitKey }, - { 0,320,0,200,&DreamGenContext::blank }, + { kDiaryx+94,kDiaryx+110,kDiaryy+97,kDiaryy+113,&DreamBase::diaryKeyN }, + { kDiaryx+151,kDiaryx+167,kDiaryy+71,kDiaryy+87,&DreamBase::diaryKeyP }, + { kDiaryx+176,kDiaryx+192,kDiaryy+108,kDiaryy+124,&DreamBase::quitKey }, + { 0,320,0,200,&DreamBase::blank }, { 0xFFFF,0,0,0,0 } }; -- cgit v1.2.3 From 12cac260c9acb16180ab4414fecd5748d77886f3 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 16 Dec 2011 22:04:47 +0200 Subject: DREAMWEB: Port 'isryanholding' to C++ --- engines/dreamweb/use.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 4e956cd016..385bfbb101 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -625,13 +625,7 @@ void DreamGenContext::sLabDoorB() { data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; } else { - al = 'S'; - ah = 'H'; - cl = 'L'; - ch = 'D'; - isRyanHolding(); - - if (flags.z()) { + if (isRyanHolding("SHLD")) { // No crystal showPuzText(44, 200); putBackObStuff(); -- cgit v1.2.3 From 654a60a90cfec631893598325dbfc5ab8adbfa35 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 17 Dec 2011 00:01:45 +0200 Subject: DREAMWEB: Rewrote useCashCard() in C++ and got rid of moneyPoke() and its associated offsets in the data blob --- engines/dreamweb/use.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 385bfbb101..6b59faf401 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1613,4 +1613,33 @@ void DreamGenContext::notHeldError() { putBackObStuff(); } +void DreamGenContext::useCashCard() { + getRidOfReels(); + loadKeypad(); + createPanel(); + showPanel(); + showExit(); + showMan(); + uint16 y = (!data.byte(kForeignrelease)) ? 120 : 120 - 3; + showFrame(tempGraphics(), 114, y, 39, 0); + const uint8 *obText = getObTextStartCPP(); + findNextColon(&obText); + findNextColon(&obText); + y = 98; + printDirect(&obText, 36, &y, 36, 36 & 1); + char amountStr[10]; + sprintf(amountStr, "%04d", data.word(kCard1money) / 10); + data.word(kCharshift) = 91 * 2 + 75; + printDirect((const uint8 *)amountStr, 160, 155, 240, 240 & 1); + sprintf(amountStr, "%02d", (data.word(kCard1money) % 10) * 10); + data.word(kCharshift) = 91 * 2 + 85; + printDirect((const uint8 *)amountStr, 187, 155, 240, 240 & 1); + data.word(kCharshift) = 0; + workToScreenM(); + hangOnP(400); + getRidOfTemp(); + restoreReels(); + putBackObStuff(); +} + } // End of namespace DreamGen -- cgit v1.2.3 From b371c46af9d5dd7e1282a9e227a853e0d2054fb2 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 17 Dec 2011 00:41:30 +0200 Subject: DREAMWEB: Port 'checkinside' to C++ --- engines/dreamweb/use.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 6b59faf401..b4e7efdb4f 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -994,11 +994,7 @@ void DreamGenContext::useObject() { } void DreamGenContext::useWinch() { - al = 40; - ah = 1; - checkInside(); - - if (cl == kNumexobjects || !compare(cl, 4, "FUSE")) { + if (checkInside(40, 1) == kNumexobjects || !compare(cl, 4, "FUSE")) { // No winch showFirstUse(); putBackObStuff(); @@ -1244,11 +1240,7 @@ void DreamGenContext::hotelControl() { } void DreamGenContext::useCooker() { - al = data.byte(kCommand); - ah = data.byte(kObjecttype); - checkInside(); - - if (cl == 114) + if (checkInside(data.byte(kCommand), data.byte(kObjecttype)) == kNumexobjects) showFirstUse(); else showSecondUse(); // Food inside -- cgit v1.2.3 From f9d4886e50dc87535c34ec7c12c1e53fed3a3910 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 17 Dec 2011 02:04:31 +0200 Subject: DREAMWEB: Port 'usestereo' to C++ --- engines/dreamweb/use.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index b4e7efdb4f..4be3c7a6b3 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1634,4 +1634,34 @@ void DreamGenContext::useCashCard() { putBackObStuff(); } +void DreamGenContext::useStereo() { + if (data.byte(kLocation) != 0) { + showPuzText(4, 400); + putBackObStuff(); + } else if (data.byte(kMapx) != 11) { + showPuzText(5, 400); + putBackObStuff(); + } else if (checkInside(findSetObject("CDPL"), 1) == kNumexobjects) { + // No CD inside + showPuzText(6, 400); + putBackObStuff(); + // TODO: Use the C++ version of getAnyAd() + getAnyAd(); + es.byte(bx + 10) = 255; + } else { + // CD inside + getAnyAd(); + es.byte(bx + 10) ^= 1; + if (es.byte(bx + 10) != 255) { + // Stereo off + showPuzText(7, 400); + } else { + // Stereo on + showPuzText(8, 400); + } + + putBackObStuff(); + } +} + } // End of namespace DreamGen -- cgit v1.2.3 From 3185dac25e2f1984ccf92e7c33eee12caa6cd676 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 17 Dec 2011 16:39:01 +0100 Subject: DREAMWEB: Work around runtime limitation The WordRef accessor writes back its value too late. Example: in the call printDirect(data.word(kLastxpos), .....) the destructor isn't called until after printDirect returns. This destroys the modifications to lastXPos that printDirect makes. --- engines/dreamweb/use.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 4be3c7a6b3..ba1e8e4952 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1581,7 +1581,8 @@ void DreamGenContext::withWhat() { copyName(data.byte(kObjecttype), data.byte(kCommand), commandLine); printMessage2(100, 21, 63, 200, false, 2); - printDirect(commandLine, data.word(kLastxpos) + 5, 21, 220, false); + uint16 x = data.word(kLastxpos) + 5; + printDirect(commandLine, x, 21, 220, false); printMessage2(data.word(kLastxpos) + 5, 21, 63, 200, false, 3); fillRyan(); -- cgit v1.2.3 From 656409c72bd4142781fc369a496b026edb2cb87c Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 17 Dec 2011 23:28:26 +0100 Subject: DREAMWEB: Fix regression in slabdoorb --- engines/dreamweb/use.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index ba1e8e4952..5b6e3f8dff 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -625,7 +625,7 @@ void DreamGenContext::sLabDoorB() { data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; } else { - if (isRyanHolding("SHLD")) { + if (!isRyanHolding("SHLD")) { // No crystal showPuzText(44, 200); putBackObStuff(); -- cgit v1.2.3 From 421c8cd2624a9e8ac2f0091ef1b51b42f99dae26 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 18 Dec 2011 11:25:49 +0200 Subject: DREAMWEB: Port 'setpickup' to C++ and added an enum for the object types --- engines/dreamweb/use.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 5b6e3f8dff..06cb5a9131 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -760,7 +760,7 @@ void DreamGenContext::useChurchGate() { void DreamGenContext::useGun() { - if (data.byte(kObjecttype) != 4) { + if (data.byte(kObjecttype) != kExObjectType) { // gun is not taken showSecondUse(); putBackObStuff(); -- cgit v1.2.3 From f0508dd05a2840a98f98d3a215b5a859d757e653 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sun, 18 Dec 2011 14:08:32 +0100 Subject: DREAMWEB: Fix regression in useWinch --- engines/dreamweb/use.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 06cb5a9131..5a80a33bd5 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -994,7 +994,8 @@ void DreamGenContext::useObject() { } void DreamGenContext::useWinch() { - if (checkInside(40, 1) == kNumexobjects || !compare(cl, 4, "FUSE")) { + uint16 contentIndex = checkInside(40, 1); + if (contentIndex == kNumexobjects || !compare(contentIndex, kExObjectType, "FUSE")) { // No winch showFirstUse(); putBackObStuff(); -- cgit v1.2.3 From 8c8666e811d1b68fec400f4100a02146e0e1235b Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 18 Dec 2011 13:04:45 +0100 Subject: DREAMWEB: Move backdrop.cpp and more to DreamBase; remove some dead code --- engines/dreamweb/use.cpp | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 5a80a33bd5..5cb1f6b92c 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -163,10 +163,6 @@ void DreamGenContext::useRoutine() { data.byte(kCommandtype) = 255; } -void DreamGenContext::useText() { - useText(es.ptr(si, 0)); -} - void DreamGenContext::useText(const uint8 *string) { createPanel(); showPanel(); @@ -1408,7 +1404,6 @@ void DreamGenContext::usePipe() { putBackObStuff(); } else { showPuzText(14, 300); - showPuzText(); putBackObStuff(); } } @@ -1572,7 +1567,7 @@ void DreamGenContext::useAltar() { } } -void DreamGenContext::withWhat() { +void DreamBase::withWhat() { uint8 commandLine[64] = "OBJECT NAME ONE "; createPanel(); @@ -1590,7 +1585,7 @@ void DreamGenContext::withWhat() { data.byte(kCommandtype) = 255; readMouse(); showPointer(); - workToScreen(); + workToScreenCPP(); delPointer(); data.byte(kInvopen) = 2; } @@ -1666,4 +1661,27 @@ void DreamGenContext::useStereo() { } } +uint16 DreamBase::checkInside(uint16 command, uint16 type) { + for (uint16 index = 0; index < kNumexobjects; index++) { + DynObject *object = getExAd(index); + if (object->mapad[1] == command && object->mapad[0] == type) + return index; + } + + return kNumexobjects; +} + +void DreamBase::showPuzText(uint16 command, uint16 count) { + createPanel(); + showPanel(); + showMan(); + showExit(); + obIcons(); + uint16 offset = kTextstart + getSegment(data.word(kPuzzletext)).word(command * 2); + const uint8 *string = getSegment(data.word(kPuzzletext)).ptr(offset, 0); + printDirect(string, 36, 104, 241, 241 & 1); + workToScreenM(); + hangOnP(count); +} + } // End of namespace DreamGen -- cgit v1.2.3 From cdc6bc421bef6ed0119819a92fba1b2b9283ce17 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 20 Dec 2011 09:44:00 +0100 Subject: DREAMWEB: Turn RectWithCallback into template Also moves checkCoords to DreamBase, adding a nasty cast to it. This is a temporary HACK, which allows moving functions that use checkCoords to DreamBase one at a time, instead of all at once (and at the same time as checkCoords). This can be undone once everything using checkCoords has been moved to DreamBase. --- engines/dreamweb/use.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 5cb1f6b92c..7765215827 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1270,7 +1270,7 @@ void DreamGenContext::useDiary() { delPointer(); data.byte(kGetback) = 0; - RectWithCallback diaryList[] = { + RectWithCallback diaryList[] = { { kDiaryx+94,kDiaryx+110,kDiaryy+97,kDiaryy+113,&DreamBase::diaryKeyN }, { kDiaryx+151,kDiaryx+167,kDiaryy+71,kDiaryy+87,&DreamBase::diaryKeyP }, { kDiaryx+176,kDiaryx+192,kDiaryy+108,kDiaryy+124,&DreamBase::quitKey }, -- cgit v1.2.3 From ef98df589563d77625928b69be79f7227e97d4a7 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 20 Dec 2011 10:27:02 +0100 Subject: DREAMWEB: cleanup --- engines/dreamweb/use.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 7765215827..f6406dc773 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1270,7 +1270,7 @@ void DreamGenContext::useDiary() { delPointer(); data.byte(kGetback) = 0; - RectWithCallback diaryList[] = { + RectWithCallback diaryList[] = { { kDiaryx+94,kDiaryx+110,kDiaryy+97,kDiaryy+113,&DreamBase::diaryKeyN }, { kDiaryx+151,kDiaryx+167,kDiaryy+71,kDiaryy+87,&DreamBase::diaryKeyP }, { kDiaryx+176,kDiaryx+192,kDiaryy+108,kDiaryy+124,&DreamBase::quitKey }, -- cgit v1.2.3 From b6e139d112b08d9280c145ae40f6324be6707efe Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 20 Dec 2011 11:23:51 +0100 Subject: DREAMWEB: Convert resetLocation and purgeALocation to C++ --- engines/dreamweb/use.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index f6406dc773..d3dda0e0a0 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -823,8 +823,7 @@ void DreamGenContext::useGun() { } else if (data.byte(kReallocation) == 29) { // aide data.byte(kGetback) = 1; - al = 13; - resetLocation(); + resetLocation(13); setLocation(12); data.byte(kDestpos) = 12; data.byte(kDestination) = 2; -- cgit v1.2.3 From f6d63ae6a8adeb182d404274b856c03bb40bae4a Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 24 Dec 2011 00:34:56 +0200 Subject: DREAMWEB: Use the C++ versions of getAnyAd and makeWorn in some places This allows us to remove the ASM style version of makeWorn() --- engines/dreamweb/use.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index d3dda0e0a0..b642598589 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -363,8 +363,8 @@ void DreamGenContext::wearWatch() { showFirstUse(); data.byte(kWatchon) = 1; data.byte(kGetback) = 1; - getAnyAd(); - makeWorn(); + uint8 dummy; + makeWorn((DynObject *)getAnyAd(&dummy, &dummy)); } } @@ -377,8 +377,8 @@ void DreamGenContext::wearShades() { data.byte(kShadeson) = 1; showFirstUse(); data.byte(kGetback) = 1; - getAnyAd(); - makeWorn(); + uint8 dummy; + makeWorn((DynObject *)getAnyAd(&dummy, &dummy)); } } @@ -1027,13 +1027,13 @@ void DreamGenContext::useCart() { } void DreamGenContext::useTrainer() { - // TODO: Use the C++ version of getAnyAd() - getAnyAd(); - if (es.byte(bx + 2) != 4) { + uint8 dummy; + DynObject *object = (DynObject *)getAnyAd(&dummy, &dummy); + if (object->mapad[0] != 4) { notHeldError(); } else { data.byte(kProgresspoints)++; - makeWorn(); + makeWorn(object); showSecondUse(); putBackObStuff(); } -- cgit v1.2.3 From 64b7aee081af753366bdd2000e73f24b28b226e8 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 24 Dec 2011 00:28:45 +0100 Subject: DREAMWEB: Minor cleanup --- engines/dreamweb/use.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index b642598589..aa7c2bddea 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -128,11 +128,12 @@ void DreamGenContext::useRoutine() { } getAnyAd(); - const uint8 *id = es.ptr(bx + 12, 4); + // CHECKME: Do the callbacks use es:bx ? + void *obj = es.ptr(bx, 15); for (size_t i = 0; i < sizeof(kUseList)/sizeof(UseListEntry); ++i) { const UseListEntry &entry = kUseList[i]; - if (('A' + id[0] == entry.id[0]) && ('A' + id[1] == entry.id[1]) && ('A' + id[2] == entry.id[2]) && ('A' + id[3] == entry.id[3])) { + if (objectMatches(obj, entry.id)) { (this->*entry.callback)(); return; } -- cgit v1.2.3 From b9839635eab502b640c29e23bdbb20240b2bf440 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 24 Dec 2011 12:23:24 +0100 Subject: DREAMWEB: Convert getObTextStart --- engines/dreamweb/use.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index aa7c2bddea..e891298f2b 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -140,7 +140,7 @@ void DreamGenContext::useRoutine() { } delPointer(); - const uint8 *obText = getObTextStartCPP(); + const uint8 *obText = getObTextStart(); if (findNextColon(&obText) != 0) { if (findNextColon(&obText) != 0) { if (*obText != 0) { @@ -175,7 +175,7 @@ void DreamGenContext::useText(const uint8 *string) { } void DreamGenContext::showFirstUse() { - const uint8 *obText = getObTextStartCPP(); + const uint8 *obText = getObTextStart(); findNextColon(&obText); findNextColon(&obText); useText(obText); @@ -183,7 +183,7 @@ void DreamGenContext::showFirstUse() { } void DreamGenContext::showSecondUse() { - const uint8 *obText = getObTextStartCPP(); + const uint8 *obText = getObTextStart(); findNextColon(&obText); findNextColon(&obText); findNextColon(&obText); @@ -1611,7 +1611,7 @@ void DreamGenContext::useCashCard() { showMan(); uint16 y = (!data.byte(kForeignrelease)) ? 120 : 120 - 3; showFrame(tempGraphics(), 114, y, 39, 0); - const uint8 *obText = getObTextStartCPP(); + const uint8 *obText = getObTextStart(); findNextColon(&obText); findNextColon(&obText); y = 98; -- cgit v1.2.3 From bcf789274f605a0f4901399f767a1da40444fa79 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 24 Dec 2011 13:39:27 +0100 Subject: DREAMWEB: Move many use-related functions to DreamBase --- engines/dreamweb/use.cpp | 290 +++++++++++++++++++++++------------------------ 1 file changed, 145 insertions(+), 145 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index e891298f2b..bbcf028b78 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -40,85 +40,85 @@ void DreamGenContext::useRoutine() { static const UseListEntry kUseList[] = { { &DreamGenContext::useMon, "NETW" }, { &DreamGenContext::useElevator1, "ELVA" }, - { &DreamGenContext::useElevator2, "ELVB" }, - { &DreamGenContext::useElevator3, "ELVC" }, - { &DreamGenContext::useElevator4, "ELVE" }, - { &DreamGenContext::useElevator5, "ELVF" }, - { &DreamGenContext::useChurchGate, "CGAT" }, + { &DreamBase::useElevator2, "ELVB" }, + { &DreamBase::useElevator3, "ELVC" }, + { &DreamBase::useElevator4, "ELVE" }, + { &DreamBase::useElevator5, "ELVF" }, + { &DreamBase::useChurchGate, "CGAT" }, { &DreamGenContext::useStereo, "REMO" }, { &DreamGenContext::useButtonA, "BUTA" }, - { &DreamGenContext::useWinch, "CBOX" }, - { &DreamGenContext::useLighter, "LITE" }, - { &DreamGenContext::usePlate, "PLAT" }, - { &DreamGenContext::useControl, "LIFT" }, - { &DreamGenContext::useWire, "WIRE" }, - { &DreamGenContext::useHandle, "HNDL" }, - { &DreamGenContext::useHatch, "HACH" }, - { &DreamGenContext::useElvDoor, "DOOR" }, - { &DreamGenContext::useCashCard, "CSHR" }, - { &DreamGenContext::useGun, "GUNA" }, - { &DreamGenContext::useCardReader1, "CRAA" }, - { &DreamGenContext::useCardReader2, "CRBB" }, - { &DreamGenContext::useCardReader3, "CRCC" }, - { &DreamGenContext::sitDownInBar, "SEAT" }, + { &DreamBase::useWinch, "CBOX" }, + { &DreamBase::useLighter, "LITE" }, + { &DreamBase::usePlate, "PLAT" }, + { &DreamBase::useControl, "LIFT" }, + { &DreamBase::useWire, "WIRE" }, + { &DreamBase::useHandle, "HNDL" }, + { &DreamBase::useHatch, "HACH" }, + { &DreamBase::useElvDoor, "DOOR" }, + { &DreamBase::useCashCard, "CSHR" }, + { &DreamBase::useGun, "GUNA" }, + { &DreamBase::useCardReader1, "CRAA" }, + { &DreamBase::useCardReader2, "CRBB" }, + { &DreamBase::useCardReader3, "CRCC" }, + { &DreamBase::sitDownInBar, "SEAT" }, { &DreamGenContext::useMenu, "MENU" }, - { &DreamGenContext::useCooker, "COOK" }, - { &DreamGenContext::callHotelLift, "ELCA" }, - { &DreamGenContext::callEdensLift, "EDCA" }, - { &DreamGenContext::callEdensDLift, "DDCA" }, - { &DreamGenContext::useAltar, "ALTR" }, - { &DreamGenContext::openHotelDoor, "LOKA" }, - { &DreamGenContext::openHotelDoor2, "LOKB" }, - { &DreamGenContext::openLouis, "ENTA" }, - { &DreamGenContext::openRyan, "ENTB" }, - { &DreamGenContext::openPoolBoss, "ENTE" }, - { &DreamGenContext::openYourNeighbour, "ENTC" }, - { &DreamGenContext::openEden, "ENTD" }, - { &DreamGenContext::openSarters, "ENTH" }, + { &DreamBase::useCooker, "COOK" }, + { &DreamBase::callHotelLift, "ELCA" }, + { &DreamBase::callEdensLift, "EDCA" }, + { &DreamBase::callEdensDLift, "DDCA" }, + { &DreamBase::useAltar, "ALTR" }, + { &DreamBase::openHotelDoor, "LOKA" }, + { &DreamBase::openHotelDoor2, "LOKB" }, + { &DreamBase::openLouis, "ENTA" }, + { &DreamBase::openRyan, "ENTB" }, + { &DreamBase::openPoolBoss, "ENTE" }, + { &DreamBase::openYourNeighbour, "ENTC" }, + { &DreamBase::openEden, "ENTD" }, + { &DreamBase::openSarters, "ENTH" }, { &DreamGenContext::wearWatch, "WWAT" }, - { &DreamGenContext::usePoolReader, "POOL" }, + { &DreamBase::usePoolReader, "POOL" }, { &DreamGenContext::wearShades, "WSHD" }, - { &DreamGenContext::grafittiDoor, "GRAF" }, - { &DreamGenContext::trapDoor, "TRAP" }, - { &DreamGenContext::edensCDPlayer, "CDPE" }, - { &DreamGenContext::openTVDoor, "DLOK" }, - { &DreamGenContext::useHole, "HOLE" }, - { &DreamGenContext::useDryer, "DRYR" }, - { &DreamGenContext::useChurchHole, "HOLY" }, - { &DreamGenContext::useWall, "WALL" }, - { &DreamGenContext::useDiary, "BOOK" }, - { &DreamGenContext::useAxe, "AXED" }, - { &DreamGenContext::useShield, "SHLD" }, - { &DreamGenContext::useRailing, "BCNY" }, - { &DreamGenContext::useCoveredBox, "LIDC" }, - { &DreamGenContext::useClearBox, "LIDU" }, - { &DreamGenContext::useOpenBox, "LIDO" }, - { &DreamGenContext::usePipe, "PIPE" }, - { &DreamGenContext::useBalcony, "BALC" }, - { &DreamGenContext::useWindow, "WIND" }, - { &DreamGenContext::viewFolder, "PAPR" }, + { &DreamBase::grafittiDoor, "GRAF" }, + { &DreamBase::trapDoor, "TRAP" }, + { &DreamBase::edensCDPlayer, "CDPE" }, + { &DreamBase::openTVDoor, "DLOK" }, + { &DreamBase::useHole, "HOLE" }, + { &DreamBase::useDryer, "DRYR" }, + { &DreamBase::useChurchHole, "HOLY" }, + { &DreamBase::useWall, "WALL" }, + { &DreamBase::useDiary, "BOOK" }, + { &DreamBase::useAxe, "AXED" }, + { &DreamBase::useShield, "SHLD" }, + { &DreamBase::useRailing, "BCNY" }, + { &DreamBase::useCoveredBox, "LIDC" }, + { &DreamBase::useClearBox, "LIDU" }, + { &DreamBase::useOpenBox, "LIDO" }, + { &DreamBase::usePipe, "PIPE" }, + { &DreamBase::useBalcony, "BALC" }, + { &DreamBase::useWindow, "WIND" }, + { &DreamBase::viewFolder, "PAPR" }, { &DreamGenContext::useTrainer, "UWTA" }, { &DreamGenContext::useTrainer, "UWTB" }, { &DreamGenContext::enterSymbol, "STAT" }, - { &DreamGenContext::openTomb, "TLID" }, - { &DreamGenContext::useSLab, "SLAB" }, - { &DreamGenContext::useCart, "CART" }, - { &DreamGenContext::useFullCart, "FCAR" }, - { &DreamGenContext::sLabDoorA, "SLBA" }, - { &DreamGenContext::sLabDoorB, "SLBB" }, - { &DreamGenContext::sLabDoorC, "SLBC" }, - { &DreamGenContext::sLabDoorD, "SLBD" }, - { &DreamGenContext::sLabDoorE, "SLBE" }, - { &DreamGenContext::sLabDoorF, "SLBF" }, - { &DreamGenContext::usePlinth, "PLIN" }, - { &DreamGenContext::useLadder, "LADD" }, - { &DreamGenContext::useLadderB, "LADB" }, + { &DreamBase::openTomb, "TLID" }, + { &DreamBase::useSlab, "SLAB" }, + { &DreamBase::useCart, "CART" }, + { &DreamBase::useFullCart, "FCAR" }, + { &DreamBase::slabDoorA, "SLBA" }, + { &DreamBase::slabDoorB, "SLBB" }, + { &DreamBase::slabDoorC, "SLBC" }, + { &DreamBase::slabDoorD, "SLBD" }, + { &DreamBase::slabDoorE, "SLBE" }, + { &DreamBase::slabDoorF, "SLBF" }, + { &DreamBase::usePlinth, "PLIN" }, + { &DreamBase::useLadder, "LADD" }, + { &DreamBase::useLadderB, "LADB" }, { &DreamGenContext::chewy, "GUMA" }, - { &DreamGenContext::wheelSound, "SQEE" }, - { &DreamGenContext::runTap, "TAPP" }, - { &DreamGenContext::playGuitar, "GUIT" }, - { &DreamGenContext::hotelControl, "CONT" }, - { &DreamGenContext::hotelBell, "BELL" }, + { &DreamBase::wheelSound, "SQEE" }, + { &DreamBase::runTap, "TAPP" }, + { &DreamBase::playGuitar, "GUIT" }, + { &DreamBase::hotelControl, "CONT" }, + { &DreamBase::hotelBell, "BELL" }, }; if (data.byte(kReallocation) >= 50) { @@ -164,7 +164,7 @@ void DreamGenContext::useRoutine() { data.byte(kCommandtype) = 255; } -void DreamGenContext::useText(const uint8 *string) { +void DreamBase::useText(const uint8 *string) { createPanel(); showPanel(); showMan(); @@ -174,7 +174,7 @@ void DreamGenContext::useText(const uint8 *string) { workToScreenM(); } -void DreamGenContext::showFirstUse() { +void DreamBase::showFirstUse() { const uint8 *obText = getObTextStart(); findNextColon(&obText); findNextColon(&obText); @@ -182,7 +182,7 @@ void DreamGenContext::showFirstUse() { hangOnP(400); } -void DreamGenContext::showSecondUse() { +void DreamBase::showSecondUse() { const uint8 *obText = getObTextStart(); findNextColon(&obText); findNextColon(&obText); @@ -191,7 +191,7 @@ void DreamGenContext::showSecondUse() { hangOnP(400); } -void DreamGenContext::viewFolder() { +void DreamBase::viewFolder() { data.byte(kManisoffscreen) = 1; getRidOfAll(); loadFolder(); @@ -220,7 +220,7 @@ void DreamGenContext::viewFolder() { workToScreenM(); } -void DreamGenContext::edensCDPlayer() { +void DreamBase::edensCDPlayer() { showFirstUse(); data.word(kWatchingtime) = 18 * 2; data.word(kReeltowatch) = 25; @@ -230,13 +230,13 @@ void DreamGenContext::edensCDPlayer() { data.byte(kGetback) = 1; } -void DreamGenContext::hotelBell() { +void DreamBase::hotelBell() { playChannel1(12); showFirstUse(); putBackObStuff(); } -void DreamGenContext::playGuitar() { +void DreamBase::playGuitar() { playChannel1(14); showFirstUse(); putBackObStuff(); @@ -248,7 +248,7 @@ void DreamGenContext::useElevator1() { data.byte(kGetback) = 1; } -void DreamGenContext::useElevator2() { +void DreamBase::useElevator2() { showFirstUse(); if (data.byte(kLocation) == 23) // In pool hall @@ -262,7 +262,7 @@ void DreamGenContext::useElevator2() { data.byte(kGetback) = 1; } -void DreamGenContext::useElevator3() { +void DreamBase::useElevator3() { showFirstUse(); data.byte(kCounttoclose) = 20; data.byte(kNewlocation) = 34; @@ -274,7 +274,7 @@ void DreamGenContext::useElevator3() { data.byte(kGetback) = 1; } -void DreamGenContext::useElevator4() { +void DreamBase::useElevator4() { showFirstUse(); data.word(kReeltowatch) = 0; data.word(kEndwatchreel) = 11; @@ -286,7 +286,7 @@ void DreamGenContext::useElevator4() { data.byte(kNewlocation) = 24; } -void DreamGenContext::useElevator5() { +void DreamBase::useElevator5() { placeSetObject(4); removeSetObject(0); data.byte(kNewlocation) = 20; @@ -296,19 +296,19 @@ void DreamGenContext::useElevator5() { data.byte(kGetback) = 1; } -void DreamGenContext::useHatch() { +void DreamBase::useHatch() { showFirstUse(); data.byte(kNewlocation) = 40; data.byte(kGetback) = 1; } -void DreamGenContext::wheelSound() { +void DreamBase::wheelSound() { playChannel1(17); showFirstUse(); putBackObStuff(); } -void DreamGenContext::callHotelLift() { +void DreamBase::callHotelLift() { playChannel1(12); showFirstUse(); data.byte(kCounttoopen) = 8; @@ -319,7 +319,7 @@ void DreamGenContext::callHotelLift() { turnPathOn(4); } -void DreamGenContext::useShield() { +void DreamBase::useShield() { if (data.byte(kReallocation) != 20 || data.byte(kCombatcount) == 0) { // Not in Sart room showFirstUse(); @@ -333,7 +333,7 @@ void DreamGenContext::useShield() { } } -void DreamGenContext::useCoveredBox() { +void DreamBase::useCoveredBox() { data.byte(kProgresspoints)++; showFirstUse(); data.word(kWatchingtime) = 50; @@ -344,7 +344,7 @@ void DreamGenContext::useCoveredBox() { data.byte(kGetback) = 1; } -void DreamGenContext::useRailing() { +void DreamBase::useRailing() { showFirstUse(); data.word(kWatchingtime) = 80; data.word(kReeltowatch) = 0; @@ -383,7 +383,7 @@ void DreamGenContext::wearShades() { } } -void DreamGenContext::useChurchHole() { +void DreamBase::useChurchHole() { showFirstUse(); data.byte(kGetback) = 1; data.word(kWatchingtime) = 28; @@ -393,7 +393,7 @@ void DreamGenContext::useChurchHole() { data.byte(kSpeedcount) = 1; } -void DreamGenContext::sitDownInBar() { +void DreamBase::sitDownInBar() { if (data.byte(kWatchmode) != 0xFF) { // Sat down showSecondUse(); @@ -411,13 +411,13 @@ void DreamGenContext::sitDownInBar() { } } -void DreamGenContext::useDryer() { +void DreamBase::useDryer() { playChannel1(12); showFirstUse(); data.byte(kGetback) = 1; } -void DreamGenContext::useBalcony() { +void DreamBase::useBalcony() { showFirstUse(); turnPathOn(6); turnPathOff(0); @@ -441,7 +441,7 @@ void DreamGenContext::useBalcony() { data.byte(kGetback) = 1; } -void DreamGenContext::useWindow() { +void DreamBase::useWindow() { if (data.byte(kManspath) != 6) { // Not on balcony showSecondUse(); @@ -454,7 +454,7 @@ void DreamGenContext::useWindow() { } } -void DreamGenContext::trapDoor() { +void DreamBase::trapDoor() { data.byte(kProgresspoints)++; showFirstUse(); switchRyanOff(); @@ -467,14 +467,14 @@ void DreamGenContext::trapDoor() { data.byte(kGetback) = 1; } -void DreamGenContext::callEdensLift() { +void DreamBase::callEdensLift() { showFirstUse(); data.byte(kCounttoopen) = 8; data.byte(kGetback) = 1; turnPathOn(2); } -void DreamGenContext::callEdensDLift() { +void DreamBase::callEdensDLift() { if (data.byte(kLiftflag) == 1) { // Eden's D here showSecondUse(); @@ -487,38 +487,38 @@ void DreamGenContext::callEdensDLift() { } } -void DreamGenContext::openYourNeighbour() { +void DreamBase::openYourNeighbour() { enterCode(255, 255, 255, 255); data.byte(kGetback) = 1; } -void DreamGenContext::openRyan() { +void DreamBase::openRyan() { enterCode(5, 1, 0, 6); data.byte(kGetback) = 1; } -void DreamGenContext::openPoolBoss() { +void DreamBase::openPoolBoss() { enterCode(5, 2, 2, 2); data.byte(kGetback) = 1; } -void DreamGenContext::openEden() { +void DreamBase::openEden() { enterCode(2, 8, 6, 5); data.byte(kGetback) = 1; } -void DreamGenContext::openSarters() { +void DreamBase::openSarters() { enterCode(7, 8, 3, 3); data.byte(kGetback) = 1; } -void DreamGenContext::openLouis() { +void DreamBase::openLouis() { enterCode(5, 2, 3, 8); data.byte(kGetback) = 1; } -void DreamGenContext::useWall() { +void DreamBase::useWall() { showFirstUse(); if (data.byte(kManspath) != 3) { @@ -561,7 +561,7 @@ void DreamGenContext::useWall() { } } -void DreamGenContext::useLadder() { +void DreamBase::useLadder() { showFirstUse(); data.byte(kMapx) = data.byte(kMapx) - 11; findRoomInLoc(); @@ -575,7 +575,7 @@ void DreamGenContext::useLadder() { data.byte(kGetback) = 1; } -void DreamGenContext::useLadderB() { +void DreamBase::useLadderB() { showFirstUse(); data.byte(kMapx) = data.byte(kMapx) + 11; findRoomInLoc(); @@ -589,7 +589,7 @@ void DreamGenContext::useLadderB() { data.byte(kGetback) = 1; } -void DreamGenContext::sLabDoorA() { +void DreamBase::slabDoorA() { showFirstUse(); data.byte(kGetback) = 1; data.byte(kWatchspeed) = 1; @@ -609,7 +609,7 @@ void DreamGenContext::sLabDoorA() { } } -void DreamGenContext::sLabDoorB() { +void DreamBase::slabDoorB() { if (data.byte(kDreamnumber) != 1) { // Wrong showFirstUse(); @@ -641,7 +641,7 @@ void DreamGenContext::sLabDoorB() { } } -void DreamGenContext::sLabDoorC() { +void DreamBase::slabDoorC() { showFirstUse(); data.byte(kGetback) = 1; data.byte(kWatchspeed) = 1; @@ -661,7 +661,7 @@ void DreamGenContext::sLabDoorC() { } } -void DreamGenContext::sLabDoorD() { +void DreamBase::slabDoorD() { showFirstUse(); data.byte(kGetback) = 1; data.byte(kWatchspeed) = 1; @@ -681,7 +681,7 @@ void DreamGenContext::sLabDoorD() { } } -void DreamGenContext::sLabDoorE() { +void DreamBase::slabDoorE() { showFirstUse(); data.byte(kGetback) = 1; data.byte(kWatchspeed) = 1; @@ -701,7 +701,7 @@ void DreamGenContext::sLabDoorE() { } } -void DreamGenContext::sLabDoorF() { +void DreamBase::slabDoorF() { showFirstUse(); data.byte(kGetback) = 1; data.byte(kWatchspeed) = 1; @@ -721,7 +721,7 @@ void DreamGenContext::sLabDoorF() { } } -bool DreamGenContext::defaultUseHandler(const char *id) { +bool DreamBase::defaultUseHandler(const char *id) { if (data.byte(kWithobject) == 255) { withWhat(); return true; // event handled @@ -737,7 +737,7 @@ bool DreamGenContext::defaultUseHandler(const char *id) { return false; // continue with the original event } -void DreamGenContext::useChurchGate() { +void DreamBase::useChurchGate() { if (defaultUseHandler("CUTT")) return; @@ -755,7 +755,7 @@ void DreamGenContext::useChurchGate() { turnPathOn(2); // Open church } -void DreamGenContext::useGun() { +void DreamBase::useGun() { if (data.byte(kObjecttype) != kExObjectType) { // gun is not taken @@ -866,7 +866,7 @@ void DreamGenContext::useGun() { } } -void DreamGenContext::useFullCart() { +void DreamBase::useFullCart() { data.byte(kProgresspoints)++; turnAnyPathOn(2, data.byte(kRoomnum) + 6); data.byte(kManspath) = 4; @@ -884,7 +884,7 @@ void DreamGenContext::useFullCart() { data.byte(kGetback) = 1; } -void DreamGenContext::useClearBox() { +void DreamBase::useClearBox() { if (defaultUseHandler("RAIL")) return; @@ -899,7 +899,7 @@ void DreamGenContext::useClearBox() { data.byte(kGetback) = 1; } -void DreamGenContext::openTVDoor() { +void DreamBase::openTVDoor() { if (defaultUseHandler("ULOK")) return; @@ -909,7 +909,7 @@ void DreamGenContext::openTVDoor() { data.byte(kGetback) = 1; } -void DreamGenContext::usePlate() { +void DreamBase::usePlate() { if (data.byte(kWithobject) == 255) { withWhat(); return; @@ -936,7 +936,7 @@ void DreamGenContext::usePlate() { } } -void DreamGenContext::usePlinth() { +void DreamBase::usePlinth() { if (data.byte(kWithobject) == 255) { withWhat(); return; @@ -959,7 +959,7 @@ void DreamGenContext::usePlinth() { } } -void DreamGenContext::useElvDoor() { +void DreamBase::useElvDoor() { if (defaultUseHandler("AXED")) return; @@ -989,7 +989,7 @@ void DreamGenContext::useObject() { useRoutine(); } -void DreamGenContext::useWinch() { +void DreamBase::useWinch() { uint16 contentIndex = checkInside(40, 1); if (contentIndex == kNumexobjects || !compare(contentIndex, kExObjectType, "FUSE")) { // No winch @@ -1013,7 +1013,7 @@ void DreamGenContext::useWinch() { data.byte(kProgresspoints)++; } -void DreamGenContext::useCart() { +void DreamBase::useCart() { if (defaultUseHandler("ROCK")) return; @@ -1048,7 +1048,7 @@ void DreamGenContext::chewy() { data.byte(kGetback) = 1; } -void DreamGenContext::useHole() { +void DreamBase::useHole() { if (defaultUseHandler("HNDA")) return; @@ -1060,7 +1060,7 @@ void DreamGenContext::useHole() { data.byte(kGetback) = 1; } -void DreamGenContext::openHotelDoor() { +void DreamBase::openHotelDoor() { if (defaultUseHandler("KEYA")) return; @@ -1070,7 +1070,7 @@ void DreamGenContext::openHotelDoor() { data.byte(kGetback) = 1; } -void DreamGenContext::openHotelDoor2() { +void DreamBase::openHotelDoor2() { if (defaultUseHandler("KEYA")) return; @@ -1079,7 +1079,7 @@ void DreamGenContext::openHotelDoor2() { putBackObStuff(); } -void DreamGenContext::grafittiDoor() { +void DreamBase::grafittiDoor() { if (defaultUseHandler("APEN")) return; @@ -1087,7 +1087,7 @@ void DreamGenContext::grafittiDoor() { putBackObStuff(); } -void DreamGenContext::usePoolReader() { +void DreamBase::usePoolReader() { if (defaultUseHandler("MEMB")) return; @@ -1103,7 +1103,7 @@ void DreamGenContext::usePoolReader() { } } -void DreamGenContext::useCardReader1() { +void DreamBase::useCardReader1() { if (defaultUseHandler("CSHR")) return; @@ -1125,7 +1125,7 @@ void DreamGenContext::useCardReader1() { } } -void DreamGenContext::useCardReader2() { +void DreamBase::useCardReader2() { if (defaultUseHandler("CSHR")) return; @@ -1152,7 +1152,7 @@ void DreamGenContext::useCardReader2() { } } -void DreamGenContext::useCardReader3() { +void DreamBase::useCardReader3() { if (defaultUseHandler("CSHR")) return; @@ -1174,7 +1174,7 @@ void DreamGenContext::useCardReader3() { } } -void DreamGenContext::useLighter() { +void DreamBase::useLighter() { if (data.byte(kWithobject) == 255) { withWhat(); return; @@ -1191,7 +1191,7 @@ void DreamGenContext::useLighter() { } } -void DreamGenContext::useWire() { +void DreamBase::useWire() { if (data.byte(kWithobject) == 255) { withWhat(); return; @@ -1216,7 +1216,7 @@ void DreamGenContext::useWire() { putBackObStuff(); } -void DreamGenContext::openTomb() { +void DreamBase::openTomb() { data.byte(kProgresspoints)++; showFirstUse(); data.word(kWatchingtime) = 35 * 2; @@ -1227,7 +1227,7 @@ void DreamGenContext::openTomb() { data.byte(kGetback) = 1; } -void DreamGenContext::hotelControl() { +void DreamBase::hotelControl() { if (data.byte(kReallocation) != 21 || data.byte(kMapx) != 33) showSecondUse(); // Not right control else @@ -1236,7 +1236,7 @@ void DreamGenContext::hotelControl() { putBackObStuff(); } -void DreamGenContext::useCooker() { +void DreamBase::useCooker() { if (checkInside(data.byte(kCommand), data.byte(kObjecttype)) == kNumexobjects) showFirstUse(); else @@ -1254,7 +1254,7 @@ void DreamBase::removeFreeObject(uint8 index) { getFreeAd(index)->mapad[0] = 0xFF; } -void DreamGenContext::useDiary() { +void DreamBase::useDiary() { getRidOfReels(); loadIntoTemp("DREAMWEB.G14"); loadTempText("DREAMWEB.T51"); @@ -1300,7 +1300,7 @@ void DreamGenContext::useDiary() { workToScreenM(); } -void DreamGenContext::useControl() { +void DreamBase::useControl() { if (data.byte(kWithobject) == 255) { withWhat(); return; @@ -1353,7 +1353,7 @@ void DreamGenContext::useControl() { } } -void DreamGenContext::useSLab() { +void DreamBase::useSlab() { if (data.byte(kWithobject) == 255) { withWhat(); return; @@ -1385,7 +1385,7 @@ void DreamGenContext::useSLab() { data.byte(kGetback) = 1; } -void DreamGenContext::usePipe() { +void DreamBase::usePipe() { if (data.byte(kWithobject) == 255) { withWhat(); return; @@ -1408,7 +1408,7 @@ void DreamGenContext::usePipe() { } } -void DreamGenContext::useOpenBox() { +void DreamBase::useOpenBox() { if (data.byte(kWithobject) == 255) { withWhat(); return; @@ -1440,7 +1440,7 @@ void DreamGenContext::useOpenBox() { showFirstUse(); } -void DreamGenContext::runTap() { +void DreamBase::runTap() { if (data.byte(kWithobject) == 255) { withWhat(); return; @@ -1467,7 +1467,7 @@ void DreamGenContext::runTap() { putBackObStuff(); } -void DreamGenContext::useAxe() { +void DreamBase::useAxe() { if (data.byte(kReallocation) != 22) { // Not in pool showFirstUse(); @@ -1528,7 +1528,7 @@ void DreamGenContext::useKey() { } } -void DreamGenContext::useHandle() { +void DreamBase::useHandle() { SetObject *object = getSetAd(findSetObject("CUTW")); if (object->mapad[0] == 255) { // Wire not cut @@ -1542,7 +1542,7 @@ void DreamGenContext::useHandle() { data.byte(kGetback) = 1; } -void DreamGenContext::useAltar() { +void DreamBase::useAltar() { if (findExObject("CNDA") == 114 || findExObject("CNDB") == 114) { // Things on altar showFirstUse(); @@ -1590,7 +1590,7 @@ void DreamBase::withWhat() { data.byte(kInvopen) = 2; } -void DreamGenContext::notHeldError() { +void DreamBase::notHeldError() { createPanel(); showPanel(); showMan(); @@ -1602,7 +1602,7 @@ void DreamGenContext::notHeldError() { putBackObStuff(); } -void DreamGenContext::useCashCard() { +void DreamBase::useCashCard() { getRidOfReels(); loadKeypad(); createPanel(); -- cgit v1.2.3 From 42068065b57993c865823ff56e81bd7a87aa0278 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 24 Dec 2011 13:55:56 +0100 Subject: DREAMWEB: Move more functions to DreamBase --- engines/dreamweb/use.cpp | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index bbcf028b78..47c9ae62b8 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -46,7 +46,7 @@ void DreamGenContext::useRoutine() { { &DreamBase::useElevator5, "ELVF" }, { &DreamBase::useChurchGate, "CGAT" }, { &DreamGenContext::useStereo, "REMO" }, - { &DreamGenContext::useButtonA, "BUTA" }, + { &DreamBase::useButtonA, "BUTA" }, { &DreamBase::useWinch, "CBOX" }, { &DreamBase::useLighter, "LITE" }, { &DreamBase::usePlate, "PLAT" }, @@ -61,7 +61,7 @@ void DreamGenContext::useRoutine() { { &DreamBase::useCardReader2, "CRBB" }, { &DreamBase::useCardReader3, "CRCC" }, { &DreamBase::sitDownInBar, "SEAT" }, - { &DreamGenContext::useMenu, "MENU" }, + { &DreamBase::useMenu, "MENU" }, { &DreamBase::useCooker, "COOK" }, { &DreamBase::callHotelLift, "ELCA" }, { &DreamBase::callEdensLift, "EDCA" }, @@ -75,9 +75,9 @@ void DreamGenContext::useRoutine() { { &DreamBase::openYourNeighbour, "ENTC" }, { &DreamBase::openEden, "ENTD" }, { &DreamBase::openSarters, "ENTH" }, - { &DreamGenContext::wearWatch, "WWAT" }, + { &DreamBase::wearWatch, "WWAT" }, { &DreamBase::usePoolReader, "POOL" }, - { &DreamGenContext::wearShades, "WSHD" }, + { &DreamBase::wearShades, "WSHD" }, { &DreamBase::grafittiDoor, "GRAF" }, { &DreamBase::trapDoor, "TRAP" }, { &DreamBase::edensCDPlayer, "CDPE" }, @@ -97,8 +97,8 @@ void DreamGenContext::useRoutine() { { &DreamBase::useBalcony, "BALC" }, { &DreamBase::useWindow, "WIND" }, { &DreamBase::viewFolder, "PAPR" }, - { &DreamGenContext::useTrainer, "UWTA" }, - { &DreamGenContext::useTrainer, "UWTB" }, + { &DreamBase::useTrainer, "UWTA" }, + { &DreamBase::useTrainer, "UWTB" }, { &DreamGenContext::enterSymbol, "STAT" }, { &DreamBase::openTomb, "TLID" }, { &DreamBase::useSlab, "SLAB" }, @@ -355,7 +355,7 @@ void DreamBase::useRailing() { data.byte(kMandead) = 4; } -void DreamGenContext::wearWatch() { +void DreamBase::wearWatch() { if (data.byte(kWatchon) == 1) { // Already wearing watch showSecondUse(); @@ -369,7 +369,7 @@ void DreamGenContext::wearWatch() { } } -void DreamGenContext::wearShades() { +void DreamBase::wearShades() { if (data.byte(kShadeson) == 1) { // Already wearing shades showSecondUse(); @@ -1027,7 +1027,7 @@ void DreamBase::useCart() { data.byte(kGetback) = 1; } -void DreamGenContext::useTrainer() { +void DreamBase::useTrainer() { uint8 dummy; DynObject *object = (DynObject *)getAnyAd(&dummy, &dummy); if (object->mapad[0] != 4) { @@ -1684,4 +1684,25 @@ void DreamBase::showPuzText(uint16 command, uint16 count) { hangOnP(count); } +void DreamBase::useButtonA() { + if (!isSetObOnMap(95)) { + showFirstUse(); + turnAnyPathOn(0, data.byte(kRoomnum) - 1); + removeSetObject(9); + placeSetObject(95); + data.word(kWatchingtime) = 15 * 2; + data.word(kReeltowatch) = 71; + data.word(kEndwatchreel) = 85; + data.byte(kWatchspeed) = 1; + data.byte(kSpeedcount) = 1; + data.byte(kGetback) = 1; + data.byte(kProgresspoints)++; + } else { + // Done this bit + showSecondUse(); + putBackObStuff(); + } +} + + } // End of namespace DreamGen -- cgit v1.2.3 From 3802b21183b148f1c8d43cc8d2e550afed6e9e6a Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 25 Dec 2011 15:07:56 +0200 Subject: DREAMWEB: Move some functions to DreamBase --- engines/dreamweb/use.cpp | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 47c9ae62b8..eeda27780c 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -45,7 +45,7 @@ void DreamGenContext::useRoutine() { { &DreamBase::useElevator4, "ELVE" }, { &DreamBase::useElevator5, "ELVF" }, { &DreamBase::useChurchGate, "CGAT" }, - { &DreamGenContext::useStereo, "REMO" }, + { &DreamBase::useStereo, "REMO" }, { &DreamBase::useButtonA, "BUTA" }, { &DreamBase::useWinch, "CBOX" }, { &DreamBase::useLighter, "LITE" }, @@ -113,7 +113,7 @@ void DreamGenContext::useRoutine() { { &DreamBase::usePlinth, "PLIN" }, { &DreamBase::useLadder, "LADD" }, { &DreamBase::useLadderB, "LADB" }, - { &DreamGenContext::chewy, "GUMA" }, + { &DreamBase::chewy, "GUMA" }, { &DreamBase::wheelSound, "SQEE" }, { &DreamBase::runTap, "TAPP" }, { &DreamBase::playGuitar, "GUIT" }, @@ -242,6 +242,7 @@ void DreamBase::playGuitar() { putBackObStuff(); } +// TODO: Move to DreamBase once selectLocation (in reality, locationPic) is moved void DreamGenContext::useElevator1() { showFirstUse(); selectLocation(); @@ -1040,11 +1041,12 @@ void DreamBase::useTrainer() { } } -void DreamGenContext::chewy() { +void DreamBase::chewy() { + // Chewing a gum showFirstUse(); - // TODO: Use the C++ version of getAnyAd() - getAnyAd(); - es.byte(bx + 2) = 255; + uint8 dummy; + DynObject *object = (DynObject *)getAnyAd(&dummy, &dummy); + object->mapad[0] = 255; data.byte(kGetback) = 1; } @@ -1631,7 +1633,10 @@ void DreamBase::useCashCard() { putBackObStuff(); } -void DreamGenContext::useStereo() { +void DreamBase::useStereo() { + // Handles the stereo in Ryan's apartment (accessible from the remote on + // the couch) + if (data.byte(kLocation) != 0) { showPuzText(4, 400); putBackObStuff(); @@ -1642,20 +1647,18 @@ void DreamGenContext::useStereo() { // No CD inside showPuzText(6, 400); putBackObStuff(); - // TODO: Use the C++ version of getAnyAd() - getAnyAd(); - es.byte(bx + 10) = 255; + uint8 dummy; + DynObject *object = (DynObject *)getAnyAd(&dummy, &dummy); + object->turnedOn = 255; } else { // CD inside - getAnyAd(); - es.byte(bx + 10) ^= 1; - if (es.byte(bx + 10) != 255) { - // Stereo off - showPuzText(7, 400); - } else { - // Stereo on - showPuzText(8, 400); - } + uint8 dummy; + DynObject *object = (DynObject *)getAnyAd(&dummy, &dummy); + object->turnedOn ^= 1; + if (object->turnedOn != 255) + showPuzText(7, 400); // Stereo off + else + showPuzText(8, 400); // Stereo on putBackObStuff(); } -- cgit v1.2.3 From e322d6257dae83761c86c9d5bfbc7d02c0a9988d Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 25 Dec 2011 16:33:30 +0200 Subject: DREAMWEB: Port 'locationpic', 'reexfrominv' to C++ --- engines/dreamweb/use.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index eeda27780c..41b338e885 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -242,7 +242,7 @@ void DreamBase::playGuitar() { putBackObStuff(); } -// TODO: Move to DreamBase once selectLocation (in reality, locationPic) is moved +// TODO: Move to DreamBase once selectLocation (in reality, getDestInfo) is moved void DreamGenContext::useElevator1() { showFirstUse(); selectLocation(); -- cgit v1.2.3 From 6dbc930b18c43c12138d68c34a12bc015e28354d Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 25 Dec 2011 19:48:49 +0200 Subject: DREAMWEB: Remove getDestInfo() from locationPic This allows to move some more functions into DreamBase --- engines/dreamweb/use.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 41b338e885..78dffc99ad 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -39,7 +39,7 @@ void DreamGenContext::useRoutine() { static const UseListEntry kUseList[] = { { &DreamGenContext::useMon, "NETW" }, - { &DreamGenContext::useElevator1, "ELVA" }, + { &DreamBase::useElevator1, "ELVA" }, { &DreamBase::useElevator2, "ELVB" }, { &DreamBase::useElevator3, "ELVC" }, { &DreamBase::useElevator4, "ELVE" }, @@ -242,8 +242,7 @@ void DreamBase::playGuitar() { putBackObStuff(); } -// TODO: Move to DreamBase once selectLocation (in reality, getDestInfo) is moved -void DreamGenContext::useElevator1() { +void DreamBase::useElevator1() { showFirstUse(); selectLocation(); data.byte(kGetback) = 1; -- cgit v1.2.3 From 04a147921f1259e8874c7f9b723e8b3a8158f8c8 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 26 Dec 2011 00:59:04 +0100 Subject: DREAMWEB: Rename workToScreenCPP to workToScreen --- engines/dreamweb/use.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 78dffc99ad..8aa735d84f 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1267,7 +1267,7 @@ void DreamBase::useDiary() { showDiaryPage(); readMouse(); showPointer(); - workToScreenCPP(); + workToScreen(); delPointer(); data.byte(kGetback) = 0; @@ -1586,7 +1586,7 @@ void DreamBase::withWhat() { data.byte(kCommandtype) = 255; readMouse(); showPointer(); - workToScreenCPP(); + workToScreen(); delPointer(); data.byte(kInvopen) = 2; } -- cgit v1.2.3 From 2db59ab3111746df973641bf960b68765671ff22 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 26 Dec 2011 12:58:19 +0100 Subject: DREAMWEB: Move even more use-related functions to DreamBase --- engines/dreamweb/use.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 8aa735d84f..24ea58e252 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -99,7 +99,7 @@ void DreamGenContext::useRoutine() { { &DreamBase::viewFolder, "PAPR" }, { &DreamBase::useTrainer, "UWTA" }, { &DreamBase::useTrainer, "UWTB" }, - { &DreamGenContext::enterSymbol, "STAT" }, + { &DreamBase::enterSymbol, "STAT" }, { &DreamBase::openTomb, "TLID" }, { &DreamBase::useSlab, "SLAB" }, { &DreamBase::useCart, "CART" }, -- cgit v1.2.3 From 8c3488a973fb93895d542c0b55548bb96101b187 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 26 Dec 2011 16:53:28 +0200 Subject: DREAMWEB: Remove the now unused ASM style versions of getanyad, getexad, getfreead and getsetad --- engines/dreamweb/use.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 24ea58e252..25ed8d50e5 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -127,9 +127,8 @@ void DreamGenContext::useRoutine() { data.byte(kPointerpower) = 0; } - getAnyAd(); - // CHECKME: Do the callbacks use es:bx ? - void *obj = es.ptr(bx, 15); + uint8 dummy; + void *obj = getAnyAd(&dummy, &dummy); for (size_t i = 0; i < sizeof(kUseList)/sizeof(UseListEntry); ++i) { const UseListEntry &entry = kUseList[i]; -- cgit v1.2.3 From 4c66f74b58e9a2c191f22a37f485047dd19be131 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 26 Dec 2011 22:09:47 +0200 Subject: DREAMWEB: Remove dead code and move most functions to DreamBase --- engines/dreamweb/use.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 25ed8d50e5..0f31c766b5 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1494,7 +1494,7 @@ void DreamBase::useAxe() { removeObFromInv(); } -void DreamGenContext::useKey() { +void DreamBase::useKey() { switch(data.byte(kLocation)) { case 5: case 30: @@ -1512,7 +1512,6 @@ void DreamGenContext::useKey() { if (data.byte(kMapx) == 11 && data.byte(kMapy) == 10) { showPuzText(3, 300); data.byte(kNewlocation) = 30; - al = 2; fadeScreenDown(); showFirstUse(); putBackObStuff(); -- cgit v1.2.3 From 1ba4f0a1a8965ee141987693770d2bcd3b74c292 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 26 Dec 2011 22:31:50 +0200 Subject: Revert "DREAMWEB: Remove dead code and move most functions to DreamBase" This reverts commit 4c66f74b58e9a2c191f22a37f485047dd19be131. These functions aren't ready to be moved yet till the remaining two are finished, and they're so crossreferenced that the safest thing to do is revert this commit and break it down to smaller chunks --- engines/dreamweb/use.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 0f31c766b5..25ed8d50e5 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1494,7 +1494,7 @@ void DreamBase::useAxe() { removeObFromInv(); } -void DreamBase::useKey() { +void DreamGenContext::useKey() { switch(data.byte(kLocation)) { case 5: case 30: @@ -1512,6 +1512,7 @@ void DreamBase::useKey() { if (data.byte(kMapx) == 11 && data.byte(kMapy) == 10) { showPuzText(3, 300); data.byte(kNewlocation) = 30; + al = 2; fadeScreenDown(); showFirstUse(); putBackObStuff(); -- cgit v1.2.3 From 2bbc1cbd6ae367eb2e36813fd8617b2c1751585c Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 27 Dec 2011 01:19:19 +0100 Subject: DREAMWEB: Clean up monitor functions --- engines/dreamweb/use.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 25ed8d50e5..3e38215cca 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -25,7 +25,7 @@ namespace DreamGen { -typedef void (DreamGenContext::*UseCallback)(void); +typedef void (DreamBase::*UseCallback)(void); // Note: The callback pointer has been placed before the // ID to keep MSVC happy (otherwise, it throws warnings @@ -38,7 +38,7 @@ struct UseListEntry { void DreamGenContext::useRoutine() { static const UseListEntry kUseList[] = { - { &DreamGenContext::useMon, "NETW" }, + { &DreamBase::useMon, "NETW" }, { &DreamBase::useElevator1, "ELVA" }, { &DreamBase::useElevator2, "ELVB" }, { &DreamBase::useElevator3, "ELVC" }, -- cgit v1.2.3 From 4027e635d50b510e322480c039bcc39449d096df Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 27 Dec 2011 02:42:33 +0200 Subject: DREAMWEB: Remove dead code --- engines/dreamweb/use.cpp | 34 ---------------------------------- 1 file changed, 34 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 3e38215cca..34c68cfd34 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1494,40 +1494,6 @@ void DreamBase::useAxe() { removeObFromInv(); } -void DreamGenContext::useKey() { - switch(data.byte(kLocation)) { - case 5: - case 30: - if (data.byte(kMapx) == 22 && data.byte(kMapy) == 10) { - showPuzText(0, 300); - data.byte(kCounttoclose) = 100; - data.byte(kGetback) = 1; - } else { - // Wrong room - showPuzText(2, 200); - putBackObStuff(); - } - break; - case 21: - if (data.byte(kMapx) == 11 && data.byte(kMapy) == 10) { - showPuzText(3, 300); - data.byte(kNewlocation) = 30; - al = 2; - fadeScreenDown(); - showFirstUse(); - putBackObStuff(); - } else { - // Wrong room - showPuzText(2, 200); - putBackObStuff(); - } - default: - showPuzText(1, 200); - putBackObStuff(); - break; - } -} - void DreamBase::useHandle() { SetObject *object = getSetAd(findSetObject("CUTW")); if (object->mapad[0] == 255) { -- cgit v1.2.3 From 0be53a88d626b484b9db30f3d89534d5d237a073 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 27 Dec 2011 01:43:54 +0100 Subject: DREAMWEB: Move remaining use functions to DreamBase --- engines/dreamweb/use.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 34c68cfd34..dc76cf30fd 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -35,7 +35,7 @@ struct UseListEntry { const char *id; }; -void DreamGenContext::useRoutine() { +void DreamBase::useRoutine() { static const UseListEntry kUseList[] = { { &DreamBase::useMon, "NETW" }, @@ -973,7 +973,7 @@ void DreamBase::useElvDoor() { data.byte(kGetback) = 1; } -void DreamGenContext::useObject() { +void DreamBase::useObject() { data.byte(kWithobject) = 255; if (data.byte(kCommandtype) != 229) { -- cgit v1.2.3 From 5cfa1899bdea96a2e1dc505b4cfdbbe96ae13c02 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Tue, 27 Dec 2011 03:08:43 +0000 Subject: DREAMWEB: Move kQuitRequested out of data blob. --- engines/dreamweb/use.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index dc76cf30fd..a7d80b8a03 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -199,7 +199,7 @@ void DreamBase::viewFolder() { workToScreenM(); data.byte(kGetback) = 0; do { - if (quitRequested()) + if (_quitRequested) break; delPointer(); readMouse(); @@ -1288,7 +1288,7 @@ void DreamBase::useDiary() { dumpDiaryKeys(); dumpTextLine(); checkCoords(diaryList); - } while (!data.byte(kGetback) && !quitRequested()); + } while (!data.byte(kGetback) && !_quitRequested); getRidOfTemp(); -- cgit v1.2.3 From 52569194347516f855f3d35003949b6557dfa1f2 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Tue, 27 Dec 2011 04:12:16 +0000 Subject: DREAMWEB: Move kSubtitles out of data blob. --- engines/dreamweb/use.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index a7d80b8a03..280d78ba55 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1575,7 +1575,7 @@ void DreamBase::useCashCard() { showPanel(); showExit(); showMan(); - uint16 y = (!data.byte(kForeignrelease)) ? 120 : 120 - 3; + uint16 y = (!_foreignRelease) ? 120 : 120 - 3; showFrame(tempGraphics(), 114, y, 39, 0); const uint8 *obText = getObTextStart(); findNextColon(&obText); -- cgit v1.2.3 From 08be0411b1bfba715d5c1b50b50a893a27e12f8c Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 27 Dec 2011 18:34:23 +0100 Subject: DREAMWEB: Streamline text file handling --- engines/dreamweb/use.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 280d78ba55..1b91cc8d7b 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1644,8 +1644,7 @@ void DreamBase::showPuzText(uint16 command, uint16 count) { showMan(); showExit(); obIcons(); - uint16 offset = kTextstart + getSegment(data.word(kPuzzletext)).word(command * 2); - const uint8 *string = getSegment(data.word(kPuzzletext)).ptr(offset, 0); + const uint8 *string = (const uint8 *)_puzzleText.getString(command); printDirect(string, 36, 104, 241, 241 & 1); workToScreenM(); hangOnP(count); -- cgit v1.2.3 From 90cb52b7f6364a0d4b83cdc91c76c7edf4fcf79d Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 27 Dec 2011 19:37:22 +0100 Subject: DREAMWEB: Streamline graphics file access --- engines/dreamweb/use.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 1b91cc8d7b..f2dce4d603 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1576,7 +1576,7 @@ void DreamBase::useCashCard() { showExit(); showMan(); uint16 y = (!_foreignRelease) ? 120 : 120 - 3; - showFrame(tempGraphics(), 114, y, 39, 0); + showFrame(_tempGraphics, 114, y, 39, 0); const uint8 *obText = getObTextStart(); findNextColon(&obText); findNextColon(&obText); -- cgit v1.2.3 From 4c2d2684ea54d98828d44b18fb7b17ed84c7bf22 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 28 Dec 2011 02:28:27 +0100 Subject: DREAMWEB: Mass-move variables out of data This has been done by an automated search/replace, culling unused variables in the process. The remaining variables in data are all stored in savegames. --- engines/dreamweb/use.cpp | 456 +++++++++++++++++++++++------------------------ 1 file changed, 228 insertions(+), 228 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index f2dce4d603..94c9d20ea7 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -121,10 +121,10 @@ void DreamBase::useRoutine() { { &DreamBase::hotelBell, "BELL" }, }; - if (data.byte(kReallocation) >= 50) { - if (data.byte(kPointerpower) == 0) + if (_realLocation >= 50) { + if (_pointerPower == 0) return; - data.byte(kPointerpower) = 0; + _pointerPower = 0; } uint8 dummy; @@ -160,7 +160,7 @@ void DreamBase::useRoutine() { workToScreenM(); hangOnP(50); putBackObStuff(); - data.byte(kCommandtype) = 255; + _commandType = 255; } void DreamBase::useText(const uint8 *string) { @@ -191,13 +191,13 @@ void DreamBase::showSecondUse() { } void DreamBase::viewFolder() { - data.byte(kManisoffscreen) = 1; + _manIsOffScreen = 1; getRidOfAll(); loadFolder(); - data.byte(kFolderpage) = 0; + _folderPage = 0; showFolder(); workToScreenM(); - data.byte(kGetback) = 0; + _getBack = 0; do { if (_quitRequested) break; @@ -208,8 +208,8 @@ void DreamBase::viewFolder() { dumpPointer(); dumpTextLine(); checkFolderCoords(); - } while (data.byte(kGetback) == 0); - data.byte(kManisoffscreen) = 0; + } while (_getBack == 0); + _manIsOffScreen = 0; getRidOfTemp(); getRidOfTemp2(); getRidOfTemp3(); @@ -226,7 +226,7 @@ void DreamBase::edensCDPlayer() { data.word(kEndwatchreel) = 42; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; + _getBack = 1; } void DreamBase::hotelBell() { @@ -244,33 +244,33 @@ void DreamBase::playGuitar() { void DreamBase::useElevator1() { showFirstUse(); selectLocation(); - data.byte(kGetback) = 1; + _getBack = 1; } void DreamBase::useElevator2() { showFirstUse(); if (data.byte(kLocation) == 23) // In pool hall - data.byte(kNewlocation) = 31; + _newLocation = 31; else - data.byte(kNewlocation) = 23; + _newLocation = 23; data.byte(kCounttoclose) = 20; data.byte(kCounttoopen) = 0; data.word(kWatchingtime) = 80; - data.byte(kGetback) = 1; + _getBack = 1; } void DreamBase::useElevator3() { showFirstUse(); data.byte(kCounttoclose) = 20; - data.byte(kNewlocation) = 34; + _newLocation = 34; data.word(kReeltowatch) = 46; data.word(kEndwatchreel) = 63; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; data.word(kWatchingtime) = 80; - data.byte(kGetback) = 1; + _getBack = 1; } void DreamBase::useElevator4() { @@ -281,24 +281,24 @@ void DreamBase::useElevator4() { data.byte(kSpeedcount) = 1; data.byte(kCounttoclose) = 20; data.word(kWatchingtime) = 80; - data.byte(kGetback) = 1; - data.byte(kNewlocation) = 24; + _getBack = 1; + _newLocation = 24; } void DreamBase::useElevator5() { placeSetObject(4); removeSetObject(0); - data.byte(kNewlocation) = 20; + _newLocation = 20; data.word(kWatchingtime) = 80; data.byte(kLiftflag) = 1; data.byte(kCounttoclose) = 8; - data.byte(kGetback) = 1; + _getBack = 1; } void DreamBase::useHatch() { showFirstUse(); - data.byte(kNewlocation) = 40; - data.byte(kGetback) = 1; + _newLocation = 40; + _getBack = 1; } void DreamBase::wheelSound() { @@ -311,22 +311,22 @@ void DreamBase::callHotelLift() { playChannel1(12); showFirstUse(); data.byte(kCounttoopen) = 8; - data.byte(kGetback) = 1; - data.byte(kDestination) = 5; - data.byte(kFinaldest) = 5; + _getBack = 1; + _destination = 5; + _finalDest = 5; autoSetWalk(); turnPathOn(4); } void DreamBase::useShield() { - if (data.byte(kReallocation) != 20 || data.byte(kCombatcount) == 0) { + if (_realLocation != 20 || data.byte(kCombatcount) == 0) { // Not in Sart room showFirstUse(); putBackObStuff(); } else { data.byte(kLastweapon) = 3; showSecondUse(); - data.byte(kGetback) = 1; + _getBack = 1; data.byte(kProgresspoints)++; removeObFromInv(); } @@ -340,7 +340,7 @@ void DreamBase::useCoveredBox() { data.word(kEndwatchreel) = 66; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; + _getBack = 1; } void DreamBase::useRailing() { @@ -350,7 +350,7 @@ void DreamBase::useRailing() { data.word(kEndwatchreel) = 30; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; + _getBack = 1; data.byte(kMandead) = 4; } @@ -362,7 +362,7 @@ void DreamBase::wearWatch() { } else { showFirstUse(); data.byte(kWatchon) = 1; - data.byte(kGetback) = 1; + _getBack = 1; uint8 dummy; makeWorn((DynObject *)getAnyAd(&dummy, &dummy)); } @@ -376,7 +376,7 @@ void DreamBase::wearShades() { } else { data.byte(kShadeson) = 1; showFirstUse(); - data.byte(kGetback) = 1; + _getBack = 1; uint8 dummy; makeWorn((DynObject *)getAnyAd(&dummy, &dummy)); } @@ -384,7 +384,7 @@ void DreamBase::wearShades() { void DreamBase::useChurchHole() { showFirstUse(); - data.byte(kGetback) = 1; + _getBack = 1; data.word(kWatchingtime) = 28; data.word(kReeltowatch) = 13; data.word(kEndwatchreel) = 26; @@ -406,14 +406,14 @@ void DreamBase::sitDownInBar() { data.word(kEndofholdreel) = 83; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; + _getBack = 1; } } void DreamBase::useDryer() { playChannel1(12); showFirstUse(); - data.byte(kGetback) = 1; + _getBack = 1; } void DreamBase::useBalcony() { @@ -426,30 +426,30 @@ void DreamBase::useBalcony() { turnPathOff(4); turnPathOff(5); data.byte(kProgresspoints)++; - data.byte(kManspath) = 6; - data.byte(kDestination) = 6; - data.byte(kFinaldest) = 6; + _mansPath = 6; + _destination = 6; + _finalDest = 6; findXYFromPath(); switchRyanOff(); - data.byte(kResetmanxy) = 1; + _resetManXY = 1; data.word(kWatchingtime) = 30 * 2; data.word(kReeltowatch) = 183; data.word(kEndwatchreel) = 212; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; + _getBack = 1; } void DreamBase::useWindow() { - if (data.byte(kManspath) != 6) { + if (_mansPath != 6) { // Not on balcony showSecondUse(); putBackObStuff(); } else { data.byte(kProgresspoints)++; showFirstUse(); - data.byte(kNewlocation) = 29; - data.byte(kGetback) = 1; + _newLocation = 29; + _getBack = 1; } } @@ -460,16 +460,16 @@ void DreamBase::trapDoor() { data.word(kWatchingtime) = 20 * 2; data.word(kReeltowatch) = 181; data.word(kEndwatchreel) = 197; - data.byte(kNewlocation) = 26; + _newLocation = 26; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; + _getBack = 1; } void DreamBase::callEdensLift() { showFirstUse(); data.byte(kCounttoopen) = 8; - data.byte(kGetback) = 1; + _getBack = 1; turnPathOn(2); } @@ -481,62 +481,62 @@ void DreamBase::callEdensDLift() { } else { showFirstUse(); data.byte(kCounttoopen) = 8; - data.byte(kGetback) = 1; + _getBack = 1; turnPathOn(2); } } void DreamBase::openYourNeighbour() { enterCode(255, 255, 255, 255); - data.byte(kGetback) = 1; + _getBack = 1; } void DreamBase::openRyan() { enterCode(5, 1, 0, 6); - data.byte(kGetback) = 1; + _getBack = 1; } void DreamBase::openPoolBoss() { enterCode(5, 2, 2, 2); - data.byte(kGetback) = 1; + _getBack = 1; } void DreamBase::openEden() { enterCode(2, 8, 6, 5); - data.byte(kGetback) = 1; + _getBack = 1; } void DreamBase::openSarters() { enterCode(7, 8, 3, 3); - data.byte(kGetback) = 1; + _getBack = 1; } void DreamBase::openLouis() { enterCode(5, 2, 3, 8); - data.byte(kGetback) = 1; + _getBack = 1; } void DreamBase::useWall() { showFirstUse(); - if (data.byte(kManspath) != 3) { + if (_mansPath != 3) { data.word(kWatchingtime) = 30*2; data.word(kReeltowatch) = 2; data.word(kEndwatchreel) = 31; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; + _getBack = 1; turnPathOn(3); turnPathOn(4); turnPathOff(0); turnPathOff(1); turnPathOff(2); turnPathOff(5); - data.byte(kManspath) = 3; - data.byte(kFinaldest) = 3; + _mansPath = 3; + _finalDest = 3; findXYFromPath(); - data.byte(kResetmanxy) = 1; + _resetManXY = 1; switchRyanOff(); } else { // Go back over @@ -545,52 +545,52 @@ void DreamBase::useWall() { data.word(kEndwatchreel) = 60; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; + _getBack = 1; turnPathOff(3); turnPathOff(4); turnPathOn(0); turnPathOn(1); turnPathOn(2); turnPathOn(5); - data.byte(kManspath) = 5; - data.byte(kFinaldest) = 5; + _mansPath = 5; + _finalDest = 5; findXYFromPath(); - data.byte(kResetmanxy) = 1; + _resetManXY = 1; switchRyanOff(); } } void DreamBase::useLadder() { showFirstUse(); - data.byte(kMapx) = data.byte(kMapx) - 11; + _mapX = _mapX - 11; findRoomInLoc(); - data.byte(kFacing) = 6; - data.byte(kTurntoface) = 6; - data.byte(kManspath) = 0; - data.byte(kDestination) = 0; - data.byte(kFinaldest) = 0; + _facing = 6; + _turnToFace = 6; + _mansPath = 0; + _destination = 0; + _finalDest = 0; findXYFromPath(); - data.byte(kResetmanxy) = 1; - data.byte(kGetback) = 1; + _resetManXY = 1; + _getBack = 1; } void DreamBase::useLadderB() { showFirstUse(); - data.byte(kMapx) = data.byte(kMapx) + 11; + _mapX = _mapX + 11; findRoomInLoc(); - data.byte(kFacing) = 2; - data.byte(kTurntoface) = 2; - data.byte(kManspath) = 1; - data.byte(kDestination) = 1; - data.byte(kFinaldest) = 1; + _facing = 2; + _turnToFace = 2; + _mansPath = 1; + _destination = 1; + _finalDest = 1; findXYFromPath(); - data.byte(kResetmanxy) = 1; - data.byte(kGetback) = 1; + _resetManXY = 1; + _getBack = 1; } void DreamBase::slabDoorA() { showFirstUse(); - data.byte(kGetback) = 1; + _getBack = 1; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; data.word(kReeltowatch) = 13; @@ -604,7 +604,7 @@ void DreamBase::slabDoorA() { data.byte(kProgresspoints)++; data.word(kWatchingtime) = 60; data.word(kEndwatchreel) = 42; - data.byte(kNewlocation) = 47; + _newLocation = 47; } } @@ -612,7 +612,7 @@ void DreamBase::slabDoorB() { if (data.byte(kDreamnumber) != 1) { // Wrong showFirstUse(); - data.byte(kGetback) = 1; + _getBack = 1; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; data.word(kReeltowatch) = 44; @@ -629,20 +629,20 @@ void DreamBase::slabDoorB() { // Got crystal showFirstUse(); data.byte(kProgresspoints)++; - data.byte(kGetback) = 1; + _getBack = 1; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; data.word(kReeltowatch) = 44; data.word(kWatchingtime) = 60; data.word(kEndwatchreel) = 71; - data.byte(kNewlocation) = 47; + _newLocation = 47; } } } void DreamBase::slabDoorC() { showFirstUse(); - data.byte(kGetback) = 1; + _getBack = 1; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; data.word(kReeltowatch) = 108; @@ -656,13 +656,13 @@ void DreamBase::slabDoorC() { data.byte(kProgresspoints)++; data.word(kWatchingtime) = 60; data.word(kEndwatchreel) = 135; - data.byte(kNewlocation) = 47; + _newLocation = 47; } } void DreamBase::slabDoorD() { showFirstUse(); - data.byte(kGetback) = 1; + _getBack = 1; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; data.word(kReeltowatch) = 75; @@ -676,13 +676,13 @@ void DreamBase::slabDoorD() { data.byte(kProgresspoints)++; data.word(kWatchingtime) = 60; data.word(kEndwatchreel) = 102; - data.byte(kNewlocation) = 47; + _newLocation = 47; } } void DreamBase::slabDoorE() { showFirstUse(); - data.byte(kGetback) = 1; + _getBack = 1; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; data.word(kReeltowatch) = 141; @@ -696,13 +696,13 @@ void DreamBase::slabDoorE() { data.byte(kProgresspoints)++; data.word(kWatchingtime) = 60; data.word(kEndwatchreel) = 168; - data.byte(kNewlocation) = 47; + _newLocation = 47; } } void DreamBase::slabDoorF() { showFirstUse(); - data.byte(kGetback) = 1; + _getBack = 1; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; data.word(kReeltowatch) = 171; @@ -716,17 +716,17 @@ void DreamBase::slabDoorF() { data.byte(kProgresspoints)++; data.word(kWatchingtime) = 60; data.word(kEndwatchreel) = 197; - data.byte(kNewlocation) = 47; + _newLocation = 47; } } bool DreamBase::defaultUseHandler(const char *id) { - if (data.byte(kWithobject) == 255) { + if (_withObject == 255) { withWhat(); return true; // event handled } - if (!compare(data.byte(kWithobject), data.byte(kWithtype), id)) { + if (!compare(_withObject, _withType, id)) { // Wrong item showPuzText(14, 300); putBackObStuff(); @@ -747,7 +747,7 @@ void DreamBase::useChurchGate() { data.word(kEndwatchreel) = 70; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; + _getBack = 1; data.byte(kProgresspoints)++; turnPathOn(3); if (data.byte(kAidedead) != 0) @@ -756,78 +756,78 @@ void DreamBase::useChurchGate() { void DreamBase::useGun() { - if (data.byte(kObjecttype) != kExObjectType) { + if (_objectType != kExObjectType) { // gun is not taken showSecondUse(); putBackObStuff(); - } else if (data.byte(kReallocation) == 22) { + } else if (_realLocation == 22) { // in pool room showPuzText(34, 300); data.byte(kLastweapon) = 1; data.byte(kCombatcount) = 39; - data.byte(kGetback) = 1; + _getBack = 1; data.byte(kProgresspoints)++; - } else if (data.byte(kReallocation) == 25) { + } else if (_realLocation == 25) { // helicopter showPuzText(34, 300); data.byte(kLastweapon) = 1; data.byte(kCombatcount) = 19; - data.byte(kGetback) = 1; + _getBack = 1; data.byte(kDreamnumber) = 2; data.byte(kRoomafterdream) = 38; data.byte(kSartaindead) = 1; data.byte(kProgresspoints)++; - } else if (data.byte(kReallocation) == 27) { + } else if (_realLocation == 27) { // in rock room showPuzText(46, 300); - data.byte(kPointermode) = 2; + _pointerMode = 2; data.byte(kRockstardead) = 1; data.byte(kLastweapon) = 1; data.byte(kNewsitem) = 1; - data.byte(kGetback) = 1; + _getBack = 1; data.byte(kRoomafterdream) = 32; data.byte(kDreamnumber) = 0; data.byte(kProgresspoints)++; - } else if (data.byte(kReallocation) == 8 && data.byte(kMapx) == 22 && data.byte(kMapy) == 40 - && !isSetObOnMap(92) && data.byte(kManspath) != 9) { + } else if (_realLocation == 8 && _mapX == 22 && _mapY == 40 + && !isSetObOnMap(92) && _mansPath != 9) { // by studio - data.byte(kDestination) = 9; - data.byte(kFinaldest) = 9; + _destination = 9; + _finalDest = 9; autoSetWalk(); data.byte(kLastweapon) = 1; - data.byte(kGetback) = 1; + _getBack = 1; data.byte(kProgresspoints)++; - } else if (data.byte(kReallocation) == 6 && data.byte(kMapx) == 11 && data.byte(kMapy) == 20 + } else if (_realLocation == 6 && _mapX == 11 && _mapY == 20 && isSetObOnMap(5)) { // sarters - data.byte(kDestination) = 1; - data.byte(kFinaldest) = 1; + _destination = 1; + _finalDest = 1; autoSetWalk(); removeSetObject(5); placeSetObject(6); - turnAnyPathOn(1, data.byte(kRoomnum) - 1); + turnAnyPathOn(1, _roomNum - 1); data.byte(kLiftflag) = 1; data.word(kWatchingtime) = 40*2; data.word(kReeltowatch) = 4; data.word(kEndwatchreel) = 43; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; + _getBack = 1; data.byte(kProgresspoints)++; - } else if (data.byte(kReallocation) == 29) { + } else if (_realLocation == 29) { // aide - data.byte(kGetback) = 1; + _getBack = 1; resetLocation(13); setLocation(12); - data.byte(kDestpos) = 12; - data.byte(kDestination) = 2; - data.byte(kFinaldest) = 2; + _destPos = 12; + _destination = 2; + _finalDest = 2; autoSetWalk(); data.word(kWatchingtime) = 164*2; data.word(kReeltowatch) = 3; @@ -839,25 +839,25 @@ void DreamBase::useGun() { data.byte(kRoomafterdream) = 33; data.byte(kProgresspoints)++; - } else if (data.byte(kReallocation) == 23 && data.byte(kMapx) == 0 && data.byte(kMapy) == 50) { + } else if (_realLocation == 23 && _mapX == 0 && _mapY == 50) { // with boss - if (data.byte(kManspath) != 5) { - data.byte(kDestination) = 5; - data.byte(kFinaldest) = 5; + if (_mansPath != 5) { + _destination = 5; + _finalDest = 5; autoSetWalk(); } data.byte(kLastweapon) = 1; - data.byte(kGetback) = 1; + _getBack = 1; - } else if (data.byte(kReallocation) == 8 && data.byte(kMapx) == 11 && data.byte(kMapy) == 10) { + } else if (_realLocation == 8 && _mapX == 11 && _mapY == 10) { // tv soldier - if (data.byte(kManspath) != 2) { - data.byte(kDestination) = 2; - data.byte(kFinaldest) = 2; + if (_mansPath != 2) { + _destination = 2; + _finalDest = 2; autoSetWalk(); } data.byte(kLastweapon) = 1; - data.byte(kGetback) = 1; + _getBack = 1; } else { showFirstUse(); @@ -867,20 +867,20 @@ void DreamBase::useGun() { void DreamBase::useFullCart() { data.byte(kProgresspoints)++; - turnAnyPathOn(2, data.byte(kRoomnum) + 6); - data.byte(kManspath) = 4; - data.byte(kFacing) = 4; - data.byte(kTurntoface) = 4; - data.byte(kFinaldest) = 4; + turnAnyPathOn(2, _roomNum + 6); + _mansPath = 4; + _facing = 4; + _turnToFace = 4; + _finalDest = 4; findXYFromPath(); - data.byte(kResetmanxy) = 1; + _resetManXY = 1; showFirstUse(); data.word(kWatchingtime) = 72 * 2; data.word(kReeltowatch) = 58; data.word(kEndwatchreel) = 142; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; + _getBack = 1; } void DreamBase::useClearBox() { @@ -895,7 +895,7 @@ void DreamBase::useClearBox() { data.word(kEndwatchreel) = 105; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; + _getBack = 1; } void DreamBase::openTVDoor() { @@ -905,16 +905,16 @@ void DreamBase::openTVDoor() { // Key on TV showFirstUse(); data.byte(kLockstatus) = 0; - data.byte(kGetback) = 1; + _getBack = 1; } void DreamBase::usePlate() { - if (data.byte(kWithobject) == 255) { + if (_withObject == 255) { withWhat(); return; } - if (compare(data.byte(kWithobject), data.byte(kWithtype), "SCRW")) { + if (compare(_withObject, _withType, "SCRW")) { // Unscrew plate playChannel1(20); showFirstUse(); @@ -923,8 +923,8 @@ void DreamBase::usePlate() { removeSetObject(25); placeFreeObject(0); data.byte(kProgresspoints)++; - data.byte(kGetback) = 1; - } else if (compare(data.byte(kWithobject), data.byte(kWithtype), "KNFE")) { + _getBack = 1; + } else if (compare(_withObject, _withType, "KNFE")) { // Tried knife showPuzText(54, 300); putBackObStuff(); @@ -936,12 +936,12 @@ void DreamBase::usePlate() { } void DreamBase::usePlinth() { - if (data.byte(kWithobject) == 255) { + if (_withObject == 255) { withWhat(); return; } - if (!compare(data.byte(kWithobject), data.byte(kWithtype), "DKEY")) { + if (!compare(_withObject, _withType, "DKEY")) { // Wrong key showFirstUse(); putBackObStuff(); @@ -953,8 +953,8 @@ void DreamBase::usePlinth() { data.word(kEndwatchreel) = 104; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; - data.byte(kNewlocation) = data.byte(kRoomafterdream); + _getBack = 1; + _newLocation = data.byte(kRoomafterdream); } } @@ -970,21 +970,21 @@ void DreamBase::useElvDoor() { data.word(kEndwatchreel) = 77; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; + _getBack = 1; } void DreamBase::useObject() { - data.byte(kWithobject) = 255; + _withObject = 255; - if (data.byte(kCommandtype) != 229) { - data.byte(kCommandtype) = 229; - commandWithOb(51, data.byte(kObjecttype), data.byte(kCommand)); + if (_commandType != 229) { + _commandType = 229; + commandWithOb(51, _objectType, _command); } - if (data.word(kMousebutton) == data.word(kOldbutton)) + if (_mouseButton == _oldButton) return; // nouse - if (data.word(kMousebutton) & 1) + if (_mouseButton & 1) useRoutine(); } @@ -1002,13 +1002,13 @@ void DreamBase::useWinch() { data.word(kEndwatchreel) = 217; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; - data.byte(kDestpos) = 1; - data.byte(kNewlocation) = 45; + _destPos = 1; + _newLocation = 45; data.byte(kDreamnumber) = 1; data.byte(kRoomafterdream) = 44; data.byte(kGeneraldead) = 1; data.byte(kNewsitem) = 2; - data.byte(kGetback) = 1; + _getBack = 1; data.byte(kProgresspoints)++; } @@ -1016,14 +1016,14 @@ void DreamBase::useCart() { if (defaultUseHandler("ROCK")) return; - DynObject *exObject = getExAd(data.byte(kWithobject)); + DynObject *exObject = getExAd(_withObject); exObject->mapad[0] = 0; - removeSetObject(data.byte(kCommand)); - placeSetObject(data.byte(kCommand) + 1); + removeSetObject(_command); + placeSetObject(_command + 1); data.byte(kProgresspoints)++; playChannel1(17); showFirstUse(); - data.byte(kGetback) = 1; + _getBack = 1; } void DreamBase::useTrainer() { @@ -1045,7 +1045,7 @@ void DreamBase::chewy() { uint8 dummy; DynObject *object = (DynObject *)getAnyAd(&dummy, &dummy); object->mapad[0] = 255; - data.byte(kGetback) = 1; + _getBack = 1; } void DreamBase::useHole() { @@ -1054,10 +1054,10 @@ void DreamBase::useHole() { showFirstUse(); removeSetObject(86); - DynObject *exObject = getExAd(data.byte(kWithobject)); + DynObject *exObject = getExAd(_withObject); exObject->mapad[0] = 255; data.byte(kCanmovealtar) = 1; - data.byte(kGetback) = 1; + _getBack = 1; } void DreamBase::openHotelDoor() { @@ -1067,7 +1067,7 @@ void DreamBase::openHotelDoor() { playChannel1(16); showFirstUse(); data.byte(kLockstatus) = 0; - data.byte(kGetback) = 1; + _getBack = 1; } void DreamBase::openHotelDoor2() { @@ -1099,7 +1099,7 @@ void DreamBase::usePoolReader() { playChannel1(17); showFirstUse(); data.byte(kCounttoopen) = 6; - data.byte(kGetback) = 1; + _getBack = 1; } } @@ -1121,7 +1121,7 @@ void DreamBase::useCardReader1() { showPuzText(18, 300); data.byte(kProgresspoints)++; data.word(kCard1money) = 12432; - data.byte(kGetback) = 1; + _getBack = 1; } } @@ -1148,7 +1148,7 @@ void DreamBase::useCardReader2() { data.byte(kGunpassflag) = 1; data.word(kCard1money) -= 2000; data.byte(kProgresspoints)++; - data.byte(kGetback) = 1; + _getBack = 1; } } @@ -1170,43 +1170,43 @@ void DreamBase::useCardReader3() { data.byte(kProgresspoints)++; data.word(kCard1money) -= 8300; data.byte(kCardpassflag) = 1; - data.byte(kGetback) = 1; + _getBack = 1; } } void DreamBase::useLighter() { - if (data.byte(kWithobject) == 255) { + if (_withObject == 255) { withWhat(); return; } - if (!compare(data.byte(kWithobject), data.byte(kWithtype), "SMKE")) { + if (!compare(_withObject, _withType, "SMKE")) { showFirstUse(); putBackObStuff(); } else { showPuzText(9, 300); - DynObject *withObj = getExAd(data.byte(kWithobject)); + DynObject *withObj = getExAd(_withObject); withObj->mapad[0] = 255; - data.byte(kGetback) = 1; + _getBack = 1; } } void DreamBase::useWire() { - if (data.byte(kWithobject) == 255) { + if (_withObject == 255) { withWhat(); return; } - if (compare(data.byte(kWithobject), data.byte(kWithtype), "KNFE")) { + if (compare(_withObject, _withType, "KNFE")) { removeSetObject(51); placeSetObject(52); showPuzText(11, 300); data.byte(kProgresspoints)++; - data.byte(kGetback) = 1; + _getBack = 1; return; } - if (compare(data.byte(kWithobject), data.byte(kWithtype), "AXED")) { + if (compare(_withObject, _withType, "AXED")) { showPuzText(16, 300); putBackObStuff(); return; @@ -1224,11 +1224,11 @@ void DreamBase::openTomb() { data.word(kEndwatchreel) = 33; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; + _getBack = 1; } void DreamBase::hotelControl() { - if (data.byte(kReallocation) != 21 || data.byte(kMapx) != 33) + if (_realLocation != 21 || _mapX != 33) showSecondUse(); // Not right control else showFirstUse(); @@ -1237,7 +1237,7 @@ void DreamBase::hotelControl() { } void DreamBase::useCooker() { - if (checkInside(data.byte(kCommand), data.byte(kObjecttype)) == kNumexobjects) + if (checkInside(_command, _objectType) == kNumexobjects) showFirstUse(); else showSecondUse(); // Food inside @@ -1268,7 +1268,7 @@ void DreamBase::useDiary() { showPointer(); workToScreen(); delPointer(); - data.byte(kGetback) = 0; + _getBack = 0; RectWithCallback diaryList[] = { { kDiaryx+94,kDiaryx+110,kDiaryy+97,kDiaryy+113,&DreamBase::diaryKeyN }, @@ -1288,43 +1288,43 @@ void DreamBase::useDiary() { dumpDiaryKeys(); dumpTextLine(); checkCoords(diaryList); - } while (!data.byte(kGetback) && !_quitRequested); + } while (!_getBack && !_quitRequested); getRidOfTemp(); getRidOfTempText(); getRidOfTempCharset(); restoreReels(); - data.byte(kManisoffscreen) = 0; + _manIsOffScreen = 0; redrawMainScrn(); workToScreenM(); } void DreamBase::useControl() { - if (data.byte(kWithobject) == 255) { + if (_withObject == 255) { withWhat(); return; } - if (compare(data.byte(kWithobject), data.byte(kWithtype), "KEYA")) { // Right key + if (compare(_withObject, _withType, "KEYA")) { // Right key playChannel1(16); if (data.byte(kLocation) == 21) { // Going down showPuzText(3, 300); - data.byte(kNewlocation) = 30; + _newLocation = 30; } else { showPuzText(0, 300); - data.byte(kNewlocation) = 21; + _newLocation = 21; } data.byte(kCounttoclose) = 8; data.byte(kCounttoopen) = 0; data.word(kWatchingtime) = 80; - data.byte(kGetback) = 1; + _getBack = 1; return; } - if (data.byte(kReallocation) == 21) { - if (compare(data.byte(kWithobject), data.byte(kWithtype), "KNFE")) { + if (_realLocation == 21) { + if (compare(_withObject, _withType, "KNFE")) { // Jimmy controls placeSetObject(50); placeSetObject(51); @@ -1335,8 +1335,8 @@ void DreamBase::useControl() { playChannel1(14); showPuzText(10, 300); data.byte(kProgresspoints)++; - data.byte(kGetback) = 1; - } else if (compare(data.byte(kWithobject), data.byte(kWithtype), "AXED")) { + _getBack = 1; + } else if (compare(_withObject, _withType, "AXED")) { // Axe on controls showPuzText(16, 300); data.byte(kProgresspoints)++; @@ -1354,23 +1354,23 @@ void DreamBase::useControl() { } void DreamBase::useSlab() { - if (data.byte(kWithobject) == 255) { + if (_withObject == 255) { withWhat(); return; } - if (!compare(data.byte(kWithobject), data.byte(kWithtype), "JEWL")) { + if (!compare(_withObject, _withType, "JEWL")) { showPuzText(14, 300); putBackObStuff(); return; } - DynObject *exObject = getExAd(data.byte(kWithobject)); + DynObject *exObject = getExAd(_withObject); exObject->mapad[0] = 0; - removeSetObject(data.byte(kCommand)); - placeSetObject(data.byte(kCommand) + 1); - if (data.byte(kCommand) + 1 == 54) { + removeSetObject(_command); + placeSetObject(_command + 1); + if (_command + 1 == 54) { // Last slab turnPathOn(0); data.word(kWatchingtime) = 22; @@ -1382,23 +1382,23 @@ void DreamBase::useSlab() { data.byte(kProgresspoints)++; showFirstUse(); - data.byte(kGetback) = 1; + _getBack = 1; } void DreamBase::usePipe() { - if (data.byte(kWithobject) == 255) { + if (_withObject == 255) { withWhat(); return; } - if (compare(data.byte(kWithobject), data.byte(kWithtype), "CUPE")) { + if (compare(_withObject, _withType, "CUPE")) { // Fill cup showPuzText(36, 300); putBackObStuff(); - DynObject *exObject = getExAd(data.byte(kWithobject)); + DynObject *exObject = getExAd(_withObject); exObject->id[3] = 'F'-'A'; // CUPE (empty cup) -> CUPF (full cup) return; - } else if (compare(data.byte(kWithobject), data.byte(kWithtype), "CUPF")) { + } else if (compare(_withObject, _withType, "CUPF")) { // Already full showPuzText(35, 300); putBackObStuff(); @@ -1409,16 +1409,16 @@ void DreamBase::usePipe() { } void DreamBase::useOpenBox() { - if (data.byte(kWithobject) == 255) { + if (_withObject == 255) { withWhat(); return; } - if (compare(data.byte(kWithobject), data.byte(kWithtype), "CUPF")) { + if (compare(_withObject, _withType, "CUPF")) { // Destroy open box data.byte(kProgresspoints)++; showPuzText(37, 300); - DynObject *exObject = getExAd(data.byte(kWithobject)); + DynObject *exObject = getExAd(_withObject); exObject->id[3] = 'E'-'A'; // CUPF (full cup) -> CUPE (empty cup) data.word(kWatchingtime) = 140; data.word(kReeltowatch) = 105; @@ -1426,11 +1426,11 @@ void DreamBase::useOpenBox() { data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; turnPathOn(4); - data.byte(kGetback) = 1; + _getBack = 1; return; } - if (compare(data.byte(kWithobject), data.byte(kWithtype), "CUPE")) { + if (compare(_withObject, _withType, "CUPE")) { // Open box wrong showPuzText(38, 300); putBackObStuff(); @@ -1441,14 +1441,14 @@ void DreamBase::useOpenBox() { } void DreamBase::runTap() { - if (data.byte(kWithobject) == 255) { + if (_withObject == 255) { withWhat(); return; } - if (compare(data.byte(kWithobject), data.byte(kWithtype), "CUPE")) { + if (compare(_withObject, _withType, "CUPE")) { // Fill cup from tap - DynObject *exObject = getExAd(data.byte(kWithobject)); + DynObject *exObject = getExAd(_withObject); exObject->id[3] = 'F'-'A'; // CUPE (empty cup) -> CUPF (full cup) playChannel1(8); showPuzText(57, 300); @@ -1456,7 +1456,7 @@ void DreamBase::runTap() { return; } - if (compare(data.byte(kWithobject), data.byte(kWithtype), "CUPF")) { + if (compare(_withObject, _withType, "CUPF")) { // Cup from tap full showPuzText(58, 300); putBackObStuff(); @@ -1468,13 +1468,13 @@ void DreamBase::runTap() { } void DreamBase::useAxe() { - if (data.byte(kReallocation) != 22) { + if (_realLocation != 22) { // Not in pool showFirstUse(); return; } - if (data.byte(kMapy) == 10) { + if (_mapY == 10) { // Axe on door showPuzText(15, 300); data.byte(kProgresspoints)++; @@ -1483,14 +1483,14 @@ void DreamBase::useAxe() { data.word(kEndwatchreel) = 77; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; + _getBack = 1; return; } showSecondUse(); data.byte(kProgresspoints)++; data.byte(kLastweapon) = 2; - data.byte(kGetback) = 1; + _getBack = 1; removeObFromInv(); } @@ -1502,17 +1502,17 @@ void DreamBase::useHandle() { } else { // Wire has been cut showPuzText(13, 300); - data.byte(kNewlocation) = 22; + _newLocation = 22; } - data.byte(kGetback) = 1; + _getBack = 1; } void DreamBase::useAltar() { if (findExObject("CNDA") == 114 || findExObject("CNDB") == 114) { // Things on altar showFirstUse(); - data.byte(kGetback) = 1; + _getBack = 1; return; } @@ -1526,10 +1526,10 @@ void DreamBase::useAltar() { data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; DreamBase::setupTimedUse(47, 32, 98, 52, 76); - data.byte(kGetback) = 1; + _getBack = 1; } else { showPuzText(23, 300); - data.byte(kGetback) = 1; + _getBack = 1; } } @@ -1541,19 +1541,19 @@ void DreamBase::withWhat() { showMan(); showExit(); - copyName(data.byte(kObjecttype), data.byte(kCommand), commandLine); + copyName(_objectType, _command, commandLine); printMessage2(100, 21, 63, 200, false, 2); - uint16 x = data.word(kLastxpos) + 5; + uint16 x = _lastXPos + 5; printDirect(commandLine, x, 21, 220, false); - printMessage2(data.word(kLastxpos) + 5, 21, 63, 200, false, 3); + printMessage2(_lastXPos + 5, 21, 63, 200, false, 3); fillRyan(); - data.byte(kCommandtype) = 255; + _commandType = 255; readMouse(); showPointer(); workToScreen(); delPointer(); - data.byte(kInvopen) = 2; + _invOpen = 2; } void DreamBase::notHeldError() { @@ -1584,12 +1584,12 @@ void DreamBase::useCashCard() { printDirect(&obText, 36, &y, 36, 36 & 1); char amountStr[10]; sprintf(amountStr, "%04d", data.word(kCard1money) / 10); - data.word(kCharshift) = 91 * 2 + 75; + _charShift = 91 * 2 + 75; printDirect((const uint8 *)amountStr, 160, 155, 240, 240 & 1); sprintf(amountStr, "%02d", (data.word(kCard1money) % 10) * 10); - data.word(kCharshift) = 91 * 2 + 85; + _charShift = 91 * 2 + 85; printDirect((const uint8 *)amountStr, 187, 155, 240, 240 & 1); - data.word(kCharshift) = 0; + _charShift = 0; workToScreenM(); hangOnP(400); getRidOfTemp(); @@ -1604,7 +1604,7 @@ void DreamBase::useStereo() { if (data.byte(kLocation) != 0) { showPuzText(4, 400); putBackObStuff(); - } else if (data.byte(kMapx) != 11) { + } else if (_mapX != 11) { showPuzText(5, 400); putBackObStuff(); } else if (checkInside(findSetObject("CDPL"), 1) == kNumexobjects) { @@ -1653,7 +1653,7 @@ void DreamBase::showPuzText(uint16 command, uint16 count) { void DreamBase::useButtonA() { if (!isSetObOnMap(95)) { showFirstUse(); - turnAnyPathOn(0, data.byte(kRoomnum) - 1); + turnAnyPathOn(0, _roomNum - 1); removeSetObject(9); placeSetObject(95); data.word(kWatchingtime) = 15 * 2; @@ -1661,7 +1661,7 @@ void DreamBase::useButtonA() { data.word(kEndwatchreel) = 85; data.byte(kWatchspeed) = 1; data.byte(kSpeedcount) = 1; - data.byte(kGetback) = 1; + _getBack = 1; data.byte(kProgresspoints)++; } else { // Done this bit -- cgit v1.2.3 From 57e940f67896e0f085de23088754fe1682cd49db Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 28 Dec 2011 13:10:22 +0100 Subject: DREAMWEB: Move all saved variables to a GameVars struct The data segment is now completely unused. --- engines/dreamweb/use.cpp | 602 +++++++++++++++++++++++------------------------ 1 file changed, 301 insertions(+), 301 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 94c9d20ea7..ebebc45ad5 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -221,11 +221,11 @@ void DreamBase::viewFolder() { void DreamBase::edensCDPlayer() { showFirstUse(); - data.word(kWatchingtime) = 18 * 2; - data.word(kReeltowatch) = 25; - data.word(kEndwatchreel) = 42; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._watchingTime = 18 * 2; + _vars._reelToWatch = 25; + _vars._endWatchReel = 42; + _vars._watchSpeed = 1; + _vars._speedCount = 1; _getBack = 1; } @@ -250,37 +250,37 @@ void DreamBase::useElevator1() { void DreamBase::useElevator2() { showFirstUse(); - if (data.byte(kLocation) == 23) // In pool hall + if (_vars._location == 23) // In pool hall _newLocation = 31; else _newLocation = 23; - data.byte(kCounttoclose) = 20; - data.byte(kCounttoopen) = 0; - data.word(kWatchingtime) = 80; + _vars._countToClose = 20; + _vars._countToOpen = 0; + _vars._watchingTime = 80; _getBack = 1; } void DreamBase::useElevator3() { showFirstUse(); - data.byte(kCounttoclose) = 20; + _vars._countToClose = 20; _newLocation = 34; - data.word(kReeltowatch) = 46; - data.word(kEndwatchreel) = 63; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.word(kWatchingtime) = 80; + _vars._reelToWatch = 46; + _vars._endWatchReel = 63; + _vars._watchSpeed = 1; + _vars._speedCount = 1; + _vars._watchingTime = 80; _getBack = 1; } void DreamBase::useElevator4() { showFirstUse(); - data.word(kReeltowatch) = 0; - data.word(kEndwatchreel) = 11; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kCounttoclose) = 20; - data.word(kWatchingtime) = 80; + _vars._reelToWatch = 0; + _vars._endWatchReel = 11; + _vars._watchSpeed = 1; + _vars._speedCount = 1; + _vars._countToClose = 20; + _vars._watchingTime = 80; _getBack = 1; _newLocation = 24; } @@ -289,9 +289,9 @@ void DreamBase::useElevator5() { placeSetObject(4); removeSetObject(0); _newLocation = 20; - data.word(kWatchingtime) = 80; - data.byte(kLiftflag) = 1; - data.byte(kCounttoclose) = 8; + _vars._watchingTime = 80; + _vars._liftFlag = 1; + _vars._countToClose = 8; _getBack = 1; } @@ -310,7 +310,7 @@ void DreamBase::wheelSound() { void DreamBase::callHotelLift() { playChannel1(12); showFirstUse(); - data.byte(kCounttoopen) = 8; + _vars._countToOpen = 8; _getBack = 1; _destination = 5; _finalDest = 5; @@ -319,49 +319,49 @@ void DreamBase::callHotelLift() { } void DreamBase::useShield() { - if (_realLocation != 20 || data.byte(kCombatcount) == 0) { + if (_realLocation != 20 || _vars._combatCount == 0) { // Not in Sart room showFirstUse(); putBackObStuff(); } else { - data.byte(kLastweapon) = 3; + _vars._lastWeapon = 3; showSecondUse(); _getBack = 1; - data.byte(kProgresspoints)++; + _vars._progressPoints++; removeObFromInv(); } } void DreamBase::useCoveredBox() { - data.byte(kProgresspoints)++; + _vars._progressPoints++; showFirstUse(); - data.word(kWatchingtime) = 50; - data.word(kReeltowatch) = 41; - data.word(kEndwatchreel) = 66; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._watchingTime = 50; + _vars._reelToWatch = 41; + _vars._endWatchReel = 66; + _vars._watchSpeed = 1; + _vars._speedCount = 1; _getBack = 1; } void DreamBase::useRailing() { showFirstUse(); - data.word(kWatchingtime) = 80; - data.word(kReeltowatch) = 0; - data.word(kEndwatchreel) = 30; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._watchingTime = 80; + _vars._reelToWatch = 0; + _vars._endWatchReel = 30; + _vars._watchSpeed = 1; + _vars._speedCount = 1; _getBack = 1; - data.byte(kMandead) = 4; + _vars._manDead = 4; } void DreamBase::wearWatch() { - if (data.byte(kWatchon) == 1) { + if (_vars._watchOn == 1) { // Already wearing watch showSecondUse(); putBackObStuff(); } else { showFirstUse(); - data.byte(kWatchon) = 1; + _vars._watchOn = 1; _getBack = 1; uint8 dummy; makeWorn((DynObject *)getAnyAd(&dummy, &dummy)); @@ -369,12 +369,12 @@ void DreamBase::wearWatch() { } void DreamBase::wearShades() { - if (data.byte(kShadeson) == 1) { + if (_vars._shadesOn == 1) { // Already wearing shades showSecondUse(); putBackObStuff(); } else { - data.byte(kShadeson) = 1; + _vars._shadesOn = 1; showFirstUse(); _getBack = 1; uint8 dummy; @@ -385,27 +385,27 @@ void DreamBase::wearShades() { void DreamBase::useChurchHole() { showFirstUse(); _getBack = 1; - data.word(kWatchingtime) = 28; - data.word(kReeltowatch) = 13; - data.word(kEndwatchreel) = 26; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._watchingTime = 28; + _vars._reelToWatch = 13; + _vars._endWatchReel = 26; + _vars._watchSpeed = 1; + _vars._speedCount = 1; } void DreamBase::sitDownInBar() { - if (data.byte(kWatchmode) != 0xFF) { + if (_vars._watchMode != 0xFF) { // Sat down showSecondUse(); putBackObStuff(); } else { showFirstUse(); - data.word(kWatchingtime) = 50; - data.word(kReeltowatch) = 55; - data.word(kEndwatchreel) = 71; - data.word(kReeltohold) = 73; - data.word(kEndofholdreel) = 83; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._watchingTime = 50; + _vars._reelToWatch = 55; + _vars._endWatchReel = 71; + _vars._reelToHold = 73; + _vars._endOfHoldReel = 83; + _vars._watchSpeed = 1; + _vars._speedCount = 1; _getBack = 1; } } @@ -425,18 +425,18 @@ void DreamBase::useBalcony() { turnPathOff(3); turnPathOff(4); turnPathOff(5); - data.byte(kProgresspoints)++; + _vars._progressPoints++; _mansPath = 6; _destination = 6; _finalDest = 6; findXYFromPath(); switchRyanOff(); _resetManXY = 1; - data.word(kWatchingtime) = 30 * 2; - data.word(kReeltowatch) = 183; - data.word(kEndwatchreel) = 212; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._watchingTime = 30 * 2; + _vars._reelToWatch = 183; + _vars._endWatchReel = 212; + _vars._watchSpeed = 1; + _vars._speedCount = 1; _getBack = 1; } @@ -446,7 +446,7 @@ void DreamBase::useWindow() { showSecondUse(); putBackObStuff(); } else { - data.byte(kProgresspoints)++; + _vars._progressPoints++; showFirstUse(); _newLocation = 29; _getBack = 1; @@ -454,33 +454,33 @@ void DreamBase::useWindow() { } void DreamBase::trapDoor() { - data.byte(kProgresspoints)++; + _vars._progressPoints++; showFirstUse(); switchRyanOff(); - data.word(kWatchingtime) = 20 * 2; - data.word(kReeltowatch) = 181; - data.word(kEndwatchreel) = 197; + _vars._watchingTime = 20 * 2; + _vars._reelToWatch = 181; + _vars._endWatchReel = 197; _newLocation = 26; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._watchSpeed = 1; + _vars._speedCount = 1; _getBack = 1; } void DreamBase::callEdensLift() { showFirstUse(); - data.byte(kCounttoopen) = 8; + _vars._countToOpen = 8; _getBack = 1; turnPathOn(2); } void DreamBase::callEdensDLift() { - if (data.byte(kLiftflag) == 1) { + if (_vars._liftFlag == 1) { // Eden's D here showSecondUse(); putBackObStuff(); } else { showFirstUse(); - data.byte(kCounttoopen) = 8; + _vars._countToOpen = 8; _getBack = 1; turnPathOn(2); } @@ -521,11 +521,11 @@ void DreamBase::useWall() { showFirstUse(); if (_mansPath != 3) { - data.word(kWatchingtime) = 30*2; - data.word(kReeltowatch) = 2; - data.word(kEndwatchreel) = 31; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._watchingTime = 30*2; + _vars._reelToWatch = 2; + _vars._endWatchReel = 31; + _vars._watchSpeed = 1; + _vars._speedCount = 1; _getBack = 1; turnPathOn(3); turnPathOn(4); @@ -540,11 +540,11 @@ void DreamBase::useWall() { switchRyanOff(); } else { // Go back over - data.word(kWatchingtime) = 30 * 2; - data.word(kReeltowatch) = 34; - data.word(kEndwatchreel) = 60; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._watchingTime = 30 * 2; + _vars._reelToWatch = 34; + _vars._endWatchReel = 60; + _vars._watchSpeed = 1; + _vars._speedCount = 1; _getBack = 1; turnPathOff(3); turnPathOff(4); @@ -591,35 +591,35 @@ void DreamBase::useLadderB() { void DreamBase::slabDoorA() { showFirstUse(); _getBack = 1; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.word(kReeltowatch) = 13; - if (data.byte(kDreamnumber) != 3) { + _vars._watchSpeed = 1; + _vars._speedCount = 1; + _vars._reelToWatch = 13; + if (_vars._dreamNumber != 3) { // Wrong - data.word(kWatchingtime) = 40; - data.word(kEndwatchreel) = 34; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._watchingTime = 40; + _vars._endWatchReel = 34; + _vars._watchSpeed = 1; + _vars._speedCount = 1; } else { - data.byte(kProgresspoints)++; - data.word(kWatchingtime) = 60; - data.word(kEndwatchreel) = 42; + _vars._progressPoints++; + _vars._watchingTime = 60; + _vars._endWatchReel = 42; _newLocation = 47; } } void DreamBase::slabDoorB() { - if (data.byte(kDreamnumber) != 1) { + if (_vars._dreamNumber != 1) { // Wrong showFirstUse(); _getBack = 1; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.word(kReeltowatch) = 44; - data.word(kWatchingtime) = 40; - data.word(kEndwatchreel) = 63; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._watchSpeed = 1; + _vars._speedCount = 1; + _vars._reelToWatch = 44; + _vars._watchingTime = 40; + _vars._endWatchReel = 63; + _vars._watchSpeed = 1; + _vars._speedCount = 1; } else { if (!isRyanHolding("SHLD")) { // No crystal @@ -628,13 +628,13 @@ void DreamBase::slabDoorB() { } else { // Got crystal showFirstUse(); - data.byte(kProgresspoints)++; + _vars._progressPoints++; _getBack = 1; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.word(kReeltowatch) = 44; - data.word(kWatchingtime) = 60; - data.word(kEndwatchreel) = 71; + _vars._watchSpeed = 1; + _vars._speedCount = 1; + _vars._reelToWatch = 44; + _vars._watchingTime = 60; + _vars._endWatchReel = 71; _newLocation = 47; } } @@ -643,19 +643,19 @@ void DreamBase::slabDoorB() { void DreamBase::slabDoorC() { showFirstUse(); _getBack = 1; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.word(kReeltowatch) = 108; - if (data.byte(kDreamnumber) != 4) { + _vars._watchSpeed = 1; + _vars._speedCount = 1; + _vars._reelToWatch = 108; + if (_vars._dreamNumber != 4) { // Wrong - data.word(kWatchingtime) = 40; - data.word(kEndwatchreel) = 127; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._watchingTime = 40; + _vars._endWatchReel = 127; + _vars._watchSpeed = 1; + _vars._speedCount = 1; } else { - data.byte(kProgresspoints)++; - data.word(kWatchingtime) = 60; - data.word(kEndwatchreel) = 135; + _vars._progressPoints++; + _vars._watchingTime = 60; + _vars._endWatchReel = 135; _newLocation = 47; } } @@ -663,19 +663,19 @@ void DreamBase::slabDoorC() { void DreamBase::slabDoorD() { showFirstUse(); _getBack = 1; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.word(kReeltowatch) = 75; - if (data.byte(kDreamnumber) != 0) { + _vars._watchSpeed = 1; + _vars._speedCount = 1; + _vars._reelToWatch = 75; + if (_vars._dreamNumber != 0) { // Wrong - data.word(kWatchingtime) = 40; - data.word(kEndwatchreel) = 94; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._watchingTime = 40; + _vars._endWatchReel = 94; + _vars._watchSpeed = 1; + _vars._speedCount = 1; } else { - data.byte(kProgresspoints)++; - data.word(kWatchingtime) = 60; - data.word(kEndwatchreel) = 102; + _vars._progressPoints++; + _vars._watchingTime = 60; + _vars._endWatchReel = 102; _newLocation = 47; } } @@ -683,19 +683,19 @@ void DreamBase::slabDoorD() { void DreamBase::slabDoorE() { showFirstUse(); _getBack = 1; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.word(kReeltowatch) = 141; - if (data.byte(kDreamnumber) != 5) { + _vars._watchSpeed = 1; + _vars._speedCount = 1; + _vars._reelToWatch = 141; + if (_vars._dreamNumber != 5) { // Wrong - data.word(kWatchingtime) = 40; - data.word(kEndwatchreel) = 160; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._watchingTime = 40; + _vars._endWatchReel = 160; + _vars._watchSpeed = 1; + _vars._speedCount = 1; } else { - data.byte(kProgresspoints)++; - data.word(kWatchingtime) = 60; - data.word(kEndwatchreel) = 168; + _vars._progressPoints++; + _vars._watchingTime = 60; + _vars._endWatchReel = 168; _newLocation = 47; } } @@ -703,19 +703,19 @@ void DreamBase::slabDoorE() { void DreamBase::slabDoorF() { showFirstUse(); _getBack = 1; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.word(kReeltowatch) = 171; - if (data.byte(kDreamnumber) != 2) { + _vars._watchSpeed = 1; + _vars._speedCount = 1; + _vars._reelToWatch = 171; + if (_vars._dreamNumber != 2) { // Wrong - data.word(kWatchingtime) = 40; - data.word(kEndwatchreel) = 189; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._watchingTime = 40; + _vars._endWatchReel = 189; + _vars._watchSpeed = 1; + _vars._speedCount = 1; } else { - data.byte(kProgresspoints)++; - data.word(kWatchingtime) = 60; - data.word(kEndwatchreel) = 197; + _vars._progressPoints++; + _vars._watchingTime = 60; + _vars._endWatchReel = 197; _newLocation = 47; } } @@ -742,15 +742,15 @@ void DreamBase::useChurchGate() { // Cut gate showFirstUse(); - data.word(kWatchingtime) = 64 * 2; - data.word(kReeltowatch) = 4; - data.word(kEndwatchreel) = 70; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._watchingTime = 64 * 2; + _vars._reelToWatch = 4; + _vars._endWatchReel = 70; + _vars._watchSpeed = 1; + _vars._speedCount = 1; _getBack = 1; - data.byte(kProgresspoints)++; + _vars._progressPoints++; turnPathOn(3); - if (data.byte(kAidedead) != 0) + if (_vars._aideDead != 0) turnPathOn(2); // Open church } @@ -764,33 +764,33 @@ void DreamBase::useGun() { } else if (_realLocation == 22) { // in pool room showPuzText(34, 300); - data.byte(kLastweapon) = 1; - data.byte(kCombatcount) = 39; + _vars._lastWeapon = 1; + _vars._combatCount = 39; _getBack = 1; - data.byte(kProgresspoints)++; + _vars._progressPoints++; } else if (_realLocation == 25) { // helicopter showPuzText(34, 300); - data.byte(kLastweapon) = 1; - data.byte(kCombatcount) = 19; + _vars._lastWeapon = 1; + _vars._combatCount = 19; _getBack = 1; - data.byte(kDreamnumber) = 2; - data.byte(kRoomafterdream) = 38; - data.byte(kSartaindead) = 1; - data.byte(kProgresspoints)++; + _vars._dreamNumber = 2; + _vars._roomAfterDream = 38; + _vars._sartainDead = 1; + _vars._progressPoints++; } else if (_realLocation == 27) { // in rock room showPuzText(46, 300); _pointerMode = 2; - data.byte(kRockstardead) = 1; - data.byte(kLastweapon) = 1; - data.byte(kNewsitem) = 1; + _vars._rockstarDead = 1; + _vars._lastWeapon = 1; + _vars._newsItem = 1; _getBack = 1; - data.byte(kRoomafterdream) = 32; - data.byte(kDreamnumber) = 0; - data.byte(kProgresspoints)++; + _vars._roomAfterDream = 32; + _vars._dreamNumber = 0; + _vars._progressPoints++; } else if (_realLocation == 8 && _mapX == 22 && _mapY == 40 && !isSetObOnMap(92) && _mansPath != 9) { @@ -798,9 +798,9 @@ void DreamBase::useGun() { _destination = 9; _finalDest = 9; autoSetWalk(); - data.byte(kLastweapon) = 1; + _vars._lastWeapon = 1; _getBack = 1; - data.byte(kProgresspoints)++; + _vars._progressPoints++; } else if (_realLocation == 6 && _mapX == 11 && _mapY == 20 && isSetObOnMap(5)) { @@ -811,14 +811,14 @@ void DreamBase::useGun() { removeSetObject(5); placeSetObject(6); turnAnyPathOn(1, _roomNum - 1); - data.byte(kLiftflag) = 1; - data.word(kWatchingtime) = 40*2; - data.word(kReeltowatch) = 4; - data.word(kEndwatchreel) = 43; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._liftFlag = 1; + _vars._watchingTime = 40*2; + _vars._reelToWatch = 4; + _vars._endWatchReel = 43; + _vars._watchSpeed = 1; + _vars._speedCount = 1; _getBack = 1; - data.byte(kProgresspoints)++; + _vars._progressPoints++; } else if (_realLocation == 29) { // aide @@ -829,15 +829,15 @@ void DreamBase::useGun() { _destination = 2; _finalDest = 2; autoSetWalk(); - data.word(kWatchingtime) = 164*2; - data.word(kReeltowatch) = 3; - data.word(kEndwatchreel) = 164; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; - data.byte(kAidedead) = 1; - data.byte(kDreamnumber) = 3; - data.byte(kRoomafterdream) = 33; - data.byte(kProgresspoints)++; + _vars._watchingTime = 164*2; + _vars._reelToWatch = 3; + _vars._endWatchReel = 164; + _vars._watchSpeed = 1; + _vars._speedCount = 1; + _vars._aideDead = 1; + _vars._dreamNumber = 3; + _vars._roomAfterDream = 33; + _vars._progressPoints++; } else if (_realLocation == 23 && _mapX == 0 && _mapY == 50) { // with boss @@ -846,7 +846,7 @@ void DreamBase::useGun() { _finalDest = 5; autoSetWalk(); } - data.byte(kLastweapon) = 1; + _vars._lastWeapon = 1; _getBack = 1; } else if (_realLocation == 8 && _mapX == 11 && _mapY == 10) { @@ -856,7 +856,7 @@ void DreamBase::useGun() { _finalDest = 2; autoSetWalk(); } - data.byte(kLastweapon) = 1; + _vars._lastWeapon = 1; _getBack = 1; } else { @@ -866,7 +866,7 @@ void DreamBase::useGun() { } void DreamBase::useFullCart() { - data.byte(kProgresspoints)++; + _vars._progressPoints++; turnAnyPathOn(2, _roomNum + 6); _mansPath = 4; _facing = 4; @@ -875,11 +875,11 @@ void DreamBase::useFullCart() { findXYFromPath(); _resetManXY = 1; showFirstUse(); - data.word(kWatchingtime) = 72 * 2; - data.word(kReeltowatch) = 58; - data.word(kEndwatchreel) = 142; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._watchingTime = 72 * 2; + _vars._reelToWatch = 58; + _vars._endWatchReel = 142; + _vars._watchSpeed = 1; + _vars._speedCount = 1; _getBack = 1; } @@ -888,13 +888,13 @@ void DreamBase::useClearBox() { return; // Open box - data.byte(kProgresspoints)++; + _vars._progressPoints++; showFirstUse(); - data.word(kWatchingtime) = 80; - data.word(kReeltowatch) = 67; - data.word(kEndwatchreel) = 105; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._watchingTime = 80; + _vars._reelToWatch = 67; + _vars._endWatchReel = 105; + _vars._watchSpeed = 1; + _vars._speedCount = 1; _getBack = 1; } @@ -904,7 +904,7 @@ void DreamBase::openTVDoor() { // Key on TV showFirstUse(); - data.byte(kLockstatus) = 0; + _vars._lockStatus = 0; _getBack = 1; } @@ -922,7 +922,7 @@ void DreamBase::usePlate() { placeSetObject(24); removeSetObject(25); placeFreeObject(0); - data.byte(kProgresspoints)++; + _vars._progressPoints++; _getBack = 1; } else if (compare(_withObject, _withType, "KNFE")) { // Tried knife @@ -946,15 +946,15 @@ void DreamBase::usePlinth() { showFirstUse(); putBackObStuff(); } else { - data.byte(kProgresspoints)++; + _vars._progressPoints++; showSecondUse(); - data.word(kWatchingtime) = 220; - data.word(kReeltowatch) = 0; - data.word(kEndwatchreel) = 104; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._watchingTime = 220; + _vars._reelToWatch = 0; + _vars._endWatchReel = 104; + _vars._watchSpeed = 1; + _vars._speedCount = 1; _getBack = 1; - _newLocation = data.byte(kRoomafterdream); + _newLocation = _vars._roomAfterDream; } } @@ -964,12 +964,12 @@ void DreamBase::useElvDoor() { // Axe on door showPuzText(15, 300); - data.byte(kProgresspoints)++; - data.word(kWatchingtime) = 46 * 2; - data.word(kReeltowatch) = 31; - data.word(kEndwatchreel) = 77; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._progressPoints++; + _vars._watchingTime = 46 * 2; + _vars._reelToWatch = 31; + _vars._endWatchReel = 77; + _vars._watchSpeed = 1; + _vars._speedCount = 1; _getBack = 1; } @@ -997,19 +997,19 @@ void DreamBase::useWinch() { return; } - data.word(kWatchingtime) = 217 * 2; - data.word(kReeltowatch) = 0; - data.word(kEndwatchreel) = 217; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._watchingTime = 217 * 2; + _vars._reelToWatch = 0; + _vars._endWatchReel = 217; + _vars._watchSpeed = 1; + _vars._speedCount = 1; _destPos = 1; _newLocation = 45; - data.byte(kDreamnumber) = 1; - data.byte(kRoomafterdream) = 44; - data.byte(kGeneraldead) = 1; - data.byte(kNewsitem) = 2; + _vars._dreamNumber = 1; + _vars._roomAfterDream = 44; + _vars._generalDead = 1; + _vars._newsItem = 2; _getBack = 1; - data.byte(kProgresspoints)++; + _vars._progressPoints++; } void DreamBase::useCart() { @@ -1020,7 +1020,7 @@ void DreamBase::useCart() { exObject->mapad[0] = 0; removeSetObject(_command); placeSetObject(_command + 1); - data.byte(kProgresspoints)++; + _vars._progressPoints++; playChannel1(17); showFirstUse(); _getBack = 1; @@ -1032,7 +1032,7 @@ void DreamBase::useTrainer() { if (object->mapad[0] != 4) { notHeldError(); } else { - data.byte(kProgresspoints)++; + _vars._progressPoints++; makeWorn(object); showSecondUse(); putBackObStuff(); @@ -1056,7 +1056,7 @@ void DreamBase::useHole() { removeSetObject(86); DynObject *exObject = getExAd(_withObject); exObject->mapad[0] = 255; - data.byte(kCanmovealtar) = 1; + _vars._canMoveAltar = 1; _getBack = 1; } @@ -1066,7 +1066,7 @@ void DreamBase::openHotelDoor() { playChannel1(16); showFirstUse(); - data.byte(kLockstatus) = 0; + _vars._lockStatus = 0; _getBack = 1; } @@ -1091,14 +1091,14 @@ void DreamBase::usePoolReader() { if (defaultUseHandler("MEMB")) return; - if (data.byte(kTalkedtoattendant) != 1) { + if (_vars._talkedToAttendant != 1) { // Can't open pool showSecondUse(); putBackObStuff(); } else { playChannel1(17); showFirstUse(); - data.byte(kCounttoopen) = 6; + _vars._countToOpen = 6; _getBack = 1; } } @@ -1107,11 +1107,11 @@ void DreamBase::useCardReader1() { if (defaultUseHandler("CSHR")) return; - if (data.byte(kTalkedtosparky) == 0) { + if (_vars._talkedToSparky == 0) { // Not yet showFirstUse(); putBackObStuff(); - } else if (data.word(kCard1money) != 0) { + } else if (_vars._card1Money != 0) { // No cash showPuzText(17, 300); putBackObStuff(); @@ -1119,8 +1119,8 @@ void DreamBase::useCardReader1() { // Get cash playChannel1(16); showPuzText(18, 300); - data.byte(kProgresspoints)++; - data.word(kCard1money) = 12432; + _vars._progressPoints++; + _vars._card1Money = 12432; _getBack = 1; } } @@ -1129,15 +1129,15 @@ void DreamBase::useCardReader2() { if (defaultUseHandler("CSHR")) return; - if (data.byte(kTalkedtoboss) == 0) { + if (_vars._talkedToBoss == 0) { // Haven't talked to boss showFirstUse(); putBackObStuff(); - } else if (data.byte(kCard1money) == 0) { + } else if (_vars._card1Money == 0) { // No cash showPuzText(20, 300); putBackObStuff(); - } else if (data.byte(kGunpassflag) == 2) { + } else if (_vars._gunPassFlag == 2) { // Already got new showPuzText(22, 300); putBackObStuff(); @@ -1145,9 +1145,9 @@ void DreamBase::useCardReader2() { playChannel1(18); showPuzText(19, 300); placeSetObject(94); - data.byte(kGunpassflag) = 1; - data.word(kCard1money) -= 2000; - data.byte(kProgresspoints)++; + _vars._gunPassFlag = 1; + _vars._card1Money -= 2000; + _vars._progressPoints++; _getBack = 1; } } @@ -1156,20 +1156,20 @@ void DreamBase::useCardReader3() { if (defaultUseHandler("CSHR")) return; - if (data.byte(kTalkedtorecep) == 0) { + if (_vars._talkedToRecep == 0) { // Haven't talked to receptionist showFirstUse(); putBackObStuff(); - } else if (data.byte(kCardpassflag) != 0) { + } else if (_vars._cardPassFlag != 0) { // Already used it showPuzText(26, 300); putBackObStuff(); } else { playChannel1(16); showPuzText(25, 300); - data.byte(kProgresspoints)++; - data.word(kCard1money) -= 8300; - data.byte(kCardpassflag) = 1; + _vars._progressPoints++; + _vars._card1Money -= 8300; + _vars._cardPassFlag = 1; _getBack = 1; } } @@ -1201,7 +1201,7 @@ void DreamBase::useWire() { removeSetObject(51); placeSetObject(52); showPuzText(11, 300); - data.byte(kProgresspoints)++; + _vars._progressPoints++; _getBack = 1; return; } @@ -1217,13 +1217,13 @@ void DreamBase::useWire() { } void DreamBase::openTomb() { - data.byte(kProgresspoints)++; + _vars._progressPoints++; showFirstUse(); - data.word(kWatchingtime) = 35 * 2; - data.word(kReeltowatch) = 1; - data.word(kEndwatchreel) = 33; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._watchingTime = 35 * 2; + _vars._reelToWatch = 1; + _vars._endWatchReel = 33; + _vars._watchSpeed = 1; + _vars._speedCount = 1; _getBack = 1; } @@ -1308,7 +1308,7 @@ void DreamBase::useControl() { if (compare(_withObject, _withType, "KEYA")) { // Right key playChannel1(16); - if (data.byte(kLocation) == 21) { // Going down + if (_vars._location == 21) { // Going down showPuzText(3, 300); _newLocation = 30; } else { @@ -1316,9 +1316,9 @@ void DreamBase::useControl() { _newLocation = 21; } - data.byte(kCounttoclose) = 8; - data.byte(kCounttoopen) = 0; - data.word(kWatchingtime) = 80; + _vars._countToClose = 8; + _vars._countToOpen = 0; + _vars._watchingTime = 80; _getBack = 1; return; } @@ -1334,12 +1334,12 @@ void DreamBase::useControl() { removeSetObject(17); playChannel1(14); showPuzText(10, 300); - data.byte(kProgresspoints)++; + _vars._progressPoints++; _getBack = 1; } else if (compare(_withObject, _withType, "AXED")) { // Axe on controls showPuzText(16, 300); - data.byte(kProgresspoints)++; + _vars._progressPoints++; putBackObStuff(); } else { // Balls @@ -1373,14 +1373,14 @@ void DreamBase::useSlab() { if (_command + 1 == 54) { // Last slab turnPathOn(0); - data.word(kWatchingtime) = 22; - data.word(kReeltowatch) = 35; - data.word(kEndwatchreel) = 48; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._watchingTime = 22; + _vars._reelToWatch = 35; + _vars._endWatchReel = 48; + _vars._watchSpeed = 1; + _vars._speedCount = 1; } - data.byte(kProgresspoints)++; + _vars._progressPoints++; showFirstUse(); _getBack = 1; } @@ -1416,15 +1416,15 @@ void DreamBase::useOpenBox() { if (compare(_withObject, _withType, "CUPF")) { // Destroy open box - data.byte(kProgresspoints)++; + _vars._progressPoints++; showPuzText(37, 300); DynObject *exObject = getExAd(_withObject); exObject->id[3] = 'E'-'A'; // CUPF (full cup) -> CUPE (empty cup) - data.word(kWatchingtime) = 140; - data.word(kReeltowatch) = 105; - data.word(kEndwatchreel) = 181; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._watchingTime = 140; + _vars._reelToWatch = 105; + _vars._endWatchReel = 181; + _vars._watchSpeed = 1; + _vars._speedCount = 1; turnPathOn(4); _getBack = 1; return; @@ -1477,19 +1477,19 @@ void DreamBase::useAxe() { if (_mapY == 10) { // Axe on door showPuzText(15, 300); - data.byte(kProgresspoints)++; - data.word(kWatchingtime) = 46*2; - data.word(kReeltowatch) = 31; - data.word(kEndwatchreel) = 77; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._progressPoints++; + _vars._watchingTime = 46*2; + _vars._reelToWatch = 31; + _vars._endWatchReel = 77; + _vars._watchSpeed = 1; + _vars._speedCount = 1; _getBack = 1; return; } showSecondUse(); - data.byte(kProgresspoints)++; - data.byte(kLastweapon) = 2; + _vars._progressPoints++; + _vars._lastWeapon = 2; _getBack = 1; removeObFromInv(); } @@ -1516,15 +1516,15 @@ void DreamBase::useAltar() { return; } - if (data.byte(kCanmovealtar) == 1) { + if (_vars._canMoveAltar == 1) { // Move altar - data.byte(kProgresspoints)++; + _vars._progressPoints++; showSecondUse(); - data.word(kWatchingtime) = 160; - data.word(kReeltowatch) = 81; - data.word(kEndwatchreel) = 174; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._watchingTime = 160; + _vars._reelToWatch = 81; + _vars._endWatchReel = 174; + _vars._watchSpeed = 1; + _vars._speedCount = 1; DreamBase::setupTimedUse(47, 32, 98, 52, 76); _getBack = 1; } else { @@ -1583,10 +1583,10 @@ void DreamBase::useCashCard() { y = 98; printDirect(&obText, 36, &y, 36, 36 & 1); char amountStr[10]; - sprintf(amountStr, "%04d", data.word(kCard1money) / 10); + sprintf(amountStr, "%04d", _vars._card1Money / 10); _charShift = 91 * 2 + 75; printDirect((const uint8 *)amountStr, 160, 155, 240, 240 & 1); - sprintf(amountStr, "%02d", (data.word(kCard1money) % 10) * 10); + sprintf(amountStr, "%02d", (_vars._card1Money % 10) * 10); _charShift = 91 * 2 + 85; printDirect((const uint8 *)amountStr, 187, 155, 240, 240 & 1); _charShift = 0; @@ -1601,7 +1601,7 @@ void DreamBase::useStereo() { // Handles the stereo in Ryan's apartment (accessible from the remote on // the couch) - if (data.byte(kLocation) != 0) { + if (_vars._location != 0) { showPuzText(4, 400); putBackObStuff(); } else if (_mapX != 11) { @@ -1656,13 +1656,13 @@ void DreamBase::useButtonA() { turnAnyPathOn(0, _roomNum - 1); removeSetObject(9); placeSetObject(95); - data.word(kWatchingtime) = 15 * 2; - data.word(kReeltowatch) = 71; - data.word(kEndwatchreel) = 85; - data.byte(kWatchspeed) = 1; - data.byte(kSpeedcount) = 1; + _vars._watchingTime = 15 * 2; + _vars._reelToWatch = 71; + _vars._endWatchReel = 85; + _vars._watchSpeed = 1; + _vars._speedCount = 1; _getBack = 1; - data.byte(kProgresspoints)++; + _vars._progressPoints++; } else { // Done this bit showSecondUse(); -- cgit v1.2.3 From 279746fcf0a3aac428e75bf7ca7e043cb0572aa6 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Wed, 28 Dec 2011 15:07:17 +0200 Subject: DREAMWEB: Completely remove all of the runtime, and move everything into DreamWebEngine Also, remove dead code (allocateMem/deallocateMem) --- engines/dreamweb/use.cpp | 358 +++++++++++++++++++++++------------------------ 1 file changed, 179 insertions(+), 179 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index ebebc45ad5..6ab8422075 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -22,10 +22,10 @@ #include "dreamweb/dreamweb.h" -namespace DreamGen { +namespace DreamWeb { -typedef void (DreamBase::*UseCallback)(void); +typedef void (DreamWebEngine::*UseCallback)(void); // Note: The callback pointer has been placed before the // ID to keep MSVC happy (otherwise, it throws warnings @@ -35,90 +35,90 @@ struct UseListEntry { const char *id; }; -void DreamBase::useRoutine() { +void DreamWebEngine::useRoutine() { static const UseListEntry kUseList[] = { - { &DreamBase::useMon, "NETW" }, - { &DreamBase::useElevator1, "ELVA" }, - { &DreamBase::useElevator2, "ELVB" }, - { &DreamBase::useElevator3, "ELVC" }, - { &DreamBase::useElevator4, "ELVE" }, - { &DreamBase::useElevator5, "ELVF" }, - { &DreamBase::useChurchGate, "CGAT" }, - { &DreamBase::useStereo, "REMO" }, - { &DreamBase::useButtonA, "BUTA" }, - { &DreamBase::useWinch, "CBOX" }, - { &DreamBase::useLighter, "LITE" }, - { &DreamBase::usePlate, "PLAT" }, - { &DreamBase::useControl, "LIFT" }, - { &DreamBase::useWire, "WIRE" }, - { &DreamBase::useHandle, "HNDL" }, - { &DreamBase::useHatch, "HACH" }, - { &DreamBase::useElvDoor, "DOOR" }, - { &DreamBase::useCashCard, "CSHR" }, - { &DreamBase::useGun, "GUNA" }, - { &DreamBase::useCardReader1, "CRAA" }, - { &DreamBase::useCardReader2, "CRBB" }, - { &DreamBase::useCardReader3, "CRCC" }, - { &DreamBase::sitDownInBar, "SEAT" }, - { &DreamBase::useMenu, "MENU" }, - { &DreamBase::useCooker, "COOK" }, - { &DreamBase::callHotelLift, "ELCA" }, - { &DreamBase::callEdensLift, "EDCA" }, - { &DreamBase::callEdensDLift, "DDCA" }, - { &DreamBase::useAltar, "ALTR" }, - { &DreamBase::openHotelDoor, "LOKA" }, - { &DreamBase::openHotelDoor2, "LOKB" }, - { &DreamBase::openLouis, "ENTA" }, - { &DreamBase::openRyan, "ENTB" }, - { &DreamBase::openPoolBoss, "ENTE" }, - { &DreamBase::openYourNeighbour, "ENTC" }, - { &DreamBase::openEden, "ENTD" }, - { &DreamBase::openSarters, "ENTH" }, - { &DreamBase::wearWatch, "WWAT" }, - { &DreamBase::usePoolReader, "POOL" }, - { &DreamBase::wearShades, "WSHD" }, - { &DreamBase::grafittiDoor, "GRAF" }, - { &DreamBase::trapDoor, "TRAP" }, - { &DreamBase::edensCDPlayer, "CDPE" }, - { &DreamBase::openTVDoor, "DLOK" }, - { &DreamBase::useHole, "HOLE" }, - { &DreamBase::useDryer, "DRYR" }, - { &DreamBase::useChurchHole, "HOLY" }, - { &DreamBase::useWall, "WALL" }, - { &DreamBase::useDiary, "BOOK" }, - { &DreamBase::useAxe, "AXED" }, - { &DreamBase::useShield, "SHLD" }, - { &DreamBase::useRailing, "BCNY" }, - { &DreamBase::useCoveredBox, "LIDC" }, - { &DreamBase::useClearBox, "LIDU" }, - { &DreamBase::useOpenBox, "LIDO" }, - { &DreamBase::usePipe, "PIPE" }, - { &DreamBase::useBalcony, "BALC" }, - { &DreamBase::useWindow, "WIND" }, - { &DreamBase::viewFolder, "PAPR" }, - { &DreamBase::useTrainer, "UWTA" }, - { &DreamBase::useTrainer, "UWTB" }, - { &DreamBase::enterSymbol, "STAT" }, - { &DreamBase::openTomb, "TLID" }, - { &DreamBase::useSlab, "SLAB" }, - { &DreamBase::useCart, "CART" }, - { &DreamBase::useFullCart, "FCAR" }, - { &DreamBase::slabDoorA, "SLBA" }, - { &DreamBase::slabDoorB, "SLBB" }, - { &DreamBase::slabDoorC, "SLBC" }, - { &DreamBase::slabDoorD, "SLBD" }, - { &DreamBase::slabDoorE, "SLBE" }, - { &DreamBase::slabDoorF, "SLBF" }, - { &DreamBase::usePlinth, "PLIN" }, - { &DreamBase::useLadder, "LADD" }, - { &DreamBase::useLadderB, "LADB" }, - { &DreamBase::chewy, "GUMA" }, - { &DreamBase::wheelSound, "SQEE" }, - { &DreamBase::runTap, "TAPP" }, - { &DreamBase::playGuitar, "GUIT" }, - { &DreamBase::hotelControl, "CONT" }, - { &DreamBase::hotelBell, "BELL" }, + { &DreamWebEngine::useMon, "NETW" }, + { &DreamWebEngine::useElevator1, "ELVA" }, + { &DreamWebEngine::useElevator2, "ELVB" }, + { &DreamWebEngine::useElevator3, "ELVC" }, + { &DreamWebEngine::useElevator4, "ELVE" }, + { &DreamWebEngine::useElevator5, "ELVF" }, + { &DreamWebEngine::useChurchGate, "CGAT" }, + { &DreamWebEngine::useStereo, "REMO" }, + { &DreamWebEngine::useButtonA, "BUTA" }, + { &DreamWebEngine::useWinch, "CBOX" }, + { &DreamWebEngine::useLighter, "LITE" }, + { &DreamWebEngine::usePlate, "PLAT" }, + { &DreamWebEngine::useControl, "LIFT" }, + { &DreamWebEngine::useWire, "WIRE" }, + { &DreamWebEngine::useHandle, "HNDL" }, + { &DreamWebEngine::useHatch, "HACH" }, + { &DreamWebEngine::useElvDoor, "DOOR" }, + { &DreamWebEngine::useCashCard, "CSHR" }, + { &DreamWebEngine::useGun, "GUNA" }, + { &DreamWebEngine::useCardReader1, "CRAA" }, + { &DreamWebEngine::useCardReader2, "CRBB" }, + { &DreamWebEngine::useCardReader3, "CRCC" }, + { &DreamWebEngine::sitDownInBar, "SEAT" }, + { &DreamWebEngine::useMenu, "MENU" }, + { &DreamWebEngine::useCooker, "COOK" }, + { &DreamWebEngine::callHotelLift, "ELCA" }, + { &DreamWebEngine::callEdensLift, "EDCA" }, + { &DreamWebEngine::callEdensDLift, "DDCA" }, + { &DreamWebEngine::useAltar, "ALTR" }, + { &DreamWebEngine::openHotelDoor, "LOKA" }, + { &DreamWebEngine::openHotelDoor2, "LOKB" }, + { &DreamWebEngine::openLouis, "ENTA" }, + { &DreamWebEngine::openRyan, "ENTB" }, + { &DreamWebEngine::openPoolBoss, "ENTE" }, + { &DreamWebEngine::openYourNeighbour, "ENTC" }, + { &DreamWebEngine::openEden, "ENTD" }, + { &DreamWebEngine::openSarters, "ENTH" }, + { &DreamWebEngine::wearWatch, "WWAT" }, + { &DreamWebEngine::usePoolReader, "POOL" }, + { &DreamWebEngine::wearShades, "WSHD" }, + { &DreamWebEngine::grafittiDoor, "GRAF" }, + { &DreamWebEngine::trapDoor, "TRAP" }, + { &DreamWebEngine::edensCDPlayer, "CDPE" }, + { &DreamWebEngine::openTVDoor, "DLOK" }, + { &DreamWebEngine::useHole, "HOLE" }, + { &DreamWebEngine::useDryer, "DRYR" }, + { &DreamWebEngine::useChurchHole, "HOLY" }, + { &DreamWebEngine::useWall, "WALL" }, + { &DreamWebEngine::useDiary, "BOOK" }, + { &DreamWebEngine::useAxe, "AXED" }, + { &DreamWebEngine::useShield, "SHLD" }, + { &DreamWebEngine::useRailing, "BCNY" }, + { &DreamWebEngine::useCoveredBox, "LIDC" }, + { &DreamWebEngine::useClearBox, "LIDU" }, + { &DreamWebEngine::useOpenBox, "LIDO" }, + { &DreamWebEngine::usePipe, "PIPE" }, + { &DreamWebEngine::useBalcony, "BALC" }, + { &DreamWebEngine::useWindow, "WIND" }, + { &DreamWebEngine::viewFolder, "PAPR" }, + { &DreamWebEngine::useTrainer, "UWTA" }, + { &DreamWebEngine::useTrainer, "UWTB" }, + { &DreamWebEngine::enterSymbol, "STAT" }, + { &DreamWebEngine::openTomb, "TLID" }, + { &DreamWebEngine::useSlab, "SLAB" }, + { &DreamWebEngine::useCart, "CART" }, + { &DreamWebEngine::useFullCart, "FCAR" }, + { &DreamWebEngine::slabDoorA, "SLBA" }, + { &DreamWebEngine::slabDoorB, "SLBB" }, + { &DreamWebEngine::slabDoorC, "SLBC" }, + { &DreamWebEngine::slabDoorD, "SLBD" }, + { &DreamWebEngine::slabDoorE, "SLBE" }, + { &DreamWebEngine::slabDoorF, "SLBF" }, + { &DreamWebEngine::usePlinth, "PLIN" }, + { &DreamWebEngine::useLadder, "LADD" }, + { &DreamWebEngine::useLadderB, "LADB" }, + { &DreamWebEngine::chewy, "GUMA" }, + { &DreamWebEngine::wheelSound, "SQEE" }, + { &DreamWebEngine::runTap, "TAPP" }, + { &DreamWebEngine::playGuitar, "GUIT" }, + { &DreamWebEngine::hotelControl, "CONT" }, + { &DreamWebEngine::hotelBell, "BELL" }, }; if (_realLocation >= 50) { @@ -163,7 +163,7 @@ void DreamBase::useRoutine() { _commandType = 255; } -void DreamBase::useText(const uint8 *string) { +void DreamWebEngine::useText(const uint8 *string) { createPanel(); showPanel(); showMan(); @@ -173,7 +173,7 @@ void DreamBase::useText(const uint8 *string) { workToScreenM(); } -void DreamBase::showFirstUse() { +void DreamWebEngine::showFirstUse() { const uint8 *obText = getObTextStart(); findNextColon(&obText); findNextColon(&obText); @@ -181,7 +181,7 @@ void DreamBase::showFirstUse() { hangOnP(400); } -void DreamBase::showSecondUse() { +void DreamWebEngine::showSecondUse() { const uint8 *obText = getObTextStart(); findNextColon(&obText); findNextColon(&obText); @@ -190,7 +190,7 @@ void DreamBase::showSecondUse() { hangOnP(400); } -void DreamBase::viewFolder() { +void DreamWebEngine::viewFolder() { _manIsOffScreen = 1; getRidOfAll(); loadFolder(); @@ -219,7 +219,7 @@ void DreamBase::viewFolder() { workToScreenM(); } -void DreamBase::edensCDPlayer() { +void DreamWebEngine::edensCDPlayer() { showFirstUse(); _vars._watchingTime = 18 * 2; _vars._reelToWatch = 25; @@ -229,25 +229,25 @@ void DreamBase::edensCDPlayer() { _getBack = 1; } -void DreamBase::hotelBell() { +void DreamWebEngine::hotelBell() { playChannel1(12); showFirstUse(); putBackObStuff(); } -void DreamBase::playGuitar() { +void DreamWebEngine::playGuitar() { playChannel1(14); showFirstUse(); putBackObStuff(); } -void DreamBase::useElevator1() { +void DreamWebEngine::useElevator1() { showFirstUse(); selectLocation(); _getBack = 1; } -void DreamBase::useElevator2() { +void DreamWebEngine::useElevator2() { showFirstUse(); if (_vars._location == 23) // In pool hall @@ -261,7 +261,7 @@ void DreamBase::useElevator2() { _getBack = 1; } -void DreamBase::useElevator3() { +void DreamWebEngine::useElevator3() { showFirstUse(); _vars._countToClose = 20; _newLocation = 34; @@ -273,7 +273,7 @@ void DreamBase::useElevator3() { _getBack = 1; } -void DreamBase::useElevator4() { +void DreamWebEngine::useElevator4() { showFirstUse(); _vars._reelToWatch = 0; _vars._endWatchReel = 11; @@ -285,7 +285,7 @@ void DreamBase::useElevator4() { _newLocation = 24; } -void DreamBase::useElevator5() { +void DreamWebEngine::useElevator5() { placeSetObject(4); removeSetObject(0); _newLocation = 20; @@ -295,19 +295,19 @@ void DreamBase::useElevator5() { _getBack = 1; } -void DreamBase::useHatch() { +void DreamWebEngine::useHatch() { showFirstUse(); _newLocation = 40; _getBack = 1; } -void DreamBase::wheelSound() { +void DreamWebEngine::wheelSound() { playChannel1(17); showFirstUse(); putBackObStuff(); } -void DreamBase::callHotelLift() { +void DreamWebEngine::callHotelLift() { playChannel1(12); showFirstUse(); _vars._countToOpen = 8; @@ -318,7 +318,7 @@ void DreamBase::callHotelLift() { turnPathOn(4); } -void DreamBase::useShield() { +void DreamWebEngine::useShield() { if (_realLocation != 20 || _vars._combatCount == 0) { // Not in Sart room showFirstUse(); @@ -332,7 +332,7 @@ void DreamBase::useShield() { } } -void DreamBase::useCoveredBox() { +void DreamWebEngine::useCoveredBox() { _vars._progressPoints++; showFirstUse(); _vars._watchingTime = 50; @@ -343,7 +343,7 @@ void DreamBase::useCoveredBox() { _getBack = 1; } -void DreamBase::useRailing() { +void DreamWebEngine::useRailing() { showFirstUse(); _vars._watchingTime = 80; _vars._reelToWatch = 0; @@ -354,7 +354,7 @@ void DreamBase::useRailing() { _vars._manDead = 4; } -void DreamBase::wearWatch() { +void DreamWebEngine::wearWatch() { if (_vars._watchOn == 1) { // Already wearing watch showSecondUse(); @@ -368,7 +368,7 @@ void DreamBase::wearWatch() { } } -void DreamBase::wearShades() { +void DreamWebEngine::wearShades() { if (_vars._shadesOn == 1) { // Already wearing shades showSecondUse(); @@ -382,7 +382,7 @@ void DreamBase::wearShades() { } } -void DreamBase::useChurchHole() { +void DreamWebEngine::useChurchHole() { showFirstUse(); _getBack = 1; _vars._watchingTime = 28; @@ -392,7 +392,7 @@ void DreamBase::useChurchHole() { _vars._speedCount = 1; } -void DreamBase::sitDownInBar() { +void DreamWebEngine::sitDownInBar() { if (_vars._watchMode != 0xFF) { // Sat down showSecondUse(); @@ -410,13 +410,13 @@ void DreamBase::sitDownInBar() { } } -void DreamBase::useDryer() { +void DreamWebEngine::useDryer() { playChannel1(12); showFirstUse(); _getBack = 1; } -void DreamBase::useBalcony() { +void DreamWebEngine::useBalcony() { showFirstUse(); turnPathOn(6); turnPathOff(0); @@ -440,7 +440,7 @@ void DreamBase::useBalcony() { _getBack = 1; } -void DreamBase::useWindow() { +void DreamWebEngine::useWindow() { if (_mansPath != 6) { // Not on balcony showSecondUse(); @@ -453,7 +453,7 @@ void DreamBase::useWindow() { } } -void DreamBase::trapDoor() { +void DreamWebEngine::trapDoor() { _vars._progressPoints++; showFirstUse(); switchRyanOff(); @@ -466,14 +466,14 @@ void DreamBase::trapDoor() { _getBack = 1; } -void DreamBase::callEdensLift() { +void DreamWebEngine::callEdensLift() { showFirstUse(); _vars._countToOpen = 8; _getBack = 1; turnPathOn(2); } -void DreamBase::callEdensDLift() { +void DreamWebEngine::callEdensDLift() { if (_vars._liftFlag == 1) { // Eden's D here showSecondUse(); @@ -486,38 +486,38 @@ void DreamBase::callEdensDLift() { } } -void DreamBase::openYourNeighbour() { +void DreamWebEngine::openYourNeighbour() { enterCode(255, 255, 255, 255); _getBack = 1; } -void DreamBase::openRyan() { +void DreamWebEngine::openRyan() { enterCode(5, 1, 0, 6); _getBack = 1; } -void DreamBase::openPoolBoss() { +void DreamWebEngine::openPoolBoss() { enterCode(5, 2, 2, 2); _getBack = 1; } -void DreamBase::openEden() { +void DreamWebEngine::openEden() { enterCode(2, 8, 6, 5); _getBack = 1; } -void DreamBase::openSarters() { +void DreamWebEngine::openSarters() { enterCode(7, 8, 3, 3); _getBack = 1; } -void DreamBase::openLouis() { +void DreamWebEngine::openLouis() { enterCode(5, 2, 3, 8); _getBack = 1; } -void DreamBase::useWall() { +void DreamWebEngine::useWall() { showFirstUse(); if (_mansPath != 3) { @@ -560,7 +560,7 @@ void DreamBase::useWall() { } } -void DreamBase::useLadder() { +void DreamWebEngine::useLadder() { showFirstUse(); _mapX = _mapX - 11; findRoomInLoc(); @@ -574,7 +574,7 @@ void DreamBase::useLadder() { _getBack = 1; } -void DreamBase::useLadderB() { +void DreamWebEngine::useLadderB() { showFirstUse(); _mapX = _mapX + 11; findRoomInLoc(); @@ -588,7 +588,7 @@ void DreamBase::useLadderB() { _getBack = 1; } -void DreamBase::slabDoorA() { +void DreamWebEngine::slabDoorA() { showFirstUse(); _getBack = 1; _vars._watchSpeed = 1; @@ -608,7 +608,7 @@ void DreamBase::slabDoorA() { } } -void DreamBase::slabDoorB() { +void DreamWebEngine::slabDoorB() { if (_vars._dreamNumber != 1) { // Wrong showFirstUse(); @@ -640,7 +640,7 @@ void DreamBase::slabDoorB() { } } -void DreamBase::slabDoorC() { +void DreamWebEngine::slabDoorC() { showFirstUse(); _getBack = 1; _vars._watchSpeed = 1; @@ -660,7 +660,7 @@ void DreamBase::slabDoorC() { } } -void DreamBase::slabDoorD() { +void DreamWebEngine::slabDoorD() { showFirstUse(); _getBack = 1; _vars._watchSpeed = 1; @@ -680,7 +680,7 @@ void DreamBase::slabDoorD() { } } -void DreamBase::slabDoorE() { +void DreamWebEngine::slabDoorE() { showFirstUse(); _getBack = 1; _vars._watchSpeed = 1; @@ -700,7 +700,7 @@ void DreamBase::slabDoorE() { } } -void DreamBase::slabDoorF() { +void DreamWebEngine::slabDoorF() { showFirstUse(); _getBack = 1; _vars._watchSpeed = 1; @@ -720,7 +720,7 @@ void DreamBase::slabDoorF() { } } -bool DreamBase::defaultUseHandler(const char *id) { +bool DreamWebEngine::defaultUseHandler(const char *id) { if (_withObject == 255) { withWhat(); return true; // event handled @@ -736,7 +736,7 @@ bool DreamBase::defaultUseHandler(const char *id) { return false; // continue with the original event } -void DreamBase::useChurchGate() { +void DreamWebEngine::useChurchGate() { if (defaultUseHandler("CUTT")) return; @@ -754,7 +754,7 @@ void DreamBase::useChurchGate() { turnPathOn(2); // Open church } -void DreamBase::useGun() { +void DreamWebEngine::useGun() { if (_objectType != kExObjectType) { // gun is not taken @@ -865,7 +865,7 @@ void DreamBase::useGun() { } } -void DreamBase::useFullCart() { +void DreamWebEngine::useFullCart() { _vars._progressPoints++; turnAnyPathOn(2, _roomNum + 6); _mansPath = 4; @@ -883,7 +883,7 @@ void DreamBase::useFullCart() { _getBack = 1; } -void DreamBase::useClearBox() { +void DreamWebEngine::useClearBox() { if (defaultUseHandler("RAIL")) return; @@ -898,7 +898,7 @@ void DreamBase::useClearBox() { _getBack = 1; } -void DreamBase::openTVDoor() { +void DreamWebEngine::openTVDoor() { if (defaultUseHandler("ULOK")) return; @@ -908,7 +908,7 @@ void DreamBase::openTVDoor() { _getBack = 1; } -void DreamBase::usePlate() { +void DreamWebEngine::usePlate() { if (_withObject == 255) { withWhat(); return; @@ -935,7 +935,7 @@ void DreamBase::usePlate() { } } -void DreamBase::usePlinth() { +void DreamWebEngine::usePlinth() { if (_withObject == 255) { withWhat(); return; @@ -958,7 +958,7 @@ void DreamBase::usePlinth() { } } -void DreamBase::useElvDoor() { +void DreamWebEngine::useElvDoor() { if (defaultUseHandler("AXED")) return; @@ -973,7 +973,7 @@ void DreamBase::useElvDoor() { _getBack = 1; } -void DreamBase::useObject() { +void DreamWebEngine::useObject() { _withObject = 255; if (_commandType != 229) { @@ -988,7 +988,7 @@ void DreamBase::useObject() { useRoutine(); } -void DreamBase::useWinch() { +void DreamWebEngine::useWinch() { uint16 contentIndex = checkInside(40, 1); if (contentIndex == kNumexobjects || !compare(contentIndex, kExObjectType, "FUSE")) { // No winch @@ -1012,7 +1012,7 @@ void DreamBase::useWinch() { _vars._progressPoints++; } -void DreamBase::useCart() { +void DreamWebEngine::useCart() { if (defaultUseHandler("ROCK")) return; @@ -1026,7 +1026,7 @@ void DreamBase::useCart() { _getBack = 1; } -void DreamBase::useTrainer() { +void DreamWebEngine::useTrainer() { uint8 dummy; DynObject *object = (DynObject *)getAnyAd(&dummy, &dummy); if (object->mapad[0] != 4) { @@ -1039,7 +1039,7 @@ void DreamBase::useTrainer() { } } -void DreamBase::chewy() { +void DreamWebEngine::chewy() { // Chewing a gum showFirstUse(); uint8 dummy; @@ -1048,7 +1048,7 @@ void DreamBase::chewy() { _getBack = 1; } -void DreamBase::useHole() { +void DreamWebEngine::useHole() { if (defaultUseHandler("HNDA")) return; @@ -1060,7 +1060,7 @@ void DreamBase::useHole() { _getBack = 1; } -void DreamBase::openHotelDoor() { +void DreamWebEngine::openHotelDoor() { if (defaultUseHandler("KEYA")) return; @@ -1070,7 +1070,7 @@ void DreamBase::openHotelDoor() { _getBack = 1; } -void DreamBase::openHotelDoor2() { +void DreamWebEngine::openHotelDoor2() { if (defaultUseHandler("KEYA")) return; @@ -1079,7 +1079,7 @@ void DreamBase::openHotelDoor2() { putBackObStuff(); } -void DreamBase::grafittiDoor() { +void DreamWebEngine::grafittiDoor() { if (defaultUseHandler("APEN")) return; @@ -1087,7 +1087,7 @@ void DreamBase::grafittiDoor() { putBackObStuff(); } -void DreamBase::usePoolReader() { +void DreamWebEngine::usePoolReader() { if (defaultUseHandler("MEMB")) return; @@ -1103,7 +1103,7 @@ void DreamBase::usePoolReader() { } } -void DreamBase::useCardReader1() { +void DreamWebEngine::useCardReader1() { if (defaultUseHandler("CSHR")) return; @@ -1125,7 +1125,7 @@ void DreamBase::useCardReader1() { } } -void DreamBase::useCardReader2() { +void DreamWebEngine::useCardReader2() { if (defaultUseHandler("CSHR")) return; @@ -1152,7 +1152,7 @@ void DreamBase::useCardReader2() { } } -void DreamBase::useCardReader3() { +void DreamWebEngine::useCardReader3() { if (defaultUseHandler("CSHR")) return; @@ -1174,7 +1174,7 @@ void DreamBase::useCardReader3() { } } -void DreamBase::useLighter() { +void DreamWebEngine::useLighter() { if (_withObject == 255) { withWhat(); return; @@ -1191,7 +1191,7 @@ void DreamBase::useLighter() { } } -void DreamBase::useWire() { +void DreamWebEngine::useWire() { if (_withObject == 255) { withWhat(); return; @@ -1216,7 +1216,7 @@ void DreamBase::useWire() { putBackObStuff(); } -void DreamBase::openTomb() { +void DreamWebEngine::openTomb() { _vars._progressPoints++; showFirstUse(); _vars._watchingTime = 35 * 2; @@ -1227,7 +1227,7 @@ void DreamBase::openTomb() { _getBack = 1; } -void DreamBase::hotelControl() { +void DreamWebEngine::hotelControl() { if (_realLocation != 21 || _mapX != 33) showSecondUse(); // Not right control else @@ -1236,7 +1236,7 @@ void DreamBase::hotelControl() { putBackObStuff(); } -void DreamBase::useCooker() { +void DreamWebEngine::useCooker() { if (checkInside(_command, _objectType) == kNumexobjects) showFirstUse(); else @@ -1245,16 +1245,16 @@ void DreamBase::useCooker() { putBackObStuff(); } -void DreamBase::placeFreeObject(uint8 index) { +void DreamWebEngine::placeFreeObject(uint8 index) { findOrMake(index, 0, 1); getFreeAd(index)->mapad[0] = 0; } -void DreamBase::removeFreeObject(uint8 index) { +void DreamWebEngine::removeFreeObject(uint8 index) { getFreeAd(index)->mapad[0] = 0xFF; } -void DreamBase::useDiary() { +void DreamWebEngine::useDiary() { getRidOfReels(); loadIntoTemp("DREAMWEB.G14"); loadTempText("DREAMWEB.T51"); @@ -1270,11 +1270,11 @@ void DreamBase::useDiary() { delPointer(); _getBack = 0; - RectWithCallback diaryList[] = { - { kDiaryx+94,kDiaryx+110,kDiaryy+97,kDiaryy+113,&DreamBase::diaryKeyN }, - { kDiaryx+151,kDiaryx+167,kDiaryy+71,kDiaryy+87,&DreamBase::diaryKeyP }, - { kDiaryx+176,kDiaryx+192,kDiaryy+108,kDiaryy+124,&DreamBase::quitKey }, - { 0,320,0,200,&DreamBase::blank }, + RectWithCallback diaryList[] = { + { kDiaryx+94,kDiaryx+110,kDiaryy+97,kDiaryy+113,&DreamWebEngine::diaryKeyN }, + { kDiaryx+151,kDiaryx+167,kDiaryy+71,kDiaryy+87,&DreamWebEngine::diaryKeyP }, + { kDiaryx+176,kDiaryx+192,kDiaryy+108,kDiaryy+124,&DreamWebEngine::quitKey }, + { 0,320,0,200,&DreamWebEngine::blank }, { 0xFFFF,0,0,0,0 } }; @@ -1300,7 +1300,7 @@ void DreamBase::useDiary() { workToScreenM(); } -void DreamBase::useControl() { +void DreamWebEngine::useControl() { if (_withObject == 255) { withWhat(); return; @@ -1353,7 +1353,7 @@ void DreamBase::useControl() { } } -void DreamBase::useSlab() { +void DreamWebEngine::useSlab() { if (_withObject == 255) { withWhat(); return; @@ -1385,7 +1385,7 @@ void DreamBase::useSlab() { _getBack = 1; } -void DreamBase::usePipe() { +void DreamWebEngine::usePipe() { if (_withObject == 255) { withWhat(); return; @@ -1408,7 +1408,7 @@ void DreamBase::usePipe() { } } -void DreamBase::useOpenBox() { +void DreamWebEngine::useOpenBox() { if (_withObject == 255) { withWhat(); return; @@ -1440,7 +1440,7 @@ void DreamBase::useOpenBox() { showFirstUse(); } -void DreamBase::runTap() { +void DreamWebEngine::runTap() { if (_withObject == 255) { withWhat(); return; @@ -1467,7 +1467,7 @@ void DreamBase::runTap() { putBackObStuff(); } -void DreamBase::useAxe() { +void DreamWebEngine::useAxe() { if (_realLocation != 22) { // Not in pool showFirstUse(); @@ -1494,7 +1494,7 @@ void DreamBase::useAxe() { removeObFromInv(); } -void DreamBase::useHandle() { +void DreamWebEngine::useHandle() { SetObject *object = getSetAd(findSetObject("CUTW")); if (object->mapad[0] == 255) { // Wire not cut @@ -1508,7 +1508,7 @@ void DreamBase::useHandle() { _getBack = 1; } -void DreamBase::useAltar() { +void DreamWebEngine::useAltar() { if (findExObject("CNDA") == 114 || findExObject("CNDB") == 114) { // Things on altar showFirstUse(); @@ -1525,7 +1525,7 @@ void DreamBase::useAltar() { _vars._endWatchReel = 174; _vars._watchSpeed = 1; _vars._speedCount = 1; - DreamBase::setupTimedUse(47, 32, 98, 52, 76); + DreamWebEngine::setupTimedUse(47, 32, 98, 52, 76); _getBack = 1; } else { showPuzText(23, 300); @@ -1533,7 +1533,7 @@ void DreamBase::useAltar() { } } -void DreamBase::withWhat() { +void DreamWebEngine::withWhat() { uint8 commandLine[64] = "OBJECT NAME ONE "; createPanel(); @@ -1556,7 +1556,7 @@ void DreamBase::withWhat() { _invOpen = 2; } -void DreamBase::notHeldError() { +void DreamWebEngine::notHeldError() { createPanel(); showPanel(); showMan(); @@ -1568,7 +1568,7 @@ void DreamBase::notHeldError() { putBackObStuff(); } -void DreamBase::useCashCard() { +void DreamWebEngine::useCashCard() { getRidOfReels(); loadKeypad(); createPanel(); @@ -1597,7 +1597,7 @@ void DreamBase::useCashCard() { putBackObStuff(); } -void DreamBase::useStereo() { +void DreamWebEngine::useStereo() { // Handles the stereo in Ryan's apartment (accessible from the remote on // the couch) @@ -1628,7 +1628,7 @@ void DreamBase::useStereo() { } } -uint16 DreamBase::checkInside(uint16 command, uint16 type) { +uint16 DreamWebEngine::checkInside(uint16 command, uint16 type) { for (uint16 index = 0; index < kNumexobjects; index++) { DynObject *object = getExAd(index); if (object->mapad[1] == command && object->mapad[0] == type) @@ -1638,7 +1638,7 @@ uint16 DreamBase::checkInside(uint16 command, uint16 type) { return kNumexobjects; } -void DreamBase::showPuzText(uint16 command, uint16 count) { +void DreamWebEngine::showPuzText(uint16 command, uint16 count) { createPanel(); showPanel(); showMan(); @@ -1650,7 +1650,7 @@ void DreamBase::showPuzText(uint16 command, uint16 count) { hangOnP(count); } -void DreamBase::useButtonA() { +void DreamWebEngine::useButtonA() { if (!isSetObOnMap(95)) { showFirstUse(); turnAnyPathOn(0, _roomNum - 1); @@ -1671,4 +1671,4 @@ void DreamBase::useButtonA() { } -} // End of namespace DreamGen +} // End of namespace DreamWeb -- cgit v1.2.3 From ca7da4cffc7edacd90df408c441a6eca10cc0e55 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 28 Dec 2011 16:21:30 +0100 Subject: DREAMWEB: Rename a member of SetObject & DynObject to objId SetObject::name and DynObject::id are stored at the exact same offset, and have the exact same meaning (see also objectMatches()). Now they also have the same name, objId. --- engines/dreamweb/use.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 6ab8422075..4259d03657 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1396,7 +1396,7 @@ void DreamWebEngine::usePipe() { showPuzText(36, 300); putBackObStuff(); DynObject *exObject = getExAd(_withObject); - exObject->id[3] = 'F'-'A'; // CUPE (empty cup) -> CUPF (full cup) + exObject->objId[3] = 'F'-'A'; // CUPE (empty cup) -> CUPF (full cup) return; } else if (compare(_withObject, _withType, "CUPF")) { // Already full @@ -1419,7 +1419,7 @@ void DreamWebEngine::useOpenBox() { _vars._progressPoints++; showPuzText(37, 300); DynObject *exObject = getExAd(_withObject); - exObject->id[3] = 'E'-'A'; // CUPF (full cup) -> CUPE (empty cup) + exObject->objId[3] = 'E'-'A'; // CUPF (full cup) -> CUPE (empty cup) _vars._watchingTime = 140; _vars._reelToWatch = 105; _vars._endWatchReel = 181; @@ -1449,7 +1449,7 @@ void DreamWebEngine::runTap() { if (compare(_withObject, _withType, "CUPE")) { // Fill cup from tap DynObject *exObject = getExAd(_withObject); - exObject->id[3] = 'F'-'A'; // CUPE (empty cup) -> CUPF (full cup) + exObject->objId[3] = 'F'-'A'; // CUPE (empty cup) -> CUPF (full cup) playChannel1(8); showPuzText(57, 300); putBackObStuff(); -- cgit v1.2.3 From c6dfac9b0aa2f2b891cc14feb7fc6085e40ffa5a Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 28 Dec 2011 19:34:38 +0100 Subject: DREAMWEB: Move more methods to keypad.cpp, reorder them to match ASM --- engines/dreamweb/use.cpp | 77 +----------------------------------------------- 1 file changed, 1 insertion(+), 76 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 4259d03657..58210c1d85 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -190,35 +190,6 @@ void DreamWebEngine::showSecondUse() { hangOnP(400); } -void DreamWebEngine::viewFolder() { - _manIsOffScreen = 1; - getRidOfAll(); - loadFolder(); - _folderPage = 0; - showFolder(); - workToScreenM(); - _getBack = 0; - do { - if (_quitRequested) - break; - delPointer(); - readMouse(); - showPointer(); - vSync(); - dumpPointer(); - dumpTextLine(); - checkFolderCoords(); - } while (_getBack == 0); - _manIsOffScreen = 0; - getRidOfTemp(); - getRidOfTemp2(); - getRidOfTemp3(); - getRidOfTempCharset(); - restoreAll(); - redrawMainScrn(); - workToScreenM(); -} - void DreamWebEngine::edensCDPlayer() { showFirstUse(); _vars._watchingTime = 18 * 2; @@ -1241,7 +1212,7 @@ void DreamWebEngine::useCooker() { showFirstUse(); else showSecondUse(); // Food inside - + putBackObStuff(); } @@ -1254,52 +1225,6 @@ void DreamWebEngine::removeFreeObject(uint8 index) { getFreeAd(index)->mapad[0] = 0xFF; } -void DreamWebEngine::useDiary() { - getRidOfReels(); - loadIntoTemp("DREAMWEB.G14"); - loadTempText("DREAMWEB.T51"); - loadTempCharset("DREAMWEB.C02"); - createPanel(); - showIcon(); - showDiary(); - underTextLine(); - showDiaryPage(); - readMouse(); - showPointer(); - workToScreen(); - delPointer(); - _getBack = 0; - - RectWithCallback diaryList[] = { - { kDiaryx+94,kDiaryx+110,kDiaryy+97,kDiaryy+113,&DreamWebEngine::diaryKeyN }, - { kDiaryx+151,kDiaryx+167,kDiaryy+71,kDiaryy+87,&DreamWebEngine::diaryKeyP }, - { kDiaryx+176,kDiaryx+192,kDiaryy+108,kDiaryy+124,&DreamWebEngine::quitKey }, - { 0,320,0,200,&DreamWebEngine::blank }, - { 0xFFFF,0,0,0,0 } - }; - - do { - delPointer(); - readMouse(); - showDiaryKeys(); - showPointer(); - vSync(); - dumpPointer(); - dumpDiaryKeys(); - dumpTextLine(); - checkCoords(diaryList); - } while (!_getBack && !_quitRequested); - - - getRidOfTemp(); - getRidOfTempText(); - getRidOfTempCharset(); - restoreReels(); - _manIsOffScreen = 0; - redrawMainScrn(); - workToScreenM(); -} - void DreamWebEngine::useControl() { if (_withObject == 255) { withWhat(); -- cgit v1.2.3 From 36778c8221e7a9994db8daf9ca5f90529f09d2d0 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 28 Dec 2011 23:56:30 +0100 Subject: DREAMWEB: Remove unnecessary DreamWebEngine:: uses --- engines/dreamweb/use.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 58210c1d85..fc0398c7b9 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1450,7 +1450,7 @@ void DreamWebEngine::useAltar() { _vars._endWatchReel = 174; _vars._watchSpeed = 1; _vars._speedCount = 1; - DreamWebEngine::setupTimedUse(47, 32, 98, 52, 76); + setupTimedUse(47, 32, 98, 52, 76); _getBack = 1; } else { showPuzText(23, 300); -- cgit v1.2.3 From 256d160679eb211e9a38fbcf18ee5fedd232fc72 Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Wed, 22 Feb 2012 19:06:29 +0100 Subject: DREAMWEB: Remove shared temp graphics variables. Instead, have a different variable for each use. --- engines/dreamweb/use.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/dreamweb/use.cpp') diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index fc0398c7b9..e59843539f 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -1501,7 +1501,7 @@ void DreamWebEngine::useCashCard() { showExit(); showMan(); uint16 y = (!_foreignRelease) ? 120 : 120 - 3; - showFrame(_tempGraphics, 114, y, 39, 0); + showFrame(_keypadGraphics, 114, y, 39, 0); const uint8 *obText = getObTextStart(); findNextColon(&obText); findNextColon(&obText); @@ -1517,7 +1517,7 @@ void DreamWebEngine::useCashCard() { _charShift = 0; workToScreenM(); hangOnP(400); - getRidOfTemp(); + _keypadGraphics.clear(); restoreReels(); putBackObStuff(); } -- cgit v1.2.3