renderwalls

This commit is contained in:
GoldenTails 2020-12-15 12:41:03 -06:00
parent d9395b0a73
commit a1ce35b780
5 changed files with 30 additions and 4 deletions

View file

@ -853,6 +853,7 @@ void D_RegisterClientCommands(void)
// screen.c // screen.c
CV_RegisterVar(&cv_fullscreen); CV_RegisterVar(&cv_fullscreen);
CV_RegisterVar(&cv_renderview); CV_RegisterVar(&cv_renderview);
CV_RegisterVar(&cv_renderwalls);
CV_RegisterVar(&cv_renderer); CV_RegisterVar(&cv_renderer);
CV_RegisterVar(&cv_scr_depth); CV_RegisterVar(&cv_scr_depth);
CV_RegisterVar(&cv_scr_width); CV_RegisterVar(&cv_scr_width);

View file

@ -800,6 +800,9 @@ static void HWR_ProjectWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, FBITFIEL
{ {
INT32 shader = SHADER_DEFAULT; INT32 shader = SHADER_DEFAULT;
if (!cv_renderwalls.value)
return;
HWR_Lighting(pSurf, lightlevel, wallcolormap); HWR_Lighting(pSurf, lightlevel, wallcolormap);
if (HWR_UseShader()) if (HWR_UseShader())
@ -882,6 +885,9 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum,
FUINT lightnum = HWR_CalcWallLight(sector->lightlevel, v1x, v1y, v2x, v2y); FUINT lightnum = HWR_CalcWallLight(sector->lightlevel, v1x, v1y, v2x, v2y);
extracolormap_t *colormap = NULL; extracolormap_t *colormap = NULL;
if (!cv_renderwalls.value)
return;
realtop = top = wallVerts[3].y; realtop = top = wallVerts[3].y;
realbot = bot = wallVerts[0].y; realbot = bot = wallVerts[0].y;
pegt = wallVerts[3].t; pegt = wallVerts[3].t;
@ -6492,6 +6498,9 @@ void HWR_AddTransparentWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, INT32 te
{ {
static size_t allocedwalls = 0; static size_t allocedwalls = 0;
if (!cv_renderwalls.value)
return;
// Force realloc if buffer has been freed // Force realloc if buffer has been freed
if (!wallinfo) if (!wallinfo)
allocedwalls = 0; allocedwalls = 0;
@ -6520,6 +6529,9 @@ void HWR_RenderWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, FBITFIELD blend,
INT32 shader = SHADER_DEFAULT; INT32 shader = SHADER_DEFAULT;
if (!cv_renderwalls.value)
return;
// Lighting is done here instead so that fog isn't drawn incorrectly on transparent walls after sorting // Lighting is done here instead so that fog isn't drawn incorrectly on transparent walls after sorting
HWR_Lighting(pSurf, lightlevel, wallcolormap); HWR_Lighting(pSurf, lightlevel, wallcolormap);

View file

@ -87,6 +87,9 @@ static void R_Render2sidedMultiPatchColumn(column_t *column)
{ {
INT32 topscreen, bottomscreen; INT32 topscreen, bottomscreen;
if (!cv_renderwalls.value)
return;
topscreen = sprtopscreen; // + spryscale*column->topdelta; topdelta is 0 for the wall topscreen = sprtopscreen; // + spryscale*column->topdelta; topdelta is 0 for the wall
bottomscreen = topscreen + spryscale * lengthcol; bottomscreen = topscreen + spryscale * lengthcol;
@ -315,6 +318,9 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
else else
repeats = 1; repeats = 1;
if (!cv_renderwalls.value)
return;
for (times = 0; times < repeats; times++) for (times = 0; times < repeats; times++)
{ {
if (times > 0) if (times > 0)
@ -858,6 +864,9 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
bottom_frac += bottom_step * (x1 - ds->x1); bottom_frac += bottom_step * (x1 - ds->x1);
} }
if (!cv_renderwalls.value)
return;
// draw the columns // draw the columns
for (dc_x = x1; dc_x <= x2; dc_x++) for (dc_x = x1; dc_x <= x2; dc_x++)
{ {
@ -1347,7 +1356,8 @@ static void R_RenderSegLoop (void)
#ifdef TIMING #ifdef TIMING
ProfZeroTimer(); ProfZeroTimer();
#endif #endif
colfunc(); if (cv_renderwalls.value)
colfunc();
#ifdef TIMING #ifdef TIMING
RDMSR(0x10,&mycount); RDMSR(0x10,&mycount);
mytotal += mycount; //64bit add mytotal += mycount; //64bit add
@ -1403,7 +1413,8 @@ static void R_RenderSegLoop (void)
dc_texturemid = rw_toptexturemid; dc_texturemid = rw_toptexturemid;
dc_source = R_GetColumn(toptexture,texturecolumn); dc_source = R_GetColumn(toptexture,texturecolumn);
dc_texheight = textureheight[toptexture]>>FRACBITS; dc_texheight = textureheight[toptexture]>>FRACBITS;
colfunc(); if (cv_renderwalls.value)
colfunc();
ceilingclip[rw_x] = (INT16)mid; ceilingclip[rw_x] = (INT16)mid;
} }
else if (!rw_ceilingmarked) // entirely off top of screen else if (!rw_ceilingmarked) // entirely off top of screen
@ -1440,7 +1451,8 @@ static void R_RenderSegLoop (void)
dc_source = R_GetColumn(bottomtexture, dc_source = R_GetColumn(bottomtexture,
texturecolumn); texturecolumn);
dc_texheight = textureheight[bottomtexture]>>FRACBITS; dc_texheight = textureheight[bottomtexture]>>FRACBITS;
colfunc(); if (cv_renderwalls.value)
colfunc();
floorclip[rw_x] = (INT16)mid; floorclip[rw_x] = (INT16)mid;
} }
else if (!rw_floormarked) // entirely off bottom of screen else if (!rw_floormarked) // entirely off bottom of screen

View file

@ -68,6 +68,7 @@ consvar_t cv_scr_width = CVAR_INIT ("scr_width", "1280", CV_SAVE, CV_Unsigned, N
consvar_t cv_scr_height = CVAR_INIT ("scr_height", "800", CV_SAVE, CV_Unsigned, NULL); consvar_t cv_scr_height = CVAR_INIT ("scr_height", "800", CV_SAVE, CV_Unsigned, NULL);
consvar_t cv_scr_depth = CVAR_INIT ("scr_depth", "16 bits", CV_SAVE, scr_depth_cons_t, NULL); consvar_t cv_scr_depth = CVAR_INIT ("scr_depth", "16 bits", CV_SAVE, scr_depth_cons_t, NULL);
consvar_t cv_renderview = CVAR_INIT ("renderview", "On", 0, CV_OnOff, NULL); consvar_t cv_renderview = CVAR_INIT ("renderview", "On", 0, CV_OnOff, NULL);
consvar_t cv_renderwalls = CVAR_INIT ("renderwalls", "On", 0, CV_OnOff, NULL);
CV_PossibleValue_t cv_renderer_t[] = { CV_PossibleValue_t cv_renderer_t[] = {
{1, "Software"}, {1, "Software"},

View file

@ -189,7 +189,7 @@ extern CV_PossibleValue_t cv_renderer_t[];
extern INT32 scr_bpp; extern INT32 scr_bpp;
extern UINT8 *scr_borderpatch; // patch used to fill the view borders extern UINT8 *scr_borderpatch; // patch used to fill the view borders
extern consvar_t cv_scr_width, cv_scr_height, cv_scr_depth, cv_renderview, cv_renderer, cv_fullscreen; extern consvar_t cv_scr_width, cv_scr_height, cv_scr_depth, cv_renderview, cv_renderwalls, cv_renderer, cv_fullscreen;
// wait for page flipping to end or not // wait for page flipping to end or not
extern consvar_t cv_vidwait; extern consvar_t cv_vidwait;