aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb/people.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2011-12-18 16:53:47 +0100
committerWillem Jan Palenstijn2011-12-18 16:54:16 +0100
commit60ece632b87ab8cb797df0a245bb5f97301fe610 (patch)
treea6aca17d5ec9091a2926189ef7703e6ecf212b74 /engines/dreamweb/people.cpp
parent49877b231916a9ed75ab5b63870e89c351aafedf (diff)
downloadscummvm-rg350-60ece632b87ab8cb797df0a245bb5f97301fe610.tar.gz
scummvm-rg350-60ece632b87ab8cb797df0a245bb5f97301fe610.tar.bz2
scummvm-rg350-60ece632b87ab8cb797df0a245bb5f97301fe610.zip
DREAMWEB: Remove reelRoutines from data blob
Diffstat (limited to 'engines/dreamweb/people.cpp')
-rw-r--r--engines/dreamweb/people.cpp29
1 files changed, 10 insertions, 19 deletions
diff --git a/engines/dreamweb/people.cpp b/engines/dreamweb/people.cpp
index 801e959a13..4d66134e96 100644
--- a/engines/dreamweb/people.cpp
+++ b/engines/dreamweb/people.cpp
@@ -56,12 +56,6 @@ static void (DreamBase::*reelCallbacks[57])(ReelRoutine &) = {
&DreamBase::carParkDrip
};
-#if 0
-// TODO: Enable this when the ReelRoutine list has been moved out of the
-// data segment, all ReelCallbacks are in DreamBase, and the
-// ReelRoutine::reelPointer field is a real member.
-// See also struct ReelRoutine, clearBuffers, clearChanges, syncReelRoutine
-
static const ReelRoutine g_initialReelRoutines[] = {
// Room number and x,y
// reel pointer
@@ -126,28 +120,25 @@ static const ReelRoutine g_initialReelRoutines[] = {
{ 255,0,0, 0, 0,0,0 }
};
-void DreamBase::setupInitialReelRoutines(ReelRoutine *dest) {
- for (unsigned int i = 0; i < ARRAYSIZE(g_initialReelRoutines); ++i) {
- dest[i] = g_initialReelRoutines[i];
- if (dest[i].period == 55 && isCD() && engine->getLanguage() == Common::DE_DEU)
- dest[i].period = 65;
+void DreamBase::setupInitialReelRoutines() {
+ for (unsigned int i = 0; i < kNumReelRoutines + 1; ++i) {
+ _reelRoutines[i] = g_initialReelRoutines[i];
+ if (_reelRoutines[i].period == 55 && isCD() && engine->getLanguage() == Common::DE_DEU)
+ _reelRoutines[i].period = 65;
}
}
-#endif
void DreamBase::updatePeople() {
data.word(kListpos) = kPeoplelist;
memset(getSegment(data.word(kBuffers)).ptr(kPeoplelist, 12 * sizeof(People)), 0xff, 12 * sizeof(People));
++data.word(kMaintimer);
- ReelRoutine *r = (ReelRoutine *)data.ptr(kReelroutines, 0);
-
- for (int i = 0; r[i].reallocation != 255; ++i) {
- if (r[i].reallocation == data.byte(kReallocation) &&
- r[i].mapX == data.byte(kMapx) &&
- r[i].mapY == data.byte(kMapy)) {
+ for (int i = 0; _reelRoutines[i].reallocation != 255; ++i) {
+ if (_reelRoutines[i].reallocation == data.byte(kReallocation) &&
+ _reelRoutines[i].mapX == data.byte(kMapx) &&
+ _reelRoutines[i].mapY == data.byte(kMapy)) {
assert(reelCallbacks[i]);
- (this->*(reelCallbacks[i]))(r[i]);
+ (this->*(reelCallbacks[i]))(_reelRoutines[i]);
}
}
}