diff options
author | Max Horn | 2011-12-28 23:06:22 +0100 |
---|---|---|
committer | Max Horn | 2011-12-28 23:53:54 +0100 |
commit | 9f99fb5f8a731adf9f1aa9d538029d18c78d99a8 (patch) | |
tree | d54219b447fe251f489439ef433ec84c95e79ced /engines/dreamweb | |
parent | dc4af2afc2013a0ab20955440221dc55332a0063 (diff) | |
download | scummvm-rg350-9f99fb5f8a731adf9f1aa9d538029d18c78d99a8.tar.gz scummvm-rg350-9f99fb5f8a731adf9f1aa9d538029d18c78d99a8.tar.bz2 scummvm-rg350-9f99fb5f8a731adf9f1aa9d538029d18c78d99a8.zip |
DREAMWEB: Use ObjectType enums in more places
Diffstat (limited to 'engines/dreamweb')
-rw-r--r-- | engines/dreamweb/object.cpp | 6 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 14 |
2 files changed, 10 insertions, 10 deletions
diff --git a/engines/dreamweb/object.cpp b/engines/dreamweb/object.cpp index bcdf2e5eb9..443366561a 100644 --- a/engines/dreamweb/object.cpp +++ b/engines/dreamweb/object.cpp @@ -30,7 +30,7 @@ void DreamWebEngine::showRyanPage() { } void DreamWebEngine::findAllRyan() { - memset(_ryanInvList, 0xff, 60); + memset(_ryanInvList, 0xff, sizeof(_ryanInvList)); for (size_t i = 0; i < kNumexobjects; ++i) { const DynObject *extra = getExAd(i); if (extra->mapad[0] != kExObjectType) @@ -683,12 +683,12 @@ void DreamWebEngine::dropObject() { return; } - if (compare(_itemFrame, 4, "GUNA") || compare(_itemFrame, 4, "SHLD")) { + if (compare(_itemFrame, kExObjectType, "GUNA") || compare(_itemFrame, kExObjectType, "SHLD")) { cantDrop(); return; } - _objectType = 4; + _objectType = kExObjectType; DynObject *object = getExAd(_itemFrame); object->mapad[0] = 0; object->mapad[1] = ((_ryanX + 4) >> 4) + _mapX; diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 5bca846b36..4f18136dfc 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -1185,16 +1185,16 @@ bool DreamWebEngine::checkIfEx(uint8 x, uint8 y) { } const uint8 *DreamWebEngine::findObName(uint8 type, uint8 index) { - if (type == 5) { - uint16 i = 64 * (index & 127); - return (const uint8 *)_personText.getString(i); - } else if (type == 4) { + switch (type) { + case 5: + return (const uint8 *)_personText.getString(64 * (index & 127)); + case kExObjectType: return (const uint8 *)_exText.getString(index); - } else if (type == 2) { + case kFreeObjectType: return (const uint8 *)_freeDesc.getString(index); - } else if (type == 1) { + case kSetObjectType1: return (const uint8 *)_setDesc.getString(index); - } else { + default: return (const uint8 *)_blockDesc.getString(index); } } |