mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-14 08:31:23 +00:00
Refactored the render hack storage so that it can be decoupled from the regular GLFlat render items.
Having these in there makes it impossible to change render techniques so these are better done as separate items.
This commit is contained in:
parent
aee47d23bd
commit
a6e77ae094
5 changed files with 174 additions and 182 deletions
|
@ -56,18 +56,6 @@ sector_t * hw_FakeFlat(sector_t * sec, sector_t * dest, area_t in_area, bool bac
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
template<class T>
|
|
||||||
inline void DeleteLinkedList(T *node)
|
|
||||||
{
|
|
||||||
while (node)
|
|
||||||
{
|
|
||||||
auto n = node;
|
|
||||||
node = node->next;
|
|
||||||
delete n;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class FDrawInfoList
|
class FDrawInfoList
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -188,17 +176,10 @@ HWDrawInfo *HWDrawInfo::EndDrawInfo()
|
||||||
|
|
||||||
void HWDrawInfo::ClearBuffers()
|
void HWDrawInfo::ClearBuffers()
|
||||||
{
|
{
|
||||||
for (auto node : otherfloorplanes) DeleteLinkedList(node);
|
otherFloorPlanes.Clear();
|
||||||
otherfloorplanes.Clear();
|
otherCeilingPlanes.Clear();
|
||||||
|
floodFloorSegs.Clear();
|
||||||
for (auto node : otherceilingplanes) DeleteLinkedList(node);
|
floodCeilingSegs.Clear();
|
||||||
otherceilingplanes.Clear();
|
|
||||||
|
|
||||||
for (auto node : floodfloorsegs) DeleteLinkedList(node);
|
|
||||||
floodfloorsegs.Clear();
|
|
||||||
|
|
||||||
for (auto node : floodceilingsegs) DeleteLinkedList(node);
|
|
||||||
floodceilingsegs.Clear();
|
|
||||||
|
|
||||||
// clear all the lists that might not have been cleared already
|
// clear all the lists that might not have been cleared already
|
||||||
MissingUpperTextures.Clear();
|
MissingUpperTextures.Clear();
|
||||||
|
|
|
@ -68,6 +68,8 @@ enum SectorRenderFlags
|
||||||
SSRF_RENDERALL = 7,
|
SSRF_RENDERALL = 7,
|
||||||
SSRF_PROCESSED = 8,
|
SSRF_PROCESSED = 8,
|
||||||
SSRF_SEEN = 16,
|
SSRF_SEEN = 16,
|
||||||
|
SSRF_PLANEHACK = 32,
|
||||||
|
SSRF_FLOODHACK = 64
|
||||||
};
|
};
|
||||||
|
|
||||||
enum EPortalClip
|
enum EPortalClip
|
||||||
|
@ -160,10 +162,10 @@ struct HWDrawInfo
|
||||||
|
|
||||||
TArray<SubsectorHackInfo> SubsectorHacks;
|
TArray<SubsectorHackInfo> SubsectorHacks;
|
||||||
|
|
||||||
TArray<gl_subsectorrendernode*> otherfloorplanes;
|
TMap<int, gl_subsectorrendernode*> otherFloorPlanes;
|
||||||
TArray<gl_subsectorrendernode*> otherceilingplanes;
|
TMap<int, gl_subsectorrendernode*> otherCeilingPlanes;
|
||||||
TArray<gl_floodrendernode*> floodfloorsegs;
|
TMap<int, gl_floodrendernode*> floodFloorSegs;
|
||||||
TArray<gl_floodrendernode*> floodceilingsegs;
|
TMap<int, gl_floodrendernode*> floodCeilingSegs;
|
||||||
|
|
||||||
TArray<sector_t *> CeilingStacks;
|
TArray<sector_t *> CeilingStacks;
|
||||||
TArray<sector_t *> FloorStacks;
|
TArray<sector_t *> FloorStacks;
|
||||||
|
@ -212,32 +214,6 @@ private:
|
||||||
void DrawPSprite(HUDSprite *huds, FRenderState &state);
|
void DrawPSprite(HUDSprite *huds, FRenderState &state);
|
||||||
public:
|
public:
|
||||||
|
|
||||||
gl_subsectorrendernode * GetOtherFloorPlanes(unsigned int sector)
|
|
||||||
{
|
|
||||||
if (sector<otherfloorplanes.Size()) return otherfloorplanes[sector];
|
|
||||||
else return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
gl_subsectorrendernode * GetOtherCeilingPlanes(unsigned int sector)
|
|
||||||
{
|
|
||||||
if (sector<otherceilingplanes.Size()) return otherceilingplanes[sector];
|
|
||||||
else return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
gl_floodrendernode * GetFloodFloorSegs(unsigned int sector)
|
|
||||||
{
|
|
||||||
if (sector<floodfloorsegs.Size()) return floodfloorsegs[sector];
|
|
||||||
else return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
gl_floodrendernode * GetFloodCeilingSegs(unsigned int sector)
|
|
||||||
{
|
|
||||||
if (sector<floodceilingsegs.Size()) return floodceilingsegs[sector];
|
|
||||||
else return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void SetCameraPos(const DVector3 &pos)
|
void SetCameraPos(const DVector3 &pos)
|
||||||
{
|
{
|
||||||
VPUniforms.mCameraPos = { (float)pos.X, (float)pos.Z, (float)pos.Y, 0.f };
|
VPUniforms.mCameraPos = { (float)pos.X, (float)pos.Z, (float)pos.Y, 0.f };
|
||||||
|
|
|
@ -308,6 +308,7 @@ public:
|
||||||
bool stack;
|
bool stack;
|
||||||
bool ceiling;
|
bool ceiling;
|
||||||
uint8_t renderflags;
|
uint8_t renderflags;
|
||||||
|
uint8_t hacktype;
|
||||||
int iboindex;
|
int iboindex;
|
||||||
//int vboheight;
|
//int vboheight;
|
||||||
|
|
||||||
|
@ -319,10 +320,13 @@ public:
|
||||||
void PutFlat(HWDrawInfo *di, bool fog = false);
|
void PutFlat(HWDrawInfo *di, bool fog = false);
|
||||||
void Process(HWDrawInfo *di, sector_t * model, int whichplane, bool notexture);
|
void Process(HWDrawInfo *di, sector_t * model, int whichplane, bool notexture);
|
||||||
void SetFrom3DFloor(F3DFloor *rover, bool top, bool underside);
|
void SetFrom3DFloor(F3DFloor *rover, bool top, bool underside);
|
||||||
void ProcessSector(HWDrawInfo *di, sector_t * frontsector);
|
void ProcessSector(HWDrawInfo *di, sector_t * frontsector, int which = SSRF_RENDERALL);
|
||||||
|
|
||||||
void DrawSubsectors(HWDrawInfo *di, FRenderState &state);
|
void DrawSubsectors(HWDrawInfo *di, FRenderState &state);
|
||||||
void DrawFlat(HWDrawInfo *di, FRenderState &state, bool translucent);
|
void DrawFlat(HWDrawInfo *di, FRenderState &state, bool translucent);
|
||||||
|
|
||||||
|
void DrawOtherPlanes(HWDrawInfo *di, FRenderState &state);
|
||||||
|
void DrawFloodPlanes(HWDrawInfo *di, FRenderState &state);
|
||||||
};
|
};
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
|
@ -192,16 +192,25 @@ void GLFlat::DrawSubsectors(HWDrawInfo *di, FRenderState &state)
|
||||||
state.DrawIndexed(DT_Triangles, iboindex + section->vertexindex, section->vertexcount);
|
state.DrawIndexed(DT_Triangles, iboindex + section->vertexindex, section->vertexcount);
|
||||||
flatvertices += section->vertexcount;
|
flatvertices += section->vertexcount;
|
||||||
flatprimitives++;
|
flatprimitives++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
//==========================================================================
|
||||||
//Temporarily disabled until the render hack code can be redone and refactored into its own draw elements
|
//
|
||||||
if (!(renderflags&SSRF_RENDER3DPLANES))
|
// Drawer for render hacks
|
||||||
|
//
|
||||||
|
//==========================================================================
|
||||||
|
|
||||||
|
void GLFlat::DrawOtherPlanes(HWDrawInfo *di, FRenderState &state)
|
||||||
{
|
{
|
||||||
|
state.SetMaterial(gltexture, CLAMP_XY, 0, -1);
|
||||||
|
|
||||||
// Draw the subsectors assigned to it due to missing textures
|
// Draw the subsectors assigned to it due to missing textures
|
||||||
gl_subsectorrendernode * node = (renderflags&SSRF_RENDERFLOOR) ?
|
auto pNode = (renderflags&SSRF_RENDERFLOOR) ?
|
||||||
di->GetOtherFloorPlanes(sector->sectornum) :
|
di->otherFloorPlanes.CheckKey(sector->sectornum) : di->otherCeilingPlanes.CheckKey(sector->sectornum);
|
||||||
di->GetOtherCeilingPlanes(sector->sectornum);
|
|
||||||
|
if (!pNode) return;
|
||||||
|
auto node = *pNode;
|
||||||
|
|
||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
|
@ -212,14 +221,39 @@ void GLFlat::DrawSubsectors(HWDrawInfo *di, FRenderState &state)
|
||||||
state.Draw(DT_TriangleFan,node->vertexindex, num);
|
state.Draw(DT_TriangleFan,node->vertexindex, num);
|
||||||
node = node->next;
|
node = node->next;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//==========================================================================
|
||||||
|
//
|
||||||
|
// Drawer for render hacks
|
||||||
|
//
|
||||||
|
//==========================================================================
|
||||||
|
|
||||||
|
void GLFlat::DrawFloodPlanes(HWDrawInfo *di, FRenderState &state)
|
||||||
|
{
|
||||||
// Flood gaps with the back side's ceiling/floor texture
|
// Flood gaps with the back side's ceiling/floor texture
|
||||||
// This requires a stencil because the projected plane interferes with
|
// This requires a stencil because the projected plane interferes with
|
||||||
// the depth buffer
|
// the depth buffer
|
||||||
gl_floodrendernode * fnode = (renderflags&SSRF_RENDERFLOOR) ?
|
|
||||||
di->GetFloodFloorSegs(sector->sectornum) :
|
|
||||||
di->GetFloodCeilingSegs(sector->sectornum);
|
|
||||||
|
|
||||||
state.SetLightIndex(dynlightindex);
|
state.SetMaterial(gltexture, CLAMP_XY, 0, -1);
|
||||||
|
|
||||||
|
// Draw the subsectors assigned to it due to missing textures
|
||||||
|
auto pNode = (renderflags&SSRF_RENDERFLOOR) ?
|
||||||
|
di->floodFloorSegs.CheckKey(sector->sectornum) : di->floodCeilingSegs.CheckKey(sector->sectornum);
|
||||||
|
|
||||||
|
if (!pNode) return;
|
||||||
|
auto node = *pNode;
|
||||||
|
|
||||||
|
while (node)
|
||||||
|
{
|
||||||
|
|
||||||
|
auto pNode = (renderflags&SSRF_RENDERFLOOR) ?
|
||||||
|
di->floodFloorSegs.CheckKey(sector->sectornum) : di->floodCeilingSegs.CheckKey(sector->sectornum);
|
||||||
|
if (!pNode) return;
|
||||||
|
|
||||||
|
auto fnode = *pNode;
|
||||||
|
|
||||||
|
state.SetLightIndex(-1);
|
||||||
while (fnode)
|
while (fnode)
|
||||||
{
|
{
|
||||||
flatvertices += 12;
|
flatvertices += 12;
|
||||||
|
@ -259,9 +293,9 @@ void GLFlat::DrawSubsectors(HWDrawInfo *di, FRenderState &state)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
@ -282,7 +316,6 @@ void GLFlat::DrawFlat(HWDrawInfo *di, FRenderState &state, bool translucent)
|
||||||
|
|
||||||
state.SetColor(lightlevel, rel, di->isFullbrightScene(), Colormap, alpha);
|
state.SetColor(lightlevel, rel, di->isFullbrightScene(), Colormap, alpha);
|
||||||
state.SetFog(lightlevel, rel, di->isFullbrightScene(), &Colormap, false);
|
state.SetFog(lightlevel, rel, di->isFullbrightScene(), &Colormap, false);
|
||||||
if (!gltexture || !gltexture->tex->isFullbright())
|
|
||||||
state.SetObjectColor(FlatColor | 0xff000000);
|
state.SetObjectColor(FlatColor | 0xff000000);
|
||||||
|
|
||||||
if (!translucent)
|
if (!translucent)
|
||||||
|
@ -294,7 +327,7 @@ void GLFlat::DrawFlat(HWDrawInfo *di, FRenderState &state, bool translucent)
|
||||||
DrawSubsectors(di, state);
|
DrawSubsectors(di, state);
|
||||||
state.EnableTextureMatrix(false);
|
state.EnableTextureMatrix(false);
|
||||||
}
|
}
|
||||||
else
|
else if (!hacktype)
|
||||||
{
|
{
|
||||||
state.SetMaterial(gltexture, CLAMP_XY, 0, -1);
|
state.SetMaterial(gltexture, CLAMP_XY, 0, -1);
|
||||||
state.SetLightIndex(dynlightindex);
|
state.SetLightIndex(dynlightindex);
|
||||||
|
@ -302,6 +335,14 @@ void GLFlat::DrawFlat(HWDrawInfo *di, FRenderState &state, bool translucent)
|
||||||
flatvertices += 4;
|
flatvertices += 4;
|
||||||
flatprimitives++;
|
flatprimitives++;
|
||||||
}
|
}
|
||||||
|
else if (hacktype & SSRF_PLANEHACK)
|
||||||
|
{
|
||||||
|
DrawOtherPlanes(di, state);
|
||||||
|
}
|
||||||
|
else if (hacktype & SSRF_FLOODHACK)
|
||||||
|
{
|
||||||
|
DrawFloodPlanes(di, state);
|
||||||
|
}
|
||||||
state.SetObjectColor(0xffffffff);
|
state.SetObjectColor(0xffffffff);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -355,8 +396,6 @@ inline void GLFlat::PutFlat(HWDrawInfo *di, bool fog)
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
// This draws one flat
|
// This draws one flat
|
||||||
// The passed sector does not indicate the area which is rendered.
|
|
||||||
// It is only used as source for the plane data.
|
|
||||||
// The whichplane boolean indicates if the flat is a floor(false) or a ceiling(true)
|
// The whichplane boolean indicates if the flat is a floor(false) or a ceiling(true)
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
@ -394,8 +433,8 @@ void GLFlat::Process(HWDrawInfo *di, sector_t * model, int whichplane, bool fog)
|
||||||
iboindex = vert.second;
|
iboindex = vert.second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// For hacks this won't go into a render list.
|
||||||
PutFlat(di, fog);
|
if (hacktype == 0) PutFlat(di, fog);
|
||||||
rendered_flats++;
|
rendered_flats++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -438,7 +477,7 @@ void GLFlat::SetFrom3DFloor(F3DFloor *rover, bool top, bool underside)
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
void GLFlat::ProcessSector(HWDrawInfo *di, sector_t * frontsector)
|
void GLFlat::ProcessSector(HWDrawInfo *di, sector_t * frontsector, int which)
|
||||||
{
|
{
|
||||||
lightlist_t * light;
|
lightlist_t * light;
|
||||||
FSectorPortal *port;
|
FSectorPortal *port;
|
||||||
|
@ -454,6 +493,7 @@ void GLFlat::ProcessSector(HWDrawInfo *di, sector_t * frontsector)
|
||||||
sector = &level.sectors[frontsector->sectornum];
|
sector = &level.sectors[frontsector->sectornum];
|
||||||
extsector_t::xfloor &x = sector->e->XFloor;
|
extsector_t::xfloor &x = sector->e->XFloor;
|
||||||
dynlightindex = -1;
|
dynlightindex = -1;
|
||||||
|
hacktype = (which & (SSRF_PLANEHACK|SSRF_FLOODHACK));
|
||||||
|
|
||||||
uint8_t &srf = di->section_renderflags[level.sections.SectionIndex(section)];
|
uint8_t &srf = di->section_renderflags[level.sections.SectionIndex(section)];
|
||||||
const auto &vp = di->Viewpoint;
|
const auto &vp = di->Viewpoint;
|
||||||
|
@ -465,7 +505,7 @@ void GLFlat::ProcessSector(HWDrawInfo *di, sector_t * frontsector)
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
if (frontsector->floorplane.ZatPoint(vp.Pos) <= vp.Pos.Z)
|
if ((which & SSRF_RENDERFLOOR) && frontsector->floorplane.ZatPoint(vp.Pos) <= vp.Pos.Z)
|
||||||
{
|
{
|
||||||
// process the original floor first.
|
// process the original floor first.
|
||||||
|
|
||||||
|
@ -477,10 +517,12 @@ void GLFlat::ProcessSector(HWDrawInfo *di, sector_t * frontsector)
|
||||||
port = frontsector->ValidatePortal(sector_t::floor);
|
port = frontsector->ValidatePortal(sector_t::floor);
|
||||||
if ((stack = (port != NULL)))
|
if ((stack = (port != NULL)))
|
||||||
{
|
{
|
||||||
|
/* to be redone in a less invasive manner
|
||||||
if (port->mType == PORTS_STACKEDSECTORTHING)
|
if (port->mType == PORTS_STACKEDSECTORTHING)
|
||||||
{
|
{
|
||||||
di->AddFloorStack(sector); // stacked sector things require visplane merging.
|
di->AddFloorStack(sector); // stacked sector things require visplane merging.
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
alpha = frontsector->GetAlpha(sector_t::floor);
|
alpha = frontsector->GetAlpha(sector_t::floor);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -518,7 +560,7 @@ void GLFlat::ProcessSector(HWDrawInfo *di, sector_t * frontsector)
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
if (frontsector->ceilingplane.ZatPoint(vp.Pos) >= vp.Pos.Z)
|
if ((which & SSRF_RENDERCEILING) && frontsector->ceilingplane.ZatPoint(vp.Pos) >= vp.Pos.Z)
|
||||||
{
|
{
|
||||||
// process the original ceiling first.
|
// process the original ceiling first.
|
||||||
|
|
||||||
|
@ -530,10 +572,12 @@ void GLFlat::ProcessSector(HWDrawInfo *di, sector_t * frontsector)
|
||||||
port = frontsector->ValidatePortal(sector_t::ceiling);
|
port = frontsector->ValidatePortal(sector_t::ceiling);
|
||||||
if ((stack = (port != NULL)))
|
if ((stack = (port != NULL)))
|
||||||
{
|
{
|
||||||
|
/* as above for floors
|
||||||
if (port->mType == PORTS_STACKEDSECTORTHING)
|
if (port->mType == PORTS_STACKEDSECTORTHING)
|
||||||
{
|
{
|
||||||
di->AddCeilingStack(sector);
|
di->AddCeilingStack(sector);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
alpha = frontsector->GetAlpha(sector_t::ceiling);
|
alpha = frontsector->GetAlpha(sector_t::ceiling);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -572,7 +616,7 @@ void GLFlat::ProcessSector(HWDrawInfo *di, sector_t * frontsector)
|
||||||
//
|
//
|
||||||
|
|
||||||
stack = false;
|
stack = false;
|
||||||
if (x.ffloors.Size())
|
if ((which & SSRF_RENDER3DPLANES) && x.ffloors.Size())
|
||||||
{
|
{
|
||||||
player_t * player = players[consoleplayer].camera->player;
|
player_t * player = players[consoleplayer].camera->player;
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,17 @@
|
||||||
|
|
||||||
sector_t * hw_FakeFlat(sector_t * sec, sector_t * dest, area_t in_area, bool back);
|
sector_t * hw_FakeFlat(sector_t * sec, sector_t * dest, area_t in_area, bool back);
|
||||||
|
|
||||||
|
// Get the nodes from the render data allocator so we don't have to keep track of them ourselves.
|
||||||
|
static gl_subsectorrendernode *NewSubsectorRenderNode()
|
||||||
|
{
|
||||||
|
return (gl_subsectorrendernode*)RenderDataAllocator.Alloc(sizeof(gl_subsectorrendernode));
|
||||||
|
}
|
||||||
|
|
||||||
|
static gl_floodrendernode *NewFloodRenderNode()
|
||||||
|
{
|
||||||
|
return (gl_floodrendernode*)RenderDataAllocator.Alloc(sizeof(gl_floodrendernode));
|
||||||
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
// light setup for render hacks.
|
// light setup for render hacks.
|
||||||
|
@ -110,35 +121,24 @@ int HWDrawInfo::CreateOtherPlaneVertices(subsector_t *sub, const secplane_t *pla
|
||||||
|
|
||||||
void HWDrawInfo::AddOtherFloorPlane(int sector, gl_subsectorrendernode * node)
|
void HWDrawInfo::AddOtherFloorPlane(int sector, gl_subsectorrendernode * node)
|
||||||
{
|
{
|
||||||
int oldcnt = otherfloorplanes.Size();
|
auto pNode = otherFloorPlanes.CheckKey(sector);
|
||||||
|
|
||||||
if (oldcnt <= sector)
|
node->next = pNode? *pNode : nullptr;
|
||||||
{
|
|
||||||
otherfloorplanes.Resize(sector + 1);
|
|
||||||
for (int i = oldcnt; i <= sector; i++) otherfloorplanes[i] = nullptr;
|
|
||||||
}
|
|
||||||
node->next = otherfloorplanes[sector];
|
|
||||||
node->lightindex = SetupLightsForOtherPlane(node->sub, lightdata, &level.sectors[sector].floorplane);
|
node->lightindex = SetupLightsForOtherPlane(node->sub, lightdata, &level.sectors[sector].floorplane);
|
||||||
node->vertexindex = CreateOtherPlaneVertices(node->sub, &level.sectors[sector].floorplane);
|
node->vertexindex = CreateOtherPlaneVertices(node->sub, &level.sectors[sector].floorplane);
|
||||||
otherfloorplanes[sector] = node;
|
otherFloorPlanes[sector] = node;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HWDrawInfo::AddOtherCeilingPlane(int sector, gl_subsectorrendernode * node)
|
void HWDrawInfo::AddOtherCeilingPlane(int sector, gl_subsectorrendernode * node)
|
||||||
{
|
{
|
||||||
int oldcnt = otherceilingplanes.Size();
|
auto pNode = otherCeilingPlanes.CheckKey(sector);
|
||||||
|
|
||||||
if (oldcnt <= sector)
|
node->next = pNode? *pNode : nullptr;
|
||||||
{
|
|
||||||
otherceilingplanes.Resize(sector + 1);
|
|
||||||
for (int i = oldcnt; i <= sector; i++) otherceilingplanes[i] = nullptr;
|
|
||||||
}
|
|
||||||
node->next = otherceilingplanes[sector];
|
|
||||||
node->lightindex = SetupLightsForOtherPlane(node->sub, lightdata, &level.sectors[sector].ceilingplane);
|
node->lightindex = SetupLightsForOtherPlane(node->sub, lightdata, &level.sectors[sector].ceilingplane);
|
||||||
node->vertexindex = CreateOtherPlaneVertices(node->sub, &level.sectors[sector].ceilingplane);
|
node->vertexindex = CreateOtherPlaneVertices(node->sub, &level.sectors[sector].ceilingplane);
|
||||||
otherceilingplanes[sector] = node;
|
otherCeilingPlanes[sector] = node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
// Collects all sectors that might need a fake ceiling
|
// Collects all sectors that might need a fake ceiling
|
||||||
|
@ -511,7 +511,7 @@ void HWDrawInfo::HandleMissingTextures(area_t in_area)
|
||||||
|
|
||||||
for (unsigned int j = 0; j < HandledSubsectors.Size(); j++)
|
for (unsigned int j = 0; j < HandledSubsectors.Size(); j++)
|
||||||
{
|
{
|
||||||
gl_subsectorrendernode * node = new gl_subsectorrendernode;
|
gl_subsectorrendernode * node = NewSubsectorRenderNode();
|
||||||
node->sub = HandledSubsectors[j];
|
node->sub = HandledSubsectors[j];
|
||||||
|
|
||||||
AddOtherCeilingPlane(sec->sectornum, node);
|
AddOtherCeilingPlane(sec->sectornum, node);
|
||||||
|
@ -555,7 +555,7 @@ void HWDrawInfo::HandleMissingTextures(area_t in_area)
|
||||||
|
|
||||||
for (unsigned int j = 0; j < HandledSubsectors.Size(); j++)
|
for (unsigned int j = 0; j < HandledSubsectors.Size(); j++)
|
||||||
{
|
{
|
||||||
gl_subsectorrendernode * node = new gl_subsectorrendernode;
|
gl_subsectorrendernode * node = NewSubsectorRenderNode();
|
||||||
node->sub = HandledSubsectors[j];
|
node->sub = HandledSubsectors[j];
|
||||||
AddOtherCeilingPlane(fakesector->sectornum, node);
|
AddOtherCeilingPlane(fakesector->sectornum, node);
|
||||||
}
|
}
|
||||||
|
@ -583,7 +583,7 @@ void HWDrawInfo::HandleMissingTextures(area_t in_area)
|
||||||
|
|
||||||
for (unsigned int j = 0; j < HandledSubsectors.Size(); j++)
|
for (unsigned int j = 0; j < HandledSubsectors.Size(); j++)
|
||||||
{
|
{
|
||||||
gl_subsectorrendernode * node = new gl_subsectorrendernode;
|
gl_subsectorrendernode * node = NewSubsectorRenderNode();
|
||||||
node->sub = HandledSubsectors[j];
|
node->sub = HandledSubsectors[j];
|
||||||
AddOtherFloorPlane(sec->sectornum, node);
|
AddOtherFloorPlane(sec->sectornum, node);
|
||||||
}
|
}
|
||||||
|
@ -626,7 +626,7 @@ void HWDrawInfo::HandleMissingTextures(area_t in_area)
|
||||||
|
|
||||||
for (unsigned int j = 0; j < HandledSubsectors.Size(); j++)
|
for (unsigned int j = 0; j < HandledSubsectors.Size(); j++)
|
||||||
{
|
{
|
||||||
gl_subsectorrendernode * node = new gl_subsectorrendernode;
|
gl_subsectorrendernode * node = NewSubsectorRenderNode();
|
||||||
node->sub = HandledSubsectors[j];
|
node->sub = HandledSubsectors[j];
|
||||||
AddOtherFloorPlane(fakesector->sectornum, node);
|
AddOtherFloorPlane(fakesector->sectornum, node);
|
||||||
}
|
}
|
||||||
|
@ -730,19 +730,13 @@ void HWDrawInfo::PrepareUpperGap(seg_t * seg)
|
||||||
CreateFloodStencilPoly(&ws, vertices.first);
|
CreateFloodStencilPoly(&ws, vertices.first);
|
||||||
CreateFloodPoly(&ws, vertices.first+4, ws.z2, fakebsector, true);
|
CreateFloodPoly(&ws, vertices.first+4, ws.z2, fakebsector, true);
|
||||||
|
|
||||||
gl_floodrendernode *node = new gl_floodrendernode;
|
gl_floodrendernode *node = NewFloodRenderNode();
|
||||||
int oldcnt = floodfloorsegs.Size();
|
auto pNode = floodFloorSegs.CheckKey(fakebsector->sectornum);
|
||||||
auto sector = fakebsector->sectornum;
|
|
||||||
if (oldcnt <= sector)
|
|
||||||
{
|
|
||||||
floodfloorsegs.Resize(sector + 1);
|
|
||||||
for (int i = oldcnt; i <= sector; i++) floodfloorsegs[i] = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
node->next = floodfloorsegs[sector];
|
node->next = pNode? *pNode : nullptr;
|
||||||
node->seg = seg;
|
node->seg = seg;
|
||||||
node->vertexindex = vertices.second;
|
node->vertexindex = vertices.second;
|
||||||
floodfloorsegs[sector] = node;
|
floodFloorSegs[fakebsector->sectornum] = node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -794,19 +788,14 @@ void HWDrawInfo::PrepareLowerGap(seg_t * seg)
|
||||||
CreateFloodStencilPoly(&ws, vertices.first);
|
CreateFloodStencilPoly(&ws, vertices.first);
|
||||||
CreateFloodPoly(&ws, vertices.first+4, ws.z1, fakebsector, false);
|
CreateFloodPoly(&ws, vertices.first+4, ws.z1, fakebsector, false);
|
||||||
|
|
||||||
gl_floodrendernode *node = new gl_floodrendernode;
|
gl_floodrendernode *node = NewFloodRenderNode();
|
||||||
int oldcnt = floodceilingsegs.Size();
|
auto pNode = floodCeilingSegs.CheckKey(fakebsector->sectornum);
|
||||||
auto sector = fakebsector->sectornum;
|
|
||||||
if (oldcnt <= sector)
|
node->next = pNode? *pNode : nullptr;
|
||||||
{
|
|
||||||
floodceilingsegs.Resize(sector + 1);
|
|
||||||
for (int i = oldcnt; i <= sector; i++) floodceilingsegs[i] = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
node->next = floodceilingsegs[sector];
|
|
||||||
node->seg = seg;
|
node->seg = seg;
|
||||||
node->vertexindex = vertices.second;
|
node->vertexindex = vertices.second;
|
||||||
floodceilingsegs[sector] = node;
|
floodCeilingSegs[fakebsector->sectornum] = node;
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
@ -1122,8 +1111,7 @@ void HWDrawInfo::HandleHackedSubsectors()
|
||||||
{
|
{
|
||||||
for(unsigned int j=0;j<HandledSubsectors.Size();j++)
|
for(unsigned int j=0;j<HandledSubsectors.Size();j++)
|
||||||
{
|
{
|
||||||
gl_subsectorrendernode * node = new gl_subsectorrendernode;
|
gl_subsectorrendernode * node = NewSubsectorRenderNode();
|
||||||
|
|
||||||
node->sub = HandledSubsectors[j];
|
node->sub = HandledSubsectors[j];
|
||||||
AddOtherFloorPlane(sub->render_sector->sectornum, node);
|
AddOtherFloorPlane(sub->render_sector->sectornum, node);
|
||||||
}
|
}
|
||||||
|
@ -1145,8 +1133,7 @@ void HWDrawInfo::HandleHackedSubsectors()
|
||||||
{
|
{
|
||||||
for(unsigned int j=0;j<HandledSubsectors.Size();j++)
|
for(unsigned int j=0;j<HandledSubsectors.Size();j++)
|
||||||
{
|
{
|
||||||
gl_subsectorrendernode * node = new gl_subsectorrendernode;
|
gl_subsectorrendernode * node = NewSubsectorRenderNode();
|
||||||
|
|
||||||
node->sub = HandledSubsectors[j];
|
node->sub = HandledSubsectors[j];
|
||||||
AddOtherCeilingPlane(sub->render_sector->sectornum, node);
|
AddOtherCeilingPlane(sub->render_sector->sectornum, node);
|
||||||
}
|
}
|
||||||
|
@ -1308,7 +1295,7 @@ void HWDrawInfo::ProcessSectorStacks(area_t in_area)
|
||||||
|
|
||||||
if (sec->GetAlpha(sector_t::ceiling) != 0 && sec->GetTexture(sector_t::ceiling) != skyflatnum)
|
if (sec->GetAlpha(sector_t::ceiling) != 0 && sec->GetTexture(sector_t::ceiling) != skyflatnum)
|
||||||
{
|
{
|
||||||
gl_subsectorrendernode * node = new gl_subsectorrendernode;
|
gl_subsectorrendernode * node = NewSubsectorRenderNode();
|
||||||
node->sub = sub;
|
node->sub = sub;
|
||||||
AddOtherCeilingPlane(sec->sectornum, node);
|
AddOtherCeilingPlane(sec->sectornum, node);
|
||||||
}
|
}
|
||||||
|
@ -1353,7 +1340,7 @@ void HWDrawInfo::ProcessSectorStacks(area_t in_area)
|
||||||
|
|
||||||
if (sec->GetAlpha(sector_t::floor) != 0 && sec->GetTexture(sector_t::floor) != skyflatnum)
|
if (sec->GetAlpha(sector_t::floor) != 0 && sec->GetTexture(sector_t::floor) != skyflatnum)
|
||||||
{
|
{
|
||||||
gl_subsectorrendernode * node = new gl_subsectorrendernode;
|
gl_subsectorrendernode * node = NewSubsectorRenderNode();
|
||||||
node->sub = sub;
|
node->sub = sub;
|
||||||
AddOtherFloorPlane(sec->sectornum, node);
|
AddOtherFloorPlane(sec->sectornum, node);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue