diff --git a/source/core/sectorgeometry.cpp b/source/core/sectorgeometry.cpp index 28def5e2a..20aa82271 100644 --- a/source/core/sectorgeometry.cpp +++ b/source/core/sectorgeometry.cpp @@ -379,11 +379,7 @@ bool SectionGeometry::ValidateSection(Section* section, int plane) section->dirty &= ~EDirty::CeilingDirty; } -#ifdef SECTOR_HACKJOB - memcpy(compare, sec, sizeof(*sec)); -#else - *compare = *sec; -#endif + compare->copy(sec); sdata.poscompare[plane] = sec->firstWall()->pos; sdata.poscompare2[plane] = sec->firstWall()->point2Wall()->pos; return false; diff --git a/source/core/sectorgeometry.h b/source/core/sectorgeometry.h index 269b94bfa..a1afb18b1 100644 --- a/source/core/sectorgeometry.h +++ b/source/core/sectorgeometry.h @@ -23,12 +23,41 @@ enum GeomFlags using SectionGeometryPlane = SectorGeometryPlane; +struct sectortypelight +{ + float ceilingxpan_; + float ceilingypan_; + float floorxpan_; + float floorypan_; + + ESectorFlags ceilingstat; + ESectorFlags floorstat; + int16_t ceilingpicnum; + int16_t ceilingheinum; + int16_t floorpicnum; + int16_t floorheinum; + + void copy(sectortype* sec) + { + ceilingxpan_ = sec->ceilingxpan_; + ceilingypan_ = sec->ceilingypan_; + floorxpan_ = sec->floorxpan_; + floorypan_ = sec->floorypan_; + ceilingstat = sec->ceilingstat; + floorstat = sec->floorstat; + ceilingheinum = sec->ceilingheinum; + floorheinum = sec->floorheinum; + ceilingpicnum = sec->ceilingpicnum; + floorpicnum = sec->floorpicnum; + } +}; + struct SectionGeometryData { SectorGeometryPlane planes[2]; TArray meshVertices; // flat vertices. Stored separately so that plane changes won't require completely new triangulation. TArray meshIndices; - sectortype compare[2] = {}; + sectortypelight compare[2] = {}; vec2_t poscompare[2] = {}; vec2_t poscompare2[2] = {}; FVector3 normal[2];