Rename visplane_t to VisiblePlane

This commit is contained in:
Magnus Norddahl 2017-01-19 03:11:49 +01:00
parent 9eef7f9b32
commit e94cb3f114
18 changed files with 61 additions and 61 deletions

View file

@ -56,7 +56,7 @@ EXTERN_CVAR(Bool, r_fullbrightignoresectorcolor);
namespace swrenderer
{
void SWRenderLine::Render(seg_t *line, subsector_t *subsector, sector_t *sector, sector_t *fakebacksector, visplane_t *linefloorplane, visplane_t *lineceilingplane, bool infog, FDynamicColormap *colormap)
void SWRenderLine::Render(seg_t *line, subsector_t *subsector, sector_t *sector, sector_t *fakebacksector, VisiblePlane *linefloorplane, VisiblePlane *lineceilingplane, bool infog, FDynamicColormap *colormap)
{
static sector_t tempsec; // killough 3/8/98: ceiling/water hack
bool solid;

View file

@ -24,7 +24,7 @@ struct FDynamicColormap;
namespace swrenderer
{
struct visplane_t;
struct VisiblePlane;
struct FWallCoords
{
@ -49,7 +49,7 @@ namespace swrenderer
class SWRenderLine
{
public:
void Render(seg_t *line, subsector_t *subsector, sector_t *sector, sector_t *fakebacksector, visplane_t *floorplane, visplane_t *ceilingplane, bool foggy, FDynamicColormap *basecolormap);
void Render(seg_t *line, subsector_t *subsector, sector_t *sector, sector_t *fakebacksector, VisiblePlane *floorplane, VisiblePlane *ceilingplane, bool foggy, FDynamicColormap *basecolormap);
private:
bool RenderWallSegment(int x1, int x2);
@ -62,8 +62,8 @@ namespace swrenderer
subsector_t *InSubsector;
sector_t *frontsector;
sector_t *backsector;
visplane_t *floorplane;
visplane_t *ceilingplane;
VisiblePlane *floorplane;
VisiblePlane *ceilingplane;
seg_t *curline;
side_t *sidedef;

View file

@ -44,7 +44,7 @@
namespace swrenderer
{
void RenderFlatPlane::Render(visplane_t *pl, double _xscale, double _yscale, fixed_t alpha, bool additive, bool masked, FDynamicColormap *colormap)
void RenderFlatPlane::Render(VisiblePlane *pl, double _xscale, double _yscale, fixed_t alpha, bool additive, bool masked, FDynamicColormap *colormap)
{
using namespace drawerargs;
@ -260,7 +260,7 @@ namespace swrenderer
// Setup lights for row
dc_num_lights = 0;
dc_lights = lightbuffer + nextlightindex;
visplane_light *cur_node = light_list;
VisiblePlaneLight *cur_node = light_list;
while (cur_node && nextlightindex < 64 * 1024)
{
double lightX = cur_node->lightsource->X() - ViewPos.X;
@ -363,7 +363,7 @@ namespace swrenderer
/////////////////////////////////////////////////////////////////////////
void RenderColoredPlane::Render(visplane_t *pl)
void RenderColoredPlane::Render(VisiblePlane *pl)
{
RenderLines(pl);
}

View file

@ -17,12 +17,12 @@
namespace swrenderer
{
struct visplane_light;
struct VisiblePlaneLight;
class RenderFlatPlane : PlaneRenderer
{
public:
void Render(visplane_t *pl, double _xscale, double _yscale, fixed_t alpha, bool additive, bool masked, FDynamicColormap *basecolormap);
void Render(VisiblePlane *pl, double _xscale, double _yscale, fixed_t alpha, bool additive, bool masked, FDynamicColormap *basecolormap);
static void SetupSlope();
@ -39,7 +39,7 @@ namespace swrenderer
fixed_t xscale, yscale;
double xstepscale, ystepscale;
double basexfrac, baseyfrac;
visplane_light *light_list;
VisiblePlaneLight *light_list;
static float yslope[MAXHEIGHT];
};
@ -47,7 +47,7 @@ namespace swrenderer
class RenderColoredPlane : PlaneRenderer
{
public:
void Render(visplane_t *pl);
void Render(VisiblePlane *pl);
private:
void RenderLine(int y, int x1, int x2) override;

View file

@ -33,7 +33,7 @@
namespace swrenderer
{
void PlaneRenderer::RenderLines(visplane_t *pl)
void PlaneRenderer::RenderLines(VisiblePlane *pl)
{
// t1/b1 are at x
// t2/b2 are at x+1

View file

@ -18,12 +18,12 @@
namespace swrenderer
{
struct visplane_t;
struct VisiblePlane;
class PlaneRenderer
{
public:
void RenderLines(visplane_t *pl);
void RenderLines(VisiblePlane *pl);
virtual void RenderLine(int y, int x1, int x2) = 0;
virtual void StepColumn() { }

View file

@ -49,7 +49,7 @@ EXTERN_CVAR(Int, r_skymode)
namespace swrenderer
{
void RenderSkyPlane::Render(visplane_t *pl)
void RenderSkyPlane::Render(VisiblePlane *pl)
{
FTextureID sky1tex, sky2tex;
double frontdpos = 0, backdpos = 0;
@ -252,7 +252,7 @@ namespace swrenderer
}
}
void RenderSkyPlane::DrawSky(visplane_t *pl)
void RenderSkyPlane::DrawSky(VisiblePlane *pl)
{
int x1 = pl->left;
int x2 = pl->right;

View file

@ -20,10 +20,10 @@ namespace swrenderer
class RenderSkyPlane
{
public:
void Render(visplane_t *pl);
void Render(VisiblePlane *pl);
private:
void DrawSky(visplane_t *pl);
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);

View file

@ -48,7 +48,7 @@
namespace swrenderer
{
void RenderSlopePlane::Render(visplane_t *pl, double _xscale, double _yscale, fixed_t alpha, bool additive, bool masked, FDynamicColormap *colormap)
void RenderSlopePlane::Render(VisiblePlane *pl, double _xscale, double _yscale, fixed_t alpha, bool additive, bool masked, FDynamicColormap *colormap)
{
using namespace drawerargs;

View file

@ -20,7 +20,7 @@ namespace swrenderer
class RenderSlopePlane : PlaneRenderer
{
public:
void Render(visplane_t *pl, double _xscale, double _yscale, fixed_t alpha, bool additive, bool masked, FDynamicColormap *basecolormap);
void Render(VisiblePlane *pl, double _xscale, double _yscale, fixed_t alpha, bool additive, bool masked, FDynamicColormap *basecolormap);
private:
void RenderLine(int y, int x1, int x2) override;

View file

@ -43,7 +43,7 @@ CVAR(Bool, tilt, false, 0);
namespace swrenderer
{
visplane_t::visplane_t()
VisiblePlane::VisiblePlane()
{
picnum.SetNull();
height.set(0.0, 0.0, 1.0, 0.0);
@ -55,7 +55,7 @@ namespace swrenderer
fillshort(top, viewwidth, 0x7fff);
}
void visplane_t::AddLights(FLightNode *node)
void VisiblePlane::AddLights(FLightNode *node)
{
if (!r_dynlights)
return;
@ -65,7 +65,7 @@ namespace swrenderer
if (!(node->lightsource->flags2&MF2_DORMANT))
{
bool found = false;
visplane_light *light_node = lights;
VisiblePlaneLight *light_node = lights;
while (light_node)
{
if (light_node->lightsource == node->lightsource)
@ -77,7 +77,7 @@ namespace swrenderer
}
if (!found)
{
visplane_light *newlight = RenderMemory::NewObject<visplane_light>();
VisiblePlaneLight *newlight = RenderMemory::NewObject<VisiblePlaneLight>();
newlight->next = lights;
newlight->lightsource = node->lightsource;
lights = newlight;
@ -87,7 +87,7 @@ namespace swrenderer
}
}
void visplane_t::Render(fixed_t alpha, bool additive, bool masked)
void VisiblePlane::Render(fixed_t alpha, bool additive, bool masked)
{
if (left >= right)
return;

View file

@ -25,24 +25,24 @@ struct FSectorPortal;
namespace swrenderer
{
struct visplane_light
struct VisiblePlaneLight
{
ADynamicLight *lightsource;
visplane_light *next;
VisiblePlaneLight *next;
};
struct visplane_t
struct VisiblePlane
{
visplane_t();
VisiblePlane();
void AddLights(FLightNode *node);
void Render(fixed_t alpha, bool additive, bool masked);
visplane_t *next = nullptr; // Next visplane in hash chain -- killough
VisiblePlane *next = nullptr; // Next visplane in hash chain -- killough
FDynamicColormap *colormap = nullptr; // [RH] Support multiple colormaps
FSectorPortal *portal = nullptr; // [RH] Support sky boxes
visplane_light *lights = nullptr;
VisiblePlaneLight *lights = nullptr;
FTransform xform;
secplane_t height;

View file

@ -56,9 +56,9 @@ namespace swrenderer
plane = nullptr;
}
visplane_t *VisiblePlaneList::Add(unsigned hash)
VisiblePlane *VisiblePlaneList::Add(unsigned hash)
{
visplane_t *newplane = RenderMemory::NewObject<visplane_t>();
VisiblePlane *newplane = RenderMemory::NewObject<VisiblePlane>();
newplane->next = visplanes[hash];
visplanes[hash] = newplane;
return newplane;
@ -71,7 +71,7 @@ namespace swrenderer
{
for (int i = 0; i <= MAXVISPLANES - 1; i++)
{
for (visplane_t **probe = &visplanes[i]; *probe != nullptr; )
for (VisiblePlane **probe = &visplanes[i]; *probe != nullptr; )
{
if ((*probe)->sky < 0)
{ // fake: move past it
@ -79,7 +79,7 @@ namespace swrenderer
}
else
{ // not fake: move from list
visplane_t *vis = *probe;
VisiblePlane *vis = *probe;
*probe = vis->next;
vis->next = nullptr;
}
@ -93,10 +93,10 @@ namespace swrenderer
}
}
visplane_t *VisiblePlaneList::FindPlane(const secplane_t &height, FTextureID picnum, int lightlevel, double Alpha, bool additive, const FTransform &xxform, int sky, FSectorPortal *portal, FDynamicColormap *basecolormap)
VisiblePlane *VisiblePlaneList::FindPlane(const secplane_t &height, FTextureID picnum, int lightlevel, double Alpha, bool additive, const FTransform &xxform, int sky, FSectorPortal *portal, FDynamicColormap *basecolormap)
{
secplane_t plane;
visplane_t *check;
VisiblePlane *check;
unsigned hash; // killough
bool isskybox;
const FTransform *xform = &xxform;
@ -223,7 +223,7 @@ namespace swrenderer
return check;
}
visplane_t *VisiblePlaneList::GetRange(visplane_t *pl, int start, int stop)
VisiblePlane *VisiblePlaneList::GetRange(VisiblePlane *pl, int start, int stop)
{
int intrl, intrh;
int unionl, unionh;
@ -276,7 +276,7 @@ namespace swrenderer
{
hash = CalcHash(pl->picnum.GetIndex(), pl->lightlevel, pl->height);
}
visplane_t *new_pl = Add(hash);
VisiblePlane *new_pl = Add(hash);
new_pl->height = pl->height;
new_pl->picnum = pl->picnum;
@ -307,9 +307,9 @@ namespace swrenderer
return visplanes[MAXVISPLANES] != nullptr;
}
visplane_t *VisiblePlaneList::PopFirstPortalPlane()
VisiblePlane *VisiblePlaneList::PopFirstPortalPlane()
{
visplane_t *pl = visplanes[VisiblePlaneList::MAXVISPLANES];
VisiblePlane *pl = visplanes[VisiblePlaneList::MAXVISPLANES];
if (pl)
{
visplanes[VisiblePlaneList::MAXVISPLANES] = pl->next;
@ -325,7 +325,7 @@ namespace swrenderer
int VisiblePlaneList::Render()
{
visplane_t *pl;
VisiblePlane *pl;
int i;
int vpcount = 0;
@ -352,7 +352,7 @@ namespace swrenderer
void VisiblePlaneList::RenderHeight(double height)
{
visplane_t *pl;
VisiblePlane *pl;
int i;
drawerargs::ds_color = 3;

View file

@ -20,7 +20,7 @@ struct FSectorPortal;
namespace swrenderer
{
struct visplane_t;
struct VisiblePlane;
class VisiblePlaneList
{
@ -29,11 +29,11 @@ namespace swrenderer
void Clear(bool fullclear);
visplane_t *FindPlane(const secplane_t &height, FTextureID picnum, int lightlevel, double Alpha, bool additive, const FTransform &xxform, int sky, FSectorPortal *portal, FDynamicColormap *basecolormap);
visplane_t *GetRange(visplane_t *pl, int start, int stop);
VisiblePlane *FindPlane(const secplane_t &height, FTextureID picnum, int lightlevel, double Alpha, bool additive, const FTransform &xxform, int sky, FSectorPortal *portal, FDynamicColormap *basecolormap);
VisiblePlane *GetRange(VisiblePlane *pl, int start, int stop);
bool HasPortalPlanes() const;
visplane_t *PopFirstPortalPlane();
VisiblePlane *PopFirstPortalPlane();
void ClearPortalPlanes();
int Render();
@ -41,10 +41,10 @@ namespace swrenderer
private:
VisiblePlaneList();
visplane_t *Add(unsigned hash);
VisiblePlane *Add(unsigned hash);
enum { MAXVISPLANES = 128 }; // must be a power of 2
visplane_t *visplanes[MAXVISPLANES + 1];
VisiblePlane *visplanes[MAXVISPLANES + 1];
static unsigned CalcHash(int picnum, int lightlevel, const secplane_t &height) { return (unsigned)((picnum) * 3 + (lightlevel)+(FLOAT2FIXED((height).fD())) * 7) & (MAXVISPLANES - 1); }
};

View file

@ -398,7 +398,7 @@ namespace swrenderer
}
// kg3D - add fake segs, never rendered
void RenderOpaquePass::FakeDrawLoop(subsector_t *sub, visplane_t *floorplane, visplane_t *ceilingplane, bool foggy, FDynamicColormap *basecolormap)
void RenderOpaquePass::FakeDrawLoop(subsector_t *sub, VisiblePlane *floorplane, VisiblePlane *ceilingplane, bool foggy, FDynamicColormap *basecolormap)
{
int count;
seg_t* line;
@ -432,8 +432,8 @@ namespace swrenderer
FSectorPortal *portal;
// kg3D - fake floor stuff
visplane_t *backupfp;
visplane_t *backupcp;
VisiblePlane *backupfp;
VisiblePlane *backupcp;
//secplane_t templane;
lightlist_t *light;
@ -498,7 +498,7 @@ namespace swrenderer
portal = frontsector->ValidatePortal(sector_t::ceiling);
visplane_t *ceilingplane = frontsector->ceilingplane.PointOnSide(ViewPos) > 0 ||
VisiblePlane *ceilingplane = frontsector->ceilingplane.PointOnSide(ViewPos) > 0 ||
frontsector->GetTexture(sector_t::ceiling) == skyflatnum ||
portal != nullptr ||
(frontsector->heightsec &&
@ -539,7 +539,7 @@ namespace swrenderer
// killough 10/98: add support for skies transferred from sidedefs
portal = frontsector->ValidatePortal(sector_t::floor);
visplane_t *floorplane = frontsector->floorplane.PointOnSide(ViewPos) > 0 || // killough 3/7/98
VisiblePlane *floorplane = frontsector->floorplane.PointOnSide(ViewPos) > 0 || // killough 3/7/98
frontsector->GetTexture(sector_t::floor) == skyflatnum ||
portal != nullptr ||
(frontsector->heightsec &&

View file

@ -23,7 +23,7 @@ struct FVoxelDef;
namespace swrenderer
{
struct visplane_t;
struct VisiblePlane;
// The 3072 below is just an arbitrary value picked to avoid
// drawing lines the player is too close to that would overflow
@ -68,7 +68,7 @@ namespace swrenderer
bool CheckBBox(float *bspcoord);
void AddPolyobjs(subsector_t *sub);
void FakeDrawLoop(subsector_t *sub, visplane_t *floorplane, visplane_t *ceilingplane, bool foggy, FDynamicColormap *basecolormap);
void FakeDrawLoop(subsector_t *sub, VisiblePlane *floorplane, VisiblePlane *ceilingplane, bool foggy, FDynamicColormap *basecolormap);
void AddSprites(sector_t *sec, int lightlevel, WaterFakeSide fakeside, bool foggy, FDynamicColormap *basecolormap);

View file

@ -109,7 +109,7 @@ namespace swrenderer
AActor *savedcamera = camera;
sector_t *savedsector = viewsector;
for (visplane_t *pl = planes->PopFirstPortalPlane(); pl != nullptr; pl = planes->PopFirstPortalPlane())
for (VisiblePlane *pl = planes->PopFirstPortalPlane(); pl != nullptr; pl = planes->PopFirstPortalPlane())
{
if (pl->right < pl->left || !r_skyboxes || numskyboxes == MAX_SKYBOX_PLANES || pl->portal == nullptr)
{
@ -244,7 +244,7 @@ namespace swrenderer
VisibleSpriteList::Instance()->PopPortal();
visplane_t *pl;
VisiblePlane *pl;
visplaneStack.Pop(pl);
if (pl->Alpha > 0 && pl->picnum != skyflatnum)
{

View file

@ -17,7 +17,7 @@
namespace swrenderer
{
struct visplane_t;
struct VisiblePlane;
class RenderPortal
{
@ -56,6 +56,6 @@ namespace swrenderer
TArray<size_t> interestingStack;
TArray<ptrdiff_t> drawsegStack;
TArray<DVector3> viewposStack;
TArray<visplane_t *> visplaneStack;
TArray<VisiblePlane *> visplaneStack;
};
}