aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlukaslw2014-05-30 19:25:11 +0200
committerlukaslw2014-06-22 20:08:22 +0200
commit63834499f78cd9b1513344d2cd2b84bbae9e9b0e (patch)
treeb37d2c3943f7af34e608005143ee1c8684eeae09
parent5df6b9a4f48a10a397cf4642f8695beece4e5704 (diff)
downloadscummvm-rg350-63834499f78cd9b1513344d2cd2b84bbae9e9b0e.tar.gz
scummvm-rg350-63834499f78cd9b1513344d2cd2b84bbae9e9b0e.tar.bz2
scummvm-rg350-63834499f78cd9b1513344d2cd2b84bbae9e9b0e.zip
PRINCE: installSingleBackAnim and showBackAnims clean up
-rw-r--r--engines/prince/prince.cpp8
-rw-r--r--engines/prince/script.cpp24
2 files changed, 5 insertions, 27 deletions
diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp
index 8b294eb335..a46393f94c 100644
--- a/engines/prince/prince.cpp
+++ b/engines/prince/prince.cpp
@@ -778,7 +778,7 @@ void PrinceEngine::showBackAnims() {
int rnd = _randomSource.getRandomNumber(_backAnimList[i]._seq._anims - 2);
rnd++;
_backAnimList[i]._seq._currRelative = rnd;
- _backAnimList[i]._seq._current = rnd; // or nr of animation from lst
+ _backAnimList[i]._seq._current = _backAnimList[i].backAnims[rnd]._basaData._num;
activeSubAnim = rnd;
}
//only_1_type_2
@@ -835,7 +835,7 @@ void PrinceEngine::showBackAnims() {
rnd = _randomSource.getRandomNumber(_backAnimList[i]._seq._anims - 1);
} while (rnd == _backAnimList[i]._seq._currRelative);
_backAnimList[i]._seq._currRelative = rnd;
- _backAnimList[i]._seq._current = rnd; // or nr of animation from lst
+ _backAnimList[i]._seq._current = _backAnimList[i].backAnims[rnd]._basaData._num;
activeSubAnim = rnd;
//only_1_type_1:
//SetBackAnim
@@ -855,7 +855,7 @@ void PrinceEngine::showBackAnims() {
} else if (_backAnimList[i]._seq._type == 2) {
if (_backAnimList[i]._seq._currRelative != 0) {
_backAnimList[i]._seq._currRelative = 0;
- _backAnimList[i]._seq._current = 0; // or nr of animation from lst
+ _backAnimList[i]._seq._current = _backAnimList[i].backAnims[0]._basaData._num;
activeSubAnim = 0;
//only_1_type_1
//SetBackAnim
@@ -875,7 +875,7 @@ void PrinceEngine::showBackAnims() {
} else if (_backAnimList[i]._seq._type == 3) {
//not_type_2
_backAnimList[i]._seq._currRelative = 0;
- _backAnimList[i]._seq._current = 0; // or nr of animation from lst
+ _backAnimList[i]._seq._current = _backAnimList[i].backAnims[0]._basaData._num;
_backAnimList[i]._seq._counter = 0;
int rnd = _randomSource.getRandomNumber(_backAnimList[i]._seq._data - 1);
_backAnimList[i]._seq._data2 = rnd;
diff --git a/engines/prince/script.cpp b/engines/prince/script.cpp
index 7806bf04bb..48617f16f5 100644
--- a/engines/prince/script.cpp
+++ b/engines/prince/script.cpp
@@ -222,12 +222,6 @@ void Script::installSingleBackAnim(Common::Array<BackgroundAnim> &_backanimList,
newAnim._basaData._num = READ_UINT16(&_data[animOffset + 28 + i * 8]);
newAnim._basaData._start = READ_UINT16(&_data[animOffset + 28 + i * 8 + 2]);
newAnim._basaData._end = READ_UINT16(&_data[animOffset + 28 + i * 8 + 4]);
- if (newAnim._basaData._start != -1) {
- debug("start1: %d", newAnim._basaData._start);
- }
- if (newAnim._basaData._end != -1) {
- debug("end1: %d", newAnim._basaData._end);
- }
int animNumber = newAnim._basaData._num;
const Common::String animName = Common::String::format("AN%02d", animNumber);
const Common::String shadowName = Common::String::format("AN%02dS", animNumber);
@@ -238,7 +232,6 @@ void Script::installSingleBackAnim(Common::Array<BackgroundAnim> &_backanimList,
delete newAnim._shadowData;
newAnim._shadowData = nullptr;
}
- //newAnim._seq = 0;
newAnim._usage = 0;
newAnim._state = 0; // enabled
if ((_vm->_animList[animNumber]._flags & 4) != 0) {
@@ -251,7 +244,6 @@ void Script::installSingleBackAnim(Common::Array<BackgroundAnim> &_backanimList,
}
newAnim._flags = _vm->_animList[animNumber]._flags;
newAnim._lastFrame = _vm->_animList[animNumber]._endPhase;
- debug("lastFrame: %d", _vm->_animList[animNumber]._endPhase);
newAnim._loopFrame = _vm->_animList[animNumber]._loopPhase;
newAnim._loopType = _vm->_animList[animNumber]._loopType;
newAnim._nextAnim = _vm->_animList[animNumber]._nextAnim;
@@ -265,40 +257,26 @@ void Script::installSingleBackAnim(Common::Array<BackgroundAnim> &_backanimList,
newAnim._packFlag = 0;
newAnim._shadowBack = _vm->_animList[animNumber]._type;
newBackgroundAnim.backAnims.push_back(newAnim);
- debug("%d - animNo: %d", i, animNumber);
}
newBackgroundAnim._seq._type = READ_UINT32(&_data[animOffset]);
- debug("type: %d", newBackgroundAnim._seq._type);
newBackgroundAnim._seq._data = READ_UINT32(&_data[animOffset + 4]);
- //debug("data: %d", newBackgroundAnim._seq._data);
newBackgroundAnim._seq._anims = READ_UINT32(&_data[animOffset + 8]);
- anims = newBackgroundAnim._seq._anims;
- debug("anims: %d", newBackgroundAnim._seq._anims);
- //newBackgroundAnim._seq._current = READ_UINT32(&_data[animOffset + 12]);
- newBackgroundAnim._seq._current = 0; // nr on list like now or should it be fileNr of anim - check it
- //debug("current: %d", newBackgroundAnim._seq._current);
- //newBackgroundAnim._seq._counter = READ_UINT32(&_data[animOffset + 16]);
+ newBackgroundAnim._seq._current = newBackgroundAnim.backAnims[0]._basaData._num;
newBackgroundAnim._seq._counter = 0;
- //debug("counter: %d", newBackgroundAnim._seq._counter);
- //newBackgroundAnim._seq._currRelative = READ_UINT32(&_data[animOffset + 20]);
newBackgroundAnim._seq._currRelative = 0;
- //debug("currRelative: %d", newBackgroundAnim._seq._currRelative);
newBackgroundAnim._seq._data2 = READ_UINT32(&_data[animOffset + 24]);
- //debug("data2: %d", newBackgroundAnim._seq._data2);
int start = newBackgroundAnim.backAnims[0]._basaData._start; // BASA_Start of first frame
int end = newBackgroundAnim.backAnims[0]._basaData._end; //BASA_End of first frame
if (start != -1) {
- debug("start2: %d", start);
newBackgroundAnim.backAnims[0]._frame = start;
newBackgroundAnim.backAnims[0]._showFrame = start;
newBackgroundAnim.backAnims[0]._loopFrame = start;
}
if (end != -1) {
- debug("end2: %d", end);
newBackgroundAnim.backAnims[0]._lastFrame = end;
}