- the last batch of small scale typedefs eliminated.

This commit is contained in:
Christoph Oelckers 2021-12-31 15:40:29 +01:00
parent 87d2b3274b
commit 72962cc098
9 changed files with 37 additions and 48 deletions

View file

@ -37,7 +37,7 @@ struct DECISION
};
// Personality structure
struct PERSONALITYstruct
struct PERSONALITY
{
DECISION* Battle;
DECISION* Offense;
@ -51,15 +51,14 @@ struct PERSONALITYstruct
enum ActorStates { SLOW_SPEED, NORM_SPEED, MID_SPEED, FAST_SPEED, MAX_SPEED};
#define MAXATTRIBSNDS 11
typedef enum
enum ATTRIB_SNDS
{
attr_ambient, attr_alert, attr_attack, attr_pain, attr_die,
attr_extra1, attr_extra2, attr_extra3,attr_extra4,attr_extra5,
attr_extra6
} ATTRIB_SNDS;
attr_extra6, MAXATTRIBSNDS
};
struct ATTRIBUTEstruct
struct ATTRIBUTE
{
int16_t Speed[MAX_SPEED];
int8_t TicAdjust[MAX_SPEED];

View file

@ -34,11 +34,11 @@ BEGIN_SW_NS
// BOT DEFINITIONS AND STRUCTURES
typedef enum
enum BOT_Actions
{
BOTstand, BOThide, BOTrun, BOTduck, BOTjump, BOTstrafe, BOTshoot, BOTuseinv,
BOTopen, BOTswimup, BOTswimdown, BOTturn, BOTuserts
} BOT_Actions;
};
// Linked lists containing node trees that are chosen based on desired actions

View file

