From: Alexander Monakov Date: Sun, 6 Jun 2010 21:07:05 +0000 (+0400) Subject: Make animation types an enum, move to a separate file X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=38615999d550e75a973ce4d5520c9ef117d65cea;p=lugaru.git Make animation types an enum, move to a separate file --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 383779d..d36f0f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 index 0000000..005685b --- /dev/null +++ b/Source/Animation.def @@ -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 index 0000000..1e5ad10 --- /dev/null +++ b/Source/Animation.h @@ -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 diff --git a/Source/Constants.h b/Source/Constants.h index 6769328..4224257 100644 --- a/Source/Constants.h +++ b/Source/Constants.h @@ -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; diff --git a/Source/GameInitDispose.cpp b/Source/GameInitDispose.cpp index 6426698..e936228 100644 --- a/Source/GameInitDispose.cpp +++ b/Source/GameInitDispose.cpp @@ -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; diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index 8790825..2adf41e 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -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; diff --git a/Source/Globals.cpp b/Source/Globals.cpp index b3b7eee..c5cb64c 100644 --- a/Source/Globals.cpp +++ b/Source/Globals.cpp @@ -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}; diff --git a/Source/Person.cpp b/Source/Person.cpp index f55b400..76e9503 100644 --- a/Source/Person.cpp +++ b/Source/Person.cpp @@ -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]; diff --git a/Source/Skeleton.cpp b/Source/Skeleton.cpp index 878bcbe..1facda9 100644 --- a/Source/Skeleton.cpp +++ b/Source/Skeleton.cpp @@ -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; diff --git a/Source/Weapons.cpp b/Source/Weapons.cpp index 6d6d264..2c48dd8 100644 --- a/Source/Weapons.cpp +++ b/Source/Weapons.cpp @@ -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];