- remove C-style struct parameters.

This commit is contained in:
Christoph Oelckers 2022-02-07 11:04:19 +01:00
parent ef9534d9fa
commit 9392e31b33
20 changed files with 63 additions and 63 deletions

View file

@ -86,7 +86,7 @@ void deletesprite(DDukeActor *const actor)
//
//---------------------------------------------------------------------------
void addammo(int weapon, struct player_struct* player, int amount)
void addammo(int weapon, player_struct* player, int amount)
{
player->ammo_amount[weapon] += amount;
@ -100,7 +100,7 @@ void addammo(int weapon, struct player_struct* player, int amount)
//
//---------------------------------------------------------------------------
void checkavailinven(struct player_struct* player)
void checkavailinven(player_struct* player)
{
if (player->firstaid_amount > 0)
@ -126,7 +126,7 @@ void checkavailinven(struct player_struct* player)
//
//---------------------------------------------------------------------------
void checkavailweapon(struct player_struct* player)
void checkavailweapon(player_struct* player)
{
int i, snum;
int weap;

View file

@ -161,7 +161,7 @@ void check_fta_sounds_d(DDukeActor* actor)
//
//---------------------------------------------------------------------------
void addweapon_d(struct player_struct *p, int weapon)
void addweapon_d(player_struct *p, int weapon)
{
if ( p->gotweapon[weapon] == 0 )
{

View file

@ -441,7 +441,7 @@ void moveminecart(void)
void thunder(void)
{
struct player_struct* p;
player_struct* p;
int r1, r2;
int i = 0;
uint8_t shade;

View file

@ -114,7 +114,7 @@ void check_fta_sounds_r(DDukeActor* actor)
//
//---------------------------------------------------------------------------
void addweapon_r(struct player_struct* p, int weapon)
void addweapon_r(player_struct* p, int weapon)
{
int cw = p->curr_weapon;
if (p->OnMotorcycle || p->OnBoat)

View file

@ -60,8 +60,8 @@ bool ceilingspace_d(sectortype*);
bool ceilingspace_r(sectortype*);
bool floorspace_d(sectortype*);
bool floorspace_r(sectortype*);
void addweapon_d(struct player_struct* p, int weapon);
void addweapon_r(struct player_struct* p, int weapon);
void addweapon_d(player_struct* p, int weapon);
void addweapon_r(player_struct* p, int weapon);
void hitradius_d(DDukeActor* i, int r, int hp1, int hp2, int hp3, int hp4);
void hitradius_r(DDukeActor* i, int r, int hp1, int hp2, int hp3, int hp4);
void lotsofmoney_d(DDukeActor* s, int n);
@ -80,16 +80,16 @@ void respawnhitag_d(DDukeActor* g_sp);
void respawnhitag_r(DDukeActor* g_sp);
void move_d(DDukeActor* i, int g_p, int g_x);
void move_r(DDukeActor* i, int g_p, int g_x);
void incur_damage_d(struct player_struct* p);
void incur_damage_r(struct player_struct* p);
void incur_damage_d(player_struct* p);
void incur_damage_r(player_struct* p);
void shoot_d(DDukeActor* i, int atwith);
void shoot_r(DDukeActor* i, int atwith);
void selectweapon_d(int snum, int j);
void selectweapon_r(int snum, int j);
int doincrements_d(struct player_struct* p);
int doincrements_r(struct player_struct* p);
void checkweapons_d(struct player_struct* p);
void checkweapons_r(struct player_struct* p);
int doincrements_d(player_struct* p);
int doincrements_r(player_struct* p);
void checkweapons_d(player_struct* p);
void checkweapons_r(player_struct* p);
void processinput_d(int snum);
void processinput_r(int snum);
void displayweapon_d(int snum, double smoothratio);

View file

@ -88,7 +88,7 @@ struct Dispatcher
bool (*ceilingspace)(sectortype* sectp);
bool (*floorspace)(sectortype* sectp);
void (*addweapon)(struct player_struct *p, int weapon);
void (*addweapon)(player_struct *p, int weapon);
void (*hitradius)(DDukeActor* i, int r, int hp1, int hp2, int hp3, int hp4);
void (*lotsofmoney)(DDukeActor *s, int n);
void (*lotsofmail)(DDukeActor *s, int n);
@ -101,11 +101,11 @@ struct Dispatcher
void (*move)(DDukeActor* i, int g_p, int g_x);
// player
void (*incur_damage)(struct player_struct* p);
void (*incur_damage)(player_struct* p);
void (*shoot)(DDukeActor*, int);
void (*selectweapon)(int snum, int j);
int (*doincrements)(struct player_struct* p);
void (*checkweapons)(struct player_struct* p);
int (*doincrements)(player_struct* p);
void (*checkweapons)(player_struct* p);
void (*processinput)(int snum);
void (*displayweapon)(int snum, double smoothratio);
void (*displaymasks)(int snum, int p, double smoothratio);

View file

@ -103,9 +103,9 @@ void check_fta_sounds_r(DDukeActor* i);
int dodge(DDukeActor*);
void alterang(int ang, DDukeActor* actor, int g_p);
void fall_common(DDukeActor* actor, int g_p, int JIBS6, int DRONE, int BLOODPOOL, int SHOTSPARK1, int squished, int thud, int(*fallspecial)(DDukeActor*, int));
void checkavailweapon(struct player_struct* p);
void checkavailweapon(player_struct* p);
void deletesprite(DDukeActor* num);
void addammo(int weapon, struct player_struct* p, int amount);
void addammo(int weapon, player_struct* p, int amount);
int ssp(DDukeActor* i, unsigned int cliptype); //The set sprite function
void insertspriteq(DDukeActor *i);
@ -129,10 +129,10 @@ void playerAimUp(int snum, ESyncBits actions);
void playerAimDown(int snum, ESyncBits actions);
void tracers(int x1, int y1, int z1, int x2, int y2, int z2, int n);
DDukeActor* aim(DDukeActor* s, int aang);
void checkweapons(struct player_struct* const p);
void checkweapons(player_struct* const p);
int findotherplayer(int p, int* d);
void quickkill(struct player_struct* p);
int setpal(struct player_struct* p);
void quickkill(player_struct* p);
int setpal(player_struct* p);
int madenoise(int playerNum);
int haskey(sectortype* sect, int snum);
void shootbloodsplat(DDukeActor* i, int p, int sx, int sy, int sz, int sa, int atwith, int BIGFORCE, int OOZFILTER, int NEWBEAST);
@ -158,7 +158,7 @@ int setanimation(sectortype* animsect, int animtype, walltype* animtarget, int t
int setanimation(sectortype* animsect, int animtype, sectortype* animtarget, int thegoal, int thevel);
void dofurniture(walltype* wallNum, sectortype* sectnum, int playerNum);
void dotorch();
int hitawall(struct player_struct* pl, walltype** hitWall);
int hitawall(player_struct* pl, walltype** hitWall);
int hits(DDukeActor* snum);
DDukeActor* LocateTheLocator(int n, sectortype* sectnum);
@ -177,8 +177,8 @@ void ceilingglass(DDukeActor* snum, sectortype* sectnum, int cnt);
void spriteglass(DDukeActor* snum, int cnt);
void lotsofcolourglass(DDukeActor* snum, walltype* wallNum, int cnt);
void lotsofglass(DDukeActor* snum, walltype* wallnum, int cnt);
void checkplayerhurt_d(struct player_struct* p, const Collision& coll);
void checkplayerhurt_r(struct player_struct* p, const Collision& coll);
void checkplayerhurt_d(player_struct* p, const Collision& coll);
void checkplayerhurt_r(player_struct* p, const Collision& coll);
DDukeActor* dospawnsprite(DDukeActor* actj, int pn);
void spriteinit_d(DDukeActor*);
@ -187,7 +187,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>* actors);
void addspritetodelete(int spnum=0);
void checkavailinven(struct player_struct* p);
void checkavailinven(player_struct* p);
bool initspriteforspawn(DDukeActor* spn);
void spawninitdefault(DDukeActor* actj, DDukeActor* act);
void spawntransporter(DDukeActor* actj, DDukeActor* acti, bool beam);
@ -210,7 +210,7 @@ void prelevel_common(int g);
void cacheit_d();
void cacheit_r();
void FTA(int q, struct player_struct* p);
void FTA(int q, player_struct* p);
void OnMotorcycle(player_struct *pl, DDukeActor* snum);
void OffMotorcycle(player_struct *pl);
void OnBoat(player_struct *pl, DDukeActor* snum);

View file

@ -70,7 +70,7 @@ FString GameInterface::GetCoordString()
GameStats GameInterface::getStats()
{
struct player_struct* p = &ps[myconnectindex];
player_struct* p = &ps[myconnectindex];
return { p->actors_killed, p->max_actors_killed, p->secret_rooms, p->max_secret_rooms, p->player_par / REALGAMETICSPERSEC, p->frag };
}
@ -122,7 +122,7 @@ void GameInterface::ExitFromMenu()
//
//---------------------------------------------------------------------------
void FTA(int q, struct player_struct* p)
void FTA(int q, player_struct* p)
{
if (q < 0 || gamestate != GS_LEVEL)
return;
@ -236,7 +236,7 @@ void V_AddBlend (float r, float g, float b, float a, float v_blend[4])
void drawoverlays(double smoothratio)
{
struct player_struct* pp;
player_struct* pp;
int cposx, cposy, cang;
pp = &ps[screenpeek];

View file

@ -205,7 +205,7 @@ void displayweapon_d(int snum, double smoothratio)
int o, pal;
double weapon_sway, weapon_xoffset, gun_pos, looking_arc, kickback_pic, random_club_frame, hard_landing, look_anghalf, horiz16th, plravel;
int8_t shade;
struct player_struct *p;
player_struct* p;
p = &ps[snum];
auto kb = &p->kickback_pic;

View file

@ -60,7 +60,7 @@ void hud_input(int plnum)
{
int i, k;
uint8_t dainv;
struct player_struct* p;
player_struct* p;
p = &ps[plnum];
auto pact = p->GetActor();

View file

@ -78,7 +78,7 @@ void PlayerColorChanged(void)
//
//---------------------------------------------------------------------------
int setpal(struct player_struct* p)
int setpal(player_struct* p)
{
int palette;
if (p->DrugMode) palette = DRUGPAL;
@ -96,7 +96,7 @@ int setpal(struct player_struct* p)
//
//---------------------------------------------------------------------------
void quickkill(struct player_struct* p)
void quickkill(player_struct* p)
{
SetPlayerPal(p, PalEntry(48, 48, 48, 48));
@ -211,7 +211,7 @@ int hitasprite(DDukeActor* actor, DDukeActor** hitsp)
//
//---------------------------------------------------------------------------
int hitawall(struct player_struct* p, walltype** hitw)
int hitawall(player_struct* p, walltype** hitw)
{
HitInfo hit{};

View file

@ -50,7 +50,7 @@ void operateweapon_ww(int snum, ESyncBits actions);
//
//---------------------------------------------------------------------------
void incur_damage_d(struct player_struct* p)
void incur_damage_d(player_struct* p)
{
int damage = 0L, shield_damage = 0L;
@ -1427,7 +1427,7 @@ void selectweapon_d(int snum, int weap) // playernum, weaponnum
//
//---------------------------------------------------------------------------
int doincrements_d(struct player_struct* p)
int doincrements_d(player_struct* p)
{
int snum;
@ -1626,7 +1626,7 @@ int doincrements_d(struct player_struct* p)
//
//---------------------------------------------------------------------------
void checkweapons_d(struct player_struct* p)
void checkweapons_d(player_struct* p)
{
static const uint16_t weapon_sprites[MAX_WEAPONS] = { KNEE, FIRSTGUNSPRITE, SHOTGUNSPRITE,
CHAINGUNSPRITE, RPGSPRITE, HEAVYHBOMB, SHRINKERSPRITE, DEVISTATORSPRITE,
@ -2707,7 +2707,7 @@ void processinput_d(int snum)
Collision chz, clz;
bool shrunk;
int psectlotag;
struct player_struct* p;
player_struct* p;
p = &ps[snum];
auto pact = p->GetActor();

View file

@ -41,7 +41,7 @@ BEGIN_DUKE_NS
//
//---------------------------------------------------------------------------
void incur_damage_r(struct player_struct* p)
void incur_damage_r(player_struct* p)
{
int damage = 0, shield_damage = 0;
int gut = 0;
@ -1229,7 +1229,7 @@ void selectweapon_r(int snum, int weap)
//
//---------------------------------------------------------------------------
int doincrements_r(struct player_struct* p)
int doincrements_r(player_struct* p)
{
int snum;
auto pact = p->GetActor();
@ -1493,7 +1493,7 @@ int doincrements_r(struct player_struct* p)
//
//---------------------------------------------------------------------------
void checkweapons_r(struct player_struct* p)
void checkweapons_r(player_struct* p)
{
static const uint16_t weapon_sprites[MAX_WEAPONS] = { KNEE, FIRSTGUNSPRITE, SHOTGUNSPRITE,
CHAINGUNSPRITE, RPGSPRITE, HEAVYHBOMB, SHRINKERSPRITE, DEVISTATORSPRITE,
@ -4040,7 +4040,7 @@ HORIZONLY:
//
//---------------------------------------------------------------------------
void OnMotorcycle(struct player_struct *p, DDukeActor* motosprite)
void OnMotorcycle(player_struct *p, DDukeActor* motosprite)
{
if (!p->OnMotorcycle && !(p->cursector->lotag == 2))
{
@ -4071,7 +4071,7 @@ void OnMotorcycle(struct player_struct *p, DDukeActor* motosprite)
//
//---------------------------------------------------------------------------
void OffMotorcycle(struct player_struct *p)
void OffMotorcycle(player_struct *p)
{
auto pact = p->GetActor();
if (p->OnMotorcycle)
@ -4120,7 +4120,7 @@ void OffMotorcycle(struct player_struct *p)
//
//---------------------------------------------------------------------------
void OnBoat(struct player_struct *p, DDukeActor* boat)
void OnBoat(player_struct *p, DDukeActor* boat)
{
if (!p->OnBoat)
{
@ -4149,7 +4149,7 @@ void OnBoat(struct player_struct *p, DDukeActor* boat)
//
//---------------------------------------------------------------------------
void OffBoat(struct player_struct *p)
void OffBoat(player_struct *p)
{
if (p->OnBoat)
{

View file

@ -49,7 +49,7 @@ int operateTripbomb(int snum);
//
//---------------------------------------------------------------------------
void DoFire(struct player_struct* p, int snum)
void DoFire(player_struct* p, int snum)
{
int i;
@ -106,7 +106,7 @@ void DoFire(struct player_struct* p, int snum)
//
//---------------------------------------------------------------------------
void DoSpawn(struct player_struct *p, int snum)
void DoSpawn(player_struct *p, int snum)
{
if(!aplWeaponSpawn(p->curr_weapon, snum))
return;

View file

@ -68,7 +68,7 @@ void resetmys()
void fakedomovethingscorrect(void)
{
int i;
struct player_struct *p;
player_struct* p;
if (numplayers < 2) return;
@ -100,7 +100,7 @@ void fakedomovethingscorrect(void)
void fakedomovethings(void)
{
input *syn;
struct player_struct *p;
player_struct* p;
int i, j, k, doubvel, fz, cz, x, y;
Collision clz, chz;
int psect, psectlotag, tempsect, backcstat;

View file

@ -86,7 +86,7 @@ void premapcontroller(DDukeActor* ac)
void pickrandomspot(int snum)
{
struct player_struct *p;
player_struct* p;
int i;
p = &ps[snum];
@ -111,7 +111,7 @@ void pickrandomspot(int snum)
void resetplayerstats(int snum)
{
struct player_struct *p;
player_struct* p;
p = &ps[snum];
@ -298,7 +298,7 @@ void resetplayerstats(int snum)
void resetweapons(int snum)
{
int weapon;
struct player_struct *p;
player_struct* p;
p = &ps[snum];
@ -345,7 +345,7 @@ void resetweapons(int snum)
void resetinventory(int snum)
{
struct player_struct* p;
player_struct* p;
p = &ps[snum];
@ -419,7 +419,7 @@ void resetinventory(int snum)
void resetprestat(int snum,int g)
{
struct player_struct *p;
player_struct* p;
int i;
p = &ps[snum];
@ -992,7 +992,7 @@ static TArray<DDukeActor*> spawnactors(SpawnSpriteDef& sprites)
//
//---------------------------------------------------------------------------
static int LoadTheMap(MapRecord *mi, struct player_struct *p, int gamemode)
static int LoadTheMap(MapRecord *mi, player_struct*p, int gamemode)
{
int16_t lbang;
if (isShareware() && (mi->flags & MI_USERMAP))

View file

@ -408,7 +408,7 @@ void spriteinit_r(DDukeActor* actor, TArray<DDukeActor*>& actors)
void prelevel_r(int g, TArray<DDukeActor*>& actors)
{
struct player_struct* p;
player_struct* p;
int i;
int j;
int lotaglist;

View file

@ -226,7 +226,7 @@ void displayrooms(int snum, double smoothratio, bool sceneonly)
int cposx, cposy, cposz, fz, cz;
binangle cang, rotscrnang;
fixedhoriz choriz;
struct player_struct* p;
player_struct* p;
p = &ps[snum];

View file

@ -884,7 +884,7 @@ void checkhitwall_d(DDukeActor* spr, walltype* wal, int x, int y, int z, int atw
//
//---------------------------------------------------------------------------
void checkplayerhurt_d(struct player_struct* p, const Collision& coll)
void checkplayerhurt_d(player_struct* p, const Collision& coll)
{
if (coll.type == kHitSprite)
{
@ -1501,7 +1501,7 @@ void clearcameras(int i, player_struct* p)
void checksectors_d(int snum)
{
int i = -1, oldz;
struct player_struct* p;
player_struct* p;
walltype* hitscanwall;
HitInfo near;

View file

@ -1366,7 +1366,7 @@ void checkhitwall_r(DDukeActor* spr, walltype* wal, int x, int y, int z, int atw
//
//---------------------------------------------------------------------------
void checkplayerhurt_r(struct player_struct* p, const Collision &coll)
void checkplayerhurt_r(player_struct* p, const Collision &coll)
{
if (coll.type == kHitSprite)
{
@ -2403,7 +2403,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
void checksectors_r(int snum)
{
int oldz;
struct player_struct* p;
player_struct* p;
walltype* hitscanwall;
HitInfo near;