aboutsummaryrefslogtreecommitdiff
path: root/engines/teenagent/actor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/teenagent/actor.cpp')
-rw-r--r--engines/teenagent/actor.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/engines/teenagent/actor.cpp b/engines/teenagent/actor.cpp
index 870410b2c2..717c022c38 100644
--- a/engines/teenagent/actor.cpp
+++ b/engines/teenagent/actor.cpp
@@ -31,10 +31,9 @@ namespace TeenAgent {
Actor::Actor() : head_index(0), idle_type(0) {}
//idle animation lists at dseg: 0x6540
-Common::Rect Actor::renderIdle(Graphics::Surface *surface, const Common::Point &position, uint8 orientation, int delta_frame, uint zoom) {
- static Common::RandomSource random;
+Common::Rect Actor::renderIdle(Graphics::Surface *surface, const Common::Point &position, uint8 orientation, int delta_frame, uint zoom, Common::RandomSource &rnd) {
if (index == 0) {
- idle_type = random.getRandomNumber(2);
+ idle_type = rnd.getRandomNumber(2);
debug(0, "switched to idle animation %u", idle_type);
}
@@ -44,7 +43,7 @@ Common::Rect Actor::renderIdle(Graphics::Surface *surface, const Common::Point &
frames_idle = res->dseg.ptr(res->dseg.get_word(0x6540 + idle_type * 2)) + index;
index += delta_frame;
if (*frames_idle == 0) {
- idle_type = random.getRandomNumber(2);
+ idle_type = rnd.getRandomNumber(2);
debug(0, "switched to idle animation %u[loop]", idle_type);
index = 3; //put 4th frame (base 1) if idle animation loops
}