Skip to content

Commit

Permalink
Remove potato detail mode
Browse files Browse the repository at this point in the history
  • Loading branch information
viciious committed Oct 16, 2023
1 parent 0027b0a commit a4663c1
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 114 deletions.
8 changes: 0 additions & 8 deletions doomdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
84 changes: 0 additions & 84 deletions marsdraw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
1 change: 0 additions & 1 deletion r_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ extern fixed_t weaponXScale;

typedef enum
{
detmode_potato = -1,
detmode_medium,
detmode_high,
detmode_mipmaps,
Expand Down
6 changes: 2 additions & 4 deletions r_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
{
Expand All @@ -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
Expand Down
18 changes: 2 additions & 16 deletions r_phase7.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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
//
Expand All @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion r_phase9.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ static void R_UpdateCache(void)
maxplanemip = maxmip;
}

if (detailmode != detmode_potato)
{
flattex_t *flat = &flatpixels[wall->floorpicnum];

Expand Down

0 comments on commit a4663c1

Please sign in to comment.