- eliminated PANEL_SPRITEp

This commit is contained in:
Christoph Oelckers 2021-12-31 15:03:12 +01:00
parent 994a575435
commit 6b50344417
4 changed files with 18 additions and 19 deletions

View file

@ -374,7 +374,6 @@ typedef struct STATEstruct STATE, *STATEp, * *STATEpp;
//typedef struct PIC_STATEstruct PIC_STATE, *PIC_STATEp; //typedef struct PIC_STATEstruct PIC_STATE, *PIC_STATEp;
struct PANEL_STATE; struct PANEL_STATE;
typedef struct PANEL_STATE *PANEL_STATEp;
struct PLAYERstruct; struct PLAYERstruct;
typedef struct PLAYERstruct PLAYER, *PLAYERp; typedef struct PLAYERstruct PLAYER, *PLAYERp;

View file

@ -67,7 +67,7 @@ typedef struct
{ {
short xoff, yoff, skip; short xoff, yoff, skip;
int lo_jump_speed, hi_jump_speed, lo_xspeed, hi_xspeed; int lo_jump_speed, hi_jump_speed, lo_xspeed, hi_xspeed;
PANEL_STATEp state[2]; PANEL_STATE* state[2];
} PANEL_SHRAP, *PANEL_SHRAPp; } PANEL_SHRAP, *PANEL_SHRAPp;
void PanelInvTestSuicide(PANEL_SPRITEp psp); void PanelInvTestSuicide(PANEL_SPRITEp psp);
@ -78,7 +78,7 @@ void pWeaponBob(PANEL_SPRITEp psp, short condition);
void pSuicide(PANEL_SPRITEp psp); void pSuicide(PANEL_SPRITEp psp);
void pNextState(PANEL_SPRITEp psp); void pNextState(PANEL_SPRITEp psp);
void pStatePlusOne(PANEL_SPRITEp psp); void pStatePlusOne(PANEL_SPRITEp psp);
void pSetState(PANEL_SPRITEp psp, PANEL_STATEp panel_state); void pSetState(PANEL_SPRITEp psp, PANEL_STATE* panel_state);
void pStateControl(PANEL_SPRITEp psp); void pStateControl(PANEL_SPRITEp psp);
int DoPanelFall(PANEL_SPRITEp psp); int DoPanelFall(PANEL_SPRITEp psp);
@ -88,8 +88,8 @@ int DoBeginPanelJump(PANEL_SPRITEp psp);
void SpawnHeartBlood(PANEL_SPRITEp psp); void SpawnHeartBlood(PANEL_SPRITEp psp);
void SpawnUziShell(PANEL_SPRITEp psp); void SpawnUziShell(PANEL_SPRITEp psp);
bool pWeaponUnHideKeys(PANEL_SPRITEp psp, PANEL_STATEp state); bool pWeaponUnHideKeys(PANEL_SPRITEp psp, PANEL_STATE* state);
bool pWeaponHideKeys(PANEL_SPRITEp psp, PANEL_STATEp state); bool pWeaponHideKeys(PANEL_SPRITEp psp, PANEL_STATE* state);
void pHotHeadOverlays(PANEL_SPRITEp psp, short mode); void pHotHeadOverlays(PANEL_SPRITEp psp, short mode);
uint8_t UziRecoilYadj = 0; uint8_t UziRecoilYadj = 0;
@ -3441,21 +3441,21 @@ PANEL_STATE ps_HotheadTurnNapalm[] =
}; };
PANEL_STATEp HotheadAttackStates[] = PANEL_STATE* HotheadAttackStates[] =
{ {
ps_HotheadAttack, ps_HotheadAttack,
ps_HotheadRing, ps_HotheadRing,
ps_HotheadNapalm ps_HotheadNapalm
}; };
PANEL_STATEp HotheadRestStates[] = PANEL_STATE* HotheadRestStates[] =
{ {
ps_HotheadRest, ps_HotheadRest,
ps_HotheadRestRing, ps_HotheadRestRing,
ps_HotheadRestNapalm ps_HotheadRestNapalm
}; };
PANEL_STATEp HotheadTurnStates[] = PANEL_STATE* HotheadTurnStates[] =
{ {
ps_HotheadTurn, ps_HotheadTurn,
ps_HotheadTurnRing, ps_HotheadTurnRing,
@ -5338,7 +5338,7 @@ PANEL_STATE ps_ChopsAttack4[] =
{ID_ChopsRest, Chops_REST_RATE, pChopsDown, &ps_ChopsAttack4[6], 0,0,0}, {ID_ChopsRest, Chops_REST_RATE, pChopsDown, &ps_ChopsAttack4[6], 0,0,0},
}; };
PANEL_STATEp psp_ChopsAttack[] = {ps_ChopsAttack1, ps_ChopsAttack2, ps_ChopsAttack3, ps_ChopsAttack4}; PANEL_STATE* psp_ChopsAttack[] = {ps_ChopsAttack1, ps_ChopsAttack2, ps_ChopsAttack3, ps_ChopsAttack4};
PANEL_STATE ps_ChopsWait[] = PANEL_STATE ps_ChopsWait[] =
{ {
@ -6116,7 +6116,7 @@ void pWeaponForceRest(PLAYERp pp)
pSetState(pp->CurWpn, pp->CurWpn->RestState); pSetState(pp->CurWpn, pp->CurWpn->RestState);
} }
bool pWeaponUnHideKeys(PANEL_SPRITEp psp, PANEL_STATEp state) bool pWeaponUnHideKeys(PANEL_SPRITEp psp, PANEL_STATE* state)
{ {
// initing the other weapon will take care of this // initing the other weapon will take care of this
if (psp->flags & (PANF_DEATH_HIDE)) if (psp->flags & (PANF_DEATH_HIDE))
@ -6163,7 +6163,7 @@ bool pWeaponUnHideKeys(PANEL_SPRITEp psp, PANEL_STATEp state)
return false; return false;
} }
bool pWeaponHideKeys(PANEL_SPRITEp psp, PANEL_STATEp state) bool pWeaponHideKeys(PANEL_SPRITEp psp, PANEL_STATE* state)
{ {
if (psp->PlayerP->Flags & (PF_DEAD)) if (psp->PlayerP->Flags & (PF_DEAD))
{ {
@ -6240,7 +6240,7 @@ void InsertPanelSprite(PLAYERp pp, PANEL_SPRITEp psp)
} }
PANEL_SPRITEp pSpawnSprite(PLAYERp pp, PANEL_STATEp state, uint8_t priority, double x, double y) PANEL_SPRITEp pSpawnSprite(PLAYERp pp, PANEL_STATE* state, uint8_t priority, double x, double y)
{ {
unsigned i; unsigned i;
PANEL_SPRITEp psp; PANEL_SPRITEp psp;
@ -6681,7 +6681,7 @@ void pSpriteControl(PLAYERp pp)
} }
} }
void pSetState(PANEL_SPRITEp psp, PANEL_STATEp panel_state) void pSetState(PANEL_SPRITEp psp, PANEL_STATE* panel_state)
{ {
PRODUCTION_ASSERT(psp); PRODUCTION_ASSERT(psp);
psp->tics = 0; psp->tics = 0;

View file

@ -61,7 +61,7 @@ struct PANEL_STATE
short picndx; // for pip stuff in conpic.h short picndx; // for pip stuff in conpic.h
int tics; int tics;
void (*Animator)(PANEL_SPRITEp); // JBF: return type was long void (*Animator)(PANEL_SPRITEp); // JBF: return type was long
PANEL_STATEp NextState; PANEL_STATE* NextState;
uint32_t flags; uint32_t flags;
uint8_t xvel; uint8_t xvel;
uint8_t yvel; uint8_t yvel;
@ -97,7 +97,7 @@ typedef void (*PANEL_SPRITE_FUNCp)(PANEL_SPRITEp);
struct PANEL_SPRITE_OVERLAY struct PANEL_SPRITE_OVERLAY
{ {
PANEL_STATEp State; PANEL_STATE* State;
int flags; int flags;
short tics; short tics;
short pic; short pic;
@ -109,7 +109,7 @@ struct PANEL_SPRITE
{ {
PANEL_SPRITE* Next, * Prev; PANEL_SPRITE* Next, * Prev;
PANEL_SPRITE* sibling; PANEL_SPRITE* sibling;
PANEL_STATEp State, RetractState, PresentState, ActionState, RestState; PANEL_STATE* State, *RetractState, *PresentState, *ActionState, *RestState;
PLAYERp PlayerP; PLAYERp PlayerP;
DVector2 pos, opos, bobpos; DVector2 pos, opos, bobpos;
@ -142,7 +142,7 @@ struct PANEL_SPRITE
struct PANEL_STATE_TABLE struct PANEL_STATE_TABLE
{ {
PANEL_STATEp pstate; PANEL_STATE* pstate;
short state_size; short state_size;
}; };
@ -191,7 +191,7 @@ enum
}; };
PANEL_SPRITEp pSpawnSprite(PLAYERp pp, PANEL_STATEp state, uint8_t priority, double x, double y); PANEL_SPRITEp pSpawnSprite(PLAYERp pp, PANEL_STATE* state, uint8_t priority, double x, double y);
void pSetSuicide(PANEL_SPRITEp psp); void pSetSuicide(PANEL_SPRITEp psp);
bool pKillScreenSpiteIDs(PLAYERp pp, short id); bool pKillScreenSpiteIDs(PLAYERp pp, short id);
void PreUpdatePanel(double smoothratio); void PreUpdatePanel(double smoothratio);

View file

@ -167,7 +167,7 @@ FSerializer& SerializeCodePtr(FSerializer& arc, const char* keyname, void** w)
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
FSerializer& Serialize(FSerializer& arc, const char* keyname, PANEL_STATEp& w, PANEL_STATEp* def) FSerializer& Serialize(FSerializer& arc, const char* keyname, PANEL_STATE*& w, PANEL_STATE** def)
{ {
return SerializeDataPtr(arc, keyname, *(void**)&w, sizeof(PANEL_STATE)); return SerializeDataPtr(arc, keyname, *(void**)&w, sizeof(PANEL_STATE));
} }