mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-08 00:32:28 +00:00
- eliminated typedefs for DECISION and BREAK_INFO.
This commit is contained in:
parent
3eb640658f
commit
90ad4b8ef1
4 changed files with 31 additions and 31 deletions
|
@ -30,23 +30,23 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
||||||
BEGIN_SW_NS
|
BEGIN_SW_NS
|
||||||
|
|
||||||
// Call functions based on a random range value
|
// Call functions based on a random range value
|
||||||
typedef struct
|
struct DECISION
|
||||||
{
|
{
|
||||||
int range;
|
int range;
|
||||||
ANIMATORp action;
|
ANIMATORp action;
|
||||||
} DECISION, *DECISIONp;
|
};
|
||||||
|
|
||||||
// Personality structure
|
// Personality structure
|
||||||
struct PERSONALITYstruct
|
struct PERSONALITYstruct
|
||||||
{
|
{
|
||||||
DECISIONp Battle;
|
DECISION* Battle;
|
||||||
DECISIONp Offense;
|
DECISION* Offense;
|
||||||
DECISIONp Broadcast;
|
DECISION* Broadcast;
|
||||||
DECISIONp Surprised;
|
DECISION* Surprised;
|
||||||
DECISIONp Evasive;
|
DECISION* Evasive;
|
||||||
DECISIONp LostTarget;
|
DECISION* LostTarget;
|
||||||
DECISIONp CloseRange;
|
DECISION* CloseRange;
|
||||||
DECISIONp TouchTarget;
|
DECISION* TouchTarget;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ActorStates { SLOW_SPEED, NORM_SPEED, MID_SPEED, FAST_SPEED, MAX_SPEED};
|
enum ActorStates { SLOW_SPEED, NORM_SPEED, MID_SPEED, FAST_SPEED, MAX_SPEED};
|
||||||
|
|
|
@ -440,20 +440,20 @@ static int CompareBreakInfo(void const * a, void const * b)
|
||||||
return break_info1->picnum - break_info2->picnum;
|
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
|
// will return a number less than 0 if picnum < break_info->picnum
|
||||||
return(*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);
|
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);
|
break_info = FindWallBreakInfo(wallp->picnum);
|
||||||
if (break_info)
|
if (break_info)
|
||||||
|
@ -490,10 +490,10 @@ BREAK_INFOp SetupWallForBreak(WALLp wallp)
|
||||||
return break_info;
|
return break_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
BREAK_INFOp SetupSpriteForBreak(DSWActor* actor)
|
BREAK_INFO* SetupSpriteForBreak(DSWActor* actor)
|
||||||
{
|
{
|
||||||
int picnum = actor->spr.picnum;
|
int picnum = actor->spr.picnum;
|
||||||
BREAK_INFOp break_info;
|
BREAK_INFO* break_info;
|
||||||
|
|
||||||
// ignore as a breakable if true
|
// ignore as a breakable if true
|
||||||
if (actor->spr.lotag == TAG_SPRITE_HIT_MATCH)
|
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 not blocking then skip this code
|
||||||
if (!(actor->spr.cstat & CSTAT_SPRITE_BLOCK))
|
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)
|
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 nwp;
|
||||||
|
|
||||||
wallp->lotag = 0;
|
wallp->lotag = 0;
|
||||||
|
@ -906,7 +906,7 @@ int UserBreakSprite(DSWActor* breakActor)
|
||||||
|
|
||||||
int AutoBreakSprite(DSWActor* breakActor, int type)
|
int AutoBreakSprite(DSWActor* breakActor, int type)
|
||||||
{
|
{
|
||||||
BREAK_INFOp break_info;
|
BREAK_INFO* break_info;
|
||||||
|
|
||||||
break_info = FindSpriteBreakInfo(breakActor->spr.picnum);
|
break_info = FindSpriteBreakInfo(breakActor->spr.picnum);
|
||||||
|
|
||||||
|
|
|
@ -39,19 +39,19 @@ enum
|
||||||
BF_LEAVE_BREAK = BIT(5),
|
BF_LEAVE_BREAK = BIT(5),
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct BREAK_INFO
|
struct BREAK_INFO
|
||||||
{
|
{
|
||||||
int16_t picnum, breaknum, shrap_type;
|
int16_t picnum, breaknum, shrap_type;
|
||||||
int16_t flags, shrap_amt;
|
int16_t flags, shrap_amt;
|
||||||
} *BREAK_INFOp;
|
};
|
||||||
|
|
||||||
BREAK_INFOp FindWallBreakInfo(int picnum);
|
BREAK_INFO* FindWallBreakInfo(int picnum);
|
||||||
BREAK_INFOp FindSpriteBreakInfo(int picnum);
|
BREAK_INFO* FindSpriteBreakInfo(int picnum);
|
||||||
void SortBreakInfo(void);
|
void SortBreakInfo(void);
|
||||||
BREAK_INFOp SetupWallForBreak(WALLp wallp);
|
BREAK_INFO* SetupWallForBreak(WALLp wallp);
|
||||||
BREAK_INFOp SetupSpriteForBreak(DSWActor* actor);
|
BREAK_INFO* SetupSpriteForBreak(DSWActor* actor);
|
||||||
bool HitBreakWall(WALLp wp, int, int, int, int ang, int type);
|
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);
|
int WallBreakPosition(walltype* wp, sectortype** sectp, int* x, int* y, int* z, int* ang);
|
||||||
void SortBreakInfo(void);
|
void SortBreakInfo(void);
|
||||||
void DoWallBreakMatch(int match);
|
void DoWallBreakMatch(int match);
|
||||||
|
|
|
@ -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;
|
short i;
|
||||||
|
|
||||||
|
@ -18276,7 +18276,7 @@ int ShrapKillSprite(DSWActor* actor)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CheckBreakToughness(BREAK_INFOp break_info, int ID)
|
bool CheckBreakToughness(BREAK_INFO* break_info, int ID)
|
||||||
{
|
{
|
||||||
if ((break_info->flags & BF_TOUGH))
|
if ((break_info->flags & BF_TOUGH))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue