diff --git a/src/am_map.cpp b/src/am_map.cpp index 4357136eb..8e39951b4 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -872,7 +872,7 @@ CCMD(am_togglegrid) CCMD(am_toggletexture) { - if (am_textured && hasglnodes) + if (am_textured) { textured = !textured; Printf ("%s\n", GStrings(textured ? "AMSTR_TEXON" : "AMSTR_TEXOFF")); @@ -3212,11 +3212,7 @@ void AM_drawAuthorMarkers () while (marked != NULL) { - // Use more correct info if we have GL nodes available - if (mark->args[1] == 0 || - (mark->args[1] == 1 && (hasglnodes ? - marked->subsector->flags & SSECMF_DRAWN : - marked->Sector->MoreFlags & SECMF_DRAWN))) + if (mark->args[1] == 0 || (mark->args[1] == 1 && (marked->subsector->flags & SSECMF_DRAWN))) { DrawMarker (tex, marked->X(), marked->Y(), 0, flip, mark->Scale.X, mark->Scale.Y, mark->Translation, mark->Alpha, mark->fillcolor, mark->RenderStyle); @@ -3280,7 +3276,7 @@ void AM_Drawer (int bottom) } AM_activateNewScale(); - if (am_textured && hasglnodes && textured && !viewactive) + if (am_textured && textured && !viewactive) AM_drawSubsectors(); if (grid) diff --git a/src/p_saveg.cpp b/src/p_saveg.cpp index 68f642c78..f9078dea5 100644 --- a/src/p_saveg.cpp +++ b/src/p_saveg.cpp @@ -356,37 +356,34 @@ FSerializer &SerializeSubsectors(FSerializer &arc, const char *key) auto numsubsectors = level.subsectors.Size(); if (arc.isWriting()) { - if (hasglnodes) + TArray encoded(1 + (numsubsectors + 5) / 6); + int p = 0; + for (unsigned i = 0; i < numsubsectors; i += 6) { - TArray encoded(1 + (numsubsectors + 5) / 6); - int p = 0; - for (unsigned i = 0; i < numsubsectors; i += 6) + by = 0; + for (unsigned j = 0; j < 6; j++) { - by = 0; - for (unsigned j = 0; j < 6; j++) + if (i + j < numsubsectors && (level.subsectors[i + j].flags & SSECMF_DRAWN)) { - if (i + j < numsubsectors && (level.subsectors[i + j].flags & SSECMF_DRAWN)) - { - by |= (1 << j); - } + by |= (1 << j); } - if (by < 10) by += '0'; - else if (by < 36) by += 'A' - 10; - else if (by < 62) by += 'a' - 36; - else if (by == 62) by = '-'; - else if (by == 63) by = '+'; - encoded[p++] = by; - } - encoded[p] = 0; - str = &encoded[0]; - if (arc.BeginArray(key)) - { - auto numvertexes = level.vertexes.Size(); - arc(nullptr, numvertexes) - (nullptr, numsubsectors) - .StringPtr(nullptr, str) - .EndArray(); } + if (by < 10) by += '0'; + else if (by < 36) by += 'A' - 10; + else if (by < 62) by += 'a' - 36; + else if (by == 62) by = '-'; + else if (by == 63) by = '+'; + encoded[p++] = by; + } + encoded[p] = 0; + str = &encoded[0]; + if (arc.BeginArray(key)) + { + auto numvertexes = level.vertexes.Size(); + arc(nullptr, numvertexes) + (nullptr, numsubsectors) + .StringPtr(nullptr, str) + .EndArray(); } } else @@ -400,7 +397,7 @@ FSerializer &SerializeSubsectors(FSerializer &arc, const char *key) .StringPtr(nullptr, str) .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; int sub = 0; @@ -427,7 +424,7 @@ FSerializer &SerializeSubsectors(FSerializer &arc, const char *key) sub += 6; } } - if (hasglnodes && !success) + if (!success) { RecalculateDrawnSubsectors(); } diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 7dc77bf85..54680ba60 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -148,8 +148,6 @@ inline bool P_LoadBuildMap(uint8_t *mapdata, size_t len, FMapThing **things, int // TArray vertexdatas; -bool hasglnodes; - TArray MapThingsConverted; TMap MapThingsUserDataIndex; // from mapthing idx -> user data idx TArray MapThingsUserData; @@ -3371,7 +3369,6 @@ void P_SetupLevel(const char *lumpname, int position, bool newGame) map->GetChecksum(level.md5); // find map num level.lumpnum = map->lumpnum; - hasglnodes = false; 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 // 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)); - hasglnodes = true; } 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. @@ -3704,12 +3700,9 @@ void P_SetupLevel(const char *lumpname, int position, bool newGame) P_FloodZones(); times[13].Unclock(); - if (hasglnodes) - { - P_SetRenderSector(); - FixMinisegReferences(); - FixHoles(); - } + P_SetRenderSector(); + FixMinisegReferences(); + FixHoles(); level.bodyqueslot = 0; // phares 8/10/98: Clear body queue so the corpses from previous games are diff --git a/src/p_setup.h b/src/p_setup.h index d7e7eeae5..bffd98ea7 100644 --- a/src/p_setup.h +++ b/src/p_setup.h @@ -195,7 +195,6 @@ struct sidei_t // [RH] Only keep BOOM sidedef init stuff around for init }; }; extern sidei_t *sidetemp; -extern bool hasglnodes; struct FMissingCount { diff --git a/src/swrenderer/line/r_line.cpp b/src/swrenderer/line/r_line.cpp index ab2f6a96a..8c937966b 100644 --- a/src/swrenderer/line/r_line.cpp +++ b/src/swrenderer/line/r_line.cpp @@ -171,7 +171,7 @@ namespace swrenderer { // When using GL nodes, do a clipping test for these lines so we can // 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)) {