mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-29 15:12:11 +00:00
Merge branch 'master' of https://github.com/coelckers/gzdoom
This commit is contained in:
commit
cb0768ffef
2 changed files with 49 additions and 32 deletions
|
@ -818,41 +818,57 @@ void FNodeBuilder::SplitSegs (DWORD set, node_t &node, DWORD splitseg, DWORD &ou
|
|||
newvert.y += fixed_t(frac * double(Vertices[seg->v2].y - newvert.y));
|
||||
vertnum = VertexMap->SelectVertexClose (newvert);
|
||||
|
||||
if (vertnum == (unsigned int)seg->v1 || vertnum == (unsigned int)seg->v2)
|
||||
if (vertnum != (unsigned int)seg->v1 && vertnum != (unsigned int)seg->v2)
|
||||
{
|
||||
Printf("SelectVertexClose selected endpoint of seg %u\n", set);
|
||||
seg2 = SplitSeg(set, vertnum, sidev[0]);
|
||||
|
||||
Segs[seg2].next = outset0;
|
||||
outset0 = seg2;
|
||||
Segs[set].next = outset1;
|
||||
outset1 = set;
|
||||
_count0++;
|
||||
_count1++;
|
||||
|
||||
// Also split the seg on the back side
|
||||
if (Segs[set].partner != DWORD_MAX)
|
||||
{
|
||||
int partner1 = Segs[set].partner;
|
||||
int partner2 = SplitSeg(partner1, vertnum, sidev[1]);
|
||||
// The newly created seg stays in the same set as the
|
||||
// back seg because it has not been considered for splitting
|
||||
// yet. If it had been, then the front seg would have already
|
||||
// been split, and we would not be in this default case.
|
||||
// Moreover, the back seg may not even be in the set being
|
||||
// split, so we must not move its pieces into the out sets.
|
||||
Segs[partner1].next = partner2;
|
||||
Segs[partner2].partner = seg2;
|
||||
Segs[seg2].partner = partner2;
|
||||
}
|
||||
|
||||
if (GLNodes)
|
||||
{
|
||||
AddIntersection(node, vertnum);
|
||||
}
|
||||
}
|
||||
|
||||
seg2 = SplitSeg (set, vertnum, sidev[0]);
|
||||
|
||||
Segs[seg2].next = outset0;
|
||||
outset0 = seg2;
|
||||
Segs[set].next = outset1;
|
||||
outset1 = set;
|
||||
_count0++;
|
||||
_count1++;
|
||||
|
||||
// Also split the seg on the back side
|
||||
if (Segs[set].partner != DWORD_MAX)
|
||||
else
|
||||
{
|
||||
int partner1 = Segs[set].partner;
|
||||
int partner2 = SplitSeg (partner1, vertnum, sidev[1]);
|
||||
// The newly created seg stays in the same set as the
|
||||
// back seg because it has not been considered for splitting
|
||||
// yet. If it had been, then the front seg would have already
|
||||
// been split, and we would not be in this default case.
|
||||
// Moreover, the back seg may not even be in the set being
|
||||
// split, so we must not move its pieces into the out sets.
|
||||
Segs[partner1].next = partner2;
|
||||
Segs[partner2].partner = seg2;
|
||||
Segs[seg2].partner = partner2;
|
||||
// all that matters here is to prevent a crash so we must make sure that we do not end up with all segs being sorted to the same side - even if this may not be correct.
|
||||
// But if we do not do that this code would not be able to move on. Just discarding the seg is also not an option because it won't guarantee that we achieve an actual split.
|
||||
if (_count0 == 0)
|
||||
{
|
||||
side = 0;
|
||||
seg->next = outset0;
|
||||
outset0 = set;
|
||||
_count0++;
|
||||
}
|
||||
else
|
||||
{
|
||||
side = 1;
|
||||
seg->next = outset1;
|
||||
outset1 = set;
|
||||
_count1++;
|
||||
}
|
||||
}
|
||||
|
||||
if (GLNodes)
|
||||
{
|
||||
AddIntersection (node, vertnum);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
if (side >= 0 && GLNodes)
|
||||
|
|
|
@ -220,7 +220,7 @@ bool FZipFile::Open(bool quiet)
|
|||
|
||||
// Check if all files have the same prefix so that this can be stripped out.
|
||||
FString name0;
|
||||
for (DWORD i = 0; i < NumLumps; i++)
|
||||
if (NumLumps > 1) for (DWORD i = 0; i < NumLumps; i++)
|
||||
{
|
||||
FZipCentralDirectoryInfo *zip_fh = (FZipCentralDirectoryInfo *)dirptr;
|
||||
|
||||
|
@ -244,6 +244,7 @@ bool FZipFile::Open(bool quiet)
|
|||
{
|
||||
// check for special names, if one of these gets found this must be treated as a normal zip.
|
||||
bool isspecial = !name.Compare("flats/") ||
|
||||
name.IndexOf("/") < 0 ||
|
||||
!name.Compare("textures/") ||
|
||||
!name.Compare("hires/") ||
|
||||
!name.Compare("sprites/") ||
|
||||
|
|
Loading…
Reference in a new issue