- SW: Eliminated ANIMATORp typedef.

This commit is contained in:
Mitchell Richters 2022-01-01 09:09:34 +11:00
parent 1d51903a9e
commit 1c0ba71c69
7 changed files with 16 additions and 18 deletions

View file

@ -43,7 +43,7 @@ BEGIN_SW_NS
ANIMATOR InitActorRunToward; ANIMATOR InitActorRunToward;
bool DropAhead(DSWActor* actor, int min_height); bool DropAhead(DSWActor* actor, int min_height);
ANIMATORp ChooseAction(DECISION decision[]); ANIMATOR* ChooseAction(DECISION decision[]);
#define CHOOSE2(value) (RANDOM_P2(1024) < (value)) #define CHOOSE2(value) (RANDOM_P2(1024) < (value))
@ -130,7 +130,7 @@ void DoActorSetSpeed(DSWActor* actor, uint8_t speed)
goro.c etc. goro.c etc.
*/ */
ANIMATORp ChooseAction(DECISION decision[]) ANIMATOR* ChooseAction(DECISION decision[])
{ {
// !JIM! Here is an opportunity for some AI, instead of randomness! // !JIM! Here is an opportunity for some AI, instead of randomness!
int random_value = RANDOM_P2(1024<<5)>>5; int random_value = RANDOM_P2(1024<<5)>>5;
@ -163,7 +163,7 @@ int ChooseActionNumber(int16_t decision[])
} }
} }
int DoActorNoise(ANIMATORp Action, DSWActor* actor) int DoActorNoise(ANIMATOR* Action, DSWActor* actor)
{ {
if (Action == InitActorAmbientNoise) if (Action == InitActorAmbientNoise)
{ {
@ -473,10 +473,10 @@ DECISION GenericFlaming[] =
do anymore and then this routine is called again. do anymore and then this routine is called again.
*/ */
ANIMATORp DoActorActionDecide(DSWActor* actor) ANIMATOR* DoActorActionDecide(DSWActor* actor)
{ {
int dist; int dist;
ANIMATORp action; ANIMATOR* action;
bool ICanSee=false; bool ICanSee=false;
// REMINDER: This function is not even called if SpriteControl doesn't let // REMINDER: This function is not even called if SpriteControl doesn't let
@ -655,7 +655,7 @@ int InitActorDecide(DSWActor* actor)
int DoActorDecide(DSWActor* actor) int DoActorDecide(DSWActor* actor)
{ {
ANIMATORp actor_action; ANIMATOR* actor_action;
// See what to do next // See what to do next
actor_action = DoActorActionDecide(actor); actor_action = DoActorActionDecide(actor);

View file

@ -33,7 +33,7 @@ BEGIN_SW_NS
struct DECISION struct DECISION
{ {
int range; int range;
ANIMATORp action; ANIMATOR* action;
}; };
// Personality structure // Personality structure

View file

@ -373,11 +373,9 @@ struct ATTRIBUTE;
struct SECTOR_OBJECT; struct SECTOR_OBJECT;
struct PANEL_SPRITE; struct PANEL_SPRITE;
struct ANIM; struct ANIM;
class DSWActor; class DSWActor;
typedef int ANIMATOR (DSWActor* actor);
typedef ANIMATOR *ANIMATORp;
typedef int ANIMATOR (DSWActor* actor);
typedef void pANIMATOR (PANEL_SPRITE*); typedef void pANIMATOR (PANEL_SPRITE*);
typedef void (*soANIMATORp) (SECTOR_OBJECT*); typedef void (*soANIMATORp) (SECTOR_OBJECT*);
@ -385,7 +383,7 @@ struct STATE
{ {
short Pic; short Pic;
int Tics; int Tics;
ANIMATORp Animator; ANIMATOR* Animator;
STATE* NextState; STATE* NextState;
}; };
@ -919,7 +917,7 @@ struct USER
STATE* StateEnd; STATE* StateEnd;
STATE* *StateFallOverride; // a bit kludgy - override std fall state STATE* *StateFallOverride; // a bit kludgy - override std fall state
ANIMATORp ActorActionFunc; ANIMATOR* ActorActionFunc;
ACTOR_ACTION_SET* ActorActionSet; ACTOR_ACTION_SET* ActorActionSet;
PERSONALITY* Personality; PERSONALITY* Personality;
ATTRIBUTE* Attrib; ATTRIBUTE* Attrib;

View file

@ -38,7 +38,7 @@ void PlaceSectorObjectsOnTracks(void);
void PlaceActorsOnTracks(void); void PlaceActorsOnTracks(void);
void SetupSectorObject(sectortype* sect, short tag); void SetupSectorObject(sectortype* sect, short tag);
void PostSetupSectorObject(void); void PostSetupSectorObject(void);
void VehicleSetSmoke(SECTOR_OBJECT* sop, ANIMATORp animator); void VehicleSetSmoke(SECTOR_OBJECT* sop, ANIMATOR* animator);
void CollapseSectorObject(SECTOR_OBJECT* sop, int nx, int ny); void CollapseSectorObject(SECTOR_OBJECT* sop, int nx, int ny);
void KillSectorObjectSprites(SECTOR_OBJECT* sop); void KillSectorObjectSprites(SECTOR_OBJECT* sop);
void MoveSectorObjects(SECTOR_OBJECT* sop, short locktics); void MoveSectorObjects(SECTOR_OBJECT* sop, short locktics);

View file

@ -2628,7 +2628,7 @@ void PlaceSectorObject(SECTOR_OBJECT* sop, int newx, int newy)
RefreshPoints(sop, newx - sop->xmid, newy - sop->ymid, false); RefreshPoints(sop, newx - sop->xmid, newy - sop->ymid, false);
} }
void VehicleSetSmoke(SECTOR_OBJECT* sop, ANIMATORp animator) void VehicleSetSmoke(SECTOR_OBJECT* sop, ANIMATOR* animator)
{ {
sectortype* *sectp; sectortype* *sectp;

View file

@ -55,7 +55,7 @@ struct MISSILE_PLACEMENT
void SpawnZombie2(DSWActor*); void SpawnZombie2(DSWActor*);
Collision move_ground_missile(DSWActor* actor, int xchange, int ychange, int ceildist, int flordist, uint32_t cliptype, int numtics); Collision move_ground_missile(DSWActor* actor, int xchange, int ychange, int ceildist, int flordist, uint32_t cliptype, int numtics);
void DoPlayerBeginDie(PLAYER*); void DoPlayerBeginDie(PLAYER*);
void VehicleSetSmoke(SECTOR_OBJECT* sop, ANIMATORp animator); void VehicleSetSmoke(SECTOR_OBJECT* sop, ANIMATOR* animator);
ANIMATOR DoBettyBeginDeath; ANIMATOR DoBettyBeginDeath;
ANIMATOR DoSkullBeginDeath; ANIMATOR DoSkullBeginDeath;
ANIMATOR DoRipperGrow; ANIMATOR DoRipperGrow;
@ -11060,7 +11060,7 @@ int DoMirv(DSWActor* actor)
return false; return false;
} }
bool MissileSetPos(DSWActor* actor, ANIMATORp DoWeapon, int dist) bool MissileSetPos(DSWActor* actor, ANIMATOR* DoWeapon, int dist)
{ {
int oldvel, oldzvel; int oldvel, oldzvel;
int oldxc, oldyc, oldzc; int oldxc, oldyc, oldzc;
@ -11101,7 +11101,7 @@ bool MissileSetPos(DSWActor* actor, ANIMATORp DoWeapon, int dist)
return retval; return retval;
} }
bool TestMissileSetPos(DSWActor* actor, ANIMATORp DoWeapon, int dist, int zvel) bool TestMissileSetPos(DSWActor* actor, ANIMATOR* DoWeapon, int dist, int zvel)
{ {
int oldvel, oldzvel; int oldvel, oldzvel;
int oldxc, oldyc, oldzc; int oldxc, oldyc, oldzc;

View file

@ -96,7 +96,7 @@ void SpawnGrenadeExp(DSWActor*);
DSWActor* SpawnSectorExp(DSWActor*); DSWActor* SpawnSectorExp(DSWActor*);
int DoShrapVelocity(DSWActor*); int DoShrapVelocity(DSWActor*);
int ShrapKillSprite(DSWActor*); int ShrapKillSprite(DSWActor*);
bool MissileSetPos(DSWActor*,ANIMATORp DoWeapon,int dist); bool MissileSetPos(DSWActor*,ANIMATOR* DoWeapon,int dist);
int ActorPain(DSWActor*); int ActorPain(DSWActor*);
int SpawnBreakFlames(DSWActor*); int SpawnBreakFlames(DSWActor*);
bool PlayerTakeDamage(PLAYER* pp, DSWActor* weapActor); bool PlayerTakeDamage(PLAYER* pp, DSWActor* weapActor);