- 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 radius, Height; // for movement checking
DAngle VisibleStartAngle;
DAngle VisibleStartPitch;
DAngle VisibleEndAngle;
DAngle VisibleEndPitch;
FAngle VisibleStartAngle;
FAngle VisibleStartPitch;
FAngle VisibleEndAngle;
FAngle VisibleEndPitch;
DVector3 OldRenderPos;
DVector3 Vel;
@ -1052,6 +1052,7 @@ public:
int8_t visdir;
int16_t movecount; // when 0, select a new dir
int16_t strafecount; // for MF3_AVOIDMELEE
uint16_t SpawnAngle;
TObjPtr<AActor*> target; // thing being chased/attacked (or NULL)
// also the originator for missiles
TObjPtr<AActor*> lastenemy; // Last known enemy -- killough 2/15/98
@ -1064,11 +1065,10 @@ public:
player_t *player; // only valid if type of PlayerPawn
TObjPtr<AActor*> LastLookActor; // Actor last looked for (if TIDtoHate != 0)
DVector3 SpawnPoint; // For nightmare respawn
uint16_t SpawnAngle;
int StartHealth;
uint8_t WeaveIndexXY; // Separated from special2 because it's used by globally accessible functions.
uint8_t WeaveIndexZ;
int skillrespawncount;
uint16_t skillrespawncount;
int TIDtoHate; // TID of things to hate (0 if none)
FName Species; // For monster families
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 bouncefactor; // Strife's grenades use 50%, Hexen's Flechettes 70.
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 Friction;
int FastChaseStrafeCount;
double pushfactor;
int bouncecount; // Strife's grenades only bounce twice before exploding
int FastChaseStrafeCount;
int lastpush;
int activationtype; // How the thing behaves when activated with USESPECIAL or BUMPSPECIAL
int lastbump; // Last time the actor was bumped, used to control BUMPSPECIAL
@ -1139,8 +1139,8 @@ public:
uint8_t smokecounter;
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)
double FloatBobStrength;
PalEntry BloodColor;
uint32_t BloodTranslation;
@ -1175,14 +1175,14 @@ public:
int RipLevelMin;
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 *SeeState;
FState *MeleeState;
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.
FDecalBase *DecalGenerator;

View File

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