Skip to content

Commit

Permalink
- remove C-style struct parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Aug 10, 2022
1 parent f24b4c8 commit fb815a6
Show file tree
Hide file tree
Showing 20 changed files with 63 additions and 63 deletions.
6 changes: 3 additions & 3 deletions source/games/duke/src/actors.cpp
Expand Up @@ -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;

Expand All @@ -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)
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion source/games/duke/src/actors_d.cpp
Expand Up @@ -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 )
{
Expand Down
2 changes: 1 addition & 1 deletion source/games/duke/src/actors_lava.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion source/games/duke/src/actors_r.cpp
Expand Up @@ -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)
Expand Down
16 changes: 8 additions & 8 deletions source/games/duke/src/dispatch.cpp
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions source/games/duke/src/duke3d.h
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
20 changes: 10 additions & 10 deletions source/games/duke/src/funct.h
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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*);
Expand All @@ -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);
Expand All @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions source/games/duke/src/game_misc.cpp
Expand Up @@ -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 };
}

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion source/games/duke/src/hudweapon_d.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion source/games/duke/src/input.cpp
Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions source/games/duke/src/player.cpp
Expand Up @@ -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;
Expand All @@ -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));

Expand Down Expand Up @@ -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{};

Expand Down
8 changes: 4 additions & 4 deletions source/games/duke/src/player_d.cpp
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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();
Expand Down
14 changes: 7 additions & 7 deletions source/games/duke/src/player_r.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -4040,7 +4040,7 @@ void processinput_r(int snum)
//
//---------------------------------------------------------------------------

void OnMotorcycle(struct player_struct *p, DDukeActor* motosprite)
void OnMotorcycle(player_struct *p, DDukeActor* motosprite)
{
if (!p->OnMotorcycle && !(p->cursector->lotag == 2))
{
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions source/games/duke/src/player_w.cpp
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions source/games/duke/src/prediction.cpp
Expand Up @@ -68,7 +68,7 @@ void resetmys()
void fakedomovethingscorrect(void)
{
int i;
struct player_struct *p;
player_struct* p;

if (numplayers < 2) return;

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit fb815a6

Please sign in to comment.