aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2011-12-18 16:20:17 +0100
committerWillem Jan Palenstijn2011-12-18 16:34:57 +0100
commit49877b231916a9ed75ab5b63870e89c351aafedf (patch)
tree4d2c717496f91de0c5d44f8ce1a9ead544b9f8e1 /engines
parent8449493eff5ff26e8550dec6c50470521fc31947 (diff)
downloadscummvm-rg350-49877b231916a9ed75ab5b63870e89c351aafedf.tar.gz
scummvm-rg350-49877b231916a9ed75ab5b63870e89c351aafedf.tar.bz2
scummvm-rg350-49877b231916a9ed75ab5b63870e89c351aafedf.zip
DREAMWEB: Move all reel functions to DreamBase
Diffstat (limited to 'engines')
-rw-r--r--engines/dreamweb/dreambase.h11
-rw-r--r--engines/dreamweb/people.cpp12
-rw-r--r--engines/dreamweb/sprite.cpp42
-rw-r--r--engines/dreamweb/stubs.cpp6
-rw-r--r--engines/dreamweb/stubs.h10
5 files changed, 30 insertions, 51 deletions
diff --git a/engines/dreamweb/dreambase.h b/engines/dreamweb/dreambase.h
index eae1d05902..9a5d68436c 100644
--- a/engines/dreamweb/dreambase.h
+++ b/engines/dreamweb/dreambase.h
@@ -158,6 +158,7 @@ public:
void workoutFrames();
// from people.cpp
+ void updatePeople();
void madmanText();
void madman(ReelRoutine &routine);
void madMode();
@@ -206,7 +207,7 @@ public:
void bartender(ReelRoutine &routine);
void heavy(ReelRoutine &routine);
void helicopter(ReelRoutine &routine);
- //void mugger(ReelRoutine &routine);
+ void mugger(ReelRoutine &routine);
void businessMan(ReelRoutine &routine);
void endGameSeq(ReelRoutine &routine);
void poolGuard(ReelRoutine &routine);
@@ -288,6 +289,11 @@ public:
void getRidOfReels();
void liftNoise(uint8 index);
void checkForExit(Sprite *sprite);
+ void mainMan(Sprite *sprite);
+ void spriteUpdate();
+ void showRain();
+ void reconstruct();
+ void reelsOnScreen();
// from stubs.cpp
bool isCD();
@@ -422,6 +428,9 @@ public:
const uint8 *findObName(uint8 type, uint8 index);
void copyName(uint8 type, uint8 index, uint8 *dst);
uint16 findExObject(const char *id);
+ void makeMainScreen();
+ void showWatchReel();
+ void watchReel();
// from use.cpp
void placeFreeObject(uint8 index);
diff --git a/engines/dreamweb/people.cpp b/engines/dreamweb/people.cpp
index 20d67763ad..801e959a13 100644
--- a/engines/dreamweb/people.cpp
+++ b/engines/dreamweb/people.cpp
@@ -24,7 +24,7 @@
namespace DreamGen {
-static void (DreamGenContext::*reelCallbacks[57])(ReelRoutine &) = {
+static void (DreamBase::*reelCallbacks[57])(ReelRoutine &) = {
&DreamBase::gamer, &DreamBase::sparkyDrip,
&DreamBase::eden, &DreamBase::edenInBath,
&DreamBase::sparky, &DreamBase::smokeBloke,
@@ -42,7 +42,7 @@ static void (DreamGenContext::*reelCallbacks[57])(ReelRoutine &) = {
&DreamBase::copper, &DreamBase::poolGuard,
&DreamBase::rockstar, &DreamBase::businessMan,
&DreamBase::train, &DreamBase::genericPerson /*aide*/,
- &DreamGenContext::mugger, &DreamBase::helicopter,
+ &DreamBase::mugger, &DreamBase::helicopter,
&DreamBase::introMagic1, &DreamBase::introMusic,
&DreamBase::introMagic2, &DreamBase::candles2,
&DreamBase::gates, &DreamBase::introMagic3,
@@ -135,7 +135,7 @@ void DreamBase::setupInitialReelRoutines(ReelRoutine *dest) {
}
#endif
-void DreamGenContext::updatePeople() {
+void DreamBase::updatePeople() {
data.word(kListpos) = kPeoplelist;
memset(getSegment(data.word(kBuffers)).ptr(kPeoplelist, 12 * sizeof(People)), 0xff, 12 * sizeof(People));
++data.word(kMaintimer);
@@ -147,10 +147,6 @@ void DreamGenContext::updatePeople() {
r[i].mapX == data.byte(kMapx) &&
r[i].mapY == data.byte(kMapy)) {
assert(reelCallbacks[i]);
- // Set es:bx to the ReelRoutine, while not all ReelCallbacks are in
- // DreamBase
- es = data;
- bx = kReelroutines + 8*i;
(this->*(reelCallbacks[i]))(r[i]);
}
}
@@ -915,7 +911,7 @@ void DreamBase::helicopter(ReelRoutine &routine) {
}
}
-void DreamGenContext::mugger(ReelRoutine &routine) {
+void DreamBase::mugger(ReelRoutine &routine) {
if (routine.reelPointer() != 138) {
if (routine.reelPointer() == 176)
return; // endmugger2
diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp
index 1e980de015..cc6b09fd68 100644
--- a/engines/dreamweb/sprite.cpp
+++ b/engines/dreamweb/sprite.cpp
@@ -88,7 +88,7 @@ Sprite *DreamBase::makeSprite(uint8 x, uint8 y, uint16 updateCallback, uint16 fr
return sprite;
}
-void DreamGenContext::spriteUpdate() {
+void DreamBase::spriteUpdate() {
Sprite *sprites = spriteTable();
sprites[0].hidden = data.byte(kRyanon);
@@ -118,30 +118,19 @@ void DreamBase::initMan() {
sprite->walkFrame = 0;
}
-void DreamGenContext::mainMan(Sprite *sprite) {
- push(es);
- push(ds);
-
- // Recover es:bx from sprite
- es = data.word(kBuffers);
- bx = kSpritetable;
- Sprite *sprites = (Sprite *)es.ptr(bx, sizeof(Sprite) * 16);
- bx += 32 * (sprite - sprites);
- //
-
+void DreamBase::mainMan(Sprite *sprite) {
if (data.byte(kResetmanxy) == 1) {
data.byte(kResetmanxy) = 0;
sprite->x = data.byte(kRyanx);
sprite->y = data.byte(kRyany);
sprite->walkFrame = 0;
}
+
--sprite->speed;
- if (sprite->speed != 0xff) {
- ds = pop();
- es = pop();
+ if (sprite->speed != 0xff)
return;
- }
sprite->speed = 0;
+
if (data.byte(kTurntoface) != data.byte(kFacing)) {
aboutTurn(sprite);
} else {
@@ -177,9 +166,6 @@ void DreamGenContext::mainMan(Sprite *sprite) {
sprite->frameNumber = sprite->walkFrame + facelist[data.byte(kFacing)];
data.byte(kRyanx) = sprite->x;
data.byte(kRyany) = sprite->y;
-
- ds = pop();
- es = pop();
}
void DreamBase::walking(Sprite *sprite) {
@@ -487,25 +473,23 @@ const Frame *DreamBase::getReelFrameAX(uint16 frame) {
return base + frame;
}
-void DreamGenContext::showRain() {
+void DreamBase::showRain() {
Rain *rain = (Rain *)getSegment(data.word(kBuffers)).ptr(kRainlist, 0);
// Do nothing if there's no rain at all
if (rain->x == 255)
return;
- ds = data.word(kMainsprites);
- si = 6*58; // Frame 58
- ax = ds.word(si+2); // Frame::ptr
- si = ax + 2080;
+ const Frame *frame = (const Frame *)getSegment(data.word(kMainsprites)).ptr(58 * sizeof(Frame), sizeof(Frame));
+ const uint8 *frameData = getSegment(data.word(kMainsprites)).ptr(kFrframes + frame->ptr(), 512);
for (; rain->x != 255; ++rain) {
uint16 y = rain->y + data.word(kMapady) + data.word(kMapystart);
uint16 x = rain->x + data.word(kMapadx) + data.word(kMapxstart);
uint16 size = rain->size;
- ax = ((uint16)(rain->w3() - rain->b5)) & 511;
- rain->setW3(ax);
- const uint8 *src = ds.ptr(si, 0) + ax;
+ uint16 offset = (rain->w3() - rain->b5) & 511;
+ rain->setW3(offset);
+ const uint8 *src = frameData + offset;
uint8 *dst = workspace() + y * 320 + x;
for (uint16 i = 0; i < size; ++i) {
uint8 v = src[i];
@@ -872,7 +856,7 @@ void DreamBase::textForMonk() {
}
}
-void DreamGenContext::reelsOnScreen() {
+void DreamBase::reelsOnScreen() {
reconstruct();
updatePeople();
watchReel();
@@ -880,7 +864,7 @@ void DreamGenContext::reelsOnScreen() {
useTimedText();
}
-void DreamGenContext::reconstruct() {
+void DreamBase::reconstruct() {
if (data.byte(kHavedoneobs) == 0)
return;
data.byte(kNewobs) = 1;
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 6b7e9a7784..4ac13ea3fb 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -3273,7 +3273,7 @@ void DreamGenContext::allPointer() {
dumpPointer();
}
-void DreamGenContext::makeMainScreen() {
+void DreamBase::makeMainScreen() {
createPanel();
data.byte(kNewobs) = 1;
drawFloor();
@@ -3697,7 +3697,7 @@ void DreamBase::putUnderZoom() {
multiPut(getSegment(data.word(kBuffers)).ptr(kZoomspace, 0), kZoomx + 5, kZoomy + 4, 46, 40);
}
-void DreamGenContext::showWatchReel() {
+void DreamBase::showWatchReel() {
uint16 reelPointer = data.word(kReeltowatch);
plotReel(reelPointer);
data.word(kReeltowatch) = reelPointer;
@@ -3707,7 +3707,7 @@ void DreamGenContext::showWatchReel() {
data.byte(kShakecounter) = 0xFF;
}
-void DreamGenContext::watchReel() {
+void DreamBase::watchReel() {
if (data.word(kReeltowatch) != 0xFFFF) {
if (data.byte(kManspath) != data.byte(kFinaldest))
return; // Wait until stopped walking
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index aeda662283..de03e45c62 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -61,10 +61,7 @@
DreamBase::showFrame(frameData, x, y, frameNumber, effectsFlag);
}
void width160();
- void spriteUpdate();
- void mainMan(Sprite *sprite);
void zoom();
- void showRain();
void commandOnly();
void commandOnly(uint8 command) {
DreamBase::commandOnly(command);
@@ -77,7 +74,6 @@
bool checkIfEx(uint8 x, uint8 y);
void commandWithOb();
void commandWithOb(uint8 command, uint8 type, uint8 index);
- void updatePeople();
void blockNameText();
void walkToText();
void personNameText();
@@ -171,8 +167,6 @@
void playChannel1(uint8 index) {
DreamBase::playChannel1(index);
}
- void reelsOnScreen();
- void reconstruct();
void look();
void autoLook();
void doLook();
@@ -238,7 +232,6 @@
void checkFolderCoords();
void nextFolder();
void lastFolder();
- void mugger(ReelRoutine &routine);
void singleKey(uint8 key, uint16 x, uint16 y);
void loadSaveBox();
uint8 nextSymbol(uint8 symbol);
@@ -295,7 +288,6 @@
void openTomb();
void hotelControl();
void obsThatDoThings();
- void makeMainScreen();
void delEverything();
void errorMessage1();
void errorMessage2();
@@ -316,8 +308,6 @@
void set16ColPalette();
void showSaveOps();
void showLoadOps();
- void watchReel();
- void showWatchReel();
void afterNewRoom();
void madmanRun();
void showDecisions();