aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2011-12-23 22:58:31 +0100
committerWillem Jan Palenstijn2011-12-23 23:46:38 +0100
commitbbdbffc10744e4d9e789150ba151c1884c740ae0 (patch)
tree8a705308392f138716b2fbcdec7d4cc14d40fb74 /engines
parent10774daa586008af8e327a58a3ee910482a7cbfb (diff)
downloadscummvm-rg350-bbdbffc10744e4d9e789150ba151c1884c740ae0.tar.gz
scummvm-rg350-bbdbffc10744e4d9e789150ba151c1884c740ae0.tar.bz2
scummvm-rg350-bbdbffc10744e4d9e789150ba151c1884c740ae0.zip
DREAMWEB: Move changes out of buffers
Diffstat (limited to 'engines')
-rw-r--r--engines/dreamweb/dreambase.h6
-rw-r--r--engines/dreamweb/saveload.cpp4
-rw-r--r--engines/dreamweb/stubs.cpp6
3 files changed, 11 insertions, 5 deletions
diff --git a/engines/dreamweb/dreambase.h b/engines/dreamweb/dreambase.h
index 26f0395732..1601cb44b5 100644
--- a/engines/dreamweb/dreambase.h
+++ b/engines/dreamweb/dreambase.h
@@ -46,6 +46,7 @@ const unsigned int kUnderTimedTextSizeY_f = 30;
const unsigned int kUnderTextBufSize = kUnderTextSizeX_f * kUnderTextSizeY_f;
const unsigned int kUnderTimedTextBufSize = 256 * kUnderTextSizeY_f;
const unsigned int kLengthOfVars = 68;
+const unsigned int kNumChanges = 250;
/**
* This class is one of the parent classes of DreamGenContext. Its sole purpose
@@ -79,16 +80,21 @@ protected:
// from Buffers
uint8 _textUnder[kUnderTextBufSize];
+ // _openInvList (see fillOpen/findOpenPos)
+ // _ryanInvList (see findInvPos/findInvPosCPP)
uint8 _pointerBack[32*32];
uint8 _mapFlags[11*10*3];
uint8 _startPal[3*256];
uint8 _endPal[3*256];
uint8 _mainPal[3*256];
+ // _spriteTable
Common::List<ObjPos> _setList;
Common::List<ObjPos> _freeList;
Common::List<ObjPos> _exList;
Common::List<People> _peopleList;
uint8 _zoomSpace[46*40];
+ // _printedList (unused?)
+ Change _listOfChanges[kNumChanges]; // Note: this array is saved
uint8 _underTimedText[kUnderTimedTextBufSize];
Common::List<Rain> _rainList;
uint8 _initialVars[kLengthOfVars]; // TODO: This shouldn't be necessary
diff --git a/engines/dreamweb/saveload.cpp b/engines/dreamweb/saveload.cpp
index b12c668d82..53c2f55d38 100644
--- a/engines/dreamweb/saveload.cpp
+++ b/engines/dreamweb/saveload.cpp
@@ -479,7 +479,7 @@ void DreamBase::savePosition(unsigned int slot, const char *descbuf) {
outSaveFile->write(descbuf, len[0]);
outSaveFile->write(data.ptr(kStartvars, len[1]), len[1]);
outSaveFile->write(getSegment(data.word(kExtras)).ptr(kExframedata, len[2]), len[2]);
- outSaveFile->write(getSegment(data.word(kBuffers)).ptr(kListofchanges, len[3]), len[3]);
+ outSaveFile->write(_listOfChanges, len[3]);
// len[4] == 48, which is sizeof(Room) plus 16 for 'Roomscango'
outSaveFile->write((const uint8 *)&madeUpRoom, sizeof(Room));
@@ -545,7 +545,7 @@ void DreamBase::loadPosition(unsigned int slot) {
}
inSaveFile->read(data.ptr(kStartvars, len[1]), len[1]);
inSaveFile->read(getSegment(data.word(kExtras)).ptr(kExframedata, len[2]), len[2]);
- inSaveFile->read(getSegment(data.word(kBuffers)).ptr(kListofchanges, len[3]), len[3]);
+ inSaveFile->read(_listOfChanges, len[3]);
// len[4] == 48, which is sizeof(Room) plus 16 for 'Roomscango'
// Note: the values read into g_madeUpRoomDat are only used in actualLoad,
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 388244676d..dd1a03411f 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -1284,7 +1284,7 @@ void DreamBase::walkToText() {
}
void DreamBase::findOrMake(uint8 index, uint8 value, uint8 type) {
- Change *change = (Change *)getSegment(data.word(kBuffers)).ptr(kListofchanges, sizeof(Change));
+ Change *change = _listOfChanges;
for (; change->index != 0xff; ++change) {
if (index == change->index && data.byte(kReallocation) == change->location && type == change->type) {
change->value = value;
@@ -1299,7 +1299,7 @@ void DreamBase::findOrMake(uint8 index, uint8 value, uint8 type) {
}
void DreamBase::setAllChanges() {
- Change *change = (Change *)getSegment(data.word(kBuffers)).ptr(kListofchanges, sizeof(Change));
+ Change *change = _listOfChanges;
for (; change->index != 0xff; ++change)
if (change->location == data.byte(kReallocation))
doChange(change->index, change->value, change->type);
@@ -3698,7 +3698,7 @@ void DreamBase::clearBuffers() {
}
void DreamBase::clearChanges() {
- memset(getSegment(data.word(kBuffers)).ptr(kListofchanges, 4*kNumchanges), 0xFF, 4*kNumchanges);
+ memset(_listOfChanges, 0xFF, 4*kNumchanges);
setupInitialReelRoutines();