From a4663c1493af6f64fa819fa2d0108f983f5c81e0 Mon Sep 17 00:00:00 2001 From: viciious Date: Mon, 16 Oct 2023 20:52:35 +0300 Subject: [PATCH] Remove potato detail mode --- doomdef.h | 8 ------ marsdraw.c | 84 ------------------------------------------------------ r_local.h | 1 - r_main.c | 6 ++-- r_phase7.c | 18 ++---------- r_phase9.c | 1 - 6 files changed, 4 insertions(+), 114 deletions(-) diff --git a/doomdef.h b/doomdef.h index 353208c1c..ea300159c 100644 --- a/doomdef.h +++ b/doomdef.h @@ -827,14 +827,6 @@ void I_DrawColumnNPo2(int dc_x, int dc_yl, int dc_yh, int light, fixed_t dc_isca void I_DrawSpan(int ds_y, int ds_x1, int ds_x2, int light, fixed_t ds_xfrac, fixed_t ds_yfrac, fixed_t ds_xstep, fixed_t ds_ystep, inpixel_t* ds_source, int dc_texheight); -void I_DrawSpanPotato(int ds_y, int ds_x1, int ds_x2, int light, fixed_t ds_xfrac, - fixed_t ds_yfrac, fixed_t ds_xstep, fixed_t ds_ystep, inpixel_t* ds_source, int dc_texheight) - ATTR_DATA_CACHE_ALIGN; - -void I_DrawSpanPotatoLow(int ds_y, int ds_x1, int ds_x2, int light, fixed_t ds_xfrac, - fixed_t ds_yfrac, fixed_t ds_xstep, fixed_t ds_ystep, inpixel_t* ds_source, int dc_texheight) - ATTR_DATA_CACHE_ALIGN; - void I_DrawFuzzColumn(int dc_x, int dc_yl, int dc_yh, int light, fixed_t frac_, fixed_t fracstep, inpixel_t* dc_source, int dc_texheight, int* fuzzpos); diff --git a/marsdraw.c b/marsdraw.c index 7292b3560..72bf4bee5 100644 --- a/marsdraw.c +++ b/marsdraw.c @@ -505,90 +505,6 @@ void I_DrawFuzzColumnC(int dc_x, int dc_yl, int dc_yh, int light, fixed_t frac_, *pfuzzpos = fuzzpos; } -/* -================ -= -= I_DrawSpanPotatoLow -= -================ -*/ -void I_DrawSpanPotatoLow(int ds_y, int ds_x1, int ds_x2, int light, fixed_t ds_xfrac, - fixed_t ds_yfrac, fixed_t ds_xstep, fixed_t ds_ystep, inpixel_t* ds_source, int dc_texheight) -{ - pixel_t* dest, pix; - unsigned count; - short* dc_colormap; - -#ifdef RANGECHECK - if (ds_x2 < ds_x1 || ds_x1<0 || ds_x2 >= viewportWidth || ds_y>viewportHeight) - I_Error("R_DrawSpan: %i to %i at %i", ds_x1, ds_x2, ds_y); -#endif - - if (ds_x2 < ds_x1) - return; - - count = ds_x2 - ds_x1 + 1; - - dest = viewportbuffer + ds_y * 320 / 2 + ds_x1; - dc_colormap = (int16_t *)dc_colormaps + light; - pix = dc_colormap[(int8_t)ds_source[513]]; - - do { - *dest++ = pix; - } while (--count > 0); -} - -/* -================ -= -= I_DrawSpanPotato -= -================ -*/ -void I_DrawSpanPotato(int ds_y, int ds_x1, int ds_x2, int light, fixed_t ds_xfrac, - fixed_t ds_yfrac, fixed_t ds_xstep, fixed_t ds_ystep, inpixel_t* ds_source, int dc_texheight) -{ - byte *udest, upix; - unsigned count, scount; - int8_t* dc_colormap; - -#ifdef RANGECHECK - if (ds_x2 < ds_x1 || ds_x1<0 || ds_x2 >= viewportWidth || ds_y>viewportHeight) - I_Error("R_DrawSpan: %i to %i at %i", ds_x1, ds_x2, ds_y); -#endif - - if (ds_x2 < ds_x1) - return; - - count = ds_x2 - ds_x1 + 1; - - udest = (byte *)viewportbuffer + ds_y * 320 + ds_x1; - dc_colormap = (int8_t *)(dc_colormaps + light); - upix = dc_colormap[ds_source[513]] & 0xff; - - if (ds_x1 & 1) { - *udest++ = upix; - count--; - } - - scount = count >> 1; - if (scount > 0) - { - pixel_t spix = (upix << 8) | upix; - pixel_t *sdest = (pixel_t*)udest; - - do { - *sdest++ = spix; - } while (--scount > 0); - - udest = (byte*)sdest; - } - - if (count & 1) { - *udest = upix; - } -} - void I_DrawColumnNoDraw(int dc_x, int dc_yl, int dc_yh, int light, fixed_t frac_, fixed_t fracstep, inpixel_t* dc_source, int dc_texheight, int* fuzzpos) { diff --git a/r_local.h b/r_local.h index 90d08be0a..bef4b8196 100644 --- a/r_local.h +++ b/r_local.h @@ -51,7 +51,6 @@ extern fixed_t weaponXScale; typedef enum { - detmode_potato = -1, detmode_medium, detmode_high, detmode_mipmaps, diff --git a/r_main.c b/r_main.c index e4ffdc997..b116951ee 100644 --- a/r_main.c +++ b/r_main.c @@ -291,8 +291,6 @@ void R_SetViewportSize(int num) void R_SetDetailMode(int mode) { - if (mode < detmode_potato) - return; if (mode >= MAXDETAILMODES) return; if (mode == detmode_mipmaps && !texmips) @@ -316,7 +314,7 @@ void R_SetDetailMode(int mode) drawcolnpo2 = I_DrawColumnNPo2Low; drawfuzzcol = I_DrawFuzzColumnLow; drawcollow = I_DrawColumnLow; - drawspan = detailmode == detmode_potato ? I_DrawSpanPotatoLow : I_DrawSpanLow; + drawspan = I_DrawSpanLow; } else { @@ -325,7 +323,7 @@ void R_SetDetailMode(int mode) drawfuzzcol = I_DrawFuzzColumn; drawspan = I_DrawSpan; drawcollow = I_DrawColumnLow; - drawspan = detailmode == detmode_potato ? I_DrawSpanPotato : I_DrawSpan; + drawspan = I_DrawSpan; } #ifdef MARS diff --git a/r_phase7.c b/r_phase7.c index 849d4db42..7afbb1d7e 100644 --- a/r_phase7.c +++ b/r_phase7.c @@ -14,8 +14,6 @@ struct localplane_s; -typedef void (*mapplane_fn)(struct localplane_s* lpl, int, int, int); - typedef struct localplane_s { visplane_t* pl; @@ -32,12 +30,9 @@ typedef struct localplane_s pixel_t* ds_source[MIPLEVELS]; #endif int mipsize[MIPLEVELS]; - - mapplane_fn mapplane; } localplane_t; static void R_MapPlane(localplane_t* lpl, int y, int x, int x2) ATTR_DATA_CACHE_ALIGN; -static void R_MapPotatoPlane(localplane_t* lpl, int y, int x, int x2) ATTR_DATA_CACHE_ALIGN; static void R_PlaneLoop(localplane_t* lpl) ATTR_DATA_CACHE_ALIGN; static void R_DrawPlanes2(void) ATTR_DATA_CACHE_ALIGN; @@ -141,13 +136,6 @@ static void R_MapPlane(localplane_t* lpl, int y, int x, int x2) drawspan(y, x, x2, light, xfrac, yfrac, xstep, ystep, lpl->ds_source[miplevel], lpl->mipsize[miplevel]); } -static void R_MapPotatoPlane(localplane_t* lpl, int y, int x, int x2) -{ - if (x2 < x) - return; // nothing to draw (shouldn't happen) - drawspan(y, x, x2, lpl->lightmax, 0, 0, 0, 0, lpl->ds_source[0], 64); -} - // // Determine the horizontal spans of a single visplane // @@ -158,7 +146,6 @@ static void R_PlaneLoop(localplane_t *lpl) unsigned t1, t2, b1, b2, pl_oldtop, pl_oldbottom; int16_t spanstart[SCREENHEIGHT]; visplane_t* pl = lpl->pl; - const mapplane_fn mapplane = lpl->mapplane; pl_x = pl->minx; pl_stopx = pl->maxx; @@ -189,14 +176,14 @@ static void R_PlaneLoop(localplane_t *lpl) // top diffs while (t1 < t2 && t1 <= b1) { - mapplane(lpl, t1, spanstart[t1], x2); + R_MapPlane(lpl, t1, spanstart[t1], x2); ++t1; } // bottom diffs while (b1 > b2 && b1 >= t1) { - mapplane(lpl, b1, spanstart[b1], x2); + R_MapPlane(lpl, b1, spanstart[b1], x2); --b1; } @@ -297,7 +284,6 @@ static void R_DrawPlanes2(void) #ifdef MARS lpl.baseyscale *= 64; #endif - lpl.mapplane = detailmode == detmode_potato ? R_MapPotatoPlane : R_MapPlane; extralight = vd.extralight; while ((pl = R_GetNextPlane((uint16_t *)vd.gsortedvisplanes)) != NULL) diff --git a/r_phase9.c b/r_phase9.c index 0b71313c2..861cc0fe4 100644 --- a/r_phase9.c +++ b/r_phase9.c @@ -69,7 +69,6 @@ static void R_UpdateCache(void) maxplanemip = maxmip; } - if (detailmode != detmode_potato) { flattex_t *flat = &flatpixels[wall->floorpicnum];