aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb/sprite.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2011-12-27 22:00:27 +0100
committerWillem Jan Palenstijn2011-12-27 23:03:05 +0100
commita7cdc342b36bce68e5cdabf6a682e38ea1b21e7b (patch)
tree9cf2a70ccadb619697ade53d4b8ffc3eb96417be /engines/dreamweb/sprite.cpp
parentf729742f87648d6a5ebc1468e26e90ac1de1c2e0 (diff)
downloadscummvm-rg350-a7cdc342b36bce68e5cdabf6a682e38ea1b21e7b.tar.gz
scummvm-rg350-a7cdc342b36bce68e5cdabf6a682e38ea1b21e7b.tar.bz2
scummvm-rg350-a7cdc342b36bce68e5cdabf6a682e38ea1b21e7b.zip
DREAMWEB: Convert reel segments into GraphicsFiles
Diffstat (limited to 'engines/dreamweb/sprite.cpp')
-rw-r--r--engines/dreamweb/sprite.cpp32
1 files changed, 13 insertions, 19 deletions
diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp
index 31f7408a1c..4071c56f64 100644
--- a/engines/dreamweb/sprite.cpp
+++ b/engines/dreamweb/sprite.cpp
@@ -435,26 +435,24 @@ Reel *DreamBase::getReelStart(uint16 reelPointer) {
// Locate the reel segment (reel1, reel2, reel3) this frame is stored in,
// and adjust the frame number relative to this segment.
-const Frame *DreamBase::findSource(uint16 &frame) {
- uint16 base;
+const GraphicsFile *DreamBase::findSource(uint16 &frame) {
if (frame < 160) {
- base = data.word(kReel1);
+ return &_reel1;
} else if (frame < 320) {
frame -= 160;
- base = data.word(kReel2);
+ return &_reel2;
} else {
frame -= 320;
- base = data.word(kReel3);
+ return &_reel3;
}
- return (const Frame *)getSegment(base).ptr(0, (frame+1)*sizeof(Frame));
}
void DreamBase::showReelFrame(Reel *reel) {
uint16 x = reel->x + data.word(kMapadx);
uint16 y = reel->y + data.word(kMapady);
uint16 frame = reel->frame();
- const Frame *base = findSource(frame);
- showFrame(base, x, y, frame, 8);
+ const GraphicsFile *base = findSource(frame);
+ showFrame(*base, x, y, frame, 8);
}
void DreamBase::showGameReel(ReelRoutine *routine) {
@@ -466,8 +464,8 @@ void DreamBase::showGameReel(ReelRoutine *routine) {
}
const Frame *DreamBase::getReelFrameAX(uint16 frame) {
- const Frame *base = findSource(frame);
- return base + frame;
+ const GraphicsFile *base = findSource(frame);
+ return &base->_frames[frame];
}
void DreamBase::showRain() {
@@ -1115,18 +1113,14 @@ void DreamBase::clearBeforeLoad() {
}
void DreamBase::clearReels() {
- deallocateMem(data.word(kReel1));
- deallocateMem(data.word(kReel2));
- deallocateMem(data.word(kReel3));
+ _reel1.clear();
+ _reel2.clear();
+ _reel3.clear();
}
void DreamBase::getRidOfReels() {
- if (data.byte(kRoomloaded) == 0)
- return /* (dontgetrid) */;
-
- deallocateMem(data.word(kReel1));
- deallocateMem(data.word(kReel2));
- deallocateMem(data.word(kReel3));
+ if (data.byte(kRoomloaded))
+ clearReels();
}
void DreamBase::liftNoise(uint8 index) {