- fixed incomplete commit.

I have no idea where the rest of this stuff went...
This commit is contained in:
Christoph Oelckers 2018-12-30 08:22:34 +01:00
parent de375ce187
commit 65b01bd16d
7 changed files with 14 additions and 11 deletions

View file

@ -3134,7 +3134,7 @@ void MapLoader::LoadLevel(MapData *map, const char *lumpname, int position)
for (auto & p : Level->bodyque) for (auto & p : Level->bodyque)
p = nullptr; p = nullptr;
CreateSections(Level->sections); CreateSections(Level);
// [RH] Spawn slope creating things first. // [RH] Spawn slope creating things first.
SpawnSlopeMakers(&MapThingsConverted[0], &MapThingsConverted[MapThingsConverted.Size()], oldvertextable); 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. SWRenderer->SetColormap(); //The SW renderer needs to do some special setup for the level's default colormap.
InitPortalGroups(); InitPortalGroups(Level);
P_InitHealthGroups(); P_InitHealthGroups();
if (reloop) LoopSidedefs(false); if (reloop) LoopSidedefs(false);

View file

@ -1031,5 +1031,5 @@ void G_SerializeLevel(FSerializer &arc, bool hubload)
} }
} }
AActor::RecreateAllAttachedLights(); AActor::RecreateAllAttachedLights();
InitPortalGroups(); InitPortalGroups(&level);
} }

View file

@ -282,7 +282,8 @@ void P_TranslatePortalVXVY(line_t* src, double &velx, double &vely);
void P_TranslatePortalAngle(line_t* src, DAngle& angle); void P_TranslatePortalAngle(line_t* src, DAngle& angle);
void P_TranslatePortalZ(line_t* src, double& vz); void P_TranslatePortalZ(line_t* src, double& vz);
DVector2 P_GetOffsetPosition(double x, double y, double dx, double dy); DVector2 P_GetOffsetPosition(double x, double y, double dx, double dy);
void InitPortalGroups(); struct FLevelLocals;
void InitPortalGroups(FLevelLocals *Level);
#endif #endif

View file

@ -373,7 +373,7 @@ static void GroupSectorPortals(FLevelLocals *Level)
for (int k = 0; k < sec->subsectorcount; k++) for (int k = 0; k < sec->subsectorcount; k++)
{ {
subsector_t *sub = sec->subsectors[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; sec->portals[plane] = portal;
} }

View file

@ -815,6 +815,7 @@ public:
void PrintSections(FSectionContainer &container) void PrintSections(FSectionContainer &container)
{ {
auto Level = &level;
for (unsigned i = 0; i < container.allSections.Size(); i++) for (unsigned i = 0; i < container.allSections.Size(); i++)
{ {
auto &section = container.allSections[i]; auto &section = 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.GroupSubsectors();
creat.MakeOutlines(); creat.MakeOutlines();
creat.MergeLines(); creat.MergeLines();
creat.FindOuterLoops(); creat.FindOuterLoops();
creat.GroupSections(); creat.GroupSections();
creat.ConstructOutput(container); creat.ConstructOutput(Level->sections);
creat.FixMissingReferences(); creat.FixMissingReferences();
} }
CCMD(printsections) CCMD(printsections)
{ {
PrintSections(Level->sections); PrintSections(level.sections);
} }

View file

@ -160,7 +160,7 @@ public:
} }
}; };
struct FLevelLocals;
void CreateSections(FLevelLocals *l); void CreateSections(FLevelLocals *l);
#endif #endif

View file

@ -52,6 +52,7 @@ struct seg_t;
struct sector_t; struct sector_t;
class AActor; class AActor;
struct FSection; struct FSection;
struct FLevelLocals;
#define MAXWIDTH 12000 #define MAXWIDTH 12000
#define MAXHEIGHT 5000 #define MAXHEIGHT 5000
@ -1513,7 +1514,7 @@ struct FPortalCoverage
int sscount; 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 struct subsector_t
{ {