diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 7b1991652..1efb49238 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1086,6 +1086,7 @@ void D_RegisterClientCommands(void) COM_AddCommand("weather", Command_Weather_f); COM_AddCommand("grayscale", Command_Grayscale_f); CV_RegisterVar(&cv_renderhitbox); + CV_RegisterVar(&cv_devmode_screen); #ifdef HAVE_DISCORDRPC CV_RegisterVar(&cv_discordrp); diff --git a/src/i_video_common.cpp b/src/i_video_common.cpp index be894beb7..a0802e904 100644 --- a/src/i_video_common.cpp +++ b/src/i_video_common.cpp @@ -127,6 +127,8 @@ static void finish_legacy_ogl_update() ST_AskToJoinEnvelope(); #endif + ST_drawDebugInfo(); + OglSdlFinishUpdate(cv_vidwait.value); } #endif @@ -179,6 +181,8 @@ static void temp_legacy_finishupdate_draws() if (discordRequestList != NULL) ST_AskToJoinEnvelope(); #endif + + ST_drawDebugInfo(); } static InternalPassData build_pass_manager() diff --git a/src/m_cheat.c b/src/m_cheat.c index 62a5a2b53..cbeefafb6 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -694,6 +694,9 @@ struct debugFlagNames_s const debug_flag_names[] = {NULL, 0} }; +static CV_PossibleValue_t devmode_screen_t[] = {{1, "MIN"}, {4, "MAX"}, {0, NULL}}; +consvar_t cv_devmode_screen = CVAR_INIT ("devmode_screen", "1", CV_CHEAT, devmode_screen_t, NULL); + void Command_Devmode_f(void) { size_t argc = 0; diff --git a/src/m_cheat.h b/src/m_cheat.h index 331f70563..b272400fe 100644 --- a/src/m_cheat.h +++ b/src/m_cheat.h @@ -89,6 +89,8 @@ void Command_CauseCfail_f(void); void Command_Dumplua_f(void); #endif +extern consvar_t cv_devmode_screen; + #ifdef __cplusplus } // extern "C" #endif diff --git a/src/st_stuff.c b/src/st_stuff.c index b2d01cc2b..39d4d841c 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -360,10 +360,15 @@ static INT32 SCR(INT32 r) // Devmode information +static void ST_pushRow(INT32 *height) +{ + *height -= 4; +} + static void ST_pushDebugString(INT32 *height, const char *string) { - V_DrawRightAlignedString(320, *height, V_MONOSPACE, string); - *height -= 8; + V_DrawRightAlignedSmallString(319, *height, V_MONOSPACE, string); + ST_pushRow(height); } static void ST_pushDebugTimeMS(INT32 *height, const char *label, UINT32 ms) @@ -401,10 +406,7 @@ static void ST_drawMusicDebug(INT32 *height) ST_pushDebugTimeMS(height, " Loop A: ", S_GetMusicLoopPoint()); } - if (def) - { - ST_pushDebugString(height, va(" Volume: %4d/100", def->volume)); - } + ST_pushRow(height); if (format) { @@ -412,12 +414,21 @@ static void ST_drawMusicDebug(INT32 *height) } ST_pushDebugString(height, va(" Song: %8s", mname)); + + if (def) + { + ST_pushRow(height); + ST_pushDebugString(height, va(" Volume: %4d/100", def->volume)); + } } -static void ST_drawDebugInfo(void) +void ST_drawDebugInfo(void) { INT32 height = 192; + // devmode_screen = 1..4 + stplyr = &players[displayplayers[min(r_splitscreen, cv_devmode_screen.value - 1)]]; + if (!stplyr->mo) return; @@ -1354,6 +1365,4 @@ void ST_Drawer(void) break; } } - - ST_drawDebugInfo(); } diff --git a/src/st_stuff.h b/src/st_stuff.h index 1224f227c..44aa5f251 100644 --- a/src/st_stuff.h +++ b/src/st_stuff.h @@ -41,6 +41,9 @@ void ST_DrawDemoTitleEntry(void); void ST_AskToJoinEnvelope(void); #endif +// devmode +void ST_drawDebugInfo(void); + // Called by main loop. void ST_Drawer(void);