Remove redundant dc_pitch

This commit is contained in:
Magnus Norddahl 2017-02-01 21:52:29 +01:00
parent 93166fa150
commit 7b578bbb53
4 changed files with 16 additions and 25 deletions

View file

@ -106,7 +106,7 @@ namespace swrenderer
_dest = args.Dest();
_dest_y = args.DestY();
_fracbits = args.dc_wall_fracbits;
_pitch = RenderViewport::Instance()->dc_pitch;
_pitch = RenderViewport::Instance()->RenderTarget->GetPitch();
_srcblend = args.dc_srcblend;
_destblend = args.dc_destblend;
_dynlights = args.dc_lights;
@ -564,7 +564,7 @@ namespace swrenderer
_dest = args.Dest();
_dest_y = args.DestY();
_count = args.Count();
_pitch = RenderViewport::Instance()->dc_pitch;
_pitch = RenderViewport::Instance()->RenderTarget->GetPitch();
_source = args.FrontTexturePixels();
_source2 = args.BackTexturePixels();
_sourceheight[0] = args.FrontTextureHeight();
@ -870,7 +870,7 @@ namespace swrenderer
_count = args.dc_count;
_dest = args.Dest();
_dest_y = args.DestY();
_pitch = RenderViewport::Instance()->dc_pitch;
_pitch = RenderViewport::Instance()->RenderTarget->GetPitch();
_iscale = args.dc_iscale;
_texturefrac = args.dc_texturefrac;
_colormap = args.Colormap();
@ -1768,7 +1768,7 @@ namespace swrenderer
_yh = args.dc_yh;
_x = args.dc_x;
_destorg = RenderViewport::Instance()->dc_destorg;
_pitch = RenderViewport::Instance()->dc_pitch;
_pitch = RenderViewport::Instance()->RenderTarget->GetPitch();
_fuzzpos = fuzzpos;
_fuzzviewheight = fuzzviewheight;
}

View file

@ -73,7 +73,7 @@ namespace swrenderer
args.xbits = drawerargs.TextureWidthBits();
args.ybits = drawerargs.TextureHeightBits();
args.destorg = (uint32_t*)RenderViewport::Instance()->dc_destorg;
args.destpitch = RenderViewport::Instance()->dc_pitch;
args.destpitch = RenderViewport::Instance()->RenderTarget->GetPitch();
args.source = (const uint32_t*)drawerargs.TexturePixels();
args.light = LightBgra::calc_light_multiplier(drawerargs.Light());
args.light_red = shade_constants.light_red;
@ -186,7 +186,7 @@ namespace swrenderer
auto shade_constants = drawerargs.ColormapConstants();
args.dest = (uint32_t*)drawerargs.Dest();
args.dest_y = drawerargs.DestY();
args.pitch = RenderViewport::Instance()->dc_pitch;
args.pitch = RenderViewport::Instance()->RenderTarget->GetPitch();
args.count = drawerargs.dc_count;
args.texturefrac[0] = drawerargs.dc_texturefrac;
args.texturefracx[0] = drawerargs.dc_texturefracx;
@ -256,7 +256,7 @@ namespace swrenderer
args.colormap = drawerargs.Colormap();
args.translation = drawerargs.TranslationMap();
args.basecolors = (const uint32_t *)GPalette.BaseColors;
args.pitch = RenderViewport::Instance()->dc_pitch;
args.pitch = RenderViewport::Instance()->RenderTarget->GetPitch();
args.count = drawerargs.dc_count;
args.dest_y = drawerargs.DestY();
args.iscale = drawerargs.dc_iscale;
@ -307,7 +307,7 @@ namespace swrenderer
args.dest = (uint32_t*)drawerargs.Dest();
args.dest_y = drawerargs.DestY();
args.count = drawerargs.Count();
args.pitch = RenderViewport::Instance()->dc_pitch;
args.pitch = RenderViewport::Instance()->RenderTarget->GetPitch();
args.texturefrac[0] = drawerargs.TextureVPos();
args.iscale[0] = drawerargs.TextureVStep();
args.source0[0] = (const uint32_t *)drawerargs.FrontTexturePixels();
@ -332,7 +332,7 @@ namespace swrenderer
_yl = drawerargs.dc_yl;
_yh = drawerargs.dc_yh;
_destorg = RenderViewport::Instance()->dc_destorg;
_pitch = RenderViewport::Instance()->dc_pitch;
_pitch = RenderViewport::Instance()->RenderTarget->GetPitch();
_fuzzpos = fuzzpos;
_fuzzviewheight = fuzzviewheight;
}
@ -710,7 +710,7 @@ namespace swrenderer
_a = a;
_destorg = RenderViewport::Instance()->dc_destorg;
_pitch = RenderViewport::Instance()->dc_pitch;
_pitch = RenderViewport::Instance()->RenderTarget->GetPitch();
}
void FillTransColumnRGBACommand::Execute(DrawerThread *thread)

View file

@ -126,25 +126,17 @@ namespace swrenderer
void RenderViewport::SetupBuffer()
{
static BYTE *lastbuff = NULL;
int pitch = RenderTarget->GetPitch();
int pixelsize = RenderTarget->IsBgra() ? 4 : 1;
BYTE *lineptr = RenderTarget->GetBuffer() + (viewwindowy*pitch + viewwindowx) * pixelsize;
if (dc_pitch != pitch || lineptr != lastbuff)
R_InitFuzzTable(pitch);
dc_destorg = lineptr;
dc_destheight = RenderTarget->GetHeight() - viewwindowy;
for (int i = 0; i < RenderTarget->GetHeight(); i++)
{
if (dc_pitch != pitch)
{
dc_pitch = pitch;
R_InitFuzzTable(pitch);
}
dc_destorg = lineptr;
dc_destheight = RenderTarget->GetHeight() - viewwindowy;
for (int i = 0; i < RenderTarget->GetHeight(); i++)
{
ylookup[i] = i * pitch;
}
ylookup[i] = i * pitch;
}
R_InitParticleTexture();

View file

@ -47,7 +47,6 @@ namespace swrenderer
uint8_t *dc_destorg = nullptr;
int dc_destheight = 0;
int dc_pitch = 0;
private:
void InitTextureMapping();