X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fanimdecide.qh;h=521c6ab989b906649bf774b55ca840cb8416de1b;hb=201f6309c92217b63dc34daf004fbb7424096eca;hp=f9261adae6cc5e4cc96fcdd4108f35c2bd8b687a;hpb=7116827232f791ad3592afa2f2f065905e3aa460;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/animdecide.qh b/qcsrc/common/animdecide.qh index f9261adae..521c6ab98 100644 --- a/qcsrc/common/animdecide.qh +++ b/qcsrc/common/animdecide.qh @@ -1,9 +1,48 @@ +#ifndef ANIMDECIDE_H +#define ANIMDECIDE_H + // must be called at least once to initialize, or when modelindex is changed void animdecide_load_if_needed(entity e); // client side frame inferring void animdecide_setimplicitstate(entity e, float onground); -void animdecide_setframes(entity e, float support_blending, .float fld_frame, .float fld_frame1time, .float fld_frame2, .float fld_frame2time); +void animdecide_setframes(entity e, bool support_blending, .int fld_frame, .int fld_frame1time, .int fld_frame2, .int fld_frame2time); + +// player animation data for this model +// each vector is as follows: +// _x = startframe +// _y = numframes +// _z = framerate +.vector anim_die1; // player dies +.vector anim_die2; // player dies differently +.vector anim_draw; // player pulls out a weapon +.vector anim_duckwalk; // player walking while crouching +.vector anim_duckjump; // player jumping from a crouch +.vector anim_duckidle; // player idling while crouching +.vector anim_idle; // player standing +.vector anim_jump; // player jump +.vector anim_pain1; // player flinches from pain +.vector anim_pain2; // player flinches from pain, differently +.vector anim_shoot; // player shoots +.vector anim_taunt; // player taunts others (FIXME: no code references this) +.vector anim_run; // player running forward +.vector anim_runbackwards; // player running backward +.vector anim_strafeleft; // player shuffling left quickly +.vector anim_straferight; // player shuffling right quickly +.vector anim_forwardright; // player running forward and right +.vector anim_forwardleft; // player running forward and left +.vector anim_backright; // player running backward and right +.vector anim_backleft; // player running back and left +.vector anim_melee; // player doing the melee action +.vector anim_duck; // player doing the melee action +.vector anim_duckwalkbackwards; +.vector anim_duckwalkstrafeleft; +.vector anim_duckwalkstraferight; +.vector anim_duckwalkforwardright; +.vector anim_duckwalkforwardleft; +.vector anim_duckwalkbackright; +.vector anim_duckwalkbackleft; +.float animdecide_modelindex; // please network this one .int anim_state; @@ -22,26 +61,28 @@ void animdecide_setframes(entity e, float support_blending, .float fld_frame, .f .float anim_upper_implicit_time; // explicit anim states (networked) -void animdecide_setstate(entity e, float newstate, float restart); -const float ANIMSTATE_DEAD1 = 1; // base frames: die1 -const float ANIMSTATE_DEAD2 = 2; // base frames: die2 -const float ANIMSTATE_DUCK = 4; // turns walk into duckwalk, jump into duckjump, etc. -const float ANIMSTATE_FROZEN = 8; // force idle +void animdecide_setstate(entity e, int newstate, float restart); +const int ANIMSTATE_DEAD1 = BIT(0); // base frames: die1 +const int ANIMSTATE_DEAD2 = BIT(1); // base frames: die2 +const int ANIMSTATE_DUCK = BIT(2); // turns walk into duckwalk, jump into duckjump, etc. +const int ANIMSTATE_FROZEN = BIT(3); // force idle +const int ANIMSTATE_FOLLOW = BIT(4); // also force idle // implicit anim states (inferred from velocity, etc.) -const float ANIMIMPLICITSTATE_INAIR = 1; -const float ANIMIMPLICITSTATE_FORWARD = 2; -const float ANIMIMPLICITSTATE_BACKWARDS = 4; -const float ANIMIMPLICITSTATE_LEFT = 8; -const float ANIMIMPLICITSTATE_RIGHT = 16; -const float ANIMIMPLICITSTATE_JUMPRELEASED = 32; +const int ANIMIMPLICITSTATE_INAIR = BIT(0); +const int ANIMIMPLICITSTATE_FORWARD = BIT(1); +const int ANIMIMPLICITSTATE_BACKWARDS = BIT(2); +const int ANIMIMPLICITSTATE_LEFT = BIT(3); +const int ANIMIMPLICITSTATE_RIGHT = BIT(4); +const int ANIMIMPLICITSTATE_JUMPRELEASED = BIT(5); // explicit actions (networked); negative values are for lower body void animdecide_setaction(entity e, float action, float restart); -const float ANIMACTION_JUMP = -1; // jump -const float ANIMACTION_DRAW = 1; // draw -const float ANIMACTION_PAIN1 = 2; // pain -const float ANIMACTION_PAIN2 = 3; // pain -const float ANIMACTION_SHOOT = 4; // shoot -const float ANIMACTION_TAUNT = 5; // taunt -const float ANIMACTION_MELEE = 6; // melee +const int ANIMACTION_JUMP = -1; // jump +const int ANIMACTION_DRAW = 1; // draw +const int ANIMACTION_PAIN1 = 2; // pain +const int ANIMACTION_PAIN2 = 3; // pain +const int ANIMACTION_SHOOT = 4; // shoot +const int ANIMACTION_TAUNT = 5; // taunt +const int ANIMACTION_MELEE = 6; // melee +#endif