]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Animation/Animation.cpp
Fixed a lot of GCC warnings
[lugaru.git] / Source / Animation / Animation.cpp
index f28861ca9452892ef1c29b6ade5157aeb179acd6..89aa9f4da02f6a671b878c935f71e6eb239b85aa 100644 (file)
@@ -17,10 +17,11 @@ You should have received a copy of the GNU General Public License
 along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "Animation/Skeleton.h"
-#include "Animation/Animation.h"
-#include "Utils/Folders.h"
-#include "Game.h"
+#include "Animation/Animation.hpp"
+
+#include "Animation/Skeleton.hpp"
+#include "Game.hpp"
+#include "Utils/Folders.hpp"
 
 extern bool visibleloading;
 
@@ -85,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;
 
@@ -140,16 +142,12 @@ 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;
     offset = endoffset;
     offset.y = 0;
 }
-
-Animation::~Animation()
-{
-}