aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2015-10-21 21:40:42 +0300
committerFilippos Karapetis2015-10-21 21:42:25 +0300
commit51365c11ca5ac79d01601411e634bca34e4a97c4 (patch)
treefbeeb4da9703db9e8a11572897e9911ccd968b44
parentd12d110543f0ddd2883c721dad80fa5e39fa2f74 (diff)
downloadscummvm-rg350-51365c11ca5ac79d01601411e634bca34e4a97c4.tar.gz
scummvm-rg350-51365c11ca5ac79d01601411e634bca34e4a97c4.tar.bz2
scummvm-rg350-51365c11ca5ac79d01601411e634bca34e4a97c4.zip
MADS: Phantom: Fix loadAnimation and silence warning in animations_tick
-rw-r--r--engines/mads/scene.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp
index 34d96778b8..07e67c04d6 100644
--- a/engines/mads/scene.cpp
+++ b/engines/mads/scene.cpp
@@ -618,15 +618,20 @@ int Scene::loadAnimation(const Common::String &resName, int trigger) {
DepthSurface depthSurface;
UserInterface interfaceSurface(_vm);
- warning("TODO: Fix loadAnimation");
- int id = 0;
+ for (int i = 0; i < 10; i++) {
+ if (!_animation[i]) {
+ _animation[i] = Animation::init(_vm, this);
+ _animation[i]->load(interfaceSurface, depthSurface, resName,
+ _vm->_dithering ? ANIMFLAG_DITHER : 0, nullptr, nullptr);
+ _animation[i]->startAnimation(trigger);
+
+ return i;
+ }
+ }
- _animation[id] = Animation::init(_vm, this);
- _animation[id]->load(interfaceSurface, depthSurface, resName,
- _vm->_dithering ? ANIMFLAG_DITHER : 0, nullptr, nullptr);
- _animation[id]->startAnimation(trigger);
+ error("Unable to find an available animation slot");
- return id;
+ return -1;
}
void Scene::updateCursor() {
@@ -797,7 +802,7 @@ void Scene::sceneScale(int front_y, int front_scale, int back_y, int back_scale
}
void Scene::animations_tick() {
- warning("TODO: Implement _animations as an AnimationList and refactor (and check implementation)");
+ //warning("TODO: Implement _animations as an AnimationList and refactor (and check implementation)");
for (int i = 0; i < 10; i++) {
if (_animation[i])
_animation[i]->update();