mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-27 06:02:11 +00:00
Fixed behavior of drawing over old lines (orientation of old lines is now preserved)
This commit is contained in:
parent
16dfffb068
commit
0dc2bed6d1
1 changed files with 19 additions and 13 deletions
|
@ -1917,20 +1917,23 @@ namespace CodeImp.DoomBuilder.Map
|
|||
// Merge these two linedefs
|
||||
while(lines.Remove(l2)) ;
|
||||
l2.Join(l1);
|
||||
|
||||
|
||||
// If l2 was marked as new geometry, we have to make sure
|
||||
// that l1's FrontInterior is correct for the drawing procedure
|
||||
if(l2marked)
|
||||
{
|
||||
// The flipping is purely a cosmetic to preserve orientation
|
||||
// when drawing new lines over older lines
|
||||
l1.FrontInterior = l2.FrontInterior ^ oppositedirection;
|
||||
}
|
||||
// If l1 is marked as new geometry, we may need to flip it to preserve
|
||||
// orientation of the original geometry, and update its FrontInterior
|
||||
else if(l1.Marked)
|
||||
{
|
||||
if(oppositedirection)
|
||||
{
|
||||
l1.FlipVertices();
|
||||
l1.FlipSidedefs();
|
||||
l1.FrontInterior = !l1.FrontInterior;
|
||||
}
|
||||
|
||||
// Direction is now the same, so the interior side is also the same
|
||||
// We have to copy the interior side to preserve this for drawing
|
||||
l1.FrontInterior = l2.FrontInterior;
|
||||
}
|
||||
|
||||
joinsdone++;
|
||||
|
@ -1960,19 +1963,22 @@ namespace CodeImp.DoomBuilder.Map
|
|||
while(lines.Remove(l2)) ;
|
||||
l2.Join(l1);
|
||||
|
||||
// If l2 was marked as new geometry, we have to make sure
|
||||
// that l1's FrontInterior is correct for the drawing procedure
|
||||
if(l2marked)
|
||||
{
|
||||
// The flipping is purely a cosmetic to preserve orientation
|
||||
// when drawing new lines over older lines
|
||||
l1.FrontInterior = l2.FrontInterior ^ oppositedirection;
|
||||
}
|
||||
// If l1 is marked as new geometry, we may need to flip it to preserve
|
||||
// orientation of the original geometry, and update its FrontInterior
|
||||
else if(l1.Marked)
|
||||
{
|
||||
if(oppositedirection)
|
||||
{
|
||||
l1.FlipVertices();
|
||||
l1.FlipSidedefs();
|
||||
l1.FrontInterior = !l1.FrontInterior;
|
||||
}
|
||||
|
||||
// Direction is now the same, so the interior side is also the same
|
||||
// We have to copy the interior side to preserve this for drawing
|
||||
l1.FrontInterior = l2.FrontInterior;
|
||||
}
|
||||
|
||||
joinsdone++;
|
||||
|
|
Loading…
Reference in a new issue