Remove unused variables from the old 4 column drawers

This commit is contained in:
Magnus Norddahl 2017-01-29 10:25:32 +01:00
parent 7c7d6e99e9
commit 162f469630
7 changed files with 70 additions and 97 deletions

View file

@ -565,14 +565,12 @@ namespace swrenderer
_dest_y = args.DestY();
_count = args.dc_count;
_pitch = dc_pitch;
for (int col = 0; col < 4; col++)
{
_source[col] = args.dc_wall_source[col];
_source2[col] = args.dc_wall_source2[col];
_sourceheight[col] = args.dc_wall_sourceheight[col];
_iscale[col] = args.dc_wall_iscale[col];
_texturefrac[col] = args.dc_wall_texturefrac[col];
}
_source = args.dc_wall_source;
_source2 = args.dc_wall_source2;
_sourceheight[0] = args.dc_wall_sourceheight[0];
_sourceheight[1] = args.dc_wall_sourceheight[1];
_iscale = args.dc_wall_iscale;
_texturefrac = args.dc_wall_texturefrac;
}
void DrawSingleSky1PalCommand::Execute(DrawerThread *thread)
@ -580,11 +578,11 @@ namespace swrenderer
uint8_t *dest = _dest;
int count = _count;
int pitch = _pitch;
const uint8_t *source0 = _source[0];
const uint8_t *source0 = _source;
int textureheight0 = _sourceheight[0];
int32_t frac = _texturefrac[0];
int32_t fracstep = _iscale[0];
int32_t frac = _texturefrac;
int32_t fracstep = _iscale;
// Find bands for top solid color, top fade, center textured, bottom fade, bottom solid color:
int start_fade = 2; // How fast it should fade out
@ -711,13 +709,13 @@ namespace swrenderer
uint8_t *dest = _dest;
int count = _count;
int pitch = _pitch;
const uint8_t *source0 = _source[0];
const uint8_t *source1 = _source2[0];
const uint8_t *source0 = _source;
const uint8_t *source1 = _source2;
int textureheight0 = _sourceheight[0];
uint32_t maxtextureheight1 = _sourceheight[1] - 1;
int32_t frac = _texturefrac[0];
int32_t fracstep = _iscale[0];
int32_t frac = _texturefrac;
int32_t fracstep = _iscale;
// Find bands for top solid color, top fade, center textured, bottom fade, bottom solid color:
int start_fade = 2; // How fast it should fade out

View file

@ -56,11 +56,11 @@ namespace swrenderer
int _dest_y;
int _count;
int _pitch;
const uint8_t *_source[4];
const uint8_t *_source2[4];
int _sourceheight[4];
uint32_t _iscale[4];
uint32_t _texturefrac[4];
const uint8_t *_source;
const uint8_t *_source2;
int _sourceheight[2];
uint32_t _iscale;
uint32_t _texturefrac;
};
class DrawSingleSky1PalCommand : public PalSkyCommand { public: using PalSkyCommand::PalSkyCommand; void Execute(DrawerThread *thread) override; };

View file

@ -304,13 +304,10 @@ namespace swrenderer
args.dest_y = drawerargs.DestY();
args.count = drawerargs.dc_count;
args.pitch = dc_pitch;
for (int i = 0; i < 4; i++)
{
args.texturefrac[i] = drawerargs.dc_wall_texturefrac[i];
args.iscale[i] = drawerargs.dc_wall_iscale[i];
args.source0[i] = (const uint32_t *)drawerargs.dc_wall_source[i];
args.source1[i] = (const uint32_t *)drawerargs.dc_wall_source2[i];
}
args.texturefrac[0] = drawerargs.dc_wall_texturefrac;
args.iscale[0] = drawerargs.dc_wall_iscale;
args.source0[0] = (const uint32_t *)drawerargs.dc_wall_source;
args.source1[0] = (const uint32_t *)drawerargs.dc_wall_source2;
args.textureheight0 = drawerargs.dc_wall_sourceheight[0];
args.textureheight1 = drawerargs.dc_wall_sourceheight[1];
args.top_color = solid_top;

View file