@ -370,7 +370,7 @@ ACTOR_ACTION_SET CoolieActionSet =
};
// later. This is used by multiple enemies.
void EnemyDefaults(DSWActor* actor, ACTOR_ACTION_SET* action, PERSONALITYp person)
void EnemyDefaults(DSWActor* actor, ACTOR_ACTION_SET* action, PERSONALITY* person)
{
unsigned int wpn;
int wpn_cnt;

View file

@ -63,7 +63,7 @@ constexpr int BIT(int shift)
return 1 << shift;
}
typedef struct
struct GAME_SET
{
// Net Options from Menus
uint8_t NetGameType; // 0=DeathMatch [spawn], 1=Cooperative 2=DeathMatch [no spawn]
@ -75,7 +75,7 @@ typedef struct
uint8_t NetTimeLimit; // Limit time of game
uint8_t NetColor; // Chosen color for player
bool NetNuke;
} GAME_SET, * GAME_SETp;
};
extern const GAME_SET gs_defaults;
extern GAME_SET gs;
@ -340,8 +340,6 @@ enum Dir8
NW = ORD_NW * DEGREE_45,
};
typedef enum Dir8 DIR8;
// Auto building enumerations
#define DIGI_ENUM
@ -367,22 +365,16 @@ enum dam
// Forward declarations
struct STATEstruct;
typedef struct STATEstruct STATE, *STATEp, * *STATEpp;
//struct PIC_STATEstruct;
//typedef struct PIC_STATEstruct PIC_STATE, *PIC_STATEp;
struct STATE;
typedef STATE* STATEp;
struct PANEL_STATE;
struct PLAYERstruct;
typedef struct PLAYERstruct PLAYER, *PLAYERp;
struct PERSONALITYstruct;
typedef struct PERSONALITYstruct PERSONALITY, *PERSONALITYp;
struct ATTRIBUTEstruct;
typedef struct ATTRIBUTEstruct ATTRIBUTE, *ATTRIBUTEp;
struct PERSONALITY;
struct ATTRIBUTE;
struct SECTOR_OBJECTstruct;
typedef struct SECTOR_OBJECTstruct SECTOR_OBJECT, *SECTOR_OBJECTp;
@ -400,13 +392,12 @@ typedef ANIMATOR *ANIMATORp;
typedef void pANIMATOR (PANEL_SPRITEp);
typedef pANIMATOR *pANIMATORp;
typedef void soANIMATOR (SECTOR_OBJECTp);
typedef soANIMATOR *soANIMATORp;
typedef void (*soANIMATORp) (SECTOR_OBJECTp);
typedef sectortype SECTOR, *SECTORp;
typedef walltype WALL, *WALLp;
struct STATEstruct
struct STATE
{
short Pic;
int Tics;
@ -432,7 +423,8 @@ enum
// Jim's MISC declarations from other files
///////////////////////////////////////////////////////////////////////////////
typedef enum {WATER_FOOT, BLOOD_FOOT} FOOT_TYPE;
enum FOOT_TYPE
{WATER_FOOT, BLOOD_FOOT};
extern FOOT_TYPE FootMode;
ANIMATOR QueueFloorBlood; // Weapon.c
@ -483,7 +475,7 @@ enum
};
//#define WEAP_ENTRY(id, init_func, damage_lo, damage_hi, radius)
typedef struct
struct DAMAGE_DATA
{
void (*Init)(PLAYERp);
int16_t damage_lo;
@ -494,7 +486,7 @@ typedef struct
int16_t with_weapon;
int16_t weapon_pickup;
int16_t ammo_pickup;
} DAMAGE_DATA, *DAMAGE_DATAp;
};
extern DAMAGE_DATA DamageData[];
@ -589,14 +581,14 @@ typedef void (*PLAYER_ACTION_FUNCp)(PLAYERp);
#include "inv.h"
typedef struct
struct REMOTE_CONTROL
{
sectortype* cursectp, * lastcursectp;
int pang;
vec2_t vect, ovect, slide_vect;
vec3_t pos;
SECTOR_OBJECTp sop_control;
} REMOTE_CONTROL, *REMOTE_CONTROLp;
};
struct PLAYERstruct
{
@ -945,8 +937,8 @@ struct USER
ANIMATORp ActorActionFunc;
ACTOR_ACTION_SET* ActorActionSet;
PERSONALITYp Personality;
ATTRIBUTEp Attrib;
PERSONALITY* Personality;
ATTRIBUTE* Attrib;
SECTOR_OBJECTp sop_parent; // denotes that this sprite is a part of the
// sector object - contains info for the SO
@ -1682,7 +1674,7 @@ int AnimSet(int animtype, sectortype* animindex, int thegoal, int thevel)
short AnimSetCallback(short anim_ndx, ANIM_CALLBACKp call, SECTOR_OBJECTp data);
short AnimSetVelAdj(short anim_ndx, short vel_adj);
void EnemyDefaults(DSWActor* actor, ACTOR_ACTION_SET* action, PERSONALITYp person);
void EnemyDefaults(DSWActor* actor, ACTOR_ACTION_SET* action, PERSONALITY* person);
void getzrangepoint(int x, int y, int z, sectortype* sect, int32_t* ceilz, Collision* ceilhit, int32_t* florz, Collision* florhit);
Collision move_sprite(DSWActor* , int xchange, int ychange, int zchange, int ceildist, int flordist, uint32_t cliptype, int numtics);

View file

@ -32,23 +32,22 @@ BEGIN_SW_NS
/********************************************************************/
typedef
struct List
struct List
{
struct List *Next;
struct List *Prev;
} LISTHEAD, *LIST;
};
inline void INITLIST(void* listp)
{
LIST list = (LIST)listp;
List* list = (List*)listp;
list->Prev = list->Next = list;
}
inline void INSERT(void* listp, void* nodepp)
{
LIST list = (LIST)listp;
LIST nodep = (LIST)nodepp;
List* list = (List*)listp;
List* nodep = (List*)nodepp;
nodep->Prev = list;
nodep->Next = list->Next;
list->Next = nodep;
@ -63,7 +62,7 @@ inline void REMOVE(PANEL_SPRITEp nodep)
inline bool EMPTY(void* listp)
{
LIST list = (LIST)listp;
List* list = (List*)listp;
return list->Next == list;
}

View file

@ -6218,7 +6218,7 @@ void InsertPanelSprite(PLAYERp pp, PANEL_SPRITEp psp)
for (cur = list->Next; nxt = cur->Next, cur != list; cur = nxt)
{
// if the next pointer is the end of the list, insert it
if ((LIST) cur->Next == (LIST) &pp->PanelSpriteList)
if ((List*) cur->Next == (List*) &pp->PanelSpriteList)
{
INSERT(cur, psp);
return;
@ -6296,7 +6296,7 @@ void pClearSpriteList(PLAYERp pp)
PANEL_SPRITEp psp=nullptr, next_psp=nullptr;
auto l = &pp->PanelSpriteList;
for (psp = l->Next; next_psp = psp->Next, (LIST)psp != (LIST)l; psp = next_psp)
for (psp = l->Next; next_psp = psp->Next, (List*)psp != (List*)l; psp = next_psp)
{
if (psp->Next == nullptr || psp->Prev == nullptr) return; // this can happen when cleaning up a fatal error.
pKillSprite(psp);

View file

@ -46,7 +46,6 @@ enum conpic_id
{
#include "conpic.h"
};
typedef enum conpic_id CONPIC_ID;
#undef MAKE_CONPIC_ENUM
enum PanelSpriteIDs

View file

@ -187,12 +187,12 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, ACTOR_ACTION_SET*&
return SerializeDataPtr(arc, keyname, *(void**)&w, sizeof(ACTOR_ACTION_SET));
}
FSerializer& Serialize(FSerializer& arc, const char* keyname, PERSONALITYp& w, PERSONALITYp* def)
FSerializer& Serialize(FSerializer& arc, const char* keyname, PERSONALITY*& w, PERSONALITY** def)
{
return SerializeDataPtr(arc, keyname, *(void**)&w, sizeof(PERSONALITY));
}
FSerializer& Serialize(FSerializer& arc, const char* keyname, ATTRIBUTEp& w, ATTRIBUTEp* def)
FSerializer& Serialize(FSerializer& arc, const char* keyname, ATTRIBUTE*& w, ATTRIBUTE** def)
{
return SerializeDataPtr(arc, keyname, *(void**)&w, sizeof(ATTRIBUTE));
}
@ -219,7 +219,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PANEL_SPRITEp& w,
for (unsigned i = 0; i < MAX_SW_PLAYERS_REG; i++)
{
// special case for pointing to the list head
if ((LIST)w == (LIST)&Player[i].PanelSpriteList)
if ((List*)w == (List*)&Player[i].PanelSpriteList)
{
idx = 1000'0000 + i;
break;

View file

@ -5273,7 +5273,7 @@ int PlayerDamageSlide(PLAYERp pp, int damage, short ang)
int GetDamage(DSWActor* actor, DSWActor* weapActor, int DamageNdx)
{
DAMAGE_DATAp d = &DamageData[DamageNdx];
auto d = &DamageData[DamageNdx];
// if ndx does radius
if (d->radius > 0 && weapActor)