]> git.jsancho.org Git - lugaru.git/commitdiff
Make animation types an enum, move to a separate file
authorAlexander Monakov <amonakov@gmail.com>
Sun, 6 Jun 2010 21:07:05 +0000 (01:07 +0400)
committerAlexander Monakov <amonakov@gmail.com>
Sun, 6 Jun 2010 21:07:05 +0000 (01:07 +0400)
CMakeLists.txt
Source/Animation.def [new file with mode: 0644]
Source/Animation.h [new file with mode: 0644]
Source/Constants.h
Source/GameInitDispose.cpp
Source/GameTick.cpp
Source/Globals.cpp
Source/Person.cpp
Source/Skeleton.cpp
Source/Weapons.cpp

index 383779d1e0b92473765430a17a554627eb404cdd..d36f0f8c7f3ecbae37f7a88dfed2f82a898c9bcf 100644 (file)
@@ -114,6 +114,8 @@ set(LUGARU_H
        ${SRCDIR}/unpack_private.h
        ${SRCDIR}/Settings.h
        ${SRCDIR}/Stereo.h
+       ${SRCDIR}/Animation.h
+       ${SRCDIR}/Animation.def
 )
 
 if(UNIX)
diff --git a/Source/Animation.def b/Source/Animation.def
new file mode 100644 (file)
index 0000000..005685b
--- /dev/null
@@ -0,0 +1,150 @@
+/*
+Copyright (C) 2010 - Lugaru authors
+
+This file is part of Lugaru.
+
+Lugaru is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+*/
+
+DECLARE_ANIM(runanim)
+DECLARE_ANIM(bounceidleanim)
+DECLARE_ANIM(stopanim)
+DECLARE_ANIM(jumpupanim)
+DECLARE_ANIM(jumpdownanim)
+DECLARE_ANIM(landanim)
+DECLARE_ANIM(climbanim)
+DECLARE_ANIM(hanganim)
+DECLARE_ANIM(spinkickanim)
+DECLARE_ANIM(tempanim)
+DECLARE_ANIM(getupfromfrontanim)
+DECLARE_ANIM(getupfrombackanim)
+DECLARE_ANIM(crouchanim)
+DECLARE_ANIM(sneakanim)
+DECLARE_ANIM(rollanim)
+DECLARE_ANIM(flipanim)
+DECLARE_ANIM(spinkickreversedanim)
+DECLARE_ANIM(spinkickreversalanim)
+DECLARE_ANIM(lowkickanim)
+DECLARE_ANIM(sweepanim)
+DECLARE_ANIM(sweepreversedanim)
+DECLARE_ANIM(sweepreversalanim)
+DECLARE_ANIM(rabbitkickanim)
+DECLARE_ANIM(rabbitkickreversedanim)
+DECLARE_ANIM(rabbitkickreversalanim)
+DECLARE_ANIM(upunchanim)
+DECLARE_ANIM(staggerbackhighanim)
+DECLARE_ANIM(upunchreversedanim)
+DECLARE_ANIM(upunchreversalanim)
+DECLARE_ANIM(hurtidleanim)
+DECLARE_ANIM(backhandspringanim)
+DECLARE_ANIM(fightidleanim)
+DECLARE_ANIM(walkanim)
+DECLARE_ANIM(fightsidestep)
+DECLARE_ANIM(killanim)
+DECLARE_ANIM(sneakattackanim)
+DECLARE_ANIM(sneakattackedanim)
+DECLARE_ANIM(drawrightanim)
+DECLARE_ANIM(knifeslashstartanim)
+DECLARE_ANIM(crouchstabanim)
+DECLARE_ANIM(crouchdrawrightanim)
+DECLARE_ANIM(knifefollowanim)
+DECLARE_ANIM(knifefollowedanim)
+DECLARE_ANIM(knifethrowanim)
+DECLARE_ANIM(removeknifeanim)
+DECLARE_ANIM(crouchremoveknifeanim)
+DECLARE_ANIM(jumpreversedanim)
+DECLARE_ANIM(jumpreversalanim)
+DECLARE_ANIM(landhardanim)
+DECLARE_ANIM(staggerbackhardanim)
+DECLARE_ANIM(dropkickanim)
+DECLARE_ANIM(winduppunchanim)
+DECLARE_ANIM(winduppunchblockedanim)
+DECLARE_ANIM(blockhighleftanim)
+DECLARE_ANIM(blockhighleftstrikeanim)
+DECLARE_ANIM(walljumpfrontanim)
+DECLARE_ANIM(walljumpbackanim)
+DECLARE_ANIM(walljumpleftanim)
+DECLARE_ANIM(walljumprightanim)
+DECLARE_ANIM(backflipanim)
+DECLARE_ANIM(leftflipanim)
+DECLARE_ANIM(rightflipanim)
+DECLARE_ANIM(walljumprightkickanim)
+DECLARE_ANIM(walljumpleftkickanim)
+DECLARE_ANIM(knifefightidleanim)
+DECLARE_ANIM(knifesneakattackanim)
+DECLARE_ANIM(knifesneakattackedanim)
+DECLARE_ANIM(swordstabanim)
+DECLARE_ANIM(swordslashleftanim)
+DECLARE_ANIM(swordslashrightanim)
+DECLARE_ANIM(swordfightidleanim)
+DECLARE_ANIM(swordsneakattackanim)
+DECLARE_ANIM(swordsneakattackedanim)
+DECLARE_ANIM(drawleftanim)
+DECLARE_ANIM(swordslashanim)
+DECLARE_ANIM(swordgroundstabanim)
+DECLARE_ANIM(dodgebackanim)
+DECLARE_ANIM(swordslashreversedanim)
+DECLARE_ANIM(swordslashreversalanim)
+DECLARE_ANIM(knifeslashreversedanim)
+DECLARE_ANIM(knifeslashreversalanim)
+DECLARE_ANIM(swordfightidlebothanim)
+DECLARE_ANIM(swordslashparryanim)
+DECLARE_ANIM(sworddisarmanim)
+DECLARE_ANIM(swordslashparriedanim)
+DECLARE_ANIM(wolfidle)
+DECLARE_ANIM(wolffightidle)
+DECLARE_ANIM(wolfswordidle)
+DECLARE_ANIM(wolfhurtidle)
+DECLARE_ANIM(wolfcrouchanim)
+DECLARE_ANIM(wolfsneakanim)
+DECLARE_ANIM(wolfrunanim)
+DECLARE_ANIM(wolfstopanim)
+DECLARE_ANIM(wolfclawanim)
+DECLARE_ANIM(wolflandanim)
+DECLARE_ANIM(wolflandhardanim)
+DECLARE_ANIM(wolfrunninganim)
+DECLARE_ANIM(rabbitrunninganim)
+DECLARE_ANIM(frontflipanim)
+DECLARE_ANIM(rabbittackleanim)
+DECLARE_ANIM(rabbittacklinganim)
+DECLARE_ANIM(rabbittackledfrontanim)
+DECLARE_ANIM(rabbittackledbackanim)
+DECLARE_ANIM(rabbittacklereversal)
+DECLARE_ANIM(rabbittacklereversed)
+DECLARE_ANIM(wolftackleanim)
+DECLARE_ANIM(wolftacklinganim)
+DECLARE_ANIM(wolftackledfrontanim)
+DECLARE_ANIM(wolftackledbacanim)
+DECLARE_ANIM(wolftacklereversal)
+DECLARE_ANIM(wolftacklereversed)
+DECLARE_ANIM(wolfslapanim)
+DECLARE_ANIM(wolfbashanim)
+DECLARE_ANIM(staffhitanim)
+DECLARE_ANIM(staffgroundsmashanim)
+DECLARE_ANIM(staffspinhitanim)
+DECLARE_ANIM(staffhitreversedanim)
+DECLARE_ANIM(staffhitreversalanim)
+DECLARE_ANIM(staffspinhitreversedanim)
+DECLARE_ANIM(staffspinhitreversalanim)
+DECLARE_ANIM(sleepanim)
+DECLARE_ANIM(sitanim)
+DECLARE_ANIM(talkidleanim)
+DECLARE_ANIM(sitwallanim)
+DECLARE_ANIM(dead1anim)
+DECLARE_ANIM(dead2anim)
+DECLARE_ANIM(dead3anim)
+DECLARE_ANIM(dead4anim)
+
diff --git a/Source/Animation.h b/Source/Animation.h
new file mode 100644 (file)
index 0000000..1e5ad10
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+Copyright (C) 2010 - Lugaru authors
+
+This file is part of Lugaru.
+
+Lugaru is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+*/
+
+#ifndef ANIMATION_H
+#define        ANIMATION_H
+
+enum animation_types {
+#define DECLARE_ANIM(id) id,
+#include "Animation.def"
+#undef DECLARE_ANIM
+animation_count
+};
+
+#endif
index 676932812d6356101e2a196a0566d5d637b7d5f3..4224257200400b0732f5f30561725cffcdb15d11 100644 (file)
@@ -120,137 +120,6 @@ const int max_joints = 50;
 const int max_frames = 50;
 const int max_muscles = 100;
 
