2 Copyright (C) 2010-2017 - Lugaru contributors (see AUTHORS file)
4 This file is part of Lugaru.
6 Lugaru is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 Lugaru is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with Lugaru. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef _ANIMATION_HPP_
21 #define _ANIMATION_HPP_
23 #include "Math/XYZ.hpp"
44 #define DECLARE_ANIM(id, ...) id,
45 #include "Animation.def"
50 enum animation_bit_offsets
52 #define DECLARE_ANIM_BIT(bit) o_##bit,
53 #include "Animation.def"
54 #undef DECLARE_ANIM_BIT
58 enum animation_bits_def
60 #define DECLARE_ANIM_BIT(bit) bit = 1 << o_##bit,
61 #include "Animation.def"
62 #undef DECLARE_ANIM_BIT
65 static const int animation_bits[animation_count] = {
66 #define DECLARE_ANIM(id, name, height, type, bits) bits,
67 #include "Animation.def"
71 struct AnimationFrameJointInfo
81 void loadBaseInfo(FILE* tfile);
82 void loadTwist2(FILE* tfile);
83 void loadLabel(FILE* tfile);
84 void loadWeaponTarget(FILE* tfile);
86 std::vector<AnimationFrameJointInfo> joints;
96 static std::vector<Animation> animations;
97 static void loadAll();
99 anim_height_type height;
100 anim_attack_type attack;
103 std::vector<AnimationFrame> frames;
108 Animation(const std::string& fileName, anim_height_type aheight, anim_attack_type aattack);