[Scummvm-cvs-logs] scummvm master -> 3802b21183b148f1c8d43cc8d2e550afed6e9e6a

bluegr md5 at scummvm.org
Sun Dec 25 14:08:25 CET 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
3802b21183 DREAMWEB: Move some functions to DreamBase


Commit: 3802b21183b148f1c8d43cc8d2e550afed6e9e6a
    https://github.com/scummvm/scummvm/commit/3802b21183b148f1c8d43cc8d2e550afed6e9e6a
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-12-25T05:07:56-08:00

Commit Message:
DREAMWEB: Move some functions to DreamBase

Changed paths:
    engines/dreamweb/dreambase.h
    engines/dreamweb/newplace.cpp
    engines/dreamweb/structs.h
    engines/dreamweb/stubs.h
    engines/dreamweb/use.cpp



diff --git a/engines/dreamweb/dreambase.h b/engines/dreamweb/dreambase.h
index 2a61331..9e45e04 100644
--- a/engines/dreamweb/dreambase.h
+++ b/engines/dreamweb/dreambase.h
@@ -178,6 +178,9 @@ public:
 	uint8 getLocation(uint8 index);
 	void setLocation(uint8 index);
 	void resetLocation(uint8 index);
+	void readCityPic();
+	void readDestIcon();
+	void showCity();
 
 	// from object.cpp
 	void obIcons();
@@ -636,6 +639,8 @@ public:
 	void wearWatch();
 	void wearShades();
 	void useTrainer();
+	void useStereo();
+	void chewy();
 
 	// from vgafades.cpp
 	void clearStartPal();
diff --git a/engines/dreamweb/newplace.cpp b/engines/dreamweb/newplace.cpp
index f1743f0..69e4528 100644
--- a/engines/dreamweb/newplace.cpp
+++ b/engines/dreamweb/newplace.cpp
@@ -34,6 +34,7 @@ void DreamGenContext::newPlace() {
 	}
 }
 
+// TODO: Move to DreamBase once locationPic is moved
 void DreamGenContext::selectLocation() {
 	data.byte(kInmaparea) = 0;
 	clearBeforeLoad();
@@ -95,7 +96,7 @@ void DreamGenContext::selectLocation() {
 	deallocateMem(data.word(kTraveltext));
 }
 
-void DreamGenContext::showCity() {
+void DreamBase::showCity() {
 	clearWork();
 	showFrame(tempGraphics(), 57, 32, 0, 0);
 	showFrame(tempGraphics(), 120+57, 32, 1, 0);
@@ -259,13 +260,13 @@ void DreamBase::resetLocation(uint8 index) {
 	data.byte(kRoomscango + index) = 0;
 }
 
-void DreamGenContext::readDestIcon() {
+void DreamBase::readDestIcon() {
 	loadIntoTemp("DREAMWEB.G05");
 	loadIntoTemp2("DREAMWEB.G06");
 	loadIntoTemp3("DREAMWEB.G08");
 }
 
-void DreamGenContext::readCityPic() {
+void DreamBase::readCityPic() {
 	loadIntoTemp("DREAMWEB.G04");
 }
 
diff --git a/engines/dreamweb/structs.h b/engines/dreamweb/structs.h
index 5d93d1d..d64bcab 100644
--- a/engines/dreamweb/structs.h
+++ b/engines/dreamweb/structs.h
@@ -123,7 +123,7 @@ struct DynObject {
 	uint8 slotSize;		// the size of an object's slots
 	uint8 slotCount;	// the number of slots of an object
 	uint8 objectSize;	// the size of an object
-	uint8 b10;
+	uint8 turnedOn;
 	uint8 initialLocation;
 	uint8 id[4];
 };
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 547714e..0c764a4 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -39,8 +39,6 @@
 	}
 	void quickQuit();
 	void readOneBlock();
-	void readCityPic();
-	void readDestIcon();
 	void seeCommandTail();
 	void quickQuit2();
 	void printDirect();
@@ -95,7 +93,6 @@
 	void hangOn(uint16 frameCount) {
 		DreamBase::hangOn(frameCount);
 	}
-	void showCity();
 	void examineOb(bool examineAgain = true);
 	void dumpWatch();
 	void transferText();
@@ -148,7 +145,6 @@
 	void afterIntroRoom();
 	void gettingShot();
 	void allPointer();
-	void chewy();
 	void delEverything();
 	void errorMessage1();
 	void errorMessage2();
@@ -156,7 +152,6 @@
 	void nextDest();
 	void lastDest();
 	void destSelect();
-	void selectLocation();
 	void loadSpeech();
 	bool loadSpeech(byte type1, int idx1, byte type2, int idx2) {
 		return DreamBase::loadSpeech(type1, idx1, type2, idx2);
@@ -183,7 +178,6 @@
 	bool checkObjectSizeCPP();
 	void openOb();
 	void identifyOb();
-	void useStereo();
 	void selectOb();
 	void findInvPos();
 	uint16 findInvPosCPP();
@@ -198,5 +192,6 @@
 	void inToInv();
 	void outOfInv();
 	void selectOpenOb();
+	void selectLocation();
 
 #endif
diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index 47c9ae6..eeda277 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();
 	}






More information about the Scummvm-git-logs mailing list