- added workaround to render the crane in WT's 'Docks' map correctly.

This one violates engine specifications by creating overlapping walls when the crane is rotated.
This commit is contained in:
Christoph Oelckers 2022-06-26 09:36:01 +02:00
parent eb8fae761e
commit 9e6fe2cbaa
6 changed files with 10 additions and 3 deletions

View file

@ -190,6 +190,10 @@ static int32_t LoadMapHack(const char *filename, SpawnSpriteDef& sprites)
hw_SetSplitSector(currentsector, start, end); hw_SetSplitSector(currentsector, start, end);
} }
} }
else if (sc.Compare("dontclip"))
{
sector[currentsector].exflags |= SECTOREX_DONTCLIP;
}
else if (sc.Compare("clearflags")) else if (sc.Compare("clearflags"))
{ {
if (currentsector != -1 && validateSector()) if (currentsector != -1 && validateSector())

View file

@ -787,7 +787,6 @@ void setWallSectors()
for(auto& sect: sector) for(auto& sect: sector)
{ {
sect.dirty = EDirty::AllDirty; sect.dirty = EDirty::AllDirty;
sect.exflags = 0;
for (auto& wal : wallsofsector(&sect)) for (auto& wal : wallsofsector(&sect))
{ {
if (wal.sector == -1) if (wal.sector == -1)

View file

@ -94,6 +94,7 @@ enum ESectorExBits
{ {
SECTOREX_CLOUDSCROLL = 1, SECTOREX_CLOUDSCROLL = 1,
SECTOREX_DRAGGED = 2, SECTOREX_DRAGGED = 2,
SECTOREX_DONTCLIP = 4,
}; };
// Flags for retriangulation // Flags for retriangulation

View file

@ -278,7 +278,7 @@ int BunchDrawer::ClipLine(int aline, bool portal)
if (cline->partner == -1 || (wall[line].cstat & CSTAT_WALL_1WAY) || CheckClip(&wall[line], &topclip, &bottomclip)) if (cline->partner == -1 || (wall[line].cstat & CSTAT_WALL_1WAY) || CheckClip(&wall[line], &topclip, &bottomclip))
{ {
// one-sided // one-sided
if (!portal && !dontclip) if (!portal && !dontclip && !(sector[sections[section].sector].exflags & SECTOREX_DONTCLIP))
{ {
clipper->AddClipRange(startAngle, endAngle); clipper->AddClipRange(startAngle, endAngle);
//Printf("\nWall %d from %2.3f - %2.3f (blocking)\n", line, bamang(startAngle).asdeg(), bamang(endAngle).asdeg()); //Printf("\nWall %d from %2.3f - %2.3f (blocking)\n", line, bamang(startAngle).asdeg(), bamang(endAngle).asdeg());

View file

@ -535,7 +535,8 @@ FSerializer &Serialize(FSerializer &arc, const char *key, sectortype &c, sectort
("hitag", c.hitag, def->hitag) ("hitag", c.hitag, def->hitag)
("extra", c.extra, def->extra) ("extra", c.extra, def->extra)
("portalflags", c.portalflags, def->portalflags) ("portalflags", c.portalflags, def->portalflags)
("portalnum", c.portalnum, def->portalnum); ("portalnum", c.portalnum, def->portalnum)
("exflags", c.exflags, def->exflags);
// Save the extensions only when playing their respective games. // Save the extensions only when playing their respective games.
if (isDukeLike()) if (isDukeLike())

View file

@ -0,0 +1,2 @@
// Wanton Destruction $auto.map - workaround for sector object overlapping with an outer wall.
sector 152 dontclip