aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2011-12-28 12:15:23 +0200
committerFilippos Karapetis2011-12-28 12:15:52 +0200
commit26f1643e8646cac71b0adb7b88876674134f3613 (patch)
treebb9db0e2be3a49f21333d564711d67bca88c294c /engines
parent096c020e7af1b03bf8394d40cb3c6da98f01ae49 (diff)
downloadscummvm-rg350-26f1643e8646cac71b0adb7b88876674134f3613.tar.gz
scummvm-rg350-26f1643e8646cac71b0adb7b88876674134f3613.tar.bz2
scummvm-rg350-26f1643e8646cac71b0adb7b88876674134f3613.zip
DREAMWEB: Remove a lot of unused/duplicate constants and move some of them to dreambase.h
Diffstat (limited to 'engines')
-rw-r--r--engines/dreamweb/backdrop.cpp8
-rw-r--r--engines/dreamweb/dreambase.h11
-rw-r--r--engines/dreamweb/dreamgen.h15
-rw-r--r--engines/dreamweb/saveload.cpp4
-rw-r--r--engines/dreamweb/sprite.cpp3
-rw-r--r--engines/dreamweb/stubs.cpp10
6 files changed, 23 insertions, 28 deletions
diff --git a/engines/dreamweb/backdrop.cpp b/engines/dreamweb/backdrop.cpp
index 2a17a7a1cf..7c0713c0c4 100644
--- a/engines/dreamweb/backdrop.cpp
+++ b/engines/dreamweb/backdrop.cpp
@@ -26,7 +26,7 @@ namespace DreamGen {
void DreamBase::doBlocks() {
uint16 dstOffset = _mapAdY * 320 + _mapAdX;
- uint16 mapOffset = _mapY * kMapwidth + _mapX;
+ uint16 mapOffset = _mapY * kMapWidth + _mapX;
const uint8 *mapData = _mapData + mapOffset;
uint8 *dstBuffer = workspace() + dstOffset;
@@ -57,7 +57,7 @@ void DreamBase::doBlocks() {
memset(dst, 0xdf, 16);
}
}
- mapData += kMapwidth;
+ mapData += kMapWidth;
}
}
@@ -236,12 +236,12 @@ void DreamBase::showAllFree() {
void DreamBase::drawFlags() {
MapFlag *mapFlag = _mapFlags;
- uint16 mapOffset = _mapY * kMapwidth + _mapX;
+ uint16 mapOffset = _mapY * kMapWidth + _mapX;
const uint8 *mapData = _mapData + mapOffset;
for (size_t i = 0; i < 10; ++i) {
for (size_t j = 0; j < 11; ++j) {
- uint8 tile = mapData[i * kMapwidth + j];
+ uint8 tile = mapData[i * kMapWidth + j];
mapFlag->_flag = _backdropFlags[tile]._flag;
mapFlag->_flagEx = _backdropFlags[tile]._flagEx;
mapFlag->_type = tile;
diff --git a/engines/dreamweb/dreambase.h b/engines/dreamweb/dreambase.h
index 671664c05b..e9bf6641af 100644
--- a/engines/dreamweb/dreambase.h
+++ b/engines/dreamweb/dreambase.h
@@ -52,6 +52,17 @@ const unsigned int kMapWidth = 66;
const unsigned int kMapHeight = 60;
const unsigned int kLengthOfMap = kMapWidth * kMapHeight;
const unsigned int kNumExObjects = 114;
+const unsigned int kScreenwidth = 320;
+const unsigned int kDiaryx = (68+24);
+const unsigned int kDiaryy = (48+12);
+const unsigned int kInventx = 80;
+const unsigned int kInventy = 58;
+const unsigned int kMenux = (80+40);
+const unsigned int kMenuy = 60;
+const unsigned int kOpsx = 60;
+const unsigned int kOpsy = 52;
+const unsigned int kSymbolx = 64;
+const unsigned int kSymboly = 56;
/**
* This class is one of the parent classes of DreamGenContext. Its sole purpose
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index bee03f993f..d53353858b 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -105,25 +105,10 @@ static const uint16 kLengthofextra = (0+2080+30000+(16*114)+((114+2)*2)+18000);
static const uint16 kForeign = (1);
static const uint16 kCd = (1);
static const uint16 kNumexobjects = (114);
-static const uint16 kFreedatlen = (16*80);
static const uint16 kExtextlen = (18000);
-static const uint16 kNumchanges = (250);
static const uint16 kExframeslen = (30000);
-static const uint16 kScreenwidth = (320);
static const uint16 kItempicsize = (44);
-static const uint16 kDiaryy = (48+12);
-static const uint16 kOpsy = (52);
-static const uint16 kSymboly = (56);
-static const uint16 kInventy = (58);
-static const uint16 kMenuy = (60);
-static const uint16 kOpsx = (60);
-static const uint16 kSymbolx = (64);
-static const uint16 kMapwidth = (66);
-static const uint16 kDiaryx = (68+24);
static const uint16 kLengthofvars = (68-0);
-static const uint16 kInventx = (80);
-static const uint16 kMenux = (80+40);
-static const uint16 kHeaderlen = (96);
class DreamGenContext : public DreamBase, public Context {
diff --git a/engines/dreamweb/saveload.cpp b/engines/dreamweb/saveload.cpp
index 9faf93ae8e..06cf7e0012 100644
--- a/engines/dreamweb/saveload.cpp
+++ b/engines/dreamweb/saveload.cpp
@@ -464,7 +464,7 @@ void DreamBase::savePosition(unsigned int slot, const char *descbuf) {
// fill length fields in savegame file header
uint16 len[6] = { 17, kLengthofvars, kLengthofextra,
- 4*kNumchanges, 48, kNumReelRoutines*8+1 };
+ 4*kNumChanges, 48, kNumReelRoutines*8+1 };
for (int i = 0; i < 6; ++i)
header.setLen(i, len[i]);
@@ -551,7 +551,7 @@ void DreamBase::loadPosition(unsigned int slot) {
inSaveFile->read(data.ptr(kStartvars, len[1]), len[1]);
// the Extras segment:
- inSaveFile->read((uint8 *)_exFrames._frames, 2080);
+ inSaveFile->read((uint8 *)_exFrames._frames, kExframes);
inSaveFile->read((uint8 *)_exFrames._data, kExframeslen);
inSaveFile->read((uint8 *)_exData, sizeof(DynObject)*kNumexobjects);
inSaveFile->read((uint8 *)_exText._offsetsLE, 2*(kNumExObjects+2));
diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp
index d5617dabc2..c2646d6588 100644
--- a/engines/dreamweb/sprite.cpp
+++ b/engines/dreamweb/sprite.cpp
@@ -1092,14 +1092,13 @@ void DreamBase::soundOnReels(uint16 reelPointer) {
}
void DreamBase::clearBeforeLoad() {
- const uint16 kMaplen = 66*60;
if (_roomLoaded != 1)
return; // noclear
clearReels();
//clearRest
- memset(_mapData, 0, kMaplen);
+ memset(_mapData, 0, kLengthOfMap);
delete[] _backdropBlocks;
_backdropBlocks = 0;
_setFrames.clear();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index dfc39f8667..59fb00e3e6 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1879,12 +1879,11 @@ void DreamBase::zoomOnOff() {
}
void DreamBase::sortOutMap() {
- const uint16 kMaplength = 60;
const uint8 *src = workspace();
uint8 *dst = _mapData;
- for (uint16 y = 0; y < kMaplength; ++y) {
- memcpy(dst, src, kMapwidth);
- dst += kMapwidth;
+ for (uint16 y = 0; y < kMapHeight; ++y) {
+ memcpy(dst, src, kMapWidth);
+ dst += kMapWidth;
src += 132;
}
}
@@ -2135,6 +2134,7 @@ void DreamBase::getRidOfAll() {
// if skipDat, skip clearing and loading Setdat and Freedat
void DreamBase::loadRoomData(const Room &room, bool skipDat) {
const uint16 kSetdatlen = 64*128;
+ const uint16 kFreedatlen = 16*80;
engine->openFile(room.name);
@@ -3545,7 +3545,7 @@ void DreamBase::clearBuffers() {
}
void DreamBase::clearChanges() {
- memset(_listOfChanges, 0xFF, 4*kNumchanges);
+ memset(_listOfChanges, 0xFF, 4*kNumChanges);
setupInitialReelRoutines();