EMI: Chore duration 1000 means the chore should play infinitely.

This commit is contained in:
Joni Vähämäki 2014-05-28 17:34:47 +03:00
parent 3e322b67ba
commit 95c4650706
2 changed files with 4 additions and 6 deletions

View File

@ -70,7 +70,7 @@ void EMIChore::update(uint time) {
setKeys(_currTime, newTime);
if (newTime > _length) {
if (_length >= 0.0f && newTime > _length) {
if (!_looping && _fadeMode != Animation::FadeOut) {
stop(0);
}

View File

@ -61,7 +61,9 @@ void EMICostume::load(Common::SeekableReadStream *data) {
float length = get_float(f);
int numTracks = data->readUint32LE();
if (length < 1000)
if (length == 1000)
length = -1.0f;
else
length *= 1000;
EMIChore *chore = new EMIChore(name, i, this, (int)length, numTracks);
@ -114,10 +116,6 @@ void EMICostume::load(Common::SeekableReadStream *data) {
}
delete[] componentName;
}
// Some chores report duration 1000 while they have components with
// keyframes after 1000. See elaine_wedding/take_contract, for example.
chore->_length = ceil(length);
}
_numComponents = components.size();