X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;ds=sidebyside;f=Source%2FAnimation%2FAnimation.cpp;h=c46df97bce4bcc99cd99e6400f886413aad9154b;hb=43b29d6c2092964efbba5ee4d5f4a559d86bc508;hp=89aa9f4da02f6a671b878c935f71e6eb239b85aa;hpb=5dfd07829a5eecc87d100dd8825a81eafbaa86be;p=lugaru.git
diff --git a/Source/Animation/Animation.cpp b/Source/Animation/Animation.cpp
index 89aa9f4..c46df97 100644
--- a/Source/Animation/Animation.cpp
+++ b/Source/Animation/Animation.cpp
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2010-2016 - Lugaru contributors (see AUTHORS file)
+Copyright (C) 2010-2017 - Lugaru contributors (see AUTHORS file)
This file is part of Lugaru.
@@ -23,13 +23,13 @@ along with Lugaru. If not, see .
#include "Game.hpp"
#include "Utils/Folders.hpp"
-extern bool visibleloading;
-
std::vector Animation::animations;
void Animation::loadAll()
{
-#define DECLARE_ANIM(id, file, height, attack, ...) if (id < loadable_anim_end) animations.emplace_back(file, height, attack);
+#define DECLARE_ANIM(id, file, height, attack, ...) \
+ if (id < loadable_anim_end) \
+ animations.emplace_back(file, height, attack);
#include "Animation.def"
#undef DECLARE_ANIM
}
@@ -72,38 +72,37 @@ void AnimationFrame::loadWeaponTarget(FILE* tfile)
funpackf(tfile, "Bf Bf Bf", &weapontarget.x, &weapontarget.y, &weapontarget.z);
}
-Animation::Animation():
- height(lowheight),
- attack(neutral),
- numjoints(0)
+Animation::Animation()
+ : height(lowheight)
+ , attack(neutral)
+ , numjoints(0)
{
}
/* EFFECT
* load an animation from file
*/
-Animation::Animation(const std::string& filename, anim_height_type aheight, anim_attack_type aattack):
- Animation()
+Animation::Animation(const std::string& filename, anim_height_type aheight, anim_attack_type aattack)
+ : Animation()
{
- FILE *tfile;
+ FILE* tfile;
int numframes;
unsigned i;
LOGFUNC;
// Changing the filename into something the OS can understand
- std::string filepath = Folders::getResourcePath("Animations/"+filename);
+ std::string filepath = Folders::getResourcePath("Animations/" + filename);
LOG(std::string("Loading animation...") + filepath);
height = aheight;
attack = aattack;
- if (visibleloading)
- Game::LoadingScreen();
+ Game::LoadingScreen();
// read file in binary mode
- tfile = Folders::openMandatoryFile( filepath, "rb" );
+ tfile = Folders::openMandatoryFile(filepath, "rb");
// read numframes, joints to know how much memory to allocate
funpackf(tfile, "Bi Bi", &numframes, &numjoints);