From 1ec06463d982b22ca3e5617c9fba74fe6e0ef054 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sat, 17 Dec 2016 22:34:36 +0100 Subject: [PATCH 1/2] - Set colormap light info using R_SetColorMapLight and R_SetDSColorMapLight rather than manually calculating it - Move texture and span management into R_DrawMaskedColumn --- src/r_draw.cpp | 10 +++++++ src/r_draw.h | 2 ++ src/r_main.h | 3 +++ src/r_plane.cpp | 40 ++++++++++++++++++++-------- src/r_segs.cpp | 40 ++++++++++++++-------------- src/r_things.cpp | 68 +++++++++++++++++++++++++----------------------- src/r_things.h | 2 +- src/v_draw.cpp | 30 +++------------------ 8 files changed, 104 insertions(+), 91 deletions(-) diff --git a/src/r_draw.cpp b/src/r_draw.cpp index a461e1877d..25297f6c84 100644 --- a/src/r_draw.cpp +++ b/src/r_draw.cpp @@ -548,6 +548,11 @@ namespace swrenderer dc_colormap = base_colormap + (GETPALOOKUP(light, shade) << COLORMAPSHIFT); } + void R_SetColorMapLight(FDynamicColormap *base_colormap, float light, int shade) + { + R_SetColorMapLight(base_colormap->Maps, light, shade); + } + void R_SetDSColorMapLight(lighttable_t *base_colormap, float light, int shade) { using namespace drawerargs; @@ -555,6 +560,11 @@ namespace swrenderer ds_colormap = base_colormap + (GETPALOOKUP(light, shade) << COLORMAPSHIFT); } + void R_SetDSColorMapLight(FDynamicColormap *base_colormap, float light, int shade) + { + R_SetDSColorMapLight(base_colormap->Maps, light, shade); + } + void R_SetTranslationMap(lighttable_t *translation) { using namespace drawerargs; diff --git a/src/r_draw.h b/src/r_draw.h index 58934981b0..ab430d2af5 100644 --- a/src/r_draw.h +++ b/src/r_draw.h @@ -192,7 +192,9 @@ namespace swrenderer void R_DrawDoubleSkyCol4(uint32_t solid_top, uint32_t solid_bottom); void R_SetColorMapLight(lighttable_t *base_colormap, float light, int shade); + void R_SetColorMapLight(FDynamicColormap *base_colormap, float light, int shade); void R_SetDSColorMapLight(lighttable_t *base_colormap, float light, int shade); + void R_SetDSColorMapLight(FDynamicColormap *base_colormap, float light, int shade); void R_SetTranslationMap(lighttable_t *translation); void R_SetupSpanBits(FTexture *tex); diff --git a/src/r_main.h b/src/r_main.h index 87b56163b0..be1c36306d 100644 --- a/src/r_main.h +++ b/src/r_main.h @@ -85,6 +85,9 @@ extern bool r_dontmaplines; // Change R_CalcTiltedLighting() when this changes. #define GETPALOOKUP(vis,shade) (clamp (((shade)-FLOAT2FIXED(MIN(MAXLIGHTVIS,double(vis))))>>FRACBITS, 0, NUMCOLORMAPS-1)) +// Converts fixedlightlev into a shade value +#define FIXEDLIGHT2SHADE(lightlev) (((lightlev) >> COLORMAPSHIFT) << FRACBITS) + extern double GlobVis; void R_SetVisibility(double visibility); diff --git a/src/r_plane.cpp b/src/r_plane.cpp index eafc9fa26e..cd378aec14 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -240,8 +240,7 @@ void R_MapPlane (int y, int x1) if (plane_shade) { // Determine lighting based on the span's distance from the viewer. - ds_colormap = basecolormap->Maps + (GETPALOOKUP ( - GlobVis * fabs(CenterY - y), planeshade) << COLORMAPSHIFT); + R_SetDSColorMapLight(basecolormap, GlobVis * fabs(CenterY - y), planeshade); } ds_y = y; @@ -1043,7 +1042,7 @@ void R_DrawSinglePlane (visplane_t *pl, fixed_t alpha, bool additive, bool maske R_SetupSpanBits(tex); double xscale = pl->xform.xScale * tex->Scale.X; double yscale = pl->xform.yScale * tex->Scale.Y; - ds_source = tex->GetPixels (); + R_SetSpanSource(tex); basecolormap = pl->colormap; planeshade = LIGHT2SHADE(pl->lightlevel); @@ -1405,12 +1404,13 @@ void R_DrawSkyPlane (visplane_t *pl) bool fakefixed = false; if (fixedcolormap) { - dc_colormap = fixedcolormap; + R_SetColorMapLight(fixedcolormap, 0, 0); } else { fakefixed = true; - fixedcolormap = dc_colormap = NormalLight.Maps; + fixedcolormap = NormalLight.Maps; + R_SetColorMapLight(fixedcolormap, 0, 0); } R_DrawSky (pl); @@ -1484,12 +1484,21 @@ void R_DrawNormalPlane (visplane_t *pl, double _xscale, double _yscale, fixed_t planeheight = fabs(pl->height.Zat0() - ViewPos.Z); GlobVis = r_FloorVisibility / planeheight; + ds_light = 0; if (fixedlightlev >= 0) - ds_colormap = basecolormap->Maps + fixedlightlev, plane_shade = false; + { + R_SetDSColorMapLight(basecolormap, 0, FIXEDLIGHT2SHADE(fixedlightlev)); + plane_shade = false; + } else if (fixedcolormap) - ds_colormap = fixedcolormap, plane_shade = false; + { + R_SetDSColorMapLight(fixedcolormap, 0, 0); + plane_shade = false; + } else + { plane_shade = true; + } if (spanfunc != R_FillSpan) { @@ -1645,11 +1654,20 @@ void R_DrawTiltedPlane (visplane_t *pl, double _xscale, double _yscale, fixed_t planelightfloat = -planelightfloat; if (fixedlightlev >= 0) - ds_colormap = basecolormap->Maps + fixedlightlev, plane_shade = false; + { + R_SetDSColorMapLight(basecolormap, 0, FIXEDLIGHT2SHADE(fixedlightlev)); + plane_shade = false; + } else if (fixedcolormap) - ds_colormap = fixedcolormap, plane_shade = false; + { + R_SetDSColorMapLight(fixedcolormap, 0, 0); + plane_shade = false; + } else - ds_colormap = basecolormap->Maps, plane_shade = true; + { + R_SetDSColorMapLight(basecolormap, 0, 0); + plane_shade = true; + } // Hack in support for 1 x Z and Z x 1 texture sizes if (ds_ybits == 0) @@ -1766,4 +1784,4 @@ bool R_PlaneInitData () return true; } -} \ No newline at end of file +} diff --git a/src/r_segs.cpp b/src/r_segs.cpp index d6ab86aa07..38db1a6b28 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -44,6 +44,7 @@ #include "r_plane.h" #include "r_segs.h" #include "r_3dfloors.h" +#include "r_draw.h" #include "v_palette.h" #include "r_data/colormaps.h" @@ -53,8 +54,9 @@ CVAR(Bool, r_fogboundary, true, 0) CVAR(Bool, r_drawmirrors, true, 0) EXTERN_CVAR(Bool, r_fullbrightignoresectorcolor); +EXTERN_CVAR(Bool, r_mipmap) -namespace swrenderer +namespace swrenderer { using namespace drawerargs; @@ -156,7 +158,7 @@ static void BlastMaskedColumn (FTexture *tex, bool useRt) // calculate lighting if (fixedcolormap == NULL && fixedlightlev < 0) { - dc_colormap = basecolormap->Maps + (GETPALOOKUP (rw_light, wallshade) << COLORMAPSHIFT); + R_SetColorMapLight(basecolormap, rw_light, wallshade); } dc_iscale = xs_Fix<16>::ToFix(MaskedSWall[dc_x] * MaskedScaleY); @@ -174,9 +176,7 @@ static void BlastMaskedColumn (FTexture *tex, bool useRt) // when forming multipatched textures (see r_data.c). // draw the texture - const FTexture::Span *spans; - const BYTE *pixels = tex->GetColumn (maskedtexturecol[dc_x] >> FRACBITS, &spans); - R_DrawMaskedColumn(pixels, spans, useRt); + R_DrawMaskedColumn(tex, maskedtexturecol[dc_x], useRt); rw_light += rw_lightstep; spryscale += rw_scalestep; } @@ -292,9 +292,9 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2) rw_scalestep = ds->iscalestep; if (fixedlightlev >= 0) - dc_colormap = (r_fullbrightignoresectorcolor) ? (FullNormalLight.Maps + fixedlightlev) : (basecolormap->Maps + fixedlightlev); + R_SetColorMapLight((r_fullbrightignoresectorcolor) ? &FullNormalLight : basecolormap, 0, FIXEDLIGHT2SHADE(fixedlightlev)); else if (fixedcolormap != NULL) - dc_colormap = fixedcolormap; + R_SetColorMapLight(fixedcolormap, 0, 0); // find positioning texheight = tex->GetScaledHeightDouble(); @@ -440,7 +440,7 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2) while (dc_x < stop) { - rt_initcols(); + rt_initcols(nullptr); BlastMaskedColumn (tex, true); dc_x++; BlastMaskedColumn (tex, true); dc_x++; BlastMaskedColumn (tex, true); dc_x++; @@ -609,9 +609,9 @@ void R_RenderFakeWall(drawseg_t *ds, int x1, int x2, F3DFloor *rover) } if (fixedlightlev >= 0) - dc_colormap = (r_fullbrightignoresectorcolor) ? (FullNormalLight.Maps + fixedlightlev) : (basecolormap->Maps + fixedlightlev); + R_SetColorMapLight((r_fullbrightignoresectorcolor) ? &FullNormalLight : basecolormap, 0, FIXEDLIGHT2SHADE(fixedlightlev)); else if (fixedcolormap != NULL) - dc_colormap = fixedcolormap; + R_SetColorMapLight(fixedcolormap, 0, 0); WallC.sz1 = ds->sz1; WallC.sz2 = ds->sz2; @@ -1061,9 +1061,9 @@ void R_RenderSegLoop () fixed_t xoffset = rw_offset; if (fixedlightlev >= 0) - dc_colormap = (r_fullbrightignoresectorcolor) ? (FullNormalLight.Maps + fixedlightlev) : (basecolormap->Maps + fixedlightlev); + R_SetColorMapLight((r_fullbrightignoresectorcolor) ? &FullNormalLight : basecolormap, 0, FIXEDLIGHT2SHADE(fixedlightlev)); else if (fixedcolormap != NULL) - dc_colormap = fixedcolormap; + R_SetColorMapLight(fixedcolormap, 0, 0); // clip wall to the floor and ceiling for (x = x1; x < x2; ++x) @@ -2304,11 +2304,11 @@ static void R_RenderDecal (side_t *wall, DBaseDecal *decal, drawseg_t *clipper, rw_light = rw_lightleft + (x1 - savecoord.sx1) * rw_lightstep; if (fixedlightlev >= 0) - dc_colormap = (r_fullbrightignoresectorcolor) ? (FullNormalLight.Maps + fixedlightlev) : (usecolormap->Maps + fixedlightlev); + R_SetColorMapLight((r_fullbrightignoresectorcolor) ? &FullNormalLight : usecolormap, 0, FIXEDLIGHT2SHADE(fixedlightlev)); else if (fixedcolormap != NULL) - dc_colormap = fixedcolormap; + R_SetColorMapLight(fixedcolormap, 0, 0); else if (!foggy && (decal->RenderFlags & RF_FULLBRIGHT)) - dc_colormap = (r_fullbrightignoresectorcolor) ? FullNormalLight.Maps : usecolormap->Maps; + R_SetColorMapLight((r_fullbrightignoresectorcolor) ? &FullNormalLight : usecolormap, 0, 0); else calclighting = true; @@ -2359,7 +2359,7 @@ static void R_RenderDecal (side_t *wall, DBaseDecal *decal, drawseg_t *clipper, { if (calclighting) { // calculate lighting - dc_colormap = usecolormap->Maps + (GETPALOOKUP (rw_light, wallshade) << COLORMAPSHIFT); + R_SetColorMapLight(usecolormap, rw_light, wallshade); } R_WallSpriteColumn (false); dc_x++; @@ -2369,9 +2369,9 @@ static void R_RenderDecal (side_t *wall, DBaseDecal *decal, drawseg_t *clipper, { if (calclighting) { // calculate lighting - dc_colormap = usecolormap->Maps + (GETPALOOKUP (rw_light, wallshade) << COLORMAPSHIFT); + R_SetColorMapLight(usecolormap, rw_light, wallshade); } - rt_initcols(); + rt_initcols(nullptr); for (int zz = 4; zz; --zz) { R_WallSpriteColumn (true); @@ -2384,7 +2384,7 @@ static void R_RenderDecal (side_t *wall, DBaseDecal *decal, drawseg_t *clipper, { if (calclighting) { // calculate lighting - dc_colormap = usecolormap->Maps + (GETPALOOKUP (rw_light, wallshade) << COLORMAPSHIFT); + R_SetColorMapLight(usecolormap, rw_light, wallshade); } R_WallSpriteColumn (false); dc_x++; @@ -2408,4 +2408,4 @@ done: WallC = savecoord; } -} \ No newline at end of file +} diff --git a/src/r_things.cpp b/src/r_things.cpp index 9e9b161cdf..f03bfbae0a 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -256,8 +256,23 @@ double sprtopscreen; bool sprflipvert; -void R_DrawMaskedColumn (const BYTE *column, const FTexture::Span *span, bool useRt) +void R_DrawMaskedColumn (FTexture *tex, fixed_t col, bool useRt, bool unmasked) { + const FTexture::Span *span; + const BYTE *column; + + column = tex->GetColumn(col >> FRACBITS, &span); + + FTexture::Span unmaskedSpan[2]; + if (unmasked) + { + span = unmaskedSpan; + unmaskedSpan[0].TopOffset = 0; + unmaskedSpan[0].Length = tex->GetHeight(); + unmaskedSpan[1].TopOffset = 0; + unmaskedSpan[1].Length = 0; + } + while (span->Length != 0) { const int length = span->Length; @@ -377,8 +392,6 @@ static inline bool R_ClipSpriteColumnWithPortals(vissprite_t* spr) // void R_DrawVisSprite (vissprite_t *vis) { - const BYTE *pixels; - const FTexture::Span *spans; fixed_t frac; FTexture *tex; int x2, stop4; @@ -392,7 +405,7 @@ void R_DrawVisSprite (vissprite_t *vis) } fixed_t centeryfrac = FLOAT2FIXED(CenterY); - dc_colormap = vis->Style.colormap; + R_SetColorMapLight(vis->Style.colormap, 0.0f, 0); mode = R_SetPatchStyle (vis->Style.RenderStyle, vis->Style.Alpha, vis->Translation, vis->FillColor); @@ -400,7 +413,7 @@ void R_DrawVisSprite (vissprite_t *vis) { // For shaded sprites, R_SetPatchStyle sets a dc_colormap to an alpha table, but // it is the brightest one. We need to get back to the proper light level for // this sprite. - dc_colormap += vis->ColormapNum << COLORMAPSHIFT; + R_SetColorMapLight(dc_colormap, 0, vis->ColormapNum << FRACBITS); } if (mode != DontDraw) @@ -445,21 +458,19 @@ void R_DrawVisSprite (vissprite_t *vis) { while ((dc_x < stop4) && (dc_x & 3)) { - pixels = tex->GetColumn (frac >> FRACBITS, &spans); if (ispsprite || !R_ClipSpriteColumnWithPortals(vis)) - R_DrawMaskedColumn (pixels, spans, false); + R_DrawMaskedColumn (tex, frac, false); dc_x++; frac += xiscale; } while (dc_x < stop4) { - rt_initcols(); + rt_initcols(nullptr); for (int zz = 4; zz; --zz) { - pixels = tex->GetColumn (frac >> FRACBITS, &spans); if (ispsprite || !R_ClipSpriteColumnWithPortals(vis)) - R_DrawMaskedColumn (pixels, spans, true); + R_DrawMaskedColumn (tex, frac, true); dc_x++; frac += xiscale; } @@ -468,9 +479,8 @@ void R_DrawVisSprite (vissprite_t *vis) while (dc_x < x2) { - pixels = tex->GetColumn (frac >> FRACBITS, &spans); if (ispsprite || !R_ClipSpriteColumnWithPortals(vis)) - R_DrawMaskedColumn (pixels, spans, false); + R_DrawMaskedColumn (tex, frac, false); dc_x++; frac += xiscale; } @@ -522,11 +532,11 @@ void R_DrawWallSprite(vissprite_t *spr) rw_lightstep = float((GlobVis / spr->wallc.sz2 - rw_lightleft) / (spr->wallc.sx2 - spr->wallc.sx1)); rw_light = rw_lightleft + (x1 - spr->wallc.sx1) * rw_lightstep; if (fixedlightlev >= 0) - dc_colormap = usecolormap->Maps + fixedlightlev; + R_SetColorMapLight(usecolormap, 0, FIXEDLIGHT2SHADE(fixedlightlev)); else if (fixedcolormap != NULL) - dc_colormap = fixedcolormap; + R_SetColorMapLight(fixedcolormap, 0, 0); else if (!foggy && (spr->renderflags & RF_FULLBRIGHT)) - dc_colormap = (r_fullbrightignoresectorcolor) ? FullNormalLight.Maps : usecolormap->Maps; + R_SetColorMapLight((r_fullbrightignoresectorcolor) ? &FullNormalLight : usecolormap, 0, 0); else calclighting = true; @@ -577,7 +587,7 @@ void R_DrawWallSprite(vissprite_t *spr) { if (calclighting) { // calculate lighting - dc_colormap = usecolormap->Maps + (GETPALOOKUP (rw_light, shade) << COLORMAPSHIFT); + R_SetColorMapLight(usecolormap, rw_light, shade); } if (!R_ClipSpriteColumnWithPortals(spr)) R_WallSpriteColumn(false); @@ -588,9 +598,9 @@ void R_DrawWallSprite(vissprite_t *spr) { if (calclighting) { // calculate lighting - dc_colormap = usecolormap->Maps + (GETPALOOKUP (rw_light, shade) << COLORMAPSHIFT); + R_SetColorMapLight(usecolormap, rw_light, shade); } - rt_initcols(); + rt_initcols(nullptr); for (int zz = 4; zz; --zz) { if (!R_ClipSpriteColumnWithPortals(spr)) @@ -604,7 +614,7 @@ void R_DrawWallSprite(vissprite_t *spr) { if (calclighting) { // calculate lighting - dc_colormap = usecolormap->Maps + (GETPALOOKUP (rw_light, shade) << COLORMAPSHIFT); + R_SetColorMapLight(usecolormap, rw_light, shade); } if (!R_ClipSpriteColumnWithPortals(spr)) R_WallSpriteColumn(false); @@ -624,11 +634,8 @@ void R_WallSpriteColumn (bool useRt) else sprtopscreen = CenterY - dc_texturemid * spryscale; - const BYTE *column; - const FTexture::Span *spans; - column = WallSpriteTile->GetColumn (lwall[dc_x] >> FRACBITS, &spans); dc_texturefrac = 0; - R_DrawMaskedColumn(column, spans, useRt); + R_DrawMaskedColumn(WallSpriteTile, lwall[dc_x], useRt); rw_light += rw_lightstep; } @@ -638,7 +645,7 @@ void R_DrawVisVoxel(vissprite_t *spr, int minslabz, int maxslabz, short *cliptop int flags = 0; // Do setup for blending. - dc_colormap = spr->Style.colormap; + R_SetColorMapLight(spr->Style.colormap, 0.0f, 0); mode = R_SetPatchStyle(spr->Style.RenderStyle, spr->Style.Alpha, spr->Translation, spr->FillColor); if (mode == DontDraw) @@ -689,10 +696,7 @@ void R_DrawVisVoxel(vissprite_t *spr, int minslabz, int maxslabz, short *cliptop } else { - unsigned int **tspan = &dc_ctspan[x & 3]; - (*tspan)[0] = span->Start; - (*tspan)[1] = span->Stop - 1; - *tspan += 2; + rt_span_coverage(x, span->Start, span->Stop - 1); } } if (!(flags & DVF_SPANSONLY) && (x & 3) == 3) @@ -2044,7 +2048,7 @@ void R_DrawSprite (vissprite_t *spr) else { // diminished light spriteshade = LIGHT2SHADE(sec->lightlevel + r_actualextralight); - spr->Style.colormap = mybasecolormap->Maps + (GETPALOOKUP ( + spr->Style.colormap = mybasecolormap->Maps + (GETPALOOKUP( r_SpriteVisibility / MAX(MINZ, (double)spr->depth), spriteshade) << COLORMAPSHIFT); } } @@ -3237,16 +3241,16 @@ void R_CheckOffscreenBuffer(int width, int height, bool spansonly) { if (OffscreenColorBuffer == NULL) { - OffscreenColorBuffer = new BYTE[width * height]; + OffscreenColorBuffer = new BYTE[width * height * 4]; } else if (OffscreenBufferWidth != width || OffscreenBufferHeight != height) { delete[] OffscreenColorBuffer; - OffscreenColorBuffer = new BYTE[width * height]; + OffscreenColorBuffer = new BYTE[width * height * 4]; } } OffscreenBufferWidth = width; OffscreenBufferHeight = height; } -} \ No newline at end of file +} diff --git a/src/r_things.h b/src/r_things.h index bf32b655f2..6d694b8fd7 100644 --- a/src/r_things.h +++ b/src/r_things.h @@ -128,7 +128,7 @@ extern double pspriteyscale; extern FTexture *WallSpriteTile; -void R_DrawMaskedColumn (const BYTE *column, const FTexture::Span *spans, bool useRt); +void R_DrawMaskedColumn (FTexture *texture, fixed_t column, bool useRt, bool unmasked = false); void R_WallSpriteColumn (bool useRt); void R_CacheSprite (spritedef_t *sprite); diff --git a/src/v_draw.cpp b/src/v_draw.cpp index 1524c7ba4a..6f8bc51988 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -135,20 +135,9 @@ void DCanvas::DrawTextureParms(FTexture *img, DrawParms &parms) using namespace swrenderer; using namespace drawerargs; - FTexture::Span unmaskedSpan[2]; - const FTexture::Span **spanptr, *spans; static short bottomclipper[MAXWIDTH], topclipper[MAXWIDTH]; const BYTE *translation = NULL; - if (parms.masked) - { - spanptr = &spans; - } - else - { - spanptr = NULL; - } - if (APART(parms.colorOverlay) != 0) { // The software renderer cannot invert the source without inverting the overlay @@ -198,18 +187,8 @@ void DCanvas::DrawTextureParms(FTexture *img, DrawParms &parms) if (mode != DontDraw) { - const BYTE *pixels; int stop4; - if (spanptr == NULL) - { // Create a single span for forced unmasked images - spans = unmaskedSpan; - unmaskedSpan[0].TopOffset = 0; - unmaskedSpan[0].Length = img->GetHeight(); - unmaskedSpan[1].TopOffset = 0; - unmaskedSpan[1].Length = 0; - } - double centeryback = CenterY; CenterY = 0; @@ -301,8 +280,7 @@ void DCanvas::DrawTextureParms(FTexture *img, DrawParms &parms) { while ((dc_x < stop4) && (dc_x & 3)) { - pixels = img->GetColumn(frac >> FRACBITS, spanptr); - R_DrawMaskedColumn(pixels, spans, false); + R_DrawMaskedColumn(img, frac, false, !parms.masked); dc_x++; frac += xiscale_i; } @@ -312,8 +290,7 @@ void DCanvas::DrawTextureParms(FTexture *img, DrawParms &parms) rt_initcols(); for (int zz = 4; zz; --zz) { - pixels = img->GetColumn(frac >> FRACBITS, spanptr); - R_DrawMaskedColumn(pixels, spans, true); + R_DrawMaskedColumn(img, frac, true, !parms.masked); dc_x++; frac += xiscale_i; } @@ -322,8 +299,7 @@ void DCanvas::DrawTextureParms(FTexture *img, DrawParms &parms) while (dc_x < x2_i) { - pixels = img->GetColumn(frac >> FRACBITS, spanptr); - R_DrawMaskedColumn(pixels, spans, false); + R_DrawMaskedColumn(img, frac, false, !parms.masked); dc_x++; frac += xiscale_i; } From bb3fa15bed3f4cf5926b1f1e087a4f2ee21596f6 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sat, 17 Dec 2016 22:57:57 +0100 Subject: [PATCH 2/2] Removed leftovers from QZDoom --- src/r_segs.cpp | 3 +-- src/r_things.cpp | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/r_segs.cpp b/src/r_segs.cpp index 38db1a6b28..ccf6ccf20c 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -54,9 +54,8 @@ CVAR(Bool, r_fogboundary, true, 0) CVAR(Bool, r_drawmirrors, true, 0) EXTERN_CVAR(Bool, r_fullbrightignoresectorcolor); -EXTERN_CVAR(Bool, r_mipmap) -namespace swrenderer +namespace swrenderer { using namespace drawerargs; diff --git a/src/r_things.cpp b/src/r_things.cpp index f03bfbae0a..a1ace0d49c 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -3241,12 +3241,12 @@ void R_CheckOffscreenBuffer(int width, int height, bool spansonly) { if (OffscreenColorBuffer == NULL) { - OffscreenColorBuffer = new BYTE[width * height * 4]; + OffscreenColorBuffer = new BYTE[width * height]; } else if (OffscreenBufferWidth != width || OffscreenBufferHeight != height) { delete[] OffscreenColorBuffer; - OffscreenColorBuffer = new BYTE[width * height * 4]; + OffscreenColorBuffer = new BYTE[width * height]; } } OffscreenBufferWidth = width;