]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/animdecide.qh
Hide the MOTD when going spec
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / animdecide.qh
index 105dac7c47f2460a8710a54c87032a5b469eb1dd..521c6ab989b906649bf774b55ca840cb8416de1b 100644 (file)
@@ -1,11 +1,51 @@
-// 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);
+
+// 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
-.float anim_state;
+.int anim_state;
 .float anim_time;
 .float anim_lower_action;
 .float anim_lower_time;
@@ -13,7 +53,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 +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);
-#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 = 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.)
-#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 = 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);
-#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