Skip to content

Commit

Permalink
Correctly save and restore controller and blending variables
Browse files Browse the repository at this point in the history
Resolves #175
  • Loading branch information
SamVanheer committed Oct 25, 2022
1 parent f2c8e23 commit 89610a2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions dlls/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ TYPEDESCRIPTION gEntvarsDescription[] =
DEFINE_ENTITY_FIELD(sequence, FIELD_INTEGER),
DEFINE_ENTITY_FIELD(animtime, FIELD_TIME),
DEFINE_ENTITY_FIELD(framerate, FIELD_FLOAT),
DEFINE_ENTITY_FIELD(controller, FIELD_INTEGER),
DEFINE_ENTITY_FIELD(blending, FIELD_INTEGER),
DEFINE_ENTITY_ARRAY(controller, FIELD_CHARACTER, NUM_ENT_CONTROLLERS),
DEFINE_ENTITY_ARRAY(blending, FIELD_CHARACTER, NUM_ENT_BLENDERS),

DEFINE_ENTITY_FIELD(rendermode, FIELD_INTEGER),
DEFINE_ENTITY_FIELD(renderamt, FIELD_FLOAT),
Expand Down
1 change: 1 addition & 0 deletions engine/eiface.h
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ typedef enum _fieldtypes
#define DEFINE_FIELD(type, name, fieldtype) _FIELD(type, name, fieldtype, 1, 0)
#define DEFINE_ARRAY(type, name, fieldtype, count) _FIELD(type, name, fieldtype, count, 0)
#define DEFINE_ENTITY_FIELD(name, fieldtype) _FIELD(entvars_t, name, fieldtype, 1, 0)
#define DEFINE_ENTITY_ARRAY(name, fieldtype, count) _FIELD(entvars_t, name, fieldtype, count, 0)
#define DEFINE_ENTITY_GLOBAL_FIELD(name, fieldtype) _FIELD(entvars_t, name, fieldtype, 1, FTYPEDESC_GLOBAL)
#define DEFINE_GLOBAL_FIELD(type, name, fieldtype) _FIELD(type, name, fieldtype, 1, FTYPEDESC_GLOBAL)

Expand Down
16 changes: 9 additions & 7 deletions engine/progdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ typedef struct
Vector vecLandmarkOffset;
} globalvars_t;

constexpr int NUM_ENT_CONTROLLERS = 4;
constexpr int NUM_ENT_BLENDERS = 2;

typedef struct entvars_s
{
Expand Down Expand Up @@ -109,13 +111,13 @@ typedef struct entvars_s

int light_level;

int sequence; // animation sequence
int gaitsequence; // movement animation sequence for player (0 for none)
float frame; // % playback position in animation sequences (0..255)
float animtime; // world time when frame was set
float framerate; // animation playback rate (-8x to 8x)
byte controller[4]; // bone controller setting (0..255)
byte blending[2]; // blending amount between sub-sequences (0..255)
int sequence; // animation sequence
int gaitsequence; // movement animation sequence for player (0 for none)
float frame; // % playback position in animation sequences (0..255)
float animtime; // world time when frame was set
float framerate; // animation playback rate (-8x to 8x)
byte controller[NUM_ENT_CONTROLLERS]; // bone controller setting (0..255)
byte blending[NUM_ENT_BLENDERS]; // blending amount between sub-sequences (0..255)

float scale; // sprite rendering scale (0..255)

Expand Down

0 comments on commit 89610a2

Please sign in to comment.