2 Copyright (C) 2010-2016 - 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/>.
24 #include "Math/Quaternions.h"
26 enum anim_attack_type {
27 neutral, normalattack, reversed, reversal
30 enum anim_height_type {
31 lowheight, middleheight, highheight
34 enum animation_types {
35 #define DECLARE_ANIM(id, ...) id,
36 #include "Animation.def"
41 enum animation_bit_offsets {
42 #define DECLARE_ANIM_BIT(bit) o_##bit,
43 #include "Animation.def"
44 #undef DECLARE_ANIM_BIT
48 enum animation_bits_def {
49 #define DECLARE_ANIM_BIT(bit) bit = 1 << o_##bit,
50 #include "Animation.def"
51 #undef DECLARE_ANIM_BIT
54 static const int animation_bits[animation_count] = {
55 #define DECLARE_ANIM(id, name, height, type, bits) bits,
56 #include "Animation.def"
60 struct AnimationFrameJointInfo
70 void loadBaseInfo(FILE* tfile);
71 void loadTwist2(FILE* tfile);
72 void loadLabel(FILE* tfile);
73 void loadWeaponTarget(FILE* tfile);
75 std::vector<AnimationFrameJointInfo> joints;
85 static std::vector<Animation> animations;
86 static void loadAll();
88 anim_height_type height;
89 anim_attack_type attack;
92 std::vector<AnimationFrame> frames;
97 Animation(const std::string& fileName, anim_height_type aheight, anim_attack_type aattack);