aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2011-12-25 14:30:00 +0200
committerFilippos Karapetis2011-12-25 14:30:00 +0200
commit3ac88c16ea63243a46444e5754a94e41302f2d64 (patch)
treef6d639104ebf09fba27cad0304becf28f113340b /engines
parente412078319c11206617c8d86d9b6f166b4526287 (diff)
downloadscummvm-rg350-3ac88c16ea63243a46444e5754a94e41302f2d64.tar.gz
scummvm-rg350-3ac88c16ea63243a46444e5754a94e41302f2d64.tar.bz2
scummvm-rg350-3ac88c16ea63243a46444e5754a94e41302f2d64.zip
DREAMWEB: Port 'selectopenob' to C++
Diffstat (limited to 'engines')
-rw-r--r--engines/dreamweb/dreamgen.cpp46
-rw-r--r--engines/dreamweb/dreamgen.h1
-rw-r--r--engines/dreamweb/object.cpp33
-rw-r--r--engines/dreamweb/stubs.h1
4 files changed, 34 insertions, 47 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 8cd5dd43df..bca2232267 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -537,52 +537,6 @@ findopenp1:
_add(bx, (0+(228*13)));
}
-void DreamGenContext::selectOpenOb() {
- STACK_CHECK;
- al = data.byte(kCommand);
- getAnyAd();
- _cmp(al, 255);
- if (!flags.z())
- goto canopenit1;
- blank();
- return;
-canopenit1:
- _cmp(data.byte(kCommandtype), 224);
- if (flags.z())
- goto alreadyopob;
- data.byte(kCommandtype) = 224;
- bl = data.byte(kCommand);
- bh = data.byte(kObjecttype);
- al = 38;
- commandWithOb();
-alreadyopob:
- ax = data.word(kMousebutton);
- _cmp(ax, data.word(kOldbutton));
- if (flags.z())
- return /* (noopenob) */;
- _and(ax, 1);
- if (!flags.z())
- goto doopenob;
- return;
-doopenob:
- al = data.byte(kCommand);
- data.byte(kOpenedob) = al;
- al = data.byte(kObjecttype);
- data.byte(kOpenedtype) = al;
- createPanel();
- showPanel();
- showMan();
- examIcon();
- showExit();
- openInv();
- openOb();
- underTextLine();
- readMouse();
- showPointer();
- workToScreen();
- delPointer();
-}
-
void DreamGenContext::useOpened() {
STACK_CHECK;
_cmp(data.byte(kOpenedob), 255);
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 52009dc5ed..db9a8c2eeb 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -478,7 +478,6 @@ public:
void getDestInfo();
void read();
void searchForString();
- void selectOpenOb();
void searchForFiles();
void getExAd();
void swapWithInv();
diff --git a/engines/dreamweb/object.cpp b/engines/dreamweb/object.cpp
index 4addfc404e..dff58050a5 100644
--- a/engines/dreamweb/object.cpp
+++ b/engines/dreamweb/object.cpp
@@ -793,4 +793,37 @@ bool DreamGenContext::checkObjectSizeCPP() {
return false;
}
+void DreamGenContext::selectOpenOb() {
+ uint8 slotSize, slotCount;
+ getAnyAd(&slotSize, &slotCount);
+ if (slotCount == 255) {
+ // Can't open the object
+ blank();
+ return;
+ }
+
+ if (data.byte(kCommandtype) != 224) {
+ data.byte(kCommandtype) = 224;
+ commandWithOb(38, data.byte(kObjecttype), data.byte(kCommand));
+ }
+
+ if (data.word(kMousebutton) == data.word(kOldbutton) || !(data.word(kMousebutton) & 1))
+ return;
+
+ data.byte(kOpenedob) = data.byte(kCommand);
+ data.byte(kOpenedtype) = data.byte(kObjecttype);
+ createPanel();
+ showPanel();
+ showMan();
+ examIcon();
+ showExit();
+ openInv();
+ openOb();
+ underTextLine();
+ readMouse();
+ showPointer();
+ workToScreenCPP();
+ delPointer();
+}
+
} // End of namespace DreamGen
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index ed0afa4ea9..547714e006 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -197,5 +197,6 @@
void lookAtPlace();
void inToInv();
void outOfInv();
+ void selectOpenOb();
#endif