aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb/people.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2011-12-23 19:13:42 +0100
committerWillem Jan Palenstijn2011-12-23 19:15:25 +0100
commit0f36350e03c69ce605fde1277118c43487f724af (patch)
tree15431ddc2de6a52ef66ef6686c95886db7875150 /engines/dreamweb/people.cpp
parentc4af50ae63fc93e221306440fee0337a77059295 (diff)
downloadscummvm-rg350-0f36350e03c69ce605fde1277118c43487f724af.tar.gz
scummvm-rg350-0f36350e03c69ce605fde1277118c43487f724af.tar.bz2
scummvm-rg350-0f36350e03c69ce605fde1277118c43487f724af.zip
DREAMWEB: Fix regression from moving ReelRoutines out of data
The struct People still had an old-style pointer to a ReelRoutine. Fix this by converting People to use a real ReelRoutine * and moving the PeopleList from the buffers segment to a Common::List. Thanks to digitall for the assistance with tracking this down.
Diffstat (limited to 'engines/dreamweb/people.cpp')
-rw-r--r--engines/dreamweb/people.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/engines/dreamweb/people.cpp b/engines/dreamweb/people.cpp
index 1e79471a65..32fbbc04e5 100644
--- a/engines/dreamweb/people.cpp
+++ b/engines/dreamweb/people.cpp
@@ -129,8 +129,7 @@ void DreamBase::setupInitialReelRoutines() {
}
void DreamBase::updatePeople() {
- data.word(kListpos) = kPeoplelist;
- memset(getSegment(data.word(kBuffers)).ptr(kPeoplelist, 12 * sizeof(People)), 0xff, 12 * sizeof(People));
+ _peopleList.clear();
++data.word(kMaintimer);
for (int i = 0; _reelRoutines[i].reallocation != 255; ++i) {
@@ -220,13 +219,12 @@ void DreamBase::madMode() {
}
void DreamBase::addToPeopleList(ReelRoutine *routine) {
- uint16 routinePointer = (const uint8 *)routine - data.ptr(0, 0);
+ People people;
+ people._reelPointer = routine->reelPointer();
+ people._routinePointer = routine;
+ people.b4 = routine->b7;
- People *people = (People *)getSegment(data.word(kBuffers)).ptr(data.word(kListpos), sizeof(People));
- people->setReelPointer(routine->reelPointer());
- people->setRoutinePointer(routinePointer);
- people->b4 = routine->b7;
- data.word(kListpos) += sizeof(People);
+ _peopleList.push_back(people);
}
bool DreamBase::checkSpeed(ReelRoutine &routine) {