[Scummvm-cvs-logs] scummvm master -> ef94b2d15a543493a7d11ed208c74c5c2c37214c

bluegr md5 at scummvm.org
Mon Dec 12 22:52: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:
ef94b2d15a DREAMWEB: Port 'usepipe' to C++


Commit: ef94b2d15a543493a7d11ed208c74c5c2c37214c
    https://github.com/scummvm/scummvm/commit/ef94b2d15a543493a7d11ed208c74c5c2c37214c
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-12-12T13:51:40-08:00

Commit Message:
DREAMWEB: Port 'usepipe' to C++

Changed paths:
    devtools/tasmrecover/tasm-recover
    engines/dreamweb/dreamgen.cpp
    engines/dreamweb/dreamgen.h
    engines/dreamweb/stubs.h
    engines/dreamweb/use.cpp



diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 6efa0c0..f9863a6 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -802,6 +802,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'usemenu',
 	'usemon',
 	'useobject',
+	'usepipe',
 	'useplate',
 	'useplinth',
 	'usepoolreader',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index a2d8c2c..0a0aa7a 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -3590,53 +3590,6 @@ void DreamGenContext::notHeldError() {
 	putBackObStuff();
 }
 
-void DreamGenContext::usePipe() {
-	STACK_CHECK;
-	_cmp(data.byte(kWithobject), 255);
-	if (!flags.z())
-		goto pipewith;
-	withWhat();
-	return;
-pipewith:
-	al = data.byte(kWithobject);
-	ah = data.byte(kWithtype);
-	cl = 'C';
-	ch = 'U';
-	dl = 'P';
-	dh = 'E';
-	compare();
-	if (flags.z())
-		goto fillcup;
-	al = data.byte(kWithobject);
-	ah = data.byte(kWithtype);
-	cl = 'C';
-	ch = 'U';
-	dl = 'P';
-	dh = 'F';
-	compare();
-	if (flags.z())
-		goto alreadyfull;
-	cx = 300;
-	al = 14;
-	showPuzText();
-	putBackObStuff();
-	return;
-fillcup:
-	cx = 300;
-	al = 36;
-	showPuzText();
-	putBackObStuff();
-	al = data.byte(kWithobject);
-	getExAd();
-	es.byte(bx+15) = 'F'-'A';
-	return;
-alreadyfull:
-	cx = 300;
-	al = 35;
-	showPuzText();
-	putBackObStuff();
-}
-
 void DreamGenContext::useOpenBox() {
 	STACK_CHECK;
 	_cmp(data.byte(kWithobject), 255);
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 6e8400b..bbdd70e 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -511,7 +511,6 @@ public:
 	void useAltar();
 	void startTalk();
 	void getAnyAd();
-	void usePipe();
 	void reminders();
 	void runTap();
 	void dumpDiaryKeys();
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index ff7c110..2946327 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -332,6 +332,7 @@
 	void useHatch();
 	void useLighter();
 	void useSLab();
+	void usePipe();
 	void wheelSound();
 	void callHotelLift();
 	void useShield();
diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index f6d6b2f..b8d7b7c 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






More information about the Scummvm-git-logs mailing list