aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--saga/animation.cpp12
-rw-r--r--saga/animation.h8
-rw-r--r--saga/ihnm_introproc.cpp2
-rw-r--r--saga/ite_introproc.cpp2
4 files changed, 14 insertions, 10 deletions
diff --git a/saga/animation.cpp b/saga/animation.cpp
index 04f383aac7..dc3b8e323f 100644
--- a/saga/animation.cpp
+++ b/saga/animation.cpp
@@ -241,7 +241,7 @@ void Anim::load(uint16 animId, const byte *animResourceData, size_t animResource
anim->cycles = anim->maxFrame;
anim->frameTime = DEFAULT_FRAME_TIME;
- anim->flags = 0;
+ anim->flags = ANIM_FLAG_NONE;
anim->linkId = -1;
anim->state = ANIM_PAUSE;
}
@@ -314,7 +314,7 @@ void Anim::play(uint16 animId, int vectorTime, bool playing) {
if (anim->currentFrame > anim->maxFrame) {
anim->currentFrame = anim->loopFrame;
- if (anim->flags & ANIM_STOPPING || anim->currentFrame == -1) {
+ if (anim->state == ANIM_STOPPING || anim->currentFrame == -1) {
anim->state = ANIM_PAUSE;
}
}
@@ -322,7 +322,7 @@ void Anim::play(uint16 animId, int vectorTime, bool playing) {
// Animation done playing
anim->state = ANIM_PAUSE;
if (anim->linkId == -1) {
- if (anim->flags & ANIM_ENDSCENE) {
+ if (anim->flags & ANIM_FLAG_ENDSCENE) {
// This animation ends the scene
event.type = kEvTOneshot;
event.code = kSceneEvent;
@@ -339,9 +339,9 @@ void Anim::play(uint16 animId, int vectorTime, bool playing) {
linkAnim = getAnimation(anim->linkId);
debug(5, "Animation ended going to %d", anim->linkId);
- linkAnim->cycles = anim->cycles;
- linkAnim->currentFrame = 0;
- linkAnim->completed = 0;
+// linkAnim->cycles = anim->cycles;
+// linkAnim->currentFrame = 0;
+// linkAnim->completed = 0;
linkAnim->state = ANIM_PLAYING;
animId = anim->linkId;
frameTime = 0;
diff --git a/saga/animation.h b/saga/animation.h
index 994ff7d512..e03c4230e2 100644
--- a/saga/animation.h
+++ b/saga/animation.h
@@ -47,8 +47,12 @@ namespace Saga {
enum AnimationState {
ANIM_PLAYING = 0x01,
ANIM_PAUSE = 0x02,
- ANIM_STOPPING = 0x04,
- ANIM_ENDSCENE = 0x80 // When animation ends, dispatch scene end event
+ ANIM_STOPPING = 0x03,
+};
+
+enum AnimationFlags {
+ ANIM_FLAG_NONE = 0x00,
+ ANIM_FLAG_ENDSCENE = 0x01 // When animation ends, dispatch scene end event
};
// Cutaway info array member. Cutaways are basically animations with a really
diff --git a/saga/ihnm_introproc.cpp b/saga/ihnm_introproc.cpp
index 48d88d3385..7d9a21e0ee 100644
--- a/saga/ihnm_introproc.cpp
+++ b/saga/ihnm_introproc.cpp
@@ -132,7 +132,7 @@ int Scene::IHNMIntroMovieProc1(int param) {
q_event = _vm->_events->queue(&event);
_vm->_anim->setFrameTime(0, IHNM_INTRO_FRAMETIME);
- _vm->_anim->setFlag(0, ANIM_ENDSCENE);
+ _vm->_anim->setFlag(0, ANIM_FLAG_ENDSCENE);
event.type = kEvTOneshot;
event.code = kAnimEvent;
diff --git a/saga/ite_introproc.cpp b/saga/ite_introproc.cpp
index 54d25c4918..eb551ec35f 100644
--- a/saga/ite_introproc.cpp
+++ b/saga/ite_introproc.cpp
@@ -333,7 +333,7 @@ int Scene::ITEIntroAnimProc(int param) {
for (int i = 0; i < lastAnim; i++)
_vm->_anim->link(i, i+1);
- _vm->_anim->setFlag(lastAnim, ANIM_ENDSCENE);
+ _vm->_anim->setFlag(lastAnim, ANIM_FLAG_ENDSCENE);
debug(3, "Beginning animation playback.");