- avoid conversions for vertex comparisons in CollectLoops and for sectorgeometry.cpp's poscompare values.

This commit is contained in:
Christoph Oelckers 2022-02-13 10:06:41 +01:00
parent 680a87085a
commit e3f1893e02
3 changed files with 9 additions and 9 deletions

View file

@ -246,7 +246,7 @@ static void CollectLoops(TArray<loopcollect>& sectors)
{
// quick check for the only known cause of this in proper maps:
// RRRA E1L3 and SW $yamato have a wall duplicate where the duplicate's index is the original's + 1. These can just be deleted here and be ignored.
if (ww > 1 && wall[ww-1].wall_int_pos().X == wall[ww-2].wall_int_pos().X && wall[ww-1].wall_int_pos().Y == wall[ww-2].wall_int_pos().Y && wall[ww-1].point2 == wall[ww-2].point2 && wall[ww - 1].point2 == ww)
if (ww > 1 && wall[ww-1].pos == wall[ww-2].pos && wall[ww-1].point2 == wall[ww-2].point2 && wall[ww - 1].point2 == ww)
{
thisloop.Clear();
break;

View file

@ -363,8 +363,8 @@ bool SectionGeometry::ValidateSection(Section* section, int plane)
((sec->floorstat ^ compare->floorstat) & (CSTAT_SECTOR_ALIGN | CSTAT_SECTOR_YFLIP | CSTAT_SECTOR_XFLIP | CSTAT_SECTOR_TEXHALF | CSTAT_SECTOR_SWAPXY)) == 0 &&
sec->floorxpan_ == compare->floorxpan_ &&
sec->floorypan_ == compare->floorypan_ &&
sec->firstWall()->wall_int_pos() == sdata.poscompare[0] &&
sec->firstWall()->point2Wall()->wall_int_pos() == sdata.poscompare2[0] &&
sec->firstWall()->pos == sdata.poscompare[0] &&
sec->firstWall()->point2Wall()->pos == sdata.poscompare2[0] &&
!(section->dirty & EDirty::FloorDirty) && sdata.planes[plane].vertices.Size() ) return true;
section->dirty &= ~EDirty::FloorDirty;
@ -376,15 +376,15 @@ bool SectionGeometry::ValidateSection(Section* section, int plane)
((sec->ceilingstat ^ compare->ceilingstat) & (CSTAT_SECTOR_ALIGN | CSTAT_SECTOR_YFLIP | CSTAT_SECTOR_XFLIP | CSTAT_SECTOR_TEXHALF | CSTAT_SECTOR_SWAPXY)) == 0 &&
sec->ceilingxpan_ == compare->ceilingxpan_ &&
sec->ceilingypan_ == compare->ceilingypan_ &&
sec->firstWall()->wall_int_pos() == sdata.poscompare[1] &&
sec->firstWall()->point2Wall()->wall_int_pos() == sdata.poscompare2[1] &&
sec->firstWall()->pos == sdata.poscompare[1] &&
sec->firstWall()->point2Wall()->pos == sdata.poscompare2[1] &&
!(section->dirty & EDirty::CeilingDirty) && sdata.planes[1].vertices.Size()) return true;
section->dirty &= ~EDirty::CeilingDirty;
}
compare->copy(sec);
sdata.poscompare[plane] = sec->firstWall()->wall_int_pos();
sdata.poscompare2[plane] = sec->firstWall()->point2Wall()->wall_int_pos();
sdata.poscompare[plane] = sec->firstWall()->pos;
sdata.poscompare2[plane] = sec->firstWall()->point2Wall()->pos;
return false;
}

View file

@ -58,8 +58,8 @@ struct SectionGeometryData
TArray<FVector2> meshVertices; // flat vertices. Stored separately so that plane changes won't require completely new triangulation.
TArray<int> meshIndices;
sectortypelight compare[2] = {};
vec2_t poscompare[2] = {};
vec2_t poscompare2[2] = {};
DVector2 poscompare[2] = {};
DVector2 poscompare2[2] = {};
FVector3 normal[2];
};