From 2ad22c660182c64f8b56e15bfd0fba1b1d751b97 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Fri, 28 Jan 2022 15:26:17 +0100 Subject: [PATCH] IDMYPOS cheat back to infinite duration, some clean-ups for the RATE cheat --- Source/d_player.h | 2 +- Source/doomdef.h | 3 ++- Source/m_cheat.c | 7 ++++--- Source/p_user.c | 11 +++++++---- Source/r_main.c | 17 +++-------------- Source/r_main.h | 1 - 6 files changed, 17 insertions(+), 24 deletions(-) diff --git a/Source/d_player.h b/Source/d_player.h index 17181928..7b48c03e 100644 --- a/Source/d_player.h +++ b/Source/d_player.h @@ -113,7 +113,7 @@ typedef struct player_s int armortype; // Power ups. invinc and invis are tic counters. - int powers[NUMPOWERS+2]; + int powers[NUMPOWERS+3]; boolean cards[NUMCARDS]; boolean backpack; diff --git a/Source/doomdef.h b/Source/doomdef.h index 9dfdd6f0..cdc6ef6e 100644 --- a/Source/doomdef.h +++ b/Source/doomdef.h @@ -213,7 +213,8 @@ typedef enum { pw_allmap, pw_infrared, NUMPOWERS, - pw_mapcoords + pw_mapcoords, + pw_renderstats, } powertype_t; // Power up durations (how many seconds till expiration). diff --git a/Source/m_cheat.c b/Source/m_cheat.c index ac636917..bc524e1c 100644 --- a/Source/m_cheat.c +++ b/Source/m_cheat.c @@ -30,7 +30,6 @@ #include "p_tick.h" #include "g_game.h" #include "r_data.h" -#include "r_main.h" #include "p_inter.h" #include "m_cheat.h" #include "m_argv.h" @@ -536,7 +535,8 @@ char buf[3]; // killough 2/7/98: simplified using dprintf and made output more user-friendly static void cheat_mypos() { - plyr->powers[pw_mapcoords] = 10 * TICRATE; + if (!(plyr->powers[pw_mapcoords] ^= 1)) + dprintf("%s", ""); } void cheat_mypos_print() @@ -751,7 +751,8 @@ static void cheat_nuke() static void cheat_rate() { - rendering_stats ^= 1; + if (!(plyr->powers[pw_renderstats] ^= 1)) + dprintf("%s", ""); } //----------------------------------------------------------------------------- diff --git a/Source/p_user.c b/Source/p_user.c index c321e045..68229a38 100644 --- a/Source/p_user.c +++ b/Source/p_user.c @@ -452,13 +452,16 @@ void P_PlayerThink (player_t* player) if (player->powers[pw_ironfeet] > 0) // killough player->powers[pw_ironfeet]--; - if (player->powers[pw_mapcoords] > 0) + if (player->powers[pw_renderstats]) + { + extern void R_ShowRenderingStats(); + R_ShowRenderingStats(); + } + + if (player->powers[pw_mapcoords]) { extern void cheat_mypos_print(); cheat_mypos_print(); - player->powers[pw_mapcoords]--; - if (player->powers[pw_mapcoords] == 0) - player->message = ""; } if (player->damagecount) diff --git a/Source/r_main.c b/Source/r_main.c index 9ba4c2af..108dbf95 100644 --- a/Source/r_main.c +++ b/Source/r_main.c @@ -606,20 +606,11 @@ void R_SetupFrame (player_t *player) // int rendered_visplanes, rendered_segs, rendered_vissprites; -boolean rendering_stats; -static void R_ShowStats(void) +void R_ShowRenderingStats(void) { - static int saved_tick; - if (leveltime >= saved_tick + TICRATE) - { - if (rendering_stats) - { - dprintf("Segs %d, Visplanes %d, Sprites %d", rendered_segs, - rendered_visplanes, rendered_vissprites); - } - saved_tick = leveltime; - } + dprintf("Segs %d, Visplanes %d, Sprites %d", + rendered_segs, rendered_visplanes, rendered_vissprites); } static void R_ClearStats(void) @@ -741,8 +732,6 @@ void R_RenderPlayerView (player_t* player) // Check for new console commands. NetUpdate (); - - R_ShowStats(); } //---------------------------------------------------------------------------- diff --git a/Source/r_main.h b/Source/r_main.h index cc9a4842..32bfda2f 100644 --- a/Source/r_main.h +++ b/Source/r_main.h @@ -54,7 +54,6 @@ extern int loopcount; // extern int rendered_visplanes, rendered_segs, rendered_vissprites; -extern boolean rendering_stats; // // Lighting LUT.