Convert to SoldierID

Rearranged struct to optimize memory layout
This commit is contained in:
Asdow
2024-11-17 17:22:30 +02:00
parent e9a13e12d8
commit 06936b71c9
+28 -28
View File
@@ -59,22 +59,22 @@ typedef struct
typedef struct typedef struct
{ {
UINT16 usSoldierID; UINT32 usTargetGridNo; // WANNE - MP: Used for manipulating the target grid no
UINT32 uiUniqueId; UINT32 uiUniqueId;
SoldierID usSoldierID;
UINT16 usNewState; UINT16 usNewState;
INT16 sXPos; INT16 sXPos;
INT16 sYPos; INT16 sYPos;
UINT16 usStartingAniCode; UINT16 usStartingAniCode;
BOOLEAN fForce; BOOLEAN fForce;
UINT8 usNewDirection;//hayden UINT8 usNewDirection;//hayden
UINT32 usTargetGridNo; // WANNE - MP: Used for manipulating the target grid no
} EV_S_CHANGESTATE; } EV_S_CHANGESTATE;
typedef struct typedef struct
{ {
UINT16 usSoldierID; SoldierID usSoldierID;
UINT32 uiUniqueId; UINT32 uiUniqueId;
INT32 usNewDestination; INT32 usNewDestination;
@@ -82,7 +82,7 @@ typedef struct
typedef struct typedef struct
{ {
UINT16 usSoldierID; SoldierID usSoldierID;
UINT32 uiUniqueId; UINT32 uiUniqueId;
FLOAT dNewXPos; FLOAT dNewXPos;
FLOAT dNewYPos; FLOAT dNewYPos;
@@ -91,41 +91,42 @@ typedef struct
typedef struct typedef struct
{ {
UINT16 usSoldierID;
UINT32 uiUniqueId; UINT32 uiUniqueId;
INT32 sDestGridNo; INT32 sDestGridNo;
SoldierID usSoldierID;
UINT16 usMovementAnim; UINT16 usMovementAnim;
} EV_S_GETNEWPATH; } EV_S_GETNEWPATH;
typedef struct typedef struct
{ {
UINT16 usSoldierID;
UINT32 uiUniqueId; UINT32 uiUniqueId;
SoldierID usSoldierID;
} EV_S_BEGINTURN; } EV_S_BEGINTURN;
typedef struct typedef struct
{ {
UINT16 usSoldierID;
UINT32 uiUniqueId; UINT32 uiUniqueId;
UINT8 ubNewStance; SoldierID usSoldierID;
INT16 sXPos; INT16 sXPos;
INT16 sYPos; INT16 sYPos;
UINT8 ubNewStance;
} EV_S_CHANGESTANCE; } EV_S_CHANGESTANCE;
typedef struct typedef struct
{ {
UINT16 usSoldierID;
UINT32 uiUniqueId; UINT32 uiUniqueId;
SoldierID usSoldierID;
UINT16 usNewDirection; UINT16 usNewDirection;
} EV_S_SETDIRECTION; } EV_S_SETDIRECTION;
typedef struct typedef struct
{ {
UINT16 usSoldierID;
UINT32 uiUniqueId; UINT32 uiUniqueId;
SoldierID usSoldierID;
UINT16 usDesiredDirection; UINT16 usDesiredDirection;
} EV_S_SETDESIREDDIRECTION; } EV_S_SETDESIREDDIRECTION;
@@ -133,9 +134,9 @@ typedef struct
typedef struct typedef struct
{ {
UINT16 usSoldierID;
UINT32 uiUniqueId; UINT32 uiUniqueId;
INT32 sTargetGridNo; INT32 sTargetGridNo;
SoldierID usSoldierID;
INT8 bTargetLevel; INT8 bTargetLevel;
INT8 bTargetCubeLevel; INT8 bTargetCubeLevel;
} EV_S_BEGINFIREWEAPON; } EV_S_BEGINFIREWEAPON;
@@ -143,17 +144,19 @@ typedef struct
typedef struct typedef struct
{ {
UINT16 usSoldierID;
UINT32 uiUniqueId; UINT32 uiUniqueId;
INT32 sTargetGridNo; INT32 sTargetGridNo;
SoldierID usSoldierID;
INT8 bTargetLevel; INT8 bTargetLevel;
INT8 bTargetCubeLevel; INT8 bTargetCubeLevel;
} EV_S_FIREWEAPON; } EV_S_FIREWEAPON;
typedef struct typedef struct
{ {
UINT16 usSoldierID;
UINT32 uiUniqueId; UINT32 uiUniqueId;
INT32 iBullet;
SoldierID usSoldierID;
SoldierID ubAttackerID;
UINT16 usWeaponIndex; UINT16 usWeaponIndex;
INT16 sDamage; INT16 sDamage;
INT16 sBreathLoss; INT16 sBreathLoss;
@@ -162,26 +165,24 @@ typedef struct
INT16 sYPos; INT16 sYPos;
INT16 sZPos; INT16 sZPos;
INT16 sRange; INT16 sRange;
UINT16 ubAttackerID;
BOOLEAN fHit; BOOLEAN fHit;
UINT8 ubSpecial; UINT8 ubSpecial;
UINT8 ubLocation; UINT8 ubLocation;
INT32 iBullet;
BOOLEAN fStopped; BOOLEAN fStopped;
} EV_S_WEAPONHIT; } EV_S_WEAPONHIT;
typedef struct typedef struct
{ {
INT32 iImpact;
INT32 iBullet;
INT16 sXPos; INT16 sXPos;
INT16 sYPos; INT16 sYPos;
INT16 sZPos; INT16 sZPos;
UINT16 usWeaponIndex; UINT16 usWeaponIndex;
INT16 bWeaponStatus; INT16 bWeaponStatus;
UINT16 ubAttackerID; SoldierID ubAttackerID;
UINT16 usStructureID; UINT16 usStructureID;
INT32 iImpact;
INT32 iBullet;
BOOLEAN fStopped;//hayden BOOLEAN fStopped;//hayden
} EV_S_STRUCTUREHIT; } EV_S_STRUCTUREHIT;
@@ -189,23 +190,23 @@ typedef struct
typedef struct typedef struct
{ {
INT32 sGridNo; INT32 sGridNo;
INT32 iBullet;
UINT16 usStructureID; UINT16 usStructureID;
BOOLEAN fBlowWindowSouth; BOOLEAN fBlowWindowSouth;
BOOLEAN fLargeForce; BOOLEAN fLargeForce;
UINT16 ubAttackerID; SoldierID ubAttackerID;
INT32 iBullet;
} EV_S_WINDOWHIT; } EV_S_WINDOWHIT;
typedef struct typedef struct
{ {
UINT16 ubAttackerID;
INT32 iBullet; INT32 iBullet;
SoldierID ubAttackerID;
} EV_S_MISS; } EV_S_MISS;
typedef struct typedef struct
{ {
UINT16 ubNoiseMaker;
INT32 sGridNo; INT32 sGridNo;
SoldierID ubNoiseMaker;
UINT8 bLevel; UINT8 bLevel;
UINT8 ubTerrType; UINT8 ubTerrType;
UINT8 ubVolume; UINT8 ubVolume;
@@ -216,12 +217,12 @@ typedef struct
typedef struct typedef struct
{ {
UINT16 usSoldierID;
UINT32 uiUniqueId; UINT32 uiUniqueId;
UINT8 ubDirection;
INT32 sGridNo; INT32 sGridNo;
SoldierID usSoldierID;
INT16 sXPos; INT16 sXPos;
INT16 sYPos; INT16 sYPos;
UINT8 ubDirection;
BOOLEAN fset; BOOLEAN fset;
} EV_S_STOP_MERC; } EV_S_STOP_MERC;
@@ -230,7 +231,7 @@ typedef struct
typedef struct typedef struct
{ {
UINT16 usSoldierID; SoldierID usSoldierID;
// UINT32 uiUniqueId; // UINT32 uiUniqueId;
UINT16 usPathDataSize; // Size of Path UINT16 usPathDataSize; // Size of Path
INT32 sAtGridNo; // Owner merc is at this tile when sending packet INT32 sAtGridNo; // Owner merc is at this tile when sending packet
@@ -242,15 +243,14 @@ typedef struct
// INT8 bBreath; // current breath value // INT8 bBreath; // current breath value
// INT8 bDesiredDirection; // INT8 bDesiredDirection;
// maybe send current action & breath points // maybe send current action & breath points
} EV_S_SENDPATHTONETWORK; } EV_S_SENDPATHTONETWORK;
typedef struct typedef struct
{ {
UINT16 usSoldierID;
//UINT32 uiUniqueId;
INT32 sAtGridNo; // Owner merc is at this tile when sending packet INT32 sAtGridNo; // Owner merc is at this tile when sending packet
SoldierID usSoldierID;
//UINT32 uiUniqueId;
INT8 bActionPoints; // current A.P. value INT8 bActionPoints; // current A.P. value
INT8 bBreath; // current breath value INT8 bBreath; // current breath value
//hayden //hayden