From 6f0e47fde361a989376da65089c8e2c82f8710c5 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Mon, 12 Sep 2022 16:46:40 +0200 Subject: [PATCH] simplify matters again a bit in m_cheat.c --- src/m_cheat.c | 132 +++++++++++++++++++++++++------------------------- 1 file changed, 66 insertions(+), 66 deletions(-) diff --git a/src/m_cheat.c b/src/m_cheat.c index 7eaaf8b0..25c8d522 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -53,43 +53,43 @@ //----------------------------------------------------------------------------- static void cheat_mus(cheatarg_t arg); -static void cheat_choppers(cheatarg_t arg); -static void cheat_god(cheatarg_t arg); -static void cheat_fa(cheatarg_t arg); -static void cheat_k(cheatarg_t arg); -static void cheat_kfa(cheatarg_t arg); -static void cheat_noclip(cheatarg_t arg); +static void cheat_choppers(); +static void cheat_god(); +static void cheat_fa(); +static void cheat_k(); +static void cheat_kfa(); +static void cheat_noclip(); static void cheat_pw(cheatarg_t arg); -static void cheat_behold(cheatarg_t arg); +static void cheat_behold(); static void cheat_clev(cheatarg_t arg); -static void cheat_clev0(cheatarg_t arg); -static void cheat_mypos(cheatarg_t arg); -static void cheat_comp(cheatarg_t arg); -static void cheat_friction(cheatarg_t arg); -static void cheat_pushers(cheatarg_t arg); -static void cheat_tran(cheatarg_t arg); -static void cheat_massacre(cheatarg_t arg); -static void cheat_ddt(cheatarg_t arg); -static void cheat_hom(cheatarg_t arg); -static void cheat_fast(cheatarg_t arg); -static void cheat_key(cheatarg_t arg); -static void cheat_keyx(cheatarg_t arg); +static void cheat_clev0(); +static void cheat_mypos(); +static void cheat_comp(); +static void cheat_friction(); +static void cheat_pushers(); +static void cheat_tran(); +static void cheat_massacre(); +static void cheat_ddt(); +static void cheat_hom(); +static void cheat_fast(); +static void cheat_key(); +static void cheat_keyx(); static void cheat_keyxx(cheatarg_t arg); -static void cheat_weap(cheatarg_t arg); +static void cheat_weap(); static void cheat_weapx(cheatarg_t arg); -static void cheat_ammo(cheatarg_t arg); +static void cheat_ammo(); static void cheat_ammox(cheatarg_t arg); -static void cheat_smart(cheatarg_t arg); -static void cheat_pitch(cheatarg_t arg); -static void cheat_nuke(cheatarg_t arg); -static void cheat_rate(cheatarg_t arg); -static void cheat_buddha(cheatarg_t arg); -static void cheat_spechits(cheatarg_t arg); -static void cheat_notarget(cheatarg_t arg); +static void cheat_smart(); +static void cheat_pitch(); +static void cheat_nuke(); +static void cheat_rate(); +static void cheat_buddha(); +static void cheat_spechits(); +static void cheat_notarget(); -static void cheat_autoaim(cheatarg_t arg); // killough 7/19/98 -static void cheat_tst(cheatarg_t arg); -static void cheat_showfps(cheatarg_t arg); // [FG] FPS counter widget +static void cheat_autoaim(); // killough 7/19/98 +static void cheat_tst(); +static void cheat_showfps(); // [FG] FPS counter widget //----------------------------------------------------------------------------- // @@ -286,13 +286,13 @@ struct cheat_s cheat[] = { //----------------------------------------------------------------------------- // [FG] FPS counter widget -static void cheat_showfps(cheatarg_t arg) +static void cheat_showfps() { plyr->powers[pw_showfps] ^= 1; } // killough 7/19/98: Autoaiming optional in beta emulation mode -static void cheat_autoaim(cheatarg_t arg) +static void cheat_autoaim() { extern int autoaim; plyr->message = (autoaim=!autoaim) ? @@ -342,14 +342,14 @@ static void cheat_mus(cheatarg_t arg) } // 'choppers' invulnerability & chainsaw -static void cheat_choppers(cheatarg_t arg) +static void cheat_choppers() { plyr->weaponowned[wp_chainsaw] = true; plyr->powers[pw_invulnerability] = true; plyr->message = s_STSTR_CHOPPERS; // Ty 03/27/98 - externalized } -static void cheat_god(cheatarg_t arg) +static void cheat_god() { // 'dqd' cheat for toggleable god mode // [crispy] dead players are first respawned at the current position if (plyr->playerstate == PST_DEAD) @@ -385,7 +385,7 @@ static void cheat_god(cheatarg_t arg) plyr->message = s_STSTR_DQDOFF; // Ty 03/27/98 - externalized } -static void cheat_buddha(cheatarg_t arg) +static void cheat_buddha() { plyr->cheats ^= CF_BUDDHA; if (plyr->cheats & CF_BUDDHA) @@ -394,7 +394,7 @@ static void cheat_buddha(cheatarg_t arg) plyr->message = "Buddha Mode OFF"; } -static void cheat_notarget(cheatarg_t arg) +static void cheat_notarget() { plyr->cheats ^= CF_NOTARGET; if (plyr->cheats & CF_NOTARGET) @@ -403,13 +403,13 @@ static void cheat_notarget(cheatarg_t arg) plyr->message = "Notarget Mode OFF"; } -static void cheat_tst(cheatarg_t arg) +static void cheat_tst() { // killough 10/98: same as iddqd except for message - cheat_god((cheatarg_t){.i = 0}); + cheat_god(); plyr->message = plyr->cheats & CF_GODMODE ? "God Mode On" : "God Mode Off"; } -static void cheat_fa(cheatarg_t arg) +static void cheat_fa() { int i; @@ -436,7 +436,7 @@ static void cheat_fa(cheatarg_t arg) plyr->message = s_STSTR_FAADDED; } -static void cheat_k(cheatarg_t arg) +static void cheat_k() { int i; for (i=0;imessage = s_STSTR_KFAADDED; } -static void cheat_noclip(cheatarg_t arg) +static void cheat_noclip() { // Simplified, accepting both "noclip" and "idspispopd". // no clipping mode cheat @@ -485,13 +485,13 @@ static void cheat_pw(cheatarg_t arg) } // 'behold' power-up menu -static void cheat_behold(cheatarg_t arg) +static void cheat_behold() { plyr->message = s_STSTR_BEHOLD; // Ty 03/27/98 - externalized } // 'clev' change-level cheat -static void cheat_clev0(cheatarg_t arg) +static void cheat_clev0() { int epsd, map; char *cur, *next; @@ -570,14 +570,14 @@ static void cheat_clev(cheatarg_t arg) // 'mypos' for player position // killough 2/7/98: simplified using dprintf and made output more user-friendly -static void cheat_mypos(cheatarg_t arg) +static void cheat_mypos() { plyr->powers[pw_renderstats] = 0; if (!(plyr->powers[pw_mapcoords] ^= 1)) plyr->message = ""; } -void cheat_mypos_print(cheatarg_t arg) +void cheat_mypos_print() { doomprintf("X=%.10f Y=%.10f A=%-.0f", (double)players[consoleplayer].mo->x / FRACUNIT, @@ -587,7 +587,7 @@ void cheat_mypos_print(cheatarg_t arg) // compatibility cheat -static void cheat_comp(cheatarg_t arg) +static void cheat_comp() { int i; @@ -599,7 +599,7 @@ static void cheat_comp(cheatarg_t arg) } // variable friction cheat -static void cheat_friction(cheatarg_t arg) +static void cheat_friction() { plyr->message = // Ty 03/27/98 - *not* externalized (variable_friction = !variable_friction) ? "Variable Friction enabled" : @@ -609,21 +609,21 @@ static void cheat_friction(cheatarg_t arg) // Pusher cheat // phares 3/10/98 -static void cheat_pushers(cheatarg_t arg) +static void cheat_pushers() { plyr->message = // Ty 03/27/98 - *not* externalized (allow_pushers = !allow_pushers) ? "Pushers enabled" : "Pushers disabled"; } // translucency cheat -static void cheat_tran(cheatarg_t arg) +static void cheat_tran() { plyr->message = // Ty 03/27/98 - *not* externalized (translucency = !translucency) ? "Translucency enabled" : "Translucency disabled"; D_SetPredefinedTranslucency(); } -static void cheat_massacre(cheatarg_t arg) // jff 2/01/98 kill all monsters +static void cheat_massacre() // jff 2/01/98 kill all monsters { // jff 02/01/98 'em' cheat - kill all monsters // partially taken from Chi's .46 port @@ -662,7 +662,7 @@ static void cheat_massacre(cheatarg_t arg) // jff 2/01/98 kill all monsters doomprintf("%d Monster%s Killed", killcount, killcount==1 ? "" : "s"); } -static void cheat_spechits(cheatarg_t arg) +static void cheat_spechits() { int i, speciallines = 0; boolean origcards[NUMCARDS]; @@ -810,7 +810,7 @@ static void cheat_spechits(cheatarg_t arg) // killough 2/7/98: move iddt cheat from am_map.c to here // killough 3/26/98: emulate Doom better -static void cheat_ddt(cheatarg_t arg) +static void cheat_ddt() { extern int ddt_cheating; if (automapactive) @@ -818,7 +818,7 @@ static void cheat_ddt(cheatarg_t arg) } // killough 2/7/98: HOM autodetection -static void cheat_hom(cheatarg_t arg) +static void cheat_hom() { extern int autodetect_hom; // Ty 03/27/98 - *not* externalized plyr->message = (autodetect_hom = !autodetect_hom) ? "HOM Detection On" : @@ -826,7 +826,7 @@ static void cheat_hom(cheatarg_t arg) } // killough 3/6/98: -fast parameter toggle -static void cheat_fast(cheatarg_t arg) +static void cheat_fast() { plyr->message = (fastparm = !fastparm) ? "Fast Monsters On" : "Fast Monsters Off"; // Ty 03/27/98 - *not* externalized @@ -834,12 +834,12 @@ static void cheat_fast(cheatarg_t arg) } // killough 2/16/98: keycard/skullkey cheat functions -static void cheat_key(cheatarg_t arg) +static void cheat_key() { plyr->message = "Red, Yellow, Blue"; // Ty 03/27/98 - *not* externalized } -static void cheat_keyx(cheatarg_t arg) +static void cheat_keyx() { plyr->message = "Card, Skull"; // Ty 03/27/98 - *not* externalized } @@ -853,7 +853,7 @@ static void cheat_keyxx(cheatarg_t arg) // killough 2/16/98: generalized weapon cheats -static void cheat_weap(cheatarg_t arg) +static void cheat_weap() { // Ty 03/27/98 - *not* externalized plyr->message = gamemode==commercial ? // killough 2/28/98 "Weapon number 1-9" : "Weapon number 1-8"; @@ -885,7 +885,7 @@ static void cheat_weapx(cheatarg_t arg) } // killough 2/16/98: generalized ammo cheats -static void cheat_ammo(cheatarg_t arg) +static void cheat_ammo() { plyr->message = "Ammo 1-4, Backpack"; // Ty 03/27/98 - *not* externalized } @@ -913,26 +913,26 @@ static void cheat_ammox(cheatarg_t arg) } } -static void cheat_smart(cheatarg_t arg) +static void cheat_smart() { plyr->message = (monsters_remember = !monsters_remember) ? "Smart Monsters Enabled" : "Smart Monsters Disabled"; } -static void cheat_pitch(cheatarg_t arg) +static void cheat_pitch() { plyr->message=(pitched_sounds = !pitched_sounds) ? "Pitch Effects Enabled" : "Pitch Effects Disabled"; } -static void cheat_nuke(cheatarg_t arg) +static void cheat_nuke() { extern int disable_nuke; plyr->message = (disable_nuke = !disable_nuke) ? "Nukage Disabled" : "Nukage Enabled"; } -static void cheat_rate(cheatarg_t arg) +static void cheat_rate() { plyr->powers[pw_mapcoords] = 0; if (!(plyr->powers[pw_renderstats] ^= 1))