diff --git a/src/swrenderer/drawers/r_draw_pal.cpp b/src/swrenderer/drawers/r_draw_pal.cpp index 539baedfd..81f7999d1 100644 --- a/src/swrenderer/drawers/r_draw_pal.cpp +++ b/src/swrenderer/drawers/r_draw_pal.cpp @@ -98,17 +98,17 @@ namespace swrenderer { PalWall1Command::PalWall1Command(const WallDrawerArgs &args) { - _iscale = args.dc_iscale; - _texturefrac = args.dc_texturefrac; + _iscale = args.TextureVStep(); + _texturefrac = args.TextureVPos(); _colormap = args.Colormap(); - _count = args.dc_count; - _source = args.dc_source; + _count = args.Count(); + _source = args.TexturePixels(); _dest = args.Dest(); _dest_y = args.DestY(); - _fracbits = args.dc_wall_fracbits; + _fracbits = args.TextureFracBits(); _pitch = RenderViewport::Instance()->RenderTarget->GetPitch(); - _srcblend = args.dc_srcblend; - _destblend = args.dc_destblend; + _srcblend = args.SrcBlend(); + _destblend = args.DestBlend(); _dynlights = args.dc_lights; _num_dynlights = args.dc_num_lights; _viewpos_z = args.dc_viewpos.Z; diff --git a/src/swrenderer/drawers/r_draw_rgba.cpp b/src/swrenderer/drawers/r_draw_rgba.cpp index 4162f2f92..0c5d9ec82 100644 --- a/src/swrenderer/drawers/r_draw_rgba.cpp +++ b/src/swrenderer/drawers/r_draw_rgba.cpp @@ -187,13 +187,13 @@ namespace swrenderer args.dest = (uint32_t*)drawerargs.Dest(); args.dest_y = drawerargs.DestY(); args.pitch = RenderViewport::Instance()->RenderTarget->GetPitch(); - args.count = drawerargs.dc_count; - args.texturefrac[0] = drawerargs.dc_texturefrac; - args.texturefracx[0] = drawerargs.dc_texturefracx; - args.iscale[0] = drawerargs.dc_iscale; - args.textureheight[0] = drawerargs.dc_textureheight; - args.source[0] = (const uint32 *)drawerargs.dc_source; - args.source2[0] = (const uint32 *)drawerargs.dc_source2; + args.count = drawerargs.Count(); + args.texturefrac[0] = drawerargs.TextureVPos(); + args.texturefracx[0] = drawerargs.TextureUPos(); + args.iscale[0] = drawerargs.TextureVStep(); + args.textureheight[0] = drawerargs.TextureHeight(); + args.source[0] = (const uint32 *)drawerargs.TexturePixels(); + args.source2[0] = (const uint32 *)drawerargs.TexturePixels2(); args.light[0] = LightBgra::calc_light_multiplier(drawerargs.Light()); args.light_red = shade_constants.light_red; args.light_green = shade_constants.light_green; @@ -204,8 +204,8 @@ namespace swrenderer args.fade_blue = shade_constants.fade_blue; args.fade_alpha = shade_constants.fade_alpha; args.desaturate = shade_constants.desaturate; - args.srcalpha = drawerargs.dc_srcalpha >> (FRACBITS - 8); - args.destalpha = drawerargs.dc_destalpha >> (FRACBITS - 8); + args.srcalpha = drawerargs.SrcAlpha() >> (FRACBITS - 8); + args.destalpha = drawerargs.DestAlpha() >> (FRACBITS - 8); args.flags = 0; if (shade_constants.simple_shade) args.flags |= DrawWallArgs::simple_shade; diff --git a/src/swrenderer/drawers/r_drawerargs.cpp b/src/swrenderer/drawers/r_drawerargs.cpp index 7bf3e0419..1b9b1556e 100644 --- a/src/swrenderer/drawers/r_drawerargs.cpp +++ b/src/swrenderer/drawers/r_drawerargs.cpp @@ -63,7 +63,7 @@ namespace swrenderer spanfunc = &SWPixelFormatDrawers::DrawSpan; } - void DrawerArgs::SetColorMapLight(FSWColormap *base_colormap, float light, int shade) + void DrawerArgs::SetLight(FSWColormap *base_colormap, float light, int shade) { mBaseColormap = base_colormap; mTranslation = nullptr; @@ -542,11 +542,11 @@ namespace swrenderer { fixed_t shade = shadedlightshade; if (shade == 0) FIXEDLIGHT2SHADE(cameraLight->fixedlightlev); - SetColorMapLight(basecolormap, 0, shade); + SetLight(basecolormap, 0, shade); } else { - SetColorMapLight(basecolormap, 0, shadedlightshade); + SetLight(basecolormap, 0, shadedlightshade); } return true; } @@ -573,7 +573,7 @@ namespace swrenderer // dc_srccolor is used by the R_Fill* routines. It is premultiplied // with the alpha. dc_srccolor = ((((r*x) >> 4) << 20) | ((g*x) >> 4) | ((((b)*x) >> 4) << 10)) & 0x3feffbff; - SetColorMapLight(&identitycolormap, 0, 0); + SetLight(&identitycolormap, 0, 0); } if (!SpriteDrawerArgs::SetBlendFunc(style.BlendOp, fglevel, bglevel, style.Flags)) diff --git a/src/swrenderer/drawers/r_drawerargs.h b/src/swrenderer/drawers/r_drawerargs.h index ca6d202ea..56e7c6afe 100644 --- a/src/swrenderer/drawers/r_drawerargs.h +++ b/src/swrenderer/drawers/r_drawerargs.h @@ -24,7 +24,7 @@ namespace swrenderer class DrawerArgs { public: - void SetColorMapLight(FSWColormap *base_colormap, float light, int shade); + void SetLight(FSWColormap *base_colormap, float light, int shade); void SetTranslationMap(lighttable_t *translation); uint8_t *Colormap() const; @@ -70,7 +70,7 @@ namespace swrenderer const uint8_t *FrontTexturePixels() const { return dc_source; } const uint8_t *BackTexturePixels() const { return dc_source2; } int FrontTextureHeight() const { return dc_sourceheight; } - int BackTextureHeight() const { return dc_sourceheight; } + int BackTextureHeight() const { return dc_sourceheight2; } void DrawSingleSkyColumn(); void DrawDoubleSkyColumn(); @@ -164,6 +164,17 @@ namespace swrenderer public: void SetStyle(bool masked, bool additive, fixed_t alpha); void SetDest(int x, int y); + void SetCount(int count) { dc_count = count; } + void SetTexture(const uint8_t *pixels, const uint8_t *pixels2, int height) + { + dc_source = pixels; + dc_source2 = pixels2; + dc_textureheight = height; + } + void SetTextureFracBits(int bits) { dc_wall_fracbits = bits; } + void SetTextureUPos(uint32_t pos) { dc_texturefracx = pos; } + void SetTextureVPos(fixed_t pos) { dc_texturefrac = pos; } + void SetTextureVStep(fixed_t step) { dc_iscale = step; } bool IsMaskedDrawer() const; @@ -171,21 +182,22 @@ namespace swrenderer uint8_t *Dest() const { return dc_dest; } int DestY() const { return dc_dest_y; } + int Count() const { return dc_count; } - uint32_t *dc_srcblend; - uint32_t *dc_destblend; - fixed_t dc_srcalpha; - fixed_t dc_destalpha; + uint32_t *SrcBlend() const { return dc_srcblend; } + uint32_t *DestBlend() const { return dc_destblend; } + fixed_t SrcAlpha() const { return dc_srcalpha; } + fixed_t DestAlpha() const { return dc_destalpha; } - fixed_t dc_iscale; - fixed_t dc_texturefrac; - uint32_t dc_texturefracx; - uint32_t dc_textureheight; - const uint8_t *dc_source; - const uint8_t *dc_source2; - int dc_count; - - int dc_wall_fracbits; + uint32_t TextureUPos() const { return dc_texturefracx; } + fixed_t TextureVPos() const { return dc_texturefrac; } + fixed_t TextureVStep() const { return dc_iscale; } + uint32_t TextureHeight() const { return dc_textureheight; } + + const uint8_t *TexturePixels() const { return dc_source; } + const uint8_t *TexturePixels2() const { return dc_source2; } + + int TextureFracBits() const { return dc_wall_fracbits; } FVector3 dc_normal; FVector3 dc_viewpos; @@ -196,6 +208,20 @@ namespace swrenderer private: uint8_t *dc_dest = nullptr; int dc_dest_y = 0; + int dc_count; + + fixed_t dc_iscale; + fixed_t dc_texturefrac; + uint32_t dc_texturefracx; + uint32_t dc_textureheight; + const uint8_t *dc_source; + const uint8_t *dc_source2; + int dc_wall_fracbits; + + uint32_t *dc_srcblend; + uint32_t *dc_destblend; + fixed_t dc_srcalpha; + fixed_t dc_destalpha; typedef void(SWPixelFormatDrawers::*WallDrawerFunc)(const WallDrawerArgs &args); WallDrawerFunc wallfunc = nullptr; diff --git a/src/swrenderer/line/r_fogboundary.cpp b/src/swrenderer/line/r_fogboundary.cpp index f585109a4..b75ce82ce 100644 --- a/src/swrenderer/line/r_fogboundary.cpp +++ b/src/swrenderer/line/r_fogboundary.cpp @@ -64,7 +64,7 @@ namespace swrenderer fillshort(spanend + t2, b2 - t2, x); } - drawerargs.SetColorMapLight(basecolormap, (float)light, wallshade); + drawerargs.SetLight(basecolormap, (float)light, wallshade); uint8_t *fake_dc_colormap = basecolormap->Maps + (GETPALOOKUP(light, wallshade) << COLORMAPSHIFT); @@ -91,7 +91,7 @@ namespace swrenderer fillshort(spanend + t2, b2 - t2, x); } rcolormap = lcolormap; - drawerargs.SetColorMapLight(basecolormap, (float)light, wallshade); + drawerargs.SetLight(basecolormap, (float)light, wallshade); fake_dc_colormap = basecolormap->Maps + (GETPALOOKUP(light, wallshade) << COLORMAPSHIFT); } else diff --git a/src/swrenderer/line/r_line.cpp b/src/swrenderer/line/r_line.cpp index dea8f62e7..0cc59826e 100644 --- a/src/swrenderer/line/r_line.cpp +++ b/src/swrenderer/line/r_line.cpp @@ -936,9 +936,9 @@ namespace swrenderer CameraLight *cameraLight = CameraLight::Instance(); if (cameraLight->fixedlightlev >= 0) - drawerargs.SetColorMapLight((r_fullbrightignoresectorcolor) ? &FullNormalLight : basecolormap, 0, FIXEDLIGHT2SHADE(cameraLight->fixedlightlev)); + drawerargs.SetLight((r_fullbrightignoresectorcolor) ? &FullNormalLight : basecolormap, 0, FIXEDLIGHT2SHADE(cameraLight->fixedlightlev)); else if (cameraLight->fixedcolormap != nullptr) - drawerargs.SetColorMapLight(cameraLight->fixedcolormap, 0, 0); + drawerargs.SetLight(cameraLight->fixedcolormap, 0, 0); // clip wall to the floor and ceiling auto ceilingclip = RenderOpaquePass::Instance()->ceilingclip; diff --git a/src/swrenderer/line/r_renderdrawsegment.cpp b/src/swrenderer/line/r_renderdrawsegment.cpp index 42f46da5e..ea1db392e 100644 --- a/src/swrenderer/line/r_renderdrawsegment.cpp +++ b/src/swrenderer/line/r_renderdrawsegment.cpp @@ -149,13 +149,13 @@ namespace swrenderer if (cameraLight->fixedlightlev >= 0) { - walldrawerargs.SetColorMapLight((r_fullbrightignoresectorcolor) ? &FullNormalLight : basecolormap, 0, FIXEDLIGHT2SHADE(cameraLight->fixedlightlev)); - columndrawerargs.SetColorMapLight((r_fullbrightignoresectorcolor) ? &FullNormalLight : basecolormap, 0, FIXEDLIGHT2SHADE(cameraLight->fixedlightlev)); + walldrawerargs.SetLight((r_fullbrightignoresectorcolor) ? &FullNormalLight : basecolormap, 0, FIXEDLIGHT2SHADE(cameraLight->fixedlightlev)); + columndrawerargs.SetLight((r_fullbrightignoresectorcolor) ? &FullNormalLight : basecolormap, 0, FIXEDLIGHT2SHADE(cameraLight->fixedlightlev)); } else if (cameraLight->fixedcolormap != nullptr) { - walldrawerargs.SetColorMapLight(cameraLight->fixedcolormap, 0, 0); - columndrawerargs.SetColorMapLight(cameraLight->fixedcolormap, 0, 0); + walldrawerargs.SetLight(cameraLight->fixedcolormap, 0, 0); + columndrawerargs.SetLight(cameraLight->fixedcolormap, 0, 0); } // find positioning @@ -285,7 +285,7 @@ namespace swrenderer { if (cameraLight->fixedcolormap == nullptr && cameraLight->fixedlightlev < 0) { - columndrawerargs.SetColorMapLight(basecolormap, rw_light, wallshade); + columndrawerargs.SetLight(basecolormap, rw_light, wallshade); } fixed_t iscale = xs_Fix<16>::ToFix(MaskedSWall[x] * MaskedScaleY); @@ -456,9 +456,9 @@ namespace swrenderer CameraLight *cameraLight = CameraLight::Instance(); if (cameraLight->fixedlightlev >= 0) - drawerargs.SetColorMapLight((r_fullbrightignoresectorcolor) ? &FullNormalLight : basecolormap, 0, FIXEDLIGHT2SHADE(cameraLight->fixedlightlev)); + drawerargs.SetLight((r_fullbrightignoresectorcolor) ? &FullNormalLight : basecolormap, 0, FIXEDLIGHT2SHADE(cameraLight->fixedlightlev)); else if (cameraLight->fixedcolormap != nullptr) - drawerargs.SetColorMapLight(cameraLight->fixedcolormap, 0, 0); + drawerargs.SetLight(cameraLight->fixedcolormap, 0, 0); WallC.sz1 = ds->sz1; WallC.sz2 = ds->sz2; diff --git a/src/swrenderer/line/r_walldraw.cpp b/src/swrenderer/line/r_walldraw.cpp index 2f3fc04e0..8da0c4cb2 100644 --- a/src/swrenderer/line/r_walldraw.cpp +++ b/src/swrenderer/line/r_walldraw.cpp @@ -244,14 +244,12 @@ namespace swrenderer { int count = y2 - y1; - drawerargs.dc_source = sampler.source; - drawerargs.dc_source2 = sampler.source2; - drawerargs.dc_texturefracx = sampler.texturefracx; + drawerargs.SetTexture(sampler.source, sampler.source2, sampler.height); + drawerargs.SetTextureUPos(sampler.texturefracx); drawerargs.SetDest(x, y1); - drawerargs.dc_count = count; - drawerargs.dc_iscale = sampler.uv_step; - drawerargs.dc_texturefrac = sampler.uv_pos; - drawerargs.dc_textureheight = sampler.height; + drawerargs.SetCount(count); + drawerargs.SetTextureVStep(sampler.uv_step); + drawerargs.SetTextureVPos(sampler.uv_pos); drawerargs.DrawColumn(); uint64_t step64 = sampler.uv_step; @@ -264,13 +262,12 @@ namespace swrenderer { int count = y2 - y1; - drawerargs.dc_source = sampler.source; - drawerargs.dc_source2 = sampler.source2; - drawerargs.dc_texturefracx = sampler.texturefracx; + drawerargs.SetTexture(sampler.source, sampler.source2, sampler.height); + drawerargs.SetTextureUPos(sampler.texturefracx); drawerargs.SetDest(x, y1); - drawerargs.dc_count = count; - drawerargs.dc_iscale = sampler.uv_step; - drawerargs.dc_texturefrac = sampler.uv_pos; + drawerargs.SetCount(count); + drawerargs.SetTextureVStep(sampler.uv_step); + drawerargs.SetTextureVPos(sampler.uv_pos); drawerargs.DrawColumn(); uint64_t step64 = sampler.uv_step; @@ -290,13 +287,12 @@ namespace swrenderer next_uv_wrap++; uint32_t count = MIN(left, next_uv_wrap); - drawerargs.dc_source = sampler.source; - drawerargs.dc_source2 = sampler.source2; - drawerargs.dc_texturefracx = sampler.texturefracx; + drawerargs.SetTexture(sampler.source, sampler.source2, sampler.height); + drawerargs.SetTextureUPos(sampler.texturefracx); drawerargs.SetDest(x, y1); - drawerargs.dc_count = count; - drawerargs.dc_iscale = sampler.uv_step; - drawerargs.dc_texturefrac = uv_pos; + drawerargs.SetCount(count); + drawerargs.SetTextureVStep(sampler.uv_step); + drawerargs.SetTextureVPos(uv_pos); drawerargs.DrawColumn(); left -= count; @@ -324,15 +320,15 @@ namespace swrenderer texturemid = 0; } - drawerargs.dc_wall_fracbits = RenderViewport::Instance()->RenderTarget->IsBgra() ? FRACBITS : fracbits; + drawerargs.SetTextureFracBits(RenderViewport::Instance()->RenderTarget->IsBgra() ? FRACBITS : fracbits); CameraLight *cameraLight = CameraLight::Instance(); bool fixed = (cameraLight->fixedcolormap != NULL || cameraLight->fixedlightlev >= 0); if (cameraLight->fixedcolormap) - drawerargs.SetColorMapLight(cameraLight->fixedcolormap, 0, 0); + drawerargs.SetLight(cameraLight->fixedcolormap, 0, 0); else - drawerargs.SetColorMapLight(basecolormap, 0, 0); + drawerargs.SetLight(basecolormap, 0, 0); float dx = WallC.tright.X - WallC.tleft.X; float dy = WallC.tright.Y - WallC.tleft.Y; @@ -351,7 +347,7 @@ namespace swrenderer continue; if (!fixed) - drawerargs.SetColorMapLight(basecolormap, light, wallshade); + drawerargs.SetLight(basecolormap, light, wallshade); if (x + 1 < x2) xmagnitude = fabs(FIXED2DBL(lwal[x + 1]) - FIXED2DBL(lwal[x])); diff --git a/src/swrenderer/plane/r_flatplane.cpp b/src/swrenderer/plane/r_flatplane.cpp index 8c7c2704f..12cdc27fc 100644 --- a/src/swrenderer/plane/r_flatplane.cpp +++ b/src/swrenderer/plane/r_flatplane.cpp @@ -114,12 +114,12 @@ namespace swrenderer CameraLight *cameraLight = CameraLight::Instance(); if (cameraLight->fixedlightlev >= 0) { - drawerargs.SetColorMapLight(basecolormap, 0, FIXEDLIGHT2SHADE(cameraLight->fixedlightlev)); + drawerargs.SetLight(basecolormap, 0, FIXEDLIGHT2SHADE(cameraLight->fixedlightlev)); plane_shade = false; } else if (cameraLight->fixedcolormap) { - drawerargs.SetColorMapLight(cameraLight->fixedcolormap, 0, 0); + drawerargs.SetLight(cameraLight->fixedcolormap, 0, 0); plane_shade = false; } else @@ -188,7 +188,7 @@ namespace swrenderer if (plane_shade) { // Determine lighting based on the span's distance from the viewer. - drawerargs.SetColorMapLight(basecolormap, (float)(GlobVis * fabs(viewport->CenterY - y)), planeshade); + drawerargs.SetLight(basecolormap, (float)(GlobVis * fabs(viewport->CenterY - y)), planeshade); } if (r_dynlights) diff --git a/src/swrenderer/plane/r_skyplane.cpp b/src/swrenderer/plane/r_skyplane.cpp index f7b4222f2..882df107f 100644 --- a/src/swrenderer/plane/r_skyplane.cpp +++ b/src/swrenderer/plane/r_skyplane.cpp @@ -151,13 +151,13 @@ namespace swrenderer CameraLight *cameraLight = CameraLight::Instance(); if (cameraLight->fixedcolormap) { - drawerargs.SetColorMapLight(cameraLight->fixedcolormap, 0, 0); + drawerargs.SetLight(cameraLight->fixedcolormap, 0, 0); } else { fakefixed = true; cameraLight->fixedcolormap = &NormalLight; - drawerargs.SetColorMapLight(cameraLight->fixedcolormap, 0, 0); + drawerargs.SetLight(cameraLight->fixedcolormap, 0, 0); } DrawSky(pl); diff --git a/src/swrenderer/plane/r_slopeplane.cpp b/src/swrenderer/plane/r_slopeplane.cpp index 93e98f2d8..f175c9b34 100644 --- a/src/swrenderer/plane/r_slopeplane.cpp +++ b/src/swrenderer/plane/r_slopeplane.cpp @@ -156,17 +156,17 @@ namespace swrenderer CameraLight *cameraLight = CameraLight::Instance(); if (cameraLight->fixedlightlev >= 0) { - drawerargs.SetColorMapLight(basecolormap, 0, FIXEDLIGHT2SHADE(cameraLight->fixedlightlev)); + drawerargs.SetLight(basecolormap, 0, FIXEDLIGHT2SHADE(cameraLight->fixedlightlev)); plane_shade = false; } else if (cameraLight->fixedcolormap) { - drawerargs.SetColorMapLight(cameraLight->fixedcolormap, 0, 0); + drawerargs.SetLight(cameraLight->fixedcolormap, 0, 0); plane_shade = false; } else { - drawerargs.SetColorMapLight(basecolormap, 0, 0); + drawerargs.SetLight(basecolormap, 0, 0); plane_shade = true; planeshade = LIGHT2SHADE(pl->lightlevel); } diff --git a/src/swrenderer/things/r_decal.cpp b/src/swrenderer/things/r_decal.cpp index 522448b20..c902f20a1 100644 --- a/src/swrenderer/things/r_decal.cpp +++ b/src/swrenderer/things/r_decal.cpp @@ -277,11 +277,11 @@ namespace swrenderer SpriteDrawerArgs drawerargs; if (cameraLight->fixedlightlev >= 0) - drawerargs.SetColorMapLight((r_fullbrightignoresectorcolor) ? &FullNormalLight : usecolormap, 0, FIXEDLIGHT2SHADE(cameraLight->fixedlightlev)); + drawerargs.SetLight((r_fullbrightignoresectorcolor) ? &FullNormalLight : usecolormap, 0, FIXEDLIGHT2SHADE(cameraLight->fixedlightlev)); else if (cameraLight->fixedcolormap != NULL) - drawerargs.SetColorMapLight(cameraLight->fixedcolormap, 0, 0); + drawerargs.SetLight(cameraLight->fixedcolormap, 0, 0); else if (!foggy && (decal->RenderFlags & RF_FULLBRIGHT)) - drawerargs.SetColorMapLight((r_fullbrightignoresectorcolor) ? &FullNormalLight : usecolormap, 0, 0); + drawerargs.SetLight((r_fullbrightignoresectorcolor) ? &FullNormalLight : usecolormap, 0, 0); else calclighting = true; @@ -299,7 +299,7 @@ namespace swrenderer { if (calclighting) { // calculate lighting - drawerargs.SetColorMapLight(usecolormap, light, wallshade); + drawerargs.SetLight(usecolormap, light, wallshade); } DrawColumn(drawerargs, x, WallSpriteTile, walltexcoords, texturemid, maskedScaleY, sprflipvert, mfloorclip, mceilingclip); light += lightstep; diff --git a/src/swrenderer/things/r_playersprite.cpp b/src/swrenderer/things/r_playersprite.cpp index 44a82eb22..71f57960a 100644 --- a/src/swrenderer/things/r_playersprite.cpp +++ b/src/swrenderer/things/r_playersprite.cpp @@ -592,7 +592,7 @@ namespace swrenderer } SpriteDrawerArgs drawerargs; - drawerargs.SetColorMapLight(Light.BaseColormap, 0, Light.ColormapNum << FRACBITS); + drawerargs.SetLight(Light.BaseColormap, 0, Light.ColormapNum << FRACBITS); FDynamicColormap *basecolormap = static_cast(Light.BaseColormap); diff --git a/src/swrenderer/things/r_sprite.cpp b/src/swrenderer/things/r_sprite.cpp index fd4fefc9b..b83089b9e 100644 --- a/src/swrenderer/things/r_sprite.cpp +++ b/src/swrenderer/things/r_sprite.cpp @@ -248,7 +248,7 @@ namespace swrenderer } SpriteDrawerArgs drawerargs; - drawerargs.SetColorMapLight(vis->Light.BaseColormap, 0, vis->Light.ColormapNum << FRACBITS); + drawerargs.SetLight(vis->Light.BaseColormap, 0, vis->Light.ColormapNum << FRACBITS); FDynamicColormap *basecolormap = static_cast(vis->Light.BaseColormap); diff --git a/src/swrenderer/things/r_voxel.cpp b/src/swrenderer/things/r_voxel.cpp index 7f30257bb..b188368a3 100644 --- a/src/swrenderer/things/r_voxel.cpp +++ b/src/swrenderer/things/r_voxel.cpp @@ -189,7 +189,7 @@ namespace swrenderer FDynamicColormap *basecolormap = static_cast(sprite->Light.BaseColormap); SpriteDrawerArgs drawerargs; - drawerargs.SetColorMapLight(sprite->Light.BaseColormap, 0, sprite->Light.ColormapNum << FRACBITS); + drawerargs.SetLight(sprite->Light.BaseColormap, 0, sprite->Light.ColormapNum << FRACBITS); bool visible = drawerargs.SetPatchStyle(sprite->RenderStyle, sprite->Alpha, sprite->Translation, sprite->FillColor, basecolormap); if (!visible) diff --git a/src/swrenderer/things/r_wallsprite.cpp b/src/swrenderer/things/r_wallsprite.cpp index f4cb600d6..0f3c8800f 100644 --- a/src/swrenderer/things/r_wallsprite.cpp +++ b/src/swrenderer/things/r_wallsprite.cpp @@ -188,11 +188,11 @@ namespace swrenderer float light = lightleft + (x1 - spr->wallc.sx1) * lightstep; CameraLight *cameraLight = CameraLight::Instance(); if (cameraLight->fixedlightlev >= 0) - drawerargs.SetColorMapLight(usecolormap, 0, FIXEDLIGHT2SHADE(cameraLight->fixedlightlev)); + drawerargs.SetLight(usecolormap, 0, FIXEDLIGHT2SHADE(cameraLight->fixedlightlev)); else if (cameraLight->fixedcolormap != NULL) - drawerargs.SetColorMapLight(cameraLight->fixedcolormap, 0, 0); + drawerargs.SetLight(cameraLight->fixedcolormap, 0, 0); else if (!spr->foggy && (spr->renderflags & RF_FULLBRIGHT)) - drawerargs.SetColorMapLight((r_fullbrightignoresectorcolor) ? &FullNormalLight : usecolormap, 0, 0); + drawerargs.SetLight((r_fullbrightignoresectorcolor) ? &FullNormalLight : usecolormap, 0, 0); else calclighting = true; @@ -235,7 +235,7 @@ namespace swrenderer { if (calclighting) { // calculate lighting - drawerargs.SetColorMapLight(usecolormap, light, shade); + drawerargs.SetLight(usecolormap, light, shade); } if (!translucentPass->ClipSpriteColumnWithPortals(x, spr)) DrawColumn(drawerargs, x, WallSpriteTile, walltexcoords, texturemid, maskedScaleY, sprflipvert, mfloorclip, mceilingclip); diff --git a/src/v_draw.cpp b/src/v_draw.cpp index 7e5469fb3..5fdd5c690 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -1371,9 +1371,9 @@ void DCanvas::FillSimplePoly(FTexture *tex, FVector2 *points, int npoints, SpanDrawerArgs drawerargs; drawerargs.SetTexture(tex); if (colormap) - drawerargs.SetColorMapLight(colormap, 0, clamp(shade >> FRACBITS, 0, NUMCOLORMAPS - 1)); + drawerargs.SetLight(colormap, 0, clamp(shade >> FRACBITS, 0, NUMCOLORMAPS - 1)); else - drawerargs.SetColorMapLight(&identitycolormap, 0, 0); + drawerargs.SetLight(&identitycolormap, 0, 0); if (drawerargs.TextureWidthBits() != 0) { scalex = double(1u << (32 - drawerargs.TextureWidthBits())) / scalex;