X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FAnimation%2FAnimation.cpp;h=89aa9f4da02f6a671b878c935f71e6eb239b85aa;hb=5dfd07829a5eecc87d100dd8825a81eafbaa86be;hp=27b82ada685716e76d1882be2c2591dd2d1f5fab;hpb=8a677cc9d97d49493c382c8b39ef4b0c46d355a1;p=lugaru.git diff --git a/Source/Animation/Animation.cpp b/Source/Animation/Animation.cpp index 27b82ad..89aa9f4 100644 --- a/Source/Animation/Animation.cpp +++ b/Source/Animation/Animation.cpp @@ -86,7 +86,8 @@ Animation::Animation(const std::string& filename, anim_height_type aheight, anim Animation() { FILE *tfile; - int i, j, numframes; + int numframes; + unsigned i; LOGFUNC; @@ -141,9 +142,9 @@ Animation::Animation(const std::string& filename, anim_height_type aheight, anim // find average position of certain joints on last frames // and save in endoffset // (not sure what exactly this accomplishes. the y < 1 test confuses me.) - for (j = 0; j < numjoints; j++) { - if (frames.back().joints[j].position.y < 1) { - endoffset += frames.back().joints[j].position; + for (i = 0; i < frames.back().joints.size(); i++) { + if (frames.back().joints[i].position.y < 1) { + endoffset += frames.back().joints[i].position; } } endoffset /= numjoints;