From 65b01bd16d33acf7ac15a87c05c6ed152eb23529 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 30 Dec 2018 08:22:34 +0100 Subject: [PATCH] - fixed incomplete commit. I have no idea where the rest of this stuff went... --- src/maploader/maploader.cpp | 4 ++-- src/p_saveg.cpp | 2 +- src/portal.h | 3 ++- src/r_data/portalgroups.cpp | 2 +- src/r_data/r_sections.cpp | 9 +++++---- src/r_data/r_sections.h | 2 +- src/r_defs.h | 3 ++- 7 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/maploader/maploader.cpp b/src/maploader/maploader.cpp index f20bec1df..55f8278fb 100644 --- a/src/maploader/maploader.cpp +++ b/src/maploader/maploader.cpp @@ -3134,7 +3134,7 @@ void MapLoader::LoadLevel(MapData *map, const char *lumpname, int position) for (auto & p : Level->bodyque) p = nullptr; - CreateSections(Level->sections); + CreateSections(Level); // [RH] Spawn slope creating things first. SpawnSlopeMakers(&MapThingsConverted[0], &MapThingsConverted[MapThingsConverted.Size()], oldvertextable); @@ -3184,7 +3184,7 @@ void MapLoader::LoadLevel(MapData *map, const char *lumpname, int position) } SWRenderer->SetColormap(); //The SW renderer needs to do some special setup for the level's default colormap. - InitPortalGroups(); + InitPortalGroups(Level); P_InitHealthGroups(); if (reloop) LoopSidedefs(false); diff --git a/src/p_saveg.cpp b/src/p_saveg.cpp index 3131a3087..ca815bbf1 100644 --- a/src/p_saveg.cpp +++ b/src/p_saveg.cpp @@ -1031,5 +1031,5 @@ void G_SerializeLevel(FSerializer &arc, bool hubload) } } AActor::RecreateAllAttachedLights(); - InitPortalGroups(); + InitPortalGroups(&level); } diff --git a/src/portal.h b/src/portal.h index daeb784f6..0c05c71e2 100644 --- a/src/portal.h +++ b/src/portal.h @@ -282,7 +282,8 @@ void P_TranslatePortalVXVY(line_t* src, double &velx, double &vely); void P_TranslatePortalAngle(line_t* src, DAngle& angle); void P_TranslatePortalZ(line_t* src, double& vz); DVector2 P_GetOffsetPosition(double x, double y, double dx, double dy); -void InitPortalGroups(); +struct FLevelLocals; +void InitPortalGroups(FLevelLocals *Level); #endif diff --git a/src/r_data/portalgroups.cpp b/src/r_data/portalgroups.cpp index f0debb77c..25bbdd198 100644 --- a/src/r_data/portalgroups.cpp +++ b/src/r_data/portalgroups.cpp @@ -373,7 +373,7 @@ static void GroupSectorPortals(FLevelLocals *Level) for (int k = 0; k < sec->subsectorcount; k++) { subsector_t *sub = sec->subsectors[k]; - BuildPortalCoverage(&sub->portalcoverage[plane], sub, pair->Key.mDisplacement); + BuildPortalCoverage(Level, &sub->portalcoverage[plane], sub, pair->Key.mDisplacement); } sec->portals[plane] = portal; } diff --git a/src/r_data/r_sections.cpp b/src/r_data/r_sections.cpp index f107429fc..b896f1ddb 100644 --- a/src/r_data/r_sections.cpp +++ b/src/r_data/r_sections.cpp @@ -815,6 +815,7 @@ public: void PrintSections(FSectionContainer &container) { + auto Level = &level; for (unsigned i = 0; i < container.allSections.Size(); i++) { auto §ion = container.allSections[i]; @@ -861,21 +862,21 @@ void PrintSections(FSectionContainer &container) // //============================================================================= -void CreateSections(FSectionContainer &container) +void CreateSections(FLevelLocals *Level) { - FSectionCreator creat; + FSectionCreator creat(Level); creat.GroupSubsectors(); creat.MakeOutlines(); creat.MergeLines(); creat.FindOuterLoops(); creat.GroupSections(); - creat.ConstructOutput(container); + creat.ConstructOutput(Level->sections); creat.FixMissingReferences(); } CCMD(printsections) { - PrintSections(Level->sections); + PrintSections(level.sections); } diff --git a/src/r_data/r_sections.h b/src/r_data/r_sections.h index 799091904..5ac7188ea 100644 --- a/src/r_data/r_sections.h +++ b/src/r_data/r_sections.h @@ -160,7 +160,7 @@ public: } }; - +struct FLevelLocals; void CreateSections(FLevelLocals *l); #endif diff --git a/src/r_defs.h b/src/r_defs.h index 74c020b99..e8c51846d 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -52,6 +52,7 @@ struct seg_t; struct sector_t; class AActor; struct FSection; +struct FLevelLocals; #define MAXWIDTH 12000 #define MAXHEIGHT 5000 @@ -1513,7 +1514,7 @@ struct FPortalCoverage int sscount; }; -void BuildPortalCoverage(FPortalCoverage *coverage, subsector_t *subsector, const DVector2 &displacement); +void BuildPortalCoverage(FLevelLocals *Level, FPortalCoverage *coverage, subsector_t *subsector, const DVector2 &displacement); struct subsector_t {