aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/access/animation.cpp69
-rw-r--r--engines/access/animation.h8
2 files changed, 35 insertions, 42 deletions
diff --git a/engines/access/animation.cpp b/engines/access/animation.cpp
index 705fd7bf8f..6c9f300931 100644
--- a/engines/access/animation.cpp
+++ b/engines/access/animation.cpp
@@ -97,101 +97,95 @@ void Animation::animate() {
void Animation::anim0() {
if (_currentLoopCount != -1) {
if (_countdownTicks != 0) {
- calcFrame();
- setFrame1();
+ setFrame1(calcFrame());
} else {
_countdownTicks = _initialTicks;
++_frameNumber;
- calcFrame();
+ AnimationFrame *frame = calcFrame();
- if (this == _vm->_animation->_animStart) {
+ if (frame == nullptr) {
_frameNumber = 0;
_currentLoopCount = -1;
}
- setFrame();
+ setFrame(frame);
}
}
}
void Animation::anim1() {
if (_currentLoopCount == -1 || _countdownTicks != 0) {
- calcFrame();
- setFrame1();
+ setFrame1(calcFrame());
} else {
_countdownTicks = _initialTicks;
++_frameNumber;
- calcFrame();
+ AnimationFrame *frame = calcFrame();
- if (this == _vm->_animation->_animStart) {
+ if (frame == nullptr) {
--_frameNumber;
_currentLoopCount = -1;
}
- setFrame();
+ setFrame(frame);
}
}
void Animation::anim2() {
if (_countdownTicks != 0) {
- calcFrame();
- setFrame1();
+ setFrame1(calcFrame());
} else {
_countdownTicks = _initialTicks;
++_frameNumber;
- calcFrame();
+ AnimationFrame *frame = calcFrame();
- if (this == _vm->_animation->_animStart) {
+ if (frame == nullptr) {
_frameNumber = 0;
- calcFrame();
+ frame = calcFrame();
}
- setFrame();
+ setFrame(frame);
}
}
void Animation::anim3() {
if (_currentLoopCount != -1) {
if (_countdownTicks != 0) {
- calcFrame();
- setFrame1();
+ setFrame1(calcFrame());
} else {
_countdownTicks = _initialTicks;
++_frameNumber;
- calcFrame();
+ AnimationFrame *frame = calcFrame();
- if (this == _vm->_animation->_animStart) {
+ if (frame == nullptr) {
--_currentLoopCount;
_frameNumber = 0;
- calcFrame();
+ frame = calcFrame();
}
- setFrame();
+ setFrame(frame);
}
}
}
void Animation::anim4() {
if (_currentLoopCount == -1 || _countdownTicks != 0) {
- calcFrame();
- setFrame1();
+ setFrame1(calcFrame());
} else {
_countdownTicks = _initialTicks;
++_frameNumber;
- calcFrame();
+ AnimationFrame *frame = calcFrame();
- if (this == _vm->_animation->_animStart) {
+ if (frame == nullptr) {
if (--_currentLoopCount == -1) {
- calcFrame();
- setFrame1();
+ setFrame1(calcFrame());
return;
} else {
_frameNumber = 0;
- calcFrame();
+ frame = calcFrame();
}
}
- setFrame();
+ setFrame(frame);
}
}
@@ -200,23 +194,22 @@ void Animation::animNone() {
}
void Animation::anim7() {
- calcFrame1();
- setFrame();
+ setFrame(calcFrame1());
}
-void Animation::calcFrame() {
- error("TODO");
+AnimationFrame *Animation::calcFrame() {
+ return _frames[_frameNumber];
}
-void Animation::calcFrame1() {
- error("TODO");
+AnimationFrame *Animation::calcFrame1() {
+ return _frames[0];
}
-void Animation::setFrame() {
+void Animation::setFrame(AnimationFrame *frame) {
error("TODO");
}
-void Animation::setFrame1() {
+void Animation::setFrame1(AnimationFrame *frame) {
error("TODO");
}
diff --git a/engines/access/animation.h b/engines/access/animation.h
index 38065bb4c9..d9b10085ce 100644
--- a/engines/access/animation.h
+++ b/engines/access/animation.h
@@ -80,10 +80,10 @@ private:
void animNone();
void anim7();
- void calcFrame();
- void calcFrame1();
- void setFrame();
- void setFrame1();
+ AnimationFrame *calcFrame();
+ AnimationFrame *calcFrame1();
+ void setFrame(AnimationFrame *frame);
+ void setFrame1(AnimationFrame *frame);
public:
int _type;
int _scaling;