-const int animation_count = 140;
-
-const int runanim = 0;
-const int bounceidleanim = 1;
-const int stopanim = 2;
-const int jumpupanim = 3;
-const int jumpdownanim = 4;
-const int landanim = 5;
-const int climbanim = 6;
-const int hanganim = 7;
-const int spinkickanim = 8;
-const int tempanim = 9;
-const int getupfromfrontanim = 10;
-const int getupfrombackanim = 11;
-const int crouchanim = 12;
-const int sneakanim = 13;
-const int rollanim = 14;
-const int flipanim = 15;
-const int spinkickreversedanim = 16;
-const int spinkickreversalanim = 17;
-const int lowkickanim = 18;
-const int sweepanim = 19;
-const int sweepreversedanim = 20;
-const int sweepreversalanim = 21;
-const int rabbitkickanim = 22;
-const int rabbitkickreversedanim = 23;
-const int rabbitkickreversalanim = 24;
-const int upunchanim = 25;
-const int staggerbackhighanim = 26;
-const int upunchreversedanim = 27;
-const int upunchreversalanim = 28;
-const int hurtidleanim = 29;
-const int backhandspringanim = 30;
-const int fightidleanim = 31;
-const int walkanim = 32;
-const int fightsidestep = 33;
-const int killanim = 34;
-const int sneakattackanim = 35;
-const int sneakattackedanim = 36;
-const int drawrightanim = 37;
-const int knifeslashstartanim = 38;
-const int crouchstabanim = 39;
-const int crouchdrawrightanim = 40;
-const int knifefollowanim = 41;
-const int knifefollowedanim = 42;
-const int knifethrowanim = 43;
-const int removeknifeanim = 44;
-const int crouchremoveknifeanim = 45;
-const int jumpreversedanim = 46;
-const int jumpreversalanim = 47;
-const int landhardanim = 48;
-const int staggerbackhardanim = 49;
-const int dropkickanim = 50;
-const int winduppunchanim = 51;
-const int winduppunchblockedanim = 52;
-const int blockhighleftanim = 53;
-const int blockhighleftstrikeanim = 54;
-const int walljumpfrontanim = 55;
-const int walljumpbackanim = 56;
-const int walljumpleftanim = 57;
-const int walljumprightanim = 58;
-const int backflipanim = 59;
-const int leftflipanim = 60;
-const int rightflipanim = 61;
-const int walljumprightkickanim = 62;
-const int walljumpleftkickanim = 63;
-const int knifefightidleanim = 64;
-const int knifesneakattackanim = 65;
-const int knifesneakattackedanim = 66;
-const int swordstabanim = 67;
-const int swordslashleftanim = 68;
-const int swordslashrightanim = 69;
-const int swordfightidleanim = 70;
-const int swordsneakattackanim = 71;
-const int swordsneakattackedanim = 72;
-const int drawleftanim = 73;
-const int swordslashanim = 74;
-const int swordgroundstabanim = 75;
-const int dodgebackanim = 76;
-const int swordslashreversedanim = 77;
-const int swordslashreversalanim = 78;
-const int knifeslashreversedanim = 79;
-const int knifeslashreversalanim = 80;
-const int swordfightidlebothanim = 81;
-const int swordslashparryanim = 82;
-const int sworddisarmanim = 83;
-const int swordslashparriedanim = 84;
-const int wolfidle = 85;
-const int wolffightidle = 86;
-const int wolfswordidle = 87;
-const int wolfhurtidle = 88;
-const int wolfcrouchanim = 89;
-const int wolfsneakanim = 90;
-const int wolfrunanim = 91;
-const int wolfstopanim = 92;
-const int wolfclawanim = 93;
-const int wolflandanim = 94;
-const int wolflandhardanim = 95;
-const int wolfrunninganim = 96;
-const int rabbitrunninganim = 97;
-const int frontflipanim = 98;
-const int rabbittackleanim = 99;
-const int rabbittacklinganim = 100;
-const int rabbittackledfrontanim = 101;
-const int rabbittackledbackanim = 102;
-const int rabbittacklereversal = 103;
-const int rabbittacklereversed = 104;
-const int wolftackleanim = 105;
-const int wolftacklinganim = 106;
-const int wolftackledfrontanim = 107;
-const int wolftackledbacanim = 108;
-const int wolftacklereversal = 109;
-const int wolftacklereversed = 110;
-const int wolfslapanim = 111;
-const int wolfbashanim = 112;
-const int staffhitanim = 113;
-const int staffgroundsmashanim = 114;
-const int staffspinhitanim = 115;
-const int staffhitreversedanim = 116;
-const int staffhitreversalanim = 117;
-const int staffspinhitreversedanim = 118;
-const int staffspinhitreversalanim = 119;
-const int sleepanim = 120;
-const int sitanim = 121;
-const int talkidleanim = 122;
-const int sitwallanim = 123;
-const int dead1anim = 124;
-const int dead2anim = 125;
-const int dead3anim = 126;
-const int dead4anim = 127;
-
 const int max_dialogues = 20;
 const int max_dialoguelength = 20;
 
