aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb
diff options
context:
space:
mode:
authorBertrand Augereau2011-08-04 11:03:08 +0200
committerBertrand Augereau2011-08-04 11:03:08 +0200
commita3c8c1334ba5c948912e35ca8bdc30d479190df0 (patch)
tree2c7263168d08aa103ba8815ed81179431fc17e32 /engines/dreamweb
parent3427d07de07032b203f7aa02486b8073a65bca26 (diff)
downloadscummvm-rg350-a3c8c1334ba5c948912e35ca8bdc30d479190df0.tar.gz
scummvm-rg350-a3c8c1334ba5c948912e35ca8bdc30d479190df0.tar.bz2
scummvm-rg350-a3c8c1334ba5c948912e35ca8bdc30d479190df0.zip
DREAMWEB: Helper function to acquire a temporary segment ref to avoid ds and es pollution
Diffstat (limited to 'engines/dreamweb')
-rw-r--r--engines/dreamweb/runtime.h6
-rw-r--r--engines/dreamweb/sprite.cpp3
2 files changed, 7 insertions, 2 deletions
diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h
index 714a8d5850..ba16f03d1c 100644
--- a/engines/dreamweb/runtime.h
+++ b/engines/dreamweb/runtime.h
@@ -287,6 +287,12 @@ public:
_freeSegments.push_back(id);
}
+ SegmentRef segRef(uint16 seg) {
+ SegmentRef result(this);
+ result = seg;
+ return result;
+ }
+
inline void _cmp(uint8 a, uint8 b) {
_sub(a, b);
}
diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp
index 00cbd2c4dc..8cf0da1de7 100644
--- a/engines/dreamweb/sprite.cpp
+++ b/engines/dreamweb/sprite.cpp
@@ -580,8 +580,7 @@ void DreamGenContext::showrain() {
si = 6*58;
ax = ds.word(si+2);
si = ax + 2080;
- es = data.word(kBuffers);
- Rain *rain = (Rain *)es.ptr(kRainlist, 0);
+ Rain *rain = (Rain *)segRef(data.word(kBuffers)).ptr(kRainlist, 0);
if (rain->x == 255)
return;
while (true) {