[Scummvm-cvs-logs] scummvm master -> 9480b21840cd0e5e0d40ab8a88e0f7b5dac9be03
bluegr
md5 at scummvm.org
Mon Dec 12 22:59:03 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:
9480b21840 DREAMWEB: Port 'useopenbox' to C++
Commit: 9480b21840cd0e5e0d40ab8a88e0f7b5dac9be03
https://github.com/scummvm/scummvm/commit/9480b21840cd0e5e0d40ab8a88e0f7b5dac9be03
Author: Filippos Karapetis (md5 at scummvm.org)
Date: 2011-12-12T13:58:20-08:00
Commit Message:
DREAMWEB: Port 'useopenbox' 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 f9863a6..4eafce7 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -802,6 +802,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'usemenu',
'usemon',
'useobject',
+ 'useopenbox',
'usepipe',
'useplate',
'useplinth',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 0a0aa7a..851cca7 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -3590,58 +3590,6 @@ void DreamGenContext::notHeldError() {
putBackObStuff();
}
-void DreamGenContext::useOpenBox() {
- STACK_CHECK;
- _cmp(data.byte(kWithobject), 255);
- if (!flags.z())
- goto openboxwith;
- withWhat();
- return;
-openboxwith:
- al = data.byte(kWithobject);
- ah = data.byte(kWithtype);
- cl = 'C';
- ch = 'U';
- dl = 'P';
- dh = 'F';
- compare();
- if (flags.z())
- goto destoryopenbox;
- al = data.byte(kWithobject);
- ah = data.byte(kWithtype);
- cl = 'C';
- ch = 'U';
- dl = 'P';
- dh = 'E';
- compare();
- if (flags.z())
- goto openboxwrong;
- showFirstUse();
- return;
-destoryopenbox:
- _inc(data.byte(kProgresspoints));
- cx = 300;
- al = 37;
- showPuzText();
- al = data.byte(kWithobject);
- getExAd();
- es.byte(bx+15) = 'E'-'A';
- data.word(kWatchingtime) = 140;
- data.word(kReeltowatch) = 105;
- data.word(kEndwatchreel) = 181;
- data.byte(kWatchspeed) = 1;
- data.byte(kSpeedcount) = 1;
- al = 4;
- turnPathOn();
- data.byte(kGetback) = 1;
- return;
-openboxwrong:
- cx = 300;
- al = 38;
- showPuzText();
- putBackObStuff();
-}
-
void DreamGenContext::useAltar() {
STACK_CHECK;
al = 'C';
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index bbdd70e..7be8488 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -488,7 +488,6 @@ public:
void identifyOb();
void runEndSeq();
- void useOpenBox();
void clearBuffers();
void getObTextStart();
void checkObjectSize();
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 2946327..18d90ff 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -333,6 +333,7 @@
void useLighter();
void useSLab();
void usePipe();
+ void useOpenBox();
void wheelSound();
void callHotelLift();
void useShield();
diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index b8d7b7c..0ede2f4 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
More information about the Scummvm-git-logs
mailing list