Merge branch 'improve-devmode-visibility' into 'master'

Improve devmode visibility and usability

See merge request KartKrew/Kart!1113
This commit is contained in:
James R 2023-03-30 01:23:40 +00:00
commit 9aacbf6472
6 changed files with 31 additions and 9 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

@ -127,6 +127,8 @@ static void finish_legacy_ogl_update()
ST_AskToJoinEnvelope(); ST_AskToJoinEnvelope();
#endif #endif
ST_drawDebugInfo();
OglSdlFinishUpdate(cv_vidwait.value); OglSdlFinishUpdate(cv_vidwait.value);
} }
#endif #endif
@ -179,6 +181,8 @@ static void temp_legacy_finishupdate_draws()
if (discordRequestList != NULL) if (discordRequestList != NULL)
ST_AskToJoinEnvelope(); ST_AskToJoinEnvelope();
#endif #endif
ST_drawDebugInfo();
} }
static InternalPassData build_pass_manager() static InternalPassData build_pass_manager()

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

@ -360,10 +360,15 @@ static INT32 SCR(INT32 r)
// Devmode information // Devmode information
static void ST_pushRow(INT32 *height)
{
*height -= 4;
}
static void ST_pushDebugString(INT32 *height, const char *string) static void ST_pushDebugString(INT32 *height, const char *string)
{ {
V_DrawRightAlignedString(320, *height, V_MONOSPACE, string); V_DrawRightAlignedSmallString(319, *height, V_MONOSPACE, string);
*height -= 8; ST_pushRow(height);
} }
static void ST_pushDebugTimeMS(INT32 *height, const char *label, UINT32 ms) 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()); ST_pushDebugTimeMS(height, " Loop A: ", S_GetMusicLoopPoint());
} }
if (def) ST_pushRow(height);
{
ST_pushDebugString(height, va(" Volume: %4d/100", def->volume));
}
if (format) if (format)
{ {
@ -412,12 +414,21 @@ static void ST_drawMusicDebug(INT32 *height)
} }
ST_pushDebugString(height, va(" Song: %8s", mname)); 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; 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;
@ -1354,6 +1365,4 @@ void ST_Drawer(void)
break; break;
} }
} }
ST_drawDebugInfo();
} }

View file

@ -41,6 +41,9 @@ void ST_DrawDemoTitleEntry(void);
void ST_AskToJoinEnvelope(void); void ST_AskToJoinEnvelope(void);
#endif #endif
// devmode
void ST_drawDebugInfo(void);
// Called by main loop. // Called by main loop.
void ST_Drawer(void); void ST_Drawer(void);