aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2014-08-11 20:27:19 -0400
committerPaul Gilbert2014-08-11 20:27:19 -0400
commit768e144683847734cc16c9a7ec786379be6301e2 (patch)
tree1bf5398948d00d6e95d8551939ac90f8950595b2
parent617aa98ede4167fe2f9a7a419738d0030d8c48ff (diff)
downloadscummvm-rg350-768e144683847734cc16c9a7ec786379be6301e2.tar.gz
scummvm-rg350-768e144683847734cc16c9a7ec786379be6301e2.tar.bz2
scummvm-rg350-768e144683847734cc16c9a7ec786379be6301e2.zip
ACCESS: Properly implement Animation calcFrame/calcFrame1 methods
-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;