- removed the hasglnodes variables.

Since the software renderer also requires GL nodes now this was always true.
This commit is contained in:
Christoph Oelckers 2018-12-20 18:40:19 +01:00
parent d140d767a4
commit e279214f5b
5 changed files with 33 additions and 48 deletions

View File

@ -872,7 +872,7 @@ CCMD(am_togglegrid)
CCMD(am_toggletexture) CCMD(am_toggletexture)
{ {
if (am_textured && hasglnodes) if (am_textured)
{ {
textured = !textured; textured = !textured;
Printf ("%s\n", GStrings(textured ? "AMSTR_TEXON" : "AMSTR_TEXOFF")); Printf ("%s\n", GStrings(textured ? "AMSTR_TEXON" : "AMSTR_TEXOFF"));
@ -3212,11 +3212,7 @@ void AM_drawAuthorMarkers ()
while (marked != NULL) while (marked != NULL)
{ {
// Use more correct info if we have GL nodes available if (mark->args[1] == 0 || (mark->args[1] == 1 && (marked->subsector->flags & SSECMF_DRAWN)))
if (mark->args[1] == 0 ||
(mark->args[1] == 1 && (hasglnodes ?
marked->subsector->flags & SSECMF_DRAWN :
marked->Sector->MoreFlags & SECMF_DRAWN)))
{ {
DrawMarker (tex, marked->X(), marked->Y(), 0, flip, mark->Scale.X, mark->Scale.Y, mark->Translation, DrawMarker (tex, marked->X(), marked->Y(), 0, flip, mark->Scale.X, mark->Scale.Y, mark->Translation,
mark->Alpha, mark->fillcolor, mark->RenderStyle); mark->Alpha, mark->fillcolor, mark->RenderStyle);
@ -3280,7 +3276,7 @@ void AM_Drawer (int bottom)
} }
AM_activateNewScale(); AM_activateNewScale();
if (am_textured && hasglnodes && textured && !viewactive) if (am_textured && textured && !viewactive)
AM_drawSubsectors(); AM_drawSubsectors();
if (grid) if (grid)

View File

@ -355,8 +355,6 @@ FSerializer &SerializeSubsectors(FSerializer &arc, const char *key)
auto numsubsectors = level.subsectors.Size(); auto numsubsectors = level.subsectors.Size();
if (arc.isWriting()) if (arc.isWriting())
{
if (hasglnodes)
{ {
TArray<char> encoded(1 + (numsubsectors + 5) / 6); TArray<char> encoded(1 + (numsubsectors + 5) / 6);
int p = 0; int p = 0;
@ -388,7 +386,6 @@ FSerializer &SerializeSubsectors(FSerializer &arc, const char *key)
.EndArray(); .EndArray();
} }
} }
}
else else
{ {
int num_verts, num_subs; int num_verts, num_subs;
@ -400,7 +397,7 @@ FSerializer &SerializeSubsectors(FSerializer &arc, const char *key)
.StringPtr(nullptr, str) .StringPtr(nullptr, str)
.EndArray(); .EndArray();
if (num_verts == (int)level.vertexes.Size() && num_subs == (int)numsubsectors && hasglnodes) if (num_verts == (int)level.vertexes.Size() && num_subs == (int)numsubsectors)
{ {
success = true; success = true;
int sub = 0; int sub = 0;
@ -427,7 +424,7 @@ FSerializer &SerializeSubsectors(FSerializer &arc, const char *key)
sub += 6; sub += 6;
} }
} }
if (hasglnodes && !success) if (!success)
{ {
RecalculateDrawnSubsectors(); RecalculateDrawnSubsectors();
} }

View File

@ -148,8 +148,6 @@ inline bool P_LoadBuildMap(uint8_t *mapdata, size_t len, FMapThing **things, int
// //
TArray<vertexdata_t> vertexdatas; TArray<vertexdata_t> vertexdatas;
bool hasglnodes;
TArray<FMapThing> MapThingsConverted; TArray<FMapThing> MapThingsConverted;
TMap<unsigned,unsigned> MapThingsUserDataIndex; // from mapthing idx -> user data idx TMap<unsigned,unsigned> MapThingsUserDataIndex; // from mapthing idx -> user data idx
TArray<FUDMFKey> MapThingsUserData; TArray<FUDMFKey> MapThingsUserData;
@ -3371,7 +3369,6 @@ void P_SetupLevel(const char *lumpname, int position, bool newGame)
map->GetChecksum(level.md5); map->GetChecksum(level.md5);
// find map num // find map num
level.lumpnum = map->lumpnum; level.lumpnum = map->lumpnum;
hasglnodes = false;
if (newGame) if (newGame)
{ {
@ -3678,11 +3675,10 @@ void P_SetupLevel(const char *lumpname, int position, bool newGame)
// use in P_PointInSubsector to avoid problems with maps that depend on the specific // use in P_PointInSubsector to avoid problems with maps that depend on the specific
// nodes they were built with (P:AR E1M3 is a good example for a map where this is the case.) // nodes they were built with (P:AR E1M3 is a good example for a map where this is the case.)
reloop |= P_CheckNodes(map, BuildGLNodes, (uint32_t)(endTime - startTime)); reloop |= P_CheckNodes(map, BuildGLNodes, (uint32_t)(endTime - startTime));
hasglnodes = true;
} }
else else
{ {
hasglnodes = P_CheckForGLNodes(); P_CheckForGLNodes();
} }
// set the head node for gameplay purposes. If the separate gamenodes array is not empty, use that, otherwise use the render nodes. // set the head node for gameplay purposes. If the separate gamenodes array is not empty, use that, otherwise use the render nodes.
@ -3704,12 +3700,9 @@ void P_SetupLevel(const char *lumpname, int position, bool newGame)
P_FloodZones(); P_FloodZones();
times[13].Unclock(); times[13].Unclock();
if (hasglnodes)
{
P_SetRenderSector(); P_SetRenderSector();
FixMinisegReferences(); FixMinisegReferences();
FixHoles(); FixHoles();
}
level.bodyqueslot = 0; level.bodyqueslot = 0;
// phares 8/10/98: Clear body queue so the corpses from previous games are // phares 8/10/98: Clear body queue so the corpses from previous games are

View File

@ -195,7 +195,6 @@ struct sidei_t // [RH] Only keep BOOM sidedef init stuff around for init
}; };
}; };
extern sidei_t *sidetemp; extern sidei_t *sidetemp;
extern bool hasglnodes;
struct FMissingCount struct FMissingCount
{ {

View File

@ -171,7 +171,7 @@ namespace swrenderer
{ {
// When using GL nodes, do a clipping test for these lines so we can // When using GL nodes, do a clipping test for these lines so we can
// mark their subsectors as visible for automap texturing. // mark their subsectors as visible for automap texturing.
if (hasglnodes && !(mSubsector->flags & SSECMF_DRAWN)) if (!(mSubsector->flags & SSECMF_DRAWN))
{ {
if (Thread->ClipSegments->Check(WallC.sx1, WallC.sx2)) if (Thread->ClipSegments->Check(WallC.sx1, WallC.sx2))
{ {