mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 12:31:54 +00:00
debugrender_visplanes: highlight borders of visplanes
This commit is contained in:
parent
3aace4f777
commit
afa78333fc
2 changed files with 55 additions and 0 deletions
|
|
@ -878,6 +878,7 @@ consvar_t cv_debugrank = PlayerCheat("debugrank", "Off").description("Show GP ra
|
||||||
consvar_t cv_debugrender_contrast = PlayerCheat("debugrender_contrast", "0.0").floating_point().min_max(-FRACUNIT, FRACUNIT).description("Change level lighting");
|
consvar_t cv_debugrender_contrast = PlayerCheat("debugrender_contrast", "0.0").floating_point().min_max(-FRACUNIT, FRACUNIT).description("Change level lighting");
|
||||||
consvar_t cv_debugrender_portal = PlayerCheat("debugrender_portal", "Off").on_off().description("Highlight visual portals in red");
|
consvar_t cv_debugrender_portal = PlayerCheat("debugrender_portal", "Off").on_off().description("Highlight visual portals in red");
|
||||||
consvar_t cv_debugrender_spriteclip = PlayerCheat("debugrender_spriteclip", "Off").on_off().description("Let sprites draw through walls");
|
consvar_t cv_debugrender_spriteclip = PlayerCheat("debugrender_spriteclip", "Off").on_off().description("Let sprites draw through walls");
|
||||||
|
consvar_t cv_debugrender_visplanes = PlayerCheat("debugrender_visplanes", "Off").on_off().description("Highlight the number of visplanes");
|
||||||
consvar_t cv_devmode_screen = PlayerCheat("devmode_screen", "1").min_max(1, 4).description("Choose which splitscreen player devmode applies to");
|
consvar_t cv_devmode_screen = PlayerCheat("devmode_screen", "1").min_max(1, 4).description("Choose which splitscreen player devmode applies to");
|
||||||
consvar_t cv_drawpickups = PlayerCheat("drawpickups", "Yes").yes_no().description("Hide rings, spheres, item capsules, prison capsules (visual only)");
|
consvar_t cv_drawpickups = PlayerCheat("drawpickups", "Yes").yes_no().description("Hide rings, spheres, item capsules, prison capsules (visual only)");
|
||||||
consvar_t cv_drawinput = PlayerCheat("drawinput", "No").yes_no().description("Draw turn inputs outside of Record Attack (turn solver debugging)");
|
consvar_t cv_drawinput = PlayerCheat("drawinput", "No").yes_no().description("Draw turn inputs outside of Record Attack (turn solver debugging)");
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,8 @@ INT64 mytotal = 0;
|
||||||
#endif
|
#endif
|
||||||
//profile stuff ---------------------------------------------------------
|
//profile stuff ---------------------------------------------------------
|
||||||
|
|
||||||
|
extern "C" consvar_t cv_debugrender_visplanes;
|
||||||
|
|
||||||
// Fineangles in the SCREENWIDTH wide window.
|
// Fineangles in the SCREENWIDTH wide window.
|
||||||
#define FIELDOFVIEW 2048
|
#define FIELDOFVIEW 2048
|
||||||
|
|
||||||
|
|
@ -1603,6 +1605,58 @@ void R_RenderPlayerView(void)
|
||||||
R_DrawMasked(masks, nummasks);
|
R_DrawMasked(masks, nummasks);
|
||||||
ps_sw_maskedtime = I_GetPreciseTime() - ps_sw_maskedtime;
|
ps_sw_maskedtime = I_GetPreciseTime() - ps_sw_maskedtime;
|
||||||
|
|
||||||
|
if (cv_debugrender_visplanes.value)
|
||||||
|
{
|
||||||
|
for (INT32 i = 0; i < MAXVISPLANES; i++)
|
||||||
|
{
|
||||||
|
for (visplane_t* pl = visplanes[i]; pl; pl = pl->next)
|
||||||
|
{
|
||||||
|
if (pl->minx > pl->maxx)
|
||||||
|
continue;
|
||||||
|
auto col = [](int x, int top, int bot)
|
||||||
|
{
|
||||||
|
if (top > bot)
|
||||||
|
std::swap(top, bot);
|
||||||
|
UINT8* p = &screens[0][x + top * vid.width];
|
||||||
|
while (top <= bot)
|
||||||
|
{
|
||||||
|
*p = 35;
|
||||||
|
p += vid.width;
|
||||||
|
top++;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
auto span = [col](int x, int top, int bot)
|
||||||
|
{
|
||||||
|
if (top <= bot)
|
||||||
|
col(x, top, bot);
|
||||||
|
};
|
||||||
|
INT32 top = pl->top[pl->minx];
|
||||||
|
INT32 bottom = pl->bottom[pl->minx];
|
||||||
|
span(pl->minx, top, bottom);
|
||||||
|
span(pl->maxx, pl->top[pl->maxx], pl->bottom[pl->maxx]);
|
||||||
|
for (INT32 x = pl->minx + 1; x < pl->maxx; ++x)
|
||||||
|
{
|
||||||
|
INT32 new_top = pl->top[x];
|
||||||
|
INT32 new_bottom = pl->bottom[x];
|
||||||
|
if (new_top > new_bottom)
|
||||||
|
continue;
|
||||||
|
if (top > bottom)
|
||||||
|
{
|
||||||
|
col(x, new_top, new_top);
|
||||||
|
col(x, new_bottom, new_bottom);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
col(x, top, new_top);
|
||||||
|
col(x, bottom, new_bottom);
|
||||||
|
}
|
||||||
|
top = new_top;
|
||||||
|
bottom = new_bottom;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// debugrender_portal: fill portals with red, draw over everything
|
// debugrender_portal: fill portals with red, draw over everything
|
||||||
if (portal_base && cv_debugrender_portal.value)
|
if (portal_base && cv_debugrender_portal.value)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue