devmode: add devmode_screen cvar, select which splitscreen to display info for

Old behavior was just use the last splitscreen.

This does not the position devmode draws on the screen.
This commit is contained in:
James R 2023-03-29 00:09:50 -07:00
parent 4588a20a95
commit 78df6ec488
4 changed files with 9 additions and 0 deletions

View file

@ -1086,6 +1086,7 @@ void D_RegisterClientCommands(void)
COM_AddCommand("weather", Command_Weather_f); COM_AddCommand("weather", Command_Weather_f);
COM_AddCommand("grayscale", Command_Grayscale_f); COM_AddCommand("grayscale", Command_Grayscale_f);
CV_RegisterVar(&cv_renderhitbox); CV_RegisterVar(&cv_renderhitbox);
CV_RegisterVar(&cv_devmode_screen);
#ifdef HAVE_DISCORDRPC #ifdef HAVE_DISCORDRPC
CV_RegisterVar(&cv_discordrp); CV_RegisterVar(&cv_discordrp);

View file

@ -694,6 +694,9 @@ struct debugFlagNames_s const debug_flag_names[] =
{NULL, 0} {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) void Command_Devmode_f(void)
{ {
size_t argc = 0; size_t argc = 0;

View file

@ -89,6 +89,8 @@ void Command_CauseCfail_f(void);
void Command_Dumplua_f(void); void Command_Dumplua_f(void);
#endif #endif
extern consvar_t cv_devmode_screen;
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
#endif #endif

View file

@ -418,6 +418,9 @@ static void ST_drawDebugInfo(void)
{ {
INT32 height = 192; INT32 height = 192;
// devmode_screen = 1..4
stplyr = &players[displayplayers[min(r_splitscreen, cv_devmode_screen.value - 1)]];
if (!stplyr->mo) if (!stplyr->mo)
return; return;