aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2011-11-18 19:00:10 +0100
committerWillem Jan Palenstijn2011-11-18 19:04:25 +0100
commit13b2e89378b79bed4d34df41798430d49e39b8fa (patch)
treeba84eede1a41556867916fcc827da24deedd2fd0 /engines/dreamweb
parent351be2d19d9389e88a75546ba5786cf2b58dc910 (diff)
downloadscummvm-rg350-13b2e89378b79bed4d34df41798430d49e39b8fa.tar.gz
scummvm-rg350-13b2e89378b79bed4d34df41798430d49e39b8fa.tar.bz2
scummvm-rg350-13b2e89378b79bed4d34df41798430d49e39b8fa.zip
DREAMWEB: Clean up loop
Diffstat (limited to 'engines/dreamweb')
-rw-r--r--engines/dreamweb/sprite.cpp45
1 files changed, 23 insertions, 22 deletions
diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp
index a03de8caf1..c7288edd4f 100644
--- a/engines/dreamweb/sprite.cpp
+++ b/engines/dreamweb/sprite.cpp
@@ -518,37 +518,23 @@ const Frame *DreamGenContext::getreelframeax(uint16 frame) {
}
void DreamGenContext::showrain() {
+ Rain *rain = (Rain *)segRef(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;
ax = ds.word(si+2);
si = ax + 2080;
- Rain *rain = (Rain *)segRef(data.word(kBuffers)).ptr(kRainlist, 0);
- if (rain->x == 255)
- return;
- while (true) {
- if (rain->x == 255) {
- if (data.word(kCh1blockstocopy) != 0)
- return;
- if ((data.byte(kReallocation) == 2) && (data.byte(kBeenmugged) != 1))
- return;
- if (data.byte(kReallocation) == 55)
- return;
- randomnum1();
- if (al >= 1)
- return;
- if (data.byte(kCh0playing) != 6)
- al = 4;
- else
- al = 7;
- playchannel1();
- return;
- }
+
+ 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);
- ++rain;
const uint8 *src = ds.ptr(si, 0) + ax;
uint8 *dst = workspace() + y * 320 + x;
for(uint16 i = 0; i < size; ++i) {
@@ -558,6 +544,21 @@ void DreamGenContext::showrain() {
dst += 320-1;
}
}
+
+ if (data.word(kCh1blockstocopy) != 0)
+ return;
+ if (data.byte(kReallocation) == 2 && data.byte(kBeenmugged) != 1)
+ return;
+ if (data.byte(kReallocation) == 55)
+ return;
+ randomnum1();
+ if (al >= 1)
+ return;
+ if (data.byte(kCh0playing) != 6)
+ al = 4;
+ else
+ al = 7;
+ playchannel1();
}
static void (DreamGenContext::*reelCallbacks[])() = {