aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb
diff options
context:
space:
mode:
authorBertrand Augereau2011-06-28 16:05:58 +0200
committerBertrand Augereau2011-07-18 22:59:16 +0200
commitb8cc90ad6c6adc7ceaa54e964591729ce439f490 (patch)
tree4fc77eea142ba41eb36e6f068637a2877334eca0 /engines/dreamweb
parent2fd19aeedf5d3df90a1be5ae0bba30ea5131ee10 (diff)
downloadscummvm-rg350-b8cc90ad6c6adc7ceaa54e964591729ce439f490.tar.gz
scummvm-rg350-b8cc90ad6c6adc7ceaa54e964591729ce439f490.tar.bz2
scummvm-rg350-b8cc90ad6c6adc7ceaa54e964591729ce439f490.zip
DREAMWEB: Reversed random sprite callback
Diffstat (limited to 'engines/dreamweb')
-rw-r--r--engines/dreamweb/stubs.cpp7
-rw-r--r--engines/dreamweb/stubs.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 074f3bfdab..4dc4ef83c7 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -913,7 +913,7 @@ void DreamGenContext::backobject(Sprite* sprite) {
if (objData->type == 6)
widedoor();
else if (objData->type == 5)
- random();
+ random(sprite, objData);
else if (objData->type == 4)
lockeddoorway();
else if (objData->type == 3)
@@ -939,6 +939,11 @@ void DreamGenContext::constant(Sprite* sprite, ObjData* objData) {
sprite->b15 = b18;
}
+void DreamGenContext::random(Sprite* sprite, ObjData* objData) {
+ randomnum1();
+ uint16 r = ax;
+ sprite->b15 = objData->b18[r&7];
+}
void DreamGenContext::dodoor() {
Sprite *sprite = (Sprite*)es.ptr(bx, sizeof(Sprite));
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 6d1ee5ec33..d1eb5aae9f 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -31,6 +31,7 @@
void backobject(Sprite* sprite);
void constant(Sprite* sprite, ObjData* objData);
void steady(Sprite* sprite, ObjData* objData);
+ void random(Sprite* sprite, ObjData* objData);
void dodoor();
void dodoor(Sprite* sprite, ObjData* objData);
void liftsprite();