@ -86,11 +86,11 @@ namespace swrenderer
class SkyDrawerArgs : public DrawerArgs
{
public:
const uint8_t *dc_wall_source[4];
const uint8_t *dc_wall_source2[4];
uint32_t dc_wall_sourceheight[4];
uint32_t dc_wall_texturefrac[4];
uint32_t dc_wall_iscale[4];
const uint8_t *dc_wall_source;
const uint8_t *dc_wall_source2;
uint32_t dc_wall_sourceheight[2];
uint32_t dc_wall_texturefrac;
uint32_t dc_wall_iscale;
int dc_count;
void SetDest(int x, int y);
@ -124,14 +124,6 @@ namespace swrenderer
const uint8_t *dc_source2;
int dc_count;
uint32_t dc_wall_texturefrac[4];
uint32_t dc_wall_iscale[4];
uint8_t *dc_wall_colormap[4];
fixed_t dc_wall_light[4];
const uint8_t *dc_wall_source[4];
const uint8_t *dc_wall_source2[4];
uint32_t dc_wall_texturefracx[4];
uint32_t dc_wall_sourceheight[4];
int dc_wall_fracbits;
FVector3 dc_normal;

View file

@ -324,17 +324,6 @@ namespace swrenderer
CameraLight *cameraLight = CameraLight::Instance();
bool fixed = (cameraLight->fixedcolormap != NULL || cameraLight->fixedlightlev >= 0);
if (fixed)
{
drawerargs.dc_wall_colormap[0] = drawerargs.dc_colormap;
drawerargs.dc_wall_colormap[1] = drawerargs.dc_colormap;
drawerargs.dc_wall_colormap[2] = drawerargs.dc_colormap;
drawerargs.dc_wall_colormap[3] = drawerargs.dc_colormap;
drawerargs.dc_wall_light[0] = 0;
drawerargs.dc_wall_light[1] = 0;
drawerargs.dc_wall_light[2] = 0;
drawerargs.dc_wall_light[3] = 0;
}
if (cameraLight->fixedcolormap)
drawerargs.SetColorMapLight(cameraLight->fixedcolormap, 0, 0);

View file

@ -166,53 +166,50 @@ namespace swrenderer
cameraLight->fixedcolormap = nullptr;
}
void RenderSkyPlane::DrawSkyColumnStripe(int start_x, int y1, int y2, int columns, double scale, double texturemid, double yrepeat)
void RenderSkyPlane::DrawSkyColumnStripe(int start_x, int y1, int y2, double scale, double texturemid, double yrepeat)
{
RenderPortal *renderportal = RenderPortal::Instance();
uint32_t height = frontskytex->GetHeight();
for (int i = 0; i < columns; i++)
double uv_stepd = skyiscale * yrepeat;
double v = (texturemid + uv_stepd * (y1 - CenterY + 0.5)) / height;
double v_step = uv_stepd / height;
uint32_t uv_pos = (uint32_t)(v * 0x01000000);
uint32_t uv_step = (uint32_t)(v_step * 0x01000000);
int x = start_x;
if (renderportal->MirrorFlags & RF_XFLIP)
x = (viewwidth - x);
uint32_t ang, angle1, angle2;
if (r_linearsky)
{
double uv_stepd = skyiscale * yrepeat;
double v = (texturemid + uv_stepd * (y1 - CenterY + 0.5)) / height;
double v_step = uv_stepd / height;
uint32_t uv_pos = (uint32_t)(v * 0x01000000);
uint32_t uv_step = (uint32_t)(v_step * 0x01000000);
int x = start_x + i;
if (renderportal->MirrorFlags & RF_XFLIP)
x = (viewwidth - x);
uint32_t ang, angle1, angle2;
if (r_linearsky)
{
angle_t xangle = (angle_t)((0.5 - x / (double)viewwidth) * FocalTangent * ANGLE_90);
ang = (skyangle + xangle) ^ skyflip;
}
else
{
ang = (skyangle + xtoviewangle[x]) ^ skyflip;
}
angle1 = (uint32_t)((UMulScale16(ang, frontcyl) + frontpos) >> FRACBITS);
angle2 = (uint32_t)((UMulScale16(ang, backcyl) + backpos) >> FRACBITS);
if (r_swtruecolor)
{
drawerargs.dc_wall_source[i] = (const uint8_t *)frontskytex->GetColumnBgra(angle1, nullptr);
drawerargs.dc_wall_source2[i] = backskytex ? (const uint8_t *)backskytex->GetColumnBgra(angle2, nullptr) : nullptr;
}
else
{
drawerargs.dc_wall_source[i] = (const uint8_t *)frontskytex->GetColumn(angle1, nullptr);
drawerargs.dc_wall_source2[i] = backskytex ? (const uint8_t *)backskytex->GetColumn(angle2, nullptr) : nullptr;
}
drawerargs.dc_wall_iscale[i] = uv_step;
drawerargs.dc_wall_texturefrac[i] = uv_pos;
angle_t xangle = (angle_t)((0.5 - x / (double)viewwidth) * FocalTangent * ANGLE_90);
ang = (skyangle + xangle) ^ skyflip;
}
else
{
ang = (skyangle + xtoviewangle[x]) ^ skyflip;
}
angle1 = (uint32_t)((UMulScale16(ang, frontcyl) + frontpos) >> FRACBITS);
angle2 = (uint32_t)((UMulScale16(ang, backcyl) + backpos) >> FRACBITS);
if (r_swtruecolor)
{
drawerargs.dc_wall_source = (const uint8_t *)frontskytex->GetColumnBgra(angle1, nullptr);
drawerargs.dc_wall_source2 = backskytex ? (const uint8_t *)backskytex->GetColumnBgra(angle2, nullptr) : nullptr;
}
else
{
drawerargs.dc_wall_source = (const uint8_t *)frontskytex->GetColumn(angle1, nullptr);
drawerargs.dc_wall_source2 = backskytex ? (const uint8_t *)backskytex->GetColumn(angle2, nullptr) : nullptr;
}
drawerargs.dc_wall_iscale = uv_step;
drawerargs.dc_wall_texturefrac = uv_pos;
drawerargs.dc_wall_sourceheight[0] = height;
drawerargs.dc_wall_sourceheight[1] = backskytex ? backskytex->GetHeight() : height;
@ -231,12 +228,12 @@ namespace swrenderer
drawerargs.DrawDoubleSkyColumn(solid_top, solid_bottom, fadeSky);
}
void RenderSkyPlane::DrawSkyColumn(int start_x, int y1, int y2, int columns)
void RenderSkyPlane::DrawSkyColumn(int start_x, int y1, int y2)
{
if (1 << frontskytex->HeightBits == frontskytex->GetHeight())
{
double texturemid = skymid * frontskytex->Scale.Y + frontskytex->GetHeight();
DrawSkyColumnStripe(start_x, y1, y2, columns, frontskytex->Scale.Y, texturemid, frontskytex->Scale.Y);
DrawSkyColumnStripe(start_x, y1, y2, frontskytex->Scale.Y, texturemid, frontskytex->Scale.Y);
}
else
{
@ -247,7 +244,7 @@ namespace swrenderer
double topfrac = fmod(skymid + iscale * (1 - CenterY), frontskytex->GetHeight());
if (topfrac < 0) topfrac += frontskytex->GetHeight();
double texturemid = topfrac - iscale * (1 - CenterY);
DrawSkyColumnStripe(start_x, y1, y2, columns, scale, texturemid, yrepeat);
DrawSkyColumnStripe(start_x, y1, y2, scale, texturemid, yrepeat);
}
}
@ -265,7 +262,7 @@ namespace swrenderer
if (y2 <= y1)
continue;
DrawSkyColumn(x, y1, y2, 1);
DrawSkyColumn(x, y1, y2);
}
}
}

View file

@ -25,8 +25,8 @@ namespace swrenderer
private:
void DrawSky(VisiblePlane *pl);
void DrawSkyColumnStripe(int start_x, int y1, int y2, int columns, double scale, double texturemid, double yrepeat);
void DrawSkyColumn(int start_x, int y1, int y2, int columns);
void DrawSkyColumnStripe(int start_x, int y1, int y2, double scale, double texturemid, double yrepeat);
void DrawSkyColumn(int start_x, int y1, int y2);
FTexture *frontskytex = nullptr;
FTexture *backskytex = nullptr;