diff options
author | Filippos Karapetis | 2008-11-14 17:51:48 +0000 |
---|---|---|
committer | Filippos Karapetis | 2008-11-14 17:51:48 +0000 |
commit | 4294185c595bd92e5280ea057c72519c91c1975a (patch) | |
tree | 3bb886fd946d67c6a7ca397f3d7b39a98018402b /engines/saga | |
parent | 591d01b77f59dea2ba7508c0731e9b962c0eee07 (diff) | |
download | scummvm-rg350-4294185c595bd92e5280ea057c72519c91c1975a.tar.gz scummvm-rg350-4294185c595bd92e5280ea057c72519c91c1975a.tar.bz2 scummvm-rg350-4294185c595bd92e5280ea057c72519c91c1975a.zip |
Some corrections, based on observations from bug report #2284298 - "SAGA: Compiler warnings; possibly an engine bug"
svn-id: r35058
Diffstat (limited to 'engines/saga')
-rw-r--r-- | engines/saga/animation.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/engines/saga/animation.h b/engines/saga/animation.h index a88d743af1..1127028718 100644 --- a/engines/saga/animation.h +++ b/engines/saga/animation.h @@ -164,14 +164,17 @@ private: void validateAnimationId(uint16 animId) { if (animId >= MAX_ANIMATIONS) { + // Cutaway if (animId >= MAX_ANIMATIONS + ARRAYSIZE(_cutawayAnimations)) error("validateAnimationId: animId out of range"); if (_cutawayAnimations[animId - MAX_ANIMATIONS] == NULL) { error("validateAnimationId: animId=%i unassigned", animId); } - } - if (_animations[animId] == NULL) { - error("validateAnimationId: animId=%i unassigned.", animId); + } else { + // Animation + if (_animations[animId] == NULL) { + error("validateAnimationId: animId=%i unassigned.", animId); + } } } @@ -184,7 +187,7 @@ private: AnimationData* getAnimation(uint16 animId) { validateAnimationId(animId); - if (animId > MAX_ANIMATIONS) + if (animId >= MAX_ANIMATIONS) return _cutawayAnimations[animId - MAX_ANIMATIONS]; return _animations[animId]; } |