mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-01-19 08:01:50 +00:00
- add const qualifier on top/bottom clip arrays usage
This commit is contained in:
parent
e51a1867df
commit
a55be25a9d
4 changed files with 28 additions and 27 deletions
|
@ -54,7 +54,7 @@
|
||||||
|
|
||||||
namespace swrenderer
|
namespace swrenderer
|
||||||
{
|
{
|
||||||
void RenderFogBoundary::Render(RenderThread *thread, int x1, int x2, short *uclip, short *dclip, int wallshade, float lightleft, float lightstep, FDynamicColormap *basecolormap)
|
void RenderFogBoundary::Render(RenderThread *thread, int x1, int x2, const short *uclip, const short *dclip, int wallshade, float lightleft, float lightstep, FDynamicColormap *basecolormap)
|
||||||
{
|
{
|
||||||
// This is essentially the same as R_MapVisPlane but with an extra step
|
// This is essentially the same as R_MapVisPlane but with an extra step
|
||||||
// to create new horizontal spans whenever the light changes enough that
|
// to create new horizontal spans whenever the light changes enough that
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace swrenderer
|
||||||
class RenderFogBoundary
|
class RenderFogBoundary
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void Render(RenderThread *thread, int x1, int x2, short *uclip, short *dclip, int wallshade, float lightleft, float lightstep, FDynamicColormap *basecolormap);
|
void Render(RenderThread *thread, int x1, int x2, const short *uclip, const short *dclip, int wallshade, float lightleft, float lightstep, FDynamicColormap *basecolormap);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void RenderSection(RenderThread *thread, int y, int y2, int x1);
|
void RenderSection(RenderThread *thread, int y, int y2, int x1);
|
||||||
|
|
|
@ -130,8 +130,8 @@ namespace swrenderer
|
||||||
bool notrelevant = false;
|
bool notrelevant = false;
|
||||||
if (ds->bFogBoundary)
|
if (ds->bFogBoundary)
|
||||||
{
|
{
|
||||||
short *mfloorclip = ds->sprbottomclip - ds->x1;
|
const short *mfloorclip = ds->sprbottomclip - ds->x1;
|
||||||
short *mceilingclip = ds->sprtopclip - ds->x1;
|
const short *mceilingclip = ds->sprtopclip - ds->x1;
|
||||||
|
|
||||||
RenderFogBoundary renderfog;
|
RenderFogBoundary renderfog;
|
||||||
renderfog.Render(Thread, x1, x2, mceilingclip, mfloorclip, wallshade, rw_light, rw_lightstep, basecolormap);
|
renderfog.Render(Thread, x1, x2, mceilingclip, mfloorclip, wallshade, rw_light, rw_lightstep, basecolormap);
|
||||||
|
@ -179,8 +179,8 @@ namespace swrenderer
|
||||||
tex = tex->GetRawTexture();
|
tex = tex->GetRawTexture();
|
||||||
}
|
}
|
||||||
|
|
||||||
short *mfloorclip = ds->sprbottomclip - ds->x1;
|
const short *mfloorclip = ds->sprbottomclip - ds->x1;
|
||||||
short *mceilingclip = ds->sprtopclip - ds->x1;
|
const short *mceilingclip = ds->sprtopclip - ds->x1;
|
||||||
|
|
||||||
float *MaskedSWall = ds->swall - ds->x1;
|
float *MaskedSWall = ds->swall - ds->x1;
|
||||||
float MaskedScaleY = ds->yscale;
|
float MaskedScaleY = ds->yscale;
|
||||||
|
@ -428,8 +428,8 @@ namespace swrenderer
|
||||||
rw_lightstep = ds->lightstep;
|
rw_lightstep = ds->lightstep;
|
||||||
rw_light = ds->light + (x1 - ds->x1) * rw_lightstep;
|
rw_light = ds->light + (x1 - ds->x1) * rw_lightstep;
|
||||||
|
|
||||||
short *mfloorclip = ds->sprbottomclip - ds->x1;
|
const short *mfloorclip = ds->sprbottomclip - ds->x1;
|
||||||
short *mceilingclip = ds->sprtopclip - ds->x1;
|
const short *mceilingclip = ds->sprtopclip - ds->x1;
|
||||||
|
|
||||||
//double spryscale = ds->iscale + ds->iscalestep * (x1 - ds->x1);
|
//double spryscale = ds->iscale + ds->iscalestep * (x1 - ds->x1);
|
||||||
float *MaskedSWall = ds->swall - ds->x1;
|
float *MaskedSWall = ds->swall - ds->x1;
|
||||||
|
|
|
@ -62,10 +62,8 @@ namespace swrenderer
|
||||||
|
|
||||||
VisibleSprite *spr = this;
|
VisibleSprite *spr = this;
|
||||||
|
|
||||||
int i;
|
|
||||||
int x1, x2;
|
int x1, x2;
|
||||||
short topclip, botclip;
|
short topclip, botclip;
|
||||||
short *clip1, *clip2;
|
|
||||||
FSWColormap *colormap = spr->Light.BaseColormap;
|
FSWColormap *colormap = spr->Light.BaseColormap;
|
||||||
int colormapnum = spr->Light.ColormapNum;
|
int colormapnum = spr->Light.ColormapNum;
|
||||||
F3DFloor *rover;
|
F3DFloor *rover;
|
||||||
|
@ -108,7 +106,7 @@ namespace swrenderer
|
||||||
}
|
}
|
||||||
sector_t *sec = nullptr;
|
sector_t *sec = nullptr;
|
||||||
FDynamicColormap *mybasecolormap = nullptr;
|
FDynamicColormap *mybasecolormap = nullptr;
|
||||||
for (i = spr->sector->e->XFloor.lightlist.Size() - 1; i >= 0; i--)
|
for (int i = spr->sector->e->XFloor.lightlist.Size() - 1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
if (clip3d->sclipTop <= spr->sector->e->XFloor.lightlist[i].plane.Zat0())
|
if (clip3d->sclipTop <= spr->sector->e->XFloor.lightlist[i].plane.Zat0())
|
||||||
{
|
{
|
||||||
|
@ -281,14 +279,16 @@ namespace swrenderer
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
i = x2 - x1;
|
|
||||||
clip1 = clipbot + x1;
|
|
||||||
clip2 = cliptop + x1;
|
|
||||||
do
|
|
||||||
{
|
{
|
||||||
*clip1++ = botclip;
|
int i = x2 - x1;
|
||||||
*clip2++ = topclip;
|
short *clip1 = clipbot + x1;
|
||||||
} while (--i);
|
short *clip2 = cliptop + x1;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
*clip1++ = botclip;
|
||||||
|
*clip2++ = topclip;
|
||||||
|
} while (--i);
|
||||||
|
}
|
||||||
|
|
||||||
// Scan drawsegs from end to start for obscuring segs.
|
// Scan drawsegs from end to start for obscuring segs.
|
||||||
// The first drawseg that is closer than the sprite is the clip seg.
|
// The first drawseg that is closer than the sprite is the clip seg.
|
||||||
|
@ -338,9 +338,9 @@ namespace swrenderer
|
||||||
int r2 = MIN<int>(group.x2, x2);
|
int r2 = MIN<int>(group.x2, x2);
|
||||||
|
|
||||||
// Clip bottom
|
// Clip bottom
|
||||||
clip1 = clipbot + r1;
|
short *clip1 = clipbot + r1;
|
||||||
clip2 = group.sprbottomclip + r1 - group.x1;
|
const short *clip2 = group.sprbottomclip + r1 - group.x1;
|
||||||
i = r2 - r1;
|
int i = r2 - r1;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (*clip1 > *clip2)
|
if (*clip1 > *clip2)
|
||||||
|
@ -398,9 +398,9 @@ namespace swrenderer
|
||||||
|
|
||||||
if (ds->silhouette & SIL_BOTTOM) //bottom sil
|
if (ds->silhouette & SIL_BOTTOM) //bottom sil
|
||||||
{
|
{
|
||||||
clip1 = clipbot + r1;
|
short *clip1 = clipbot + r1;
|
||||||
clip2 = ds->sprbottomclip + r1 - ds->x1;
|
const short *clip2 = ds->sprbottomclip + r1 - ds->x1;
|
||||||
i = r2 - r1;
|
int i = r2 - r1;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (*clip1 > *clip2)
|
if (*clip1 > *clip2)
|
||||||
|
@ -412,9 +412,9 @@ namespace swrenderer
|
||||||
|
|
||||||
if (ds->silhouette & SIL_TOP) // top sil
|
if (ds->silhouette & SIL_TOP) // top sil
|
||||||
{
|
{
|
||||||
clip1 = cliptop + r1;
|
short *clip1 = cliptop + r1;
|
||||||
clip2 = ds->sprtopclip + r1 - ds->x1;
|
const short *clip2 = ds->sprtopclip + r1 - ds->x1;
|
||||||
i = r2 - r1;
|
int i = r2 - r1;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (*clip1 < *clip2)
|
if (*clip1 < *clip2)
|
||||||
|
@ -438,6 +438,7 @@ namespace swrenderer
|
||||||
// If it is completely clipped away, don't bother drawing it.
|
// If it is completely clipped away, don't bother drawing it.
|
||||||
if (cliptop[x2] >= clipbot[x2])
|
if (cliptop[x2] >= clipbot[x2])
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
for (i = x1; i < x2; ++i)
|
for (i = x1; i < x2; ++i)
|
||||||
{
|
{
|
||||||
if (cliptop[i] < clipbot[i])
|
if (cliptop[i] < clipbot[i])
|
||||||
|
|
Loading…
Reference in a new issue