]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Animation/Animation.h
Sorted all source files in folders
[lugaru.git] / Source / Animation / Animation.h
index 3633de9e373d67231d05092e3102a830ae8c0243..91205abe0341400bca884f6f0d1f62fc14f96e26 100644 (file)
@@ -21,6 +21,7 @@ along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
 #define ANIMATION_H
 
 #include <vector>
+#include "Math/Quaternions.h"
 
 enum anim_attack_type {
     neutral, normalattack, reversed, reversal
@@ -56,35 +57,43 @@ static const int animation_bits[animation_count] = {
 #undef DECLARE_ANIM
 };
 
+struct AnimationFrameJointInfo
+{
+    XYZ  position;
+    float twist;
+    float twist2;
+    bool onground;
+};
+
+struct AnimationFrame
+{
+    void loadBaseInfo(FILE* tfile);
+    void loadTwist2(FILE* tfile);
+    void loadLabel(FILE* tfile);
+    void loadWeaponTarget(FILE* tfile);
+
+    std::vector<AnimationFrameJointInfo> joints;
+    XYZ forward;
+    int label;
+    XYZ weapontarget;
+    float speed;
+};
+
 class Animation
 {
 public:
     static std::vector<Animation> animations;
     static void loadAll();
 
-    int numframes;
-    int height;
-    int attack;
-    int joints;
-    int weapontargetnum;
-
-    XYZ**  position;
-    float** twist;
-    float** twist2;
-    float* speed;
-    bool** onground;
-    XYZ* forward;
-    int* label;
-    XYZ* weapontarget;
+    anim_height_type height;
+    anim_attack_type attack;
+    int numjoints;
+
+    std::vector<AnimationFrame> frames;
 
     XYZ offset;
 
     Animation();
-    Animation(const std::string& fileName, int aheight, int aattack);
-    ~Animation();
-    Animation & operator = (const Animation & ani);
-
-protected:
-    void deallocate();
+    Animation(const std::string& fileName, anim_height_type aheight, anim_attack_type aattack);
 };
 #endif