MADS: Fix for sprite animation range
This commit is contained in:
parent
d58d9075da
commit
a2d03dad4c
1 changed files with 6 additions and 3 deletions
|
@ -373,7 +373,7 @@ void SequenceList::setAnimRange(int seqIndex, int startVal, int endVal) {
|
|||
SequenceEntry &seqEntry = _entries[seqIndex];
|
||||
SpriteAsset &spriteSet = *scene._sprites[seqEntry._spritesIndex];
|
||||
int numSprites = spriteSet.getCount();
|
||||
int tempStart = startVal, tempEnd = endVal;
|
||||
int tempStart, tempEnd;
|
||||
|
||||
switch (startVal) {
|
||||
case -2:
|
||||
|
@ -382,6 +382,9 @@ void SequenceList::setAnimRange(int seqIndex, int startVal, int endVal) {
|
|||
case -1:
|
||||
tempStart = 1;
|
||||
break;
|
||||
default:
|
||||
tempStart = startVal;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (endVal) {
|
||||
|
@ -393,14 +396,14 @@ void SequenceList::setAnimRange(int seqIndex, int startVal, int endVal) {
|
|||
tempEnd = 1;
|
||||
break;
|
||||
default:
|
||||
tempEnd = numSprites;
|
||||
tempEnd = endVal;
|
||||
break;
|
||||
}
|
||||
|
||||
seqEntry._frameStart = tempStart;
|
||||
seqEntry._numSprites = tempEnd;
|
||||
|
||||
seqEntry._frameIndex = (seqEntry._frameInc < 0) ? tempStart : tempEnd;
|
||||
seqEntry._frameIndex = (seqEntry._frameInc >= 0) ? tempStart : tempEnd;
|
||||
}
|
||||
|
||||
void SequenceList::scan() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue