aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMax Horn2011-12-28 16:23:16 +0100
committerMax Horn2011-12-28 16:36:17 +0100
commit8f2b8e821fb9b5c03fdeb08977003f486ede092d (patch)
treef3065b5fdfedd34588001376c0871eae7d62ad8a /engines
parentca7da4cffc7edacd90df408c441a6eca10cc0e55 (diff)
downloadscummvm-rg350-8f2b8e821fb9b5c03fdeb08977003f486ede092d.tar.gz
scummvm-rg350-8f2b8e821fb9b5c03fdeb08977003f486ede092d.tar.bz2
scummvm-rg350-8f2b8e821fb9b5c03fdeb08977003f486ede092d.zip
DREAMWEB: Cleanup
Diffstat (limited to 'engines')
-rw-r--r--engines/dreamweb/backdrop.cpp4
-rw-r--r--engines/dreamweb/sprite.cpp23
-rw-r--r--engines/dreamweb/stubs.cpp18
3 files changed, 26 insertions, 19 deletions
diff --git a/engines/dreamweb/backdrop.cpp b/engines/dreamweb/backdrop.cpp
index 887da70539..1db2663624 100644
--- a/engines/dreamweb/backdrop.cpp
+++ b/engines/dreamweb/backdrop.cpp
@@ -126,12 +126,10 @@ void DreamWebEngine::makeBackOb(SetObject *objData, uint16 x, uint16 y) {
}
void DreamWebEngine::showAllObs() {
- const unsigned int count = 128;
-
_setList.clear();
const GraphicsFile &frameBase = _setFrames;
- for (size_t i = 0; i < count; ++i) {
+ for (size_t i = 0; i < 128; ++i) {
SetObject *setEntry = &_setDat[i];
uint16 x, y;
if (getMapAd(setEntry->mapad, &x, &y) == 0)
diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp
index e662fa6ec3..3ee73d23a3 100644
--- a/engines/dreamweb/sprite.cpp
+++ b/engines/dreamweb/sprite.cpp
@@ -227,20 +227,29 @@ void DreamWebEngine::backObject(Sprite *sprite) {
}
sprite->delay = objData->delay;
- if (objData->type == 6)
+ switch (objData->type) {
+ case 6:
wideDoor(sprite, objData);
- else if (objData->type == 5)
+ break;
+ case 5:
randomSprite(sprite, objData);
- else if (objData->type == 4)
+ break;
+ case 4:
lockedDoorway(sprite, objData);
- else if (objData->type == 3)
+ break;
+ case 3:
liftSprite(sprite, objData);
- else if (objData->type == 2)
+ break;
+ case 2:
doorway(sprite, objData);
- else if (objData->type == 1)
+ break;
+ case 1:
constant(sprite, objData);
- else
+ break;
+ default:
steady(sprite, objData);
+ break;
+ }
}
void DreamWebEngine::constant(Sprite *sprite, SetObject *objData) {
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index bd9de7a23c..de42f54271 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1036,13 +1036,6 @@ void DreamWebEngine::lockMon() {
}
}
-void DreamWebEngine::clearAndLoad(uint8 *buf, uint8 c,
- unsigned int size, unsigned int maxSize) {
- assert(size <= maxSize);
- memset(buf, c, maxSize);
- readFromFile(buf, size);
-}
-
void DreamWebEngine::startLoading(const Room &room) {
_vars._combatCount = 0;
_roomsSample = room.roomsSample;
@@ -2117,10 +2110,17 @@ void DreamWebEngine::getRidOfAll() {
_freeDesc.clear();
}
+void DreamWebEngine::clearAndLoad(uint8 *buf, uint8 c,
+ unsigned int size, unsigned int maxSize) {
+ assert(size <= maxSize);
+ memset(buf, c, maxSize);
+ readFromFile(buf, size);
+}
+
// if skipDat, skip clearing and loading Setdat and Freedat
void DreamWebEngine::loadRoomData(const Room &room, bool skipDat) {
- const uint16 kSetdatlen = 64*128;
- const uint16 kFreedatlen = 16*80;
+ const uint16 kSetdatlen = 64*128; // == sizeof(_setDat)
+ const uint16 kFreedatlen = 16*80; // == sizeof(_freeDat)
openFile(room.name);