index 6426698120276c413de43a5a234ab6af73734f1e..e936228c4ab54993ea905400284c8cc60c52511b 100644 (file)
@@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include "Game.h"
 #include "openal_wrapper.h"
+#include "Animation.h"
 
 extern float screenwidth,screenheight;
 extern float viewdistance;
index 879082529777acd783620e0a525430de9a9ec49d..2adf41e1ca63093be7c6fdd18a73424c5fe978e5 100644 (file)
@@ -32,6 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "openal_wrapper.h"
 #include "Settings.h"
 #include "Input.h"
+#include "Animation.h"
 
 using namespace std;
 
index b3b7eee8e2c4463e23dc0deb8555492fb398c227..c5cb64cc371766471c4e44c3806479086b0f10ce 100644 (file)
@@ -36,6 +36,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "Stereo.h"
 
 #include "Constants.h"
+#include "Animation.h"
 
 bool visibleloading = 0;
 OPENAL_SAMPLE  *samp[100] = {0};
index f55b400097bad76913ab38789dd405c51f71fa6c..76e95033ae3c344c30a281e7fda9e77324b8f37c 100644 (file)
@@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 /**> HEADER FILES <**/
 #include "Person.h"
 #include "openal_wrapper.h"
+#include "Animation.h"
 
 extern float multiplier;
 extern Animation animation[animation_count];
index 878bcbe13511cc6ec54d317c146abe447246c94a..1facda9b1fcbc36cb6aaec5d35fe51743a2e4b00 100644 (file)
@@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "Game.h"
 #include "Skeleton.h"
 #include "openal_wrapper.h"
+#include "Animation.h"
 
 extern float multiplier;
 extern float gravity;
index 6d6d2649e537ce2ecca1163e0009d40afdaf7263..2c48dd80256b10566a3dea78a312f1c50f96e281 100644 (file)
@@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 /**> HEADER FILES <**/
 #include "Weapons.h"
 #include "openal_wrapper.h"
+#include "Animation.h"
 
 extern float multiplier;
 extern Animation animation[animation_count];