aboutsummaryrefslogtreecommitdiff
path: root/engines/teenagent
diff options
context:
space:
mode:
authorVladimir Menshakov2009-11-08 11:04:22 +0000
committerVladimir Menshakov2009-11-08 11:04:22 +0000
commit4e662b22ca3019af8519900c6889f532a2707a23 (patch)
treeea5166ff28732c8a57d7a2cc4043be22d1b31771 /engines/teenagent
parent75bbe04280d1a919d6113097e21636265ff412d2 (diff)
downloadscummvm-rg350-4e662b22ca3019af8519900c6889f532a2707a23.tar.gz
scummvm-rg350-4e662b22ca3019af8519900c6889f532a2707a23.tar.bz2
scummvm-rg350-4e662b22ca3019af8519900c6889f532a2707a23.zip
restart default animation in the slot after custom animation has ended.
svn-id: r45750
Diffstat (limited to 'engines/teenagent')
-rw-r--r--engines/teenagent/animation.cpp4
-rw-r--r--engines/teenagent/animation.h1
-rw-r--r--engines/teenagent/scene.cpp5
3 files changed, 10 insertions, 0 deletions
diff --git a/engines/teenagent/animation.cpp b/engines/teenagent/animation.cpp
index 1f5919ebd3..ee7e05cbd3 100644
--- a/engines/teenagent/animation.cpp
+++ b/engines/teenagent/animation.cpp
@@ -84,6 +84,10 @@ Surface *Animation::currentFrame(int dt) {
return r;
}
+void Animation::restart() {
+ paused = false;
+ index = 0;
+}
void Animation::free() {
id = 0;
diff --git a/engines/teenagent/animation.h b/engines/teenagent/animation.h
index 3a05f20d26..5936905b5c 100644
--- a/engines/teenagent/animation.h
+++ b/engines/teenagent/animation.h
@@ -48,6 +48,7 @@ public:
~Animation();
bool empty() const { return frames == NULL; }
+ void restart();
//uint16 width() const { return frames? frames[0].w: 0; }
//uint16 height() const { return frames? frames[0].h: 0; }
diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp
index d6a4e89915..a097fd3f13 100644
--- a/engines/teenagent/scene.cpp
+++ b/engines/teenagent/scene.cpp
@@ -392,6 +392,11 @@ bool Scene::render(OSystem *system) {
got_any_animation = true;
} else {
a = animation + i;
+ if (!custom_animation[i].empty()) {
+ debug(0, "custom animation ended, restart animation in the same slot.");
+ custom_animation[i].free();
+ a->restart();
+ }
s = a->currentFrame();
}