]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Animation/Animation.cpp
Moved visibleloading check inside LoadingScreen
[lugaru.git] / Source / Animation / Animation.cpp
index 27b82ada685716e76d1882be2c2591dd2d1f5fab..8ee1fd662ea0b171008980a2f0df62af506ed520 100644 (file)
@@ -23,8 +23,6 @@ along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
 #include "Game.hpp"
 #include "Utils/Folders.hpp"
 
-extern bool visibleloading;
-
 std::vector<Animation> Animation::animations;
 
 void Animation::loadAll()
@@ -86,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;
 
@@ -98,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" );
@@ -141,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;