aboutsummaryrefslogtreecommitdiff
path: root/engines/avalanche
diff options
context:
space:
mode:
authorStrangerke2013-10-16 06:58:31 +0200
committerWillem Jan Palenstijn2013-10-17 22:17:10 +0200
commit06f94c10854162dd0fdfade2879880ea454bd11f (patch)
treeff715040b02df56a6262e31fbb2a0f9aaa41b9bd /engines/avalanche
parentecb1bf69b9f3cfd16d35ff8bb326c192c88daa84 (diff)
downloadscummvm-rg350-06f94c10854162dd0fdfade2879880ea454bd11f.tar.gz
scummvm-rg350-06f94c10854162dd0fdfade2879880ea454bd11f.tar.bz2
scummvm-rg350-06f94c10854162dd0fdfade2879880ea454bd11f.zip
AVALANCHE: Remove 3 useless variables in Animation
Diffstat (limited to 'engines/avalanche')
-rw-r--r--engines/avalanche/animation.cpp29
-rw-r--r--engines/avalanche/animation.h3
2 files changed, 9 insertions, 23 deletions
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 05c9026628..d1d3fd14a3 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -74,20 +74,12 @@ void AnimationType::init(byte spritenum, bool doCheck) {
// Replace variable named 'soa' in the original code.
inf.skip(2);
+ // Skip real name Size (1 byte) then fixed sized zone containing name (12 bytes)
+ inf.skip(1 + 12);
+ // Skip real comment size (1 byte) then fixed sized zone containing comment (16 bytes)
+ inf.skip(1 + 16);
- if (!_name.empty())
- _name.clear();
- byte nameSize = inf.readByte();
- for (int i = 0; i < nameSize; i++)
- _name += inf.readByte();
- inf.skip(12 - nameSize);
-
- byte commentSize = inf.readByte();
- for (int i = 0; i < commentSize; i++)
- _comment += inf.readByte();
- inf.skip(16 - commentSize);
-
- _frameNum = inf.readByte();
+ byte frameNum = inf.readByte();
_xLength = inf.readByte();
_yLength = inf.readByte();
_seq = inf.readByte();
@@ -101,7 +93,7 @@ void AnimationType::init(byte spritenum, bool doCheck) {
byte xWidth = _xLength / 8;
if ((_xLength % 8) > 0)
xWidth++;
- for (int i = 0; i < _frameNum; i++) {
+ for (int i = 0; i < frameNum; i++) {
_sil[_animCount] = new SilType[11 * (_yLength + 1)];
_mani[_animCount] = new ManiType[size - 6];
for (int j = 0; j <= _yLength; j++)
@@ -367,12 +359,9 @@ void AnimationType::chatter() {
}
void AnimationType::remove() {
- _animCount--;
- for (int i = 0; i < _frameNum; i++) {
- assert(_animCount > 0);
- _animCount--;
- delete[] _mani[_animCount];
- delete[] _sil[_animCount];
+ for (int i = _animCount - 2; i > 0; i--) {
+ delete[] _mani[i];
+ delete[] _sil[i];
}
_quick = false;
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index 74cf56ac85..787f60e814 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -48,9 +48,6 @@ public:
SilType *_sil[24];
// Former Stat structure
- Common::String _name; // Name of character.
- Common::String _comment; // Comment.
- byte _frameNum; // Number of pictures.
byte _seq; // How many in one stride.
Color _fgBubbleCol, _bgBubbleCol; // Foreground & background bubble colors.
byte _acciNum; // The number according to Acci. (1=Avvy, etc.)