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 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 static sector_t tempsec; // killough 3/8/98: ceiling/water hack
bool solid; bool solid;

View file

@ -24,7 +24,7 @@ struct FDynamicColormap;
namespace swrenderer namespace swrenderer
{ {
struct visplane_t; struct VisiblePlane;
struct FWallCoords struct FWallCoords
{ {
@ -49,7 +49,7 @@ namespace swrenderer
class SWRenderLine class SWRenderLine
{ {
public: 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: private:
bool RenderWallSegment(int x1, int x2); bool RenderWallSegment(int x1, int x2);
@ -62,8 +62,8 @@ namespace swrenderer
subsector_t *InSubsector; subsector_t *InSubsector;
sector_t *frontsector; sector_t *frontsector;
sector_t *backsector; sector_t *backsector;
visplane_t *floorplane; VisiblePlane *floorplane;
visplane_t *ceilingplane; VisiblePlane *ceilingplane;
seg_t *curline; seg_t *curline;
side_t *sidedef; side_t *sidedef;

View file

@ -44,7 +44,7 @@
namespace swrenderer 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; using namespace drawerargs;
@ -260,7 +260,7 @@ namespace swrenderer
// Setup lights for row // Setup lights for row
dc_num_lights = 0; dc_num_lights = 0;
dc_lights = lightbuffer + nextlightindex; dc_lights = lightbuffer + nextlightindex;
visplane_light *cur_node = light_list; VisiblePlaneLight *cur_node = light_list;
while (cur_node && nextlightindex < 64 * 1024) while (cur_node && nextlightindex < 64 * 1024)
{ {
double lightX = cur_node->lightsource->X() - ViewPos.X; 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); RenderLines(pl);
} }

View file

@ -17,12 +17,12 @@
namespace swrenderer namespace swrenderer
{ {
struct visplane_light; struct VisiblePlaneLight;
class RenderFlatPlane : PlaneRenderer class RenderFlatPlane : PlaneRenderer
{ {
public: 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(); static void SetupSlope();
@ -39,7 +39,7 @@ namespace swrenderer
fixed_t xscale, yscale; fixed_t xscale, yscale;
double xstepscale, ystepscale; double xstepscale, ystepscale;
double basexfrac, baseyfrac; double basexfrac, baseyfrac;
visplane_light *light_list; VisiblePlaneLight *light_list;
static float yslope[MAXHEIGHT]; static float yslope[MAXHEIGHT];
}; };
@ -47,7 +47,7 @@ namespace swrenderer
class RenderColoredPlane : PlaneRenderer class RenderColoredPlane : PlaneRenderer
{ {
public: public:
void Render(visplane_t *pl); void Render(VisiblePlane *pl);
private: private:
void RenderLine(int y, int x1, int x2) override; void RenderLine(int y, int x1, int x2) override;

View file

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

View file

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

View file

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

View file

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

View file

@ -48,7 +48,7 @@
namespace swrenderer 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; using namespace drawerargs;

View file

@ -20,7 +20,7 @@ namespace swrenderer
class RenderSlopePlane : PlaneRenderer class RenderSlopePlane : PlaneRenderer
{ {
public: 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: private:
void RenderLine(int y, int x1, int x2) override; void RenderLine(int y, int x1, int x2) override;

View file

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

View file

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

View file

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

View file

@ -20,7 +20,7 @@ struct FSectorPortal;
namespace swrenderer namespace swrenderer
{ {
struct visplane_t; struct VisiblePlane;
class VisiblePlaneList class VisiblePlaneList
{ {
@ -29,11 +29,11 @@ namespace swrenderer
void Clear(bool fullclear); 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); VisiblePlane *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 *GetRange(VisiblePlane *pl, int start, int stop);
bool HasPortalPlanes() const; bool HasPortalPlanes() const;
visplane_t *PopFirstPortalPlane(); VisiblePlane *PopFirstPortalPlane();
void ClearPortalPlanes(); void ClearPortalPlanes();
int Render(); int Render();
@ -41,10 +41,10 @@ namespace swrenderer
private: private:
VisiblePlaneList(); VisiblePlaneList();
visplane_t *Add(unsigned hash); VisiblePlane *Add(unsigned hash);
enum { MAXVISPLANES = 128 }; // must be a power of 2 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); } 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 // 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; int count;
seg_t* line; seg_t* line;
@ -432,8 +432,8 @@ namespace swrenderer
FSectorPortal *portal; FSectorPortal *portal;
// kg3D - fake floor stuff // kg3D - fake floor stuff
visplane_t *backupfp; VisiblePlane *backupfp;
visplane_t *backupcp; VisiblePlane *backupcp;
//secplane_t templane; //secplane_t templane;
lightlist_t *light; lightlist_t *light;
@ -498,7 +498,7 @@ namespace swrenderer
portal = frontsector->ValidatePortal(sector_t::ceiling); 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 || frontsector->GetTexture(sector_t::ceiling) == skyflatnum ||
portal != nullptr || portal != nullptr ||
(frontsector->heightsec && (frontsector->heightsec &&
@ -539,7 +539,7 @@ namespace swrenderer
// killough 10/98: add support for skies transferred from sidedefs // killough 10/98: add support for skies transferred from sidedefs
portal = frontsector->ValidatePortal(sector_t::floor); 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 || frontsector->GetTexture(sector_t::floor) == skyflatnum ||
portal != nullptr || portal != nullptr ||
(frontsector->heightsec && (frontsector->heightsec &&

View file

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

View file

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

View file

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