X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FAnimation%2FAnimation.cpp;h=8ee1fd662ea0b171008980a2f0df62af506ed520;hb=8e4c49c2586a86cd5a85218914e9afeccd656dc2;hp=83e2c0e1da31e199f9fb978c3f3b81642bb48dd2;hpb=bb10d5d29efb774db509c87063f1294980b127c8;p=lugaru.git diff --git a/Source/Animation/Animation.cpp b/Source/Animation/Animation.cpp index 83e2c0e..8ee1fd6 100644 --- a/Source/Animation/Animation.cpp +++ b/Source/Animation/Animation.cpp @@ -17,12 +17,11 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "Animation/Skeleton.h" -#include "Animation/Animation.h" -#include "Utils/Folders.h" -#include "Game.h" +#include "Animation/Animation.hpp" -extern bool visibleloading; +#include "Animation/Skeleton.hpp" +#include "Game.hpp" +#include "Utils/Folders.hpp" std::vector Animation::animations; @@ -85,7 +84,8 @@ Animation::Animation(const std::string& filename, anim_height_type aheight, anim Animation() { FILE *tfile; - int i, j, numframes; + int numframes; + unsigned i; LOGFUNC; @@ -97,8 +97,7 @@ Animation::Animation(const std::string& filename, anim_height_type aheight, anim height = aheight; attack = aattack; - if (visibleloading) - Game::LoadingScreen(); + Game::LoadingScreen(); // read file in binary mode tfile = Folders::openMandatoryFile( filepath, "rb" ); @@ -140,9 +139,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;