X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fanimdecide.qh;h=9dc7cf7dbd0dd6273a655cb938f185e383c7d6e2;hb=79f8e8d5cfdd67d25f574bebec19d0a6f31eb20a;hp=105dac7c47f2460a8710a54c87032a5b469eb1dd;hpb=265b681e0fb49239df1bfc431a903f66244a3172;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/animdecide.qh b/qcsrc/common/animdecide.qh index 105dac7c4..9dc7cf7db 100644 --- a/qcsrc/common/animdecide.qh +++ b/qcsrc/common/animdecide.qh @@ -1,11 +1,15 @@ -// client side frame inferring -void animdecide_init(entity e); +#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); // please network this one -.float anim_state; +.int anim_state; .float anim_time; .float anim_lower_action; .float anim_lower_time; @@ -13,7 +17,7 @@ void animdecide_setframes(entity e, float support_blending, .float fld_frame, .f .float anim_upper_time; // when copying entities, copy these too -.float anim_implicit_state; +.int anim_implicit_state; .float anim_implicit_time; .float anim_lower_implicit_action; .float anim_lower_implicit_time; @@ -21,26 +25,27 @@ 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); -#define ANIMSTATE_DEAD1 1 // base frames: die1 -#define ANIMSTATE_DEAD2 2 // base frames: die2 -#define ANIMSTATE_DUCK 4 // turns walk into duckwalk, jump into duckjump, etc. -#define ANIMSTATE_FROZEN 8 // force idle +void animdecide_setstate(entity e, int newstate, float restart); +const int ANIMSTATE_DEAD1 = 1; // base frames: die1 +const int ANIMSTATE_DEAD2 = 2; // base frames: die2 +const int ANIMSTATE_DUCK = 4; // turns walk into duckwalk, jump into duckjump, etc. +const int ANIMSTATE_FROZEN = 8; // force idle // implicit anim states (inferred from velocity, etc.) -#define ANIMIMPLICITSTATE_INAIR 1 -#define ANIMIMPLICITSTATE_FORWARD 2 -#define ANIMIMPLICITSTATE_BACKWARDS 4 -#define ANIMIMPLICITSTATE_LEFT 8 -#define ANIMIMPLICITSTATE_RIGHT 16 -#define ANIMIMPLICITSTATE_JUMPRELEASED 32 +const int ANIMIMPLICITSTATE_INAIR = 1; +const int ANIMIMPLICITSTATE_FORWARD = 2; +const int ANIMIMPLICITSTATE_BACKWARDS = 4; +const int ANIMIMPLICITSTATE_LEFT = 8; +const int ANIMIMPLICITSTATE_RIGHT = 16; +const int ANIMIMPLICITSTATE_JUMPRELEASED = 32; // explicit actions (networked); negative values are for lower body void animdecide_setaction(entity e, float action, float restart); -#define ANIMACTION_JUMP -1 // jump -#define ANIMACTION_DRAW 1 // draw -#define ANIMACTION_PAIN1 2 // pain -#define ANIMACTION_PAIN2 3 // pain -#define ANIMACTION_SHOOT 4 // shoot -#define ANIMACTION_TAUNT 5 // taunt -#define 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