- eliminated typedefs for DECISION and BREAK_INFO.

This commit is contained in:
Christoph Oelckers 2021-12-31 13:16:38 +01:00
parent 3eb640658f
commit 90ad4b8ef1
4 changed files with 31 additions and 31 deletions

View file

@ -30,23 +30,23 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
BEGIN_SW_NS
// Call functions based on a random range value
typedef struct
struct DECISION
{
int range;
ANIMATORp action;
} DECISION, *DECISIONp;
};
// Personality structure
struct PERSONALITYstruct
{
DECISIONp Battle;
DECISIONp Offense;
DECISIONp Broadcast;
DECISIONp Surprised;
DECISIONp Evasive;
DECISIONp LostTarget;
DECISIONp CloseRange;
DECISIONp TouchTarget;
DECISION* Battle;
DECISION* Offense;
DECISION* Broadcast;
DECISION* Surprised;
DECISION* Evasive;
DECISION* LostTarget;
DECISION* CloseRange;
DECISION* TouchTarget;
};
enum ActorStates { SLOW_SPEED, NORM_SPEED, MID_SPEED, FAST_SPEED, MAX_SPEED};

View file

@ -440,20 +440,20 @@ static int CompareBreakInfo(void const * a, void const * b)
return break_info1->picnum - break_info2->picnum;
}
int CompareSearchBreakInfo(int *picnum, BREAK_INFOp break_info)
int CompareSearchBreakInfo(int *picnum, BREAK_INFO* break_info)
{
// will return a number less than 0 if picnum < break_info->picnum
return(*picnum - break_info->picnum);
}
BREAK_INFOp FindWallBreakInfo(int picnum)
BREAK_INFO* FindWallBreakInfo(int picnum)
{
return(BREAK_INFOp)(bsearch(&picnum, &WallBreakInfo, SIZ(WallBreakInfo), sizeof(BREAK_INFO), (int(*)(const void*,const void*))CompareSearchBreakInfo));
return(BREAK_INFO*)(bsearch(&picnum, &WallBreakInfo, SIZ(WallBreakInfo), sizeof(BREAK_INFO), (int(*)(const void*,const void*))CompareSearchBreakInfo));
}
BREAK_INFOp FindSpriteBreakInfo(int picnum)
BREAK_INFO* FindSpriteBreakInfo(int picnum)
{
return(BREAK_INFOp)(bsearch(&picnum, &SpriteBreakInfo, SIZ(SpriteBreakInfo), sizeof(BREAK_INFO), (int(*)(const void*,const void*))CompareSearchBreakInfo));
return(BREAK_INFO*)(bsearch(&picnum, &SpriteBreakInfo, SIZ(SpriteBreakInfo), sizeof(BREAK_INFO), (int(*)(const void*,const void*))CompareSearchBreakInfo));
}
//////////////////////////////////////////////
@ -466,9 +466,9 @@ void SortBreakInfo(void)
qsort(&WallBreakInfo, SIZ(WallBreakInfo), sizeof(BREAK_INFO), CompareBreakInfo);
}
BREAK_INFOp SetupWallForBreak(WALLp wallp)
BREAK_INFO* SetupWallForBreak(WALLp wallp)
{
BREAK_INFOp break_info;
BREAK_INFO* break_info;
break_info = FindWallBreakInfo(wallp->picnum);
if (break_info)
@ -490,10 +490,10 @@ BREAK_INFOp SetupWallForBreak(WALLp wallp)
return break_info;
}
BREAK_INFOp SetupSpriteForBreak(DSWActor* actor)
BREAK_INFO* SetupSpriteForBreak(DSWActor* actor)
{
int picnum = actor->spr.picnum;
BREAK_INFOp break_info;
BREAK_INFO* break_info;
// ignore as a breakable if true
if (actor->spr.lotag == TAG_SPRITE_HIT_MATCH)
@ -509,7 +509,7 @@ BREAK_INFOp SetupSpriteForBreak(DSWActor* actor)
// if not blocking then skip this code
if (!(actor->spr.cstat & CSTAT_SPRITE_BLOCK))
{
return (BREAK_INFOp)(-1);
return (BREAK_INFO*)(-1);
}
}
@ -550,7 +550,7 @@ DSWActor* FindBreakSpriteMatch(int match)
int AutoBreakWall(WALLp wallp, int hit_x, int hit_y, int hit_z, int ang, int type)
{
BREAK_INFOp break_info;
BREAK_INFO* break_info;
WALLp nwp;
wallp->lotag = 0;
@ -906,7 +906,7 @@ int UserBreakSprite(DSWActor* breakActor)
int AutoBreakSprite(DSWActor* breakActor, int type)
{
BREAK_INFOp break_info;
BREAK_INFO* break_info;
break_info = FindSpriteBreakInfo(breakActor->spr.picnum);

View file

@ -39,19 +39,19 @@ enum
BF_LEAVE_BREAK = BIT(5),
};
typedef struct BREAK_INFO
struct BREAK_INFO
{
int16_t picnum, breaknum, shrap_type;
int16_t flags, shrap_amt;
} *BREAK_INFOp;
};
BREAK_INFOp FindWallBreakInfo(int picnum);
BREAK_INFOp FindSpriteBreakInfo(int picnum);
BREAK_INFO* FindWallBreakInfo(int picnum);
BREAK_INFO* FindSpriteBreakInfo(int picnum);
void SortBreakInfo(void);
BREAK_INFOp SetupWallForBreak(WALLp wallp);
BREAK_INFOp SetupSpriteForBreak(DSWActor* actor);
BREAK_INFO* SetupWallForBreak(WALLp wallp);
BREAK_INFO* SetupSpriteForBreak(DSWActor* actor);
bool HitBreakWall(WALLp wp, int, int, int, int ang, int type);
bool CheckBreakToughness(BREAK_INFOp break_info, int ID);
bool CheckBreakToughness(BREAK_INFO* break_info, int ID);
int WallBreakPosition(walltype* wp, sectortype** sectp, int* x, int* y, int* z, int* ang);
void SortBreakInfo(void);
void DoWallBreakMatch(int match);

View file

@ -2818,7 +2818,7 @@ int DoLavaErupt(DSWActor* actor)
}
int SpawnShrap(DSWActor* parentActor, DSWActor* secondaryActor, int means, BREAK_INFOp breakinfo)
int SpawnShrap(DSWActor* parentActor, DSWActor* secondaryActor, int means, BREAK_INFO* breakinfo)
{
short i;
@ -18276,7 +18276,7 @@ int ShrapKillSprite(DSWActor* actor)
return 0;
}
bool CheckBreakToughness(BREAK_INFOp break_info, int ID)
bool CheckBreakToughness(BREAK_INFO* break_info, int ID)
{
if ((break_info->flags & BF_TOUGH))
{