- AActor size reduction

* a few shorter fields were moved into alignment gaps
* the visible angles are now stored as floats. Since these are only used for rendering the loss of precision is negligible, but this shortens AActor by 16 bytes alone.
This commit is contained in:
Christoph Oelckers 2020-10-03 08:23:36 +02:00
parent a72fdd7e3e
commit c1e04b29d1
2 changed files with 17 additions and 17 deletions

View file

@ -996,10 +996,10 @@ public:
double Floorclip; // value to use for floor clipping double Floorclip; // value to use for floor clipping
double radius, Height; // for movement checking double radius, Height; // for movement checking
DAngle VisibleStartAngle; FAngle VisibleStartAngle;
DAngle VisibleStartPitch; FAngle VisibleStartPitch;
DAngle VisibleEndAngle; FAngle VisibleEndAngle;
DAngle VisibleEndPitch; FAngle VisibleEndPitch;
DVector3 OldRenderPos; DVector3 OldRenderPos;
DVector3 Vel; DVector3 Vel;
@ -1052,6 +1052,7 @@ public:
int8_t visdir; int8_t visdir;
int16_t movecount; // when 0, select a new dir int16_t movecount; // when 0, select a new dir
int16_t strafecount; // for MF3_AVOIDMELEE int16_t strafecount; // for MF3_AVOIDMELEE
uint16_t SpawnAngle;
TObjPtr<AActor*> target; // thing being chased/attacked (or NULL) TObjPtr<AActor*> target; // thing being chased/attacked (or NULL)
// also the originator for missiles // also the originator for missiles
TObjPtr<AActor*> lastenemy; // Last known enemy -- killough 2/15/98 TObjPtr<AActor*> lastenemy; // Last known enemy -- killough 2/15/98
@ -1064,11 +1065,10 @@ public:
player_t *player; // only valid if type of PlayerPawn player_t *player; // only valid if type of PlayerPawn
TObjPtr<AActor*> LastLookActor; // Actor last looked for (if TIDtoHate != 0) TObjPtr<AActor*> LastLookActor; // Actor last looked for (if TIDtoHate != 0)
DVector3 SpawnPoint; // For nightmare respawn DVector3 SpawnPoint; // For nightmare respawn
uint16_t SpawnAngle;
int StartHealth; int StartHealth;
uint8_t WeaveIndexXY; // Separated from special2 because it's used by globally accessible functions. uint8_t WeaveIndexXY; // Separated from special2 because it's used by globally accessible functions.
uint8_t WeaveIndexZ; uint8_t WeaveIndexZ;
int skillrespawncount; uint16_t skillrespawncount;
int TIDtoHate; // TID of things to hate (0 if none) int TIDtoHate; // TID of things to hate (0 if none)
FName Species; // For monster families FName Species; // For monster families
TObjPtr<AActor*> alternative; // (Un)Morphed actors stored here. Those with the MF_UNMORPHED flag are the originals. TObjPtr<AActor*> alternative; // (Un)Morphed actors stored here. Those with the MF_UNMORPHED flag are the originals.
@ -1096,11 +1096,11 @@ public:
double maxtargetrange; // any target farther away cannot be attacked double maxtargetrange; // any target farther away cannot be attacked
double bouncefactor; // Strife's grenades use 50%, Hexen's Flechettes 70. double bouncefactor; // Strife's grenades use 50%, Hexen's Flechettes 70.
double wallbouncefactor; // The bounce factor for walls can be different. double wallbouncefactor; // The bounce factor for walls can be different.
int bouncecount; // Strife's grenades only bounce twice before exploding
double Gravity; // [GRB] Gravity factor double Gravity; // [GRB] Gravity factor
double Friction; double Friction;
int FastChaseStrafeCount;
double pushfactor; double pushfactor;
int bouncecount; // Strife's grenades only bounce twice before exploding
int FastChaseStrafeCount;
int lastpush; int lastpush;
int activationtype; // How the thing behaves when activated with USESPECIAL or BUMPSPECIAL int activationtype; // How the thing behaves when activated with USESPECIAL or BUMPSPECIAL
int lastbump; // Last time the actor was bumped, used to control BUMPSPECIAL int lastbump; // Last time the actor was bumped, used to control BUMPSPECIAL
@ -1139,8 +1139,8 @@ public:
uint8_t smokecounter; uint8_t smokecounter;
uint8_t FloatBobPhase; uint8_t FloatBobPhase;
double FloatBobStrength;
uint8_t FriendPlayer; // [RH] Player # + 1 this friendly monster works for (so 0 is no player, 1 is player 0, etc) uint8_t FriendPlayer; // [RH] Player # + 1 this friendly monster works for (so 0 is no player, 1 is player 0, etc)
double FloatBobStrength;
PalEntry BloodColor; PalEntry BloodColor;
uint32_t BloodTranslation; uint32_t BloodTranslation;
@ -1175,14 +1175,14 @@ public:
int RipLevelMin; int RipLevelMin;
int RipLevelMax; int RipLevelMax;
int ConversationRoot; // THe root of the current dialogue
FStrifeDialogueNode* Conversation; // [RH] The dialogue to show when this actor is "used."
FState *SpawnState; FState *SpawnState;
FState *SeeState; FState *SeeState;
FState *MeleeState; FState *MeleeState;
FState *MissileState; FState *MissileState;
int ConversationRoot; // THe root of the current dialogue
FStrifeDialogueNode *Conversation; // [RH] The dialogue to show when this actor is "used."
// [RH] Decal(s) this weapon/projectile generates on impact. // [RH] Decal(s) this weapon/projectile generates on impact.
FDecalBase *DecalGenerator; FDecalBase *DecalGenerator;

View file

@ -93,10 +93,10 @@ class Actor : Thinker native
native vector2 SpriteOffset; native vector2 SpriteOffset;
native double spriteAngle; native double spriteAngle;
native double spriteRotation; native double spriteRotation;
native double VisibleStartAngle; native float VisibleStartAngle;
native double VisibleStartPitch; native float VisibleStartPitch;
native double VisibleEndAngle; native float VisibleEndAngle;
native double VisibleEndPitch; native float VisibleEndPitch;
native double Angle; native double Angle;
native double Pitch; native double Pitch;
native double Roll; native double Roll;
@ -150,7 +150,7 @@ class Actor : Thinker native
native int StartHealth; native int StartHealth;
native uint8 WeaveIndexXY; native uint8 WeaveIndexXY;
native uint8 WeaveIndexZ; native uint8 WeaveIndexZ;
native int skillrespawncount; native uint16 skillrespawncount;
native int Args[5]; native int Args[5];
native int Mass; native int Mass;
native int Special; native int Special;