aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb
diff options
context:
space:
mode:
authorBertrand Augereau2011-09-02 09:11:48 +0200
committerBertrand Augereau2011-09-02 09:23:27 +0200
commit1de8427361de7b810b5043a80827bb38e474b974 (patch)
treeb6bb04c00964151c71f8c7000034c3abd3b22adb /engines/dreamweb
parent214cff8db8253759d2dd358273b8e1b83c141169 (diff)
downloadscummvm-rg350-1de8427361de7b810b5043a80827bb38e474b974.tar.gz
scummvm-rg350-1de8427361de7b810b5043a80827bb38e474b974.tar.bz2
scummvm-rg350-1de8427361de7b810b5043a80827bb38e474b974.zip
DREAMWEB: 'isitworn' and 'makeworn' ported to C++
Diffstat (limited to 'engines/dreamweb')
-rw-r--r--engines/dreamweb/dreamgen.cpp18
-rw-r--r--engines/dreamweb/dreamgen.h6
-rw-r--r--engines/dreamweb/stubs.cpp17
-rw-r--r--engines/dreamweb/stubs.h4
4 files changed, 23 insertions, 22 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 0fd6ae19d2..c28c289b77 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -4015,22 +4015,6 @@ finishfill:
bx = pop();
}
-void DreamGenContext::isitworn() {
- STACK_CHECK;
- al = es.byte(bx+12);
- _cmp(al, 'W'-'A');
- if (!flags.z())
- return /* (notworn) */;
- al = es.byte(bx+13);
- _cmp(al, 'E'-'A');
-}
-
-void DreamGenContext::makeworn() {
- STACK_CHECK;
- es.byte(bx+12) = 'W'-'A';
- es.byte(bx+13) = 'E'-'A';
-}
-
void DreamGenContext::examineob() {
STACK_CHECK;
data.byte(kPointermode) = 0;
@@ -17385,8 +17369,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case addr_findallryan: findallryan(); break;
case addr_findallopen: findallopen(); break;
case addr_obtoinv: obtoinv(); break;
- case addr_isitworn: isitworn(); break;
- case addr_makeworn: makeworn(); break;
case addr_examineob: examineob(); break;
case addr_makemainscreen: makemainscreen(); break;
case addr_getbackfromob: getbackfromob(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index c8dc1924f4..f3b502a8f6 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -494,8 +494,6 @@ public:
static const uint16 addr_getbackfromob = 0xc344;
static const uint16 addr_makemainscreen = 0xc340;
static const uint16 addr_examineob = 0xc33c;
- static const uint16 addr_makeworn = 0xc338;
- static const uint16 addr_isitworn = 0xc334;
static const uint16 addr_obtoinv = 0xc330;
static const uint16 addr_findallopen = 0xc32c;
static const uint16 addr_findallryan = 0xc328;
@@ -1273,7 +1271,7 @@ public:
void neterror();
void storeit();
//void lockeddoorway();
- void isitworn();
+ //void isitworn();
//void putundertimed();
//void dumpmap();
//void multidump();
@@ -1667,7 +1665,7 @@ public:
//void showallfree();
void loadnews();
void rollem();
- void makeworn();
+ //void makeworn();
void examineobtext();
void startup();
void savegame();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index d63e8843f6..731396697d 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1779,5 +1779,22 @@ bool DreamGenContext::checkifset(uint8 x, uint8 y) {
return false;
}
+void DreamGenContext::isitworn() {
+ flags._z = isitworn((const DynObject *)es.ptr(bx, sizeof(DynObject)));
+}
+
+bool DreamGenContext::isitworn(const DynObject *object) {
+ return (object->id[0] == 'W'-'A') && (object->id[1] == 'E'-'A');
+}
+
+void DreamGenContext::makeworn() {
+ makeworn((DynObject *)es.ptr(bx, sizeof(DynObject)));
+}
+
+void DreamGenContext::makeworn(DynObject *object) {
+ object->id[0] = 'W'-'A';
+ object->id[1] = 'E'-'A';
+}
+
} /*namespace dreamgen */
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index e1abc1b1dc..4d22fcc0bf 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -220,4 +220,8 @@
bool checkifset(uint8 x, uint8 y);
void checkifpathison();
bool checkifpathison(uint8 index);
+ void isitworn();
+ bool isitworn(const DynObject *object);
+ void makeworn();
+ void makeworn(DynObject *object);