From 0c1b3a5082fbac63dfbaa725bddf3336c07b00c2 Mon Sep 17 00:00:00 2001 From: Alexander Monakov Date: Mon, 7 Jun 2010 01:50:22 +0400 Subject: [PATCH] Prepare to cleanup animation loading --- Source/Animation.def | 258 ++++++++++++++++++++++--------------------- Source/Animation.h | 11 +- Source/Skeleton.h | 8 -- 3 files changed, 140 insertions(+), 137 deletions(-) diff --git a/Source/Animation.def b/Source/Animation.def index 005685b..49aec9f 100644 --- a/Source/Animation.def +++ b/Source/Animation.def @@ -19,132 +19,134 @@ 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) +DECLARE_ANIM(runanim, "Run", middleheight, neutral) +DECLARE_ANIM(bounceidleanim, "Idle", middleheight, neutral) +DECLARE_ANIM(stopanim, "Stop", middleheight, neutral) +DECLARE_ANIM(jumpupanim, "JumpUp", highheight, neutral) +DECLARE_ANIM(jumpdownanim, "JumpDown", highheight, neutral) +DECLARE_ANIM(landanim, "Landing", lowheight, neutral) +DECLARE_ANIM(landhardanim, "Landhard", lowheight, neutral) +DECLARE_ANIM(climbanim, "Climb", lowheight, neutral) +DECLARE_ANIM(hanganim, "Hangon", lowheight, neutral) +DECLARE_ANIM(spinkickanim, "SpinKick", middleheight, normalattack) +DECLARE_ANIM(getupfromfrontanim, "GetUpFromFront", lowheight, neutral) +DECLARE_ANIM(getupfrombackanim, "GetUpFromBack", lowheight, neutral) +DECLARE_ANIM(crouchanim, "Crouch", lowheight, neutral) +DECLARE_ANIM(sneakanim, "Sneak", lowheight, neutral) +DECLARE_ANIM(rollanim, "Roll", lowheight, neutral) +DECLARE_ANIM(flipanim, "Flip", highheight, neutral) +DECLARE_ANIM(frontflipanim, "Flip", highheight, neutral) +DECLARE_ANIM(spinkickreversedanim, "SpinKickCaught", middleheight, reversed) +DECLARE_ANIM(spinkickreversalanim, "SpinKickCatch", middleheight, reversal) +DECLARE_ANIM(lowkickanim, "lowkick", middleheight, normalattack) +DECLARE_ANIM(sweepanim, "sweep", lowheight, normalattack) +DECLARE_ANIM(sweepreversedanim, "SweepCaught", lowheight, reversed) +DECLARE_ANIM(sweepreversalanim, "SweepCatch", middleheight, reversal) +DECLARE_ANIM(rabbitkickanim, "RabbitKick", middleheight, normalattack) +DECLARE_ANIM(rabbitkickreversedanim, "RabbitKickCaught", middleheight, reversed) +DECLARE_ANIM(rabbitkickreversalanim, "RabbitKickCatch", lowheight, reversal) +DECLARE_ANIM(upunchanim, "Upunch", middleheight, normalattack) +DECLARE_ANIM(staggerbackhighanim, "Staggerbackhigh", middleheight, neutral) +DECLARE_ANIM(upunchreversedanim, "UpunchCaught", middleheight, reversed) +DECLARE_ANIM(upunchreversalanim, "UpunchCatch", middleheight, reversal) +DECLARE_ANIM(hurtidleanim, "Hurtidle", middleheight, neutral) +DECLARE_ANIM(backhandspringanim, "Backhandspring", middleheight, neutral) +DECLARE_ANIM(fightidleanim, "Fightidle", middleheight, neutral) +DECLARE_ANIM(walkanim, "Walk", middleheight, neutral) +DECLARE_ANIM(fightsidestep, "Fightsidestep", middleheight, neutral) +DECLARE_ANIM(killanim, "Kill", middleheight, normalattack) +DECLARE_ANIM(sneakattackanim, "Sneakattack", middleheight, reversal) +DECLARE_ANIM(sneakattackedanim, "Sneakattacked", middleheight, reversed) +DECLARE_ANIM(drawrightanim, "drawright", middleheight, neutral) +DECLARE_ANIM(knifeslashstartanim, "slashstart", middleheight, normalattack) +DECLARE_ANIM(crouchdrawrightanim, "crouchdrawright", lowheight, neutral) +DECLARE_ANIM(crouchstabanim, "crouchstab", lowheight, normalattack) +DECLARE_ANIM(knifefollowanim, "slashfollow", middleheight, reversal) +DECLARE_ANIM(knifefollowedanim, "slashfollowed", middleheight, reversed) +DECLARE_ANIM(knifethrowanim, "knifethrow", middleheight, normalattack) +DECLARE_ANIM(removeknifeanim, "removeknife", middleheight, neutral) +DECLARE_ANIM(crouchremoveknifeanim, "crouchremoveknife", lowheight, neutral) +DECLARE_ANIM(jumpreversedanim, "JumpCaught", middleheight, reversed) +DECLARE_ANIM(jumpreversalanim, "JumpCatch", middleheight, reversal) +DECLARE_ANIM(staggerbackhardanim, "Staggerbackhard", middleheight, neutral) +DECLARE_ANIM(dropkickanim, "Dropkick", middleheight, normalattack) +DECLARE_ANIM(winduppunchanim, "Winduppunch", middleheight, normalattack) +DECLARE_ANIM(winduppunchblockedanim, "Winduppunchblocked", middleheight, normalattack) +DECLARE_ANIM(blockhighleftanim, "Blockhighleft", middleheight, normalattack) +DECLARE_ANIM(blockhighleftstrikeanim, "Blockhighleftstrike", middleheight, normalattack) +DECLARE_ANIM(backflipanim, "Backflip", highheight, neutral) +DECLARE_ANIM(walljumpbackanim, "Walljumpback", highheight, neutral) +DECLARE_ANIM(walljumpfrontanim, "Walljumpfront", highheight, neutral) +DECLARE_ANIM(rightflipanim, "Rightflip", highheight, neutral) +DECLARE_ANIM(walljumprightanim, "Walljumpright", highheight, neutral) +DECLARE_ANIM(leftflipanim, "Leftflip", highheight, neutral) +DECLARE_ANIM(walljumpleftanim, "Walljumpleft", highheight, neutral) +DECLARE_ANIM(walljumprightkickanim, "Walljumprightkick", highheight, neutral) +DECLARE_ANIM(walljumpleftkickanim, "Walljumpleftkick", highheight, neutral) +DECLARE_ANIM(knifefightidleanim, "Knifefightidle", middleheight, neutral) +DECLARE_ANIM(knifesneakattackanim, "Knifesneakattack", middleheight, reversal) +DECLARE_ANIM(knifesneakattackedanim, "Knifesneakattacked", middleheight, reversed) +DECLARE_ANIM(swordfightidleanim, "swordfightidle", middleheight, neutral) +DECLARE_ANIM(drawleftanim, "drawleft", middleheight, neutral) +DECLARE_ANIM(swordslashanim, "swordslash", middleheight, normalattack) +DECLARE_ANIM(swordgroundstabanim, "swordgroundstab", lowheight, normalattack) +DECLARE_ANIM(dodgebackanim, "dodgeback", middleheight, neutral) +DECLARE_ANIM(swordsneakattackanim, "Swordsneakattack", middleheight, reversal) +DECLARE_ANIM(swordsneakattackedanim, "Swordsneakattacked", middleheight, reversed) +DECLARE_ANIM(swordslashreversedanim, "swordslashCaught", middleheight, reversed) +DECLARE_ANIM(swordslashreversalanim, "swordslashCatch", middleheight, reversal) +DECLARE_ANIM(knifeslashreversedanim, "knifeslashCaught", middleheight, reversed) +DECLARE_ANIM(knifeslashreversalanim, "knifeslashCatch", middleheight, reversal) +DECLARE_ANIM(swordfightidlebothanim, "swordfightidleboth", middleheight, neutral) +DECLARE_ANIM(swordslashparryanim, "sworduprightparry", middleheight, normalattack) +DECLARE_ANIM(swordslashparriedanim, "swordslashparried", middleheight, normalattack) +DECLARE_ANIM(wolfidle, "Wolfidle", middleheight, neutral) +DECLARE_ANIM(wolfcrouchanim, "Wolfcrouch", lowheight, neutral) +DECLARE_ANIM(wolflandanim, "Wolflanding", lowheight, neutral) +DECLARE_ANIM(wolflandhardanim, "Wolflandhard", lowheight, neutral) +DECLARE_ANIM(wolfrunanim, "Wolfrun", middleheight, neutral) +DECLARE_ANIM(wolfrunninganim, "Wolfrunning", middleheight, neutral) +DECLARE_ANIM(rabbitrunninganim, "Rabbitrunning", middleheight, neutral) +DECLARE_ANIM(wolfstopanim, "Wolfstop", middleheight, neutral) +DECLARE_ANIM(rabbittackleanim, "Rabbittackle", middleheight, neutral) +DECLARE_ANIM(rabbittacklinganim, "Rabbittackling", middleheight, reversal) +DECLARE_ANIM(rabbittackledbackanim, "Rabbittackledback", middleheight, reversed) +DECLARE_ANIM(rabbittackledfrontanim, "Rabbittackledfront", middleheight, reversed) +DECLARE_ANIM(wolfslapanim, "Wolfslap", middleheight, normalattack) +DECLARE_ANIM(staffhitanim, "StaffHit", middleheight, normalattack) +DECLARE_ANIM(staffgroundsmashanim, "StaffGroundSmash", lowheight, normalattack) +DECLARE_ANIM(staffspinhitanim, "Spinwhack", middleheight, normalattack) +DECLARE_ANIM(staffhitreversedanim, "StaffHitCaught", middleheight, reversed) +DECLARE_ANIM(staffhitreversalanim, "StaffHitCatch", middleheight, reversal) +DECLARE_ANIM(staffspinhitreversedanim, "SpinWhackCaught", middleheight, reversed) +DECLARE_ANIM(staffspinhitreversalanim, "SpinWhackCatch", middleheight, reversal) +DECLARE_ANIM(sitanim, "Sit", lowheight, neutral) +DECLARE_ANIM(sleepanim, "Sleep", lowheight, neutral) +DECLARE_ANIM(talkidleanim, "TalkIdle", middleheight, neutral) +DECLARE_ANIM(sitwallanim, "Dying", lowheight, neutral) +DECLARE_ANIM(dead1anim, "Dead1", lowheight, neutral) +DECLARE_ANIM(dead2anim, "Dead2", lowheight, neutral) +DECLARE_ANIM(dead3anim, "Dead3", lowheight, neutral) +DECLARE_ANIM(dead4anim, "Dead4", lowheight, neutral) +/* Not implemented. */ +DECLARE_ANIM(rabbittacklereversal, "", 0, 0) +DECLARE_ANIM(rabbittacklereversed, "", 0, 0) +DECLARE_ANIM(sworddisarmanim, "", 0, 0) +DECLARE_ANIM(swordslashleftanim, "", 0, 0) +DECLARE_ANIM(swordslashrightanim, "", 0, 0) +DECLARE_ANIM(swordstabanim, "", 0, 0) +DECLARE_ANIM(wolfbashanim, "", 0, 0) +DECLARE_ANIM(wolfclawanim, "", 0, 0) +DECLARE_ANIM(wolffightidle, "", 0, 0) +DECLARE_ANIM(wolfhurtidle, "", 0, 0) +DECLARE_ANIM(wolfsneakanim, "", 0, 0) +DECLARE_ANIM(wolfswordidle, "", 0, 0) +DECLARE_ANIM(wolftackleanim, "", 0, 0) +DECLARE_ANIM(wolftackledbacanim, "", 0, 0) +DECLARE_ANIM(wolftackledfrontanim, "", 0, 0) +DECLARE_ANIM(wolftacklereversal, "", 0, 0) +DECLARE_ANIM(wolftacklereversed, "", 0, 0) +DECLARE_ANIM(wolftacklinganim, "", 0, 0) + +DECLARE_ANIM(tempanim, "", 0, 0) diff --git a/Source/Animation.h b/Source/Animation.h index 0d4c8d1..b8e821b 100644 --- a/Source/Animation.h +++ b/Source/Animation.h @@ -22,8 +22,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef ANIMATION_H #define ANIMATION_H +enum anim_attack_type { + neutral, normalattack, reversed, reversal +}; + +enum anim_height_type { + lowheight, middleheight, highheight +}; + + enum animation_types { -#define DECLARE_ANIM(id) id, +#define DECLARE_ANIM(id, file, height, attack) id, #include "Animation.def" #undef DECLARE_ANIM animation_count diff --git a/Source/Skeleton.h b/Source/Skeleton.h index 48592a8..7dcd203 100644 --- a/Source/Skeleton.h +++ b/Source/Skeleton.h @@ -34,14 +34,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "Sprite.h" #include "binio.h" -#define neutral 0 -#define normalattack 1 -#define reversed 2 -#define reversal 3 -#define lowheight 0 -#define middleheight 1 -#define highheight 2 - class Joint { public: -- 2.39.5