diff options
author | Willem Jan Palenstijn | 2011-12-24 00:28:45 +0100 |
---|---|---|
committer | Willem Jan Palenstijn | 2011-12-24 12:10:35 +0100 |
commit | 64b7aee081af753366bdd2000e73f24b28b226e8 (patch) | |
tree | 79ec41b3f815bb432c77ca7b0cd0904057555d91 /engines/dreamweb | |
parent | f07531bed36d22354a3724d53067ee22533cf049 (diff) | |
download | scummvm-rg350-64b7aee081af753366bdd2000e73f24b28b226e8.tar.gz scummvm-rg350-64b7aee081af753366bdd2000e73f24b28b226e8.tar.bz2 scummvm-rg350-64b7aee081af753366bdd2000e73f24b28b226e8.zip |
DREAMWEB: Minor cleanup
Diffstat (limited to 'engines/dreamweb')
-rw-r--r-- | engines/dreamweb/dreambase.h | 1 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 4 | ||||
-rw-r--r-- | engines/dreamweb/use.cpp | 5 |
3 files changed, 6 insertions, 4 deletions
diff --git a/engines/dreamweb/dreambase.h b/engines/dreamweb/dreambase.h index 32b36a56da..e573443674 100644 --- a/engines/dreamweb/dreambase.h +++ b/engines/dreamweb/dreambase.h @@ -513,6 +513,7 @@ public: void startLoading(const Room &room); void startup(); void atmospheres(); + bool objectMatches(void *object, const char *id); // from use.cpp void placeFreeObject(uint8 index); diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 0b2ed7a7c5..09c8b36e81 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -1681,8 +1681,8 @@ void DreamBase::printMessage2(uint16 x, uint16 y, uint8 index, uint8 maxWidth, b printDirect(string, x, y, maxWidth, centered); } -static bool objectMatches(void *object, const char *id) { - const char *objId = (const char *)(((const uint8 *)object) + 12); // whether it is a DynObject or a SetObject +bool DreamBase::objectMatches(void *object, const char *id) { + const char *objId = (const char *)object + 12; // whether it is a DynObject or a SetObject for (size_t i = 0; i < 4; ++i) { if (id[i] != objId[i] + 'A') return false; diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index b642598589..aa7c2bddea 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -128,11 +128,12 @@ void DreamGenContext::useRoutine() { } getAnyAd(); - const uint8 *id = es.ptr(bx + 12, 4); + // CHECKME: Do the callbacks use es:bx ? + void *obj = es.ptr(bx, 15); for (size_t i = 0; i < sizeof(kUseList)/sizeof(UseListEntry); ++i) { const UseListEntry &entry = kUseList[i]; - if (('A' + id[0] == entry.id[0]) && ('A' + id[1] == entry.id[1]) && ('A' + id[2] == entry.id[2]) && ('A' + id[3] == entry.id[3])) { + if (objectMatches(obj, entry.id)) { (this->*entry.callback)(); return; } |