mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-31 04:40:55 +00:00
moved files around
This commit is contained in:
parent
63879df5c0
commit
0f9f06ce88
7 changed files with 76 additions and 20 deletions
|
@ -195,6 +195,9 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="Resources\BrightnessGradient.png" />
|
<None Include="Resources\BrightnessGradient.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="Resources\TriangulatorMode.png" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
|
|
@ -142,6 +142,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render labels
|
// Render labels
|
||||||
|
/*
|
||||||
if(renderer.StartOverlay(true))
|
if(renderer.StartOverlay(true))
|
||||||
{
|
{
|
||||||
if(labelpos != null)
|
if(labelpos != null)
|
||||||
|
@ -152,6 +153,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing
|
||||||
|
|
||||||
renderer.Finish();
|
renderer.Finish();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// Do not show things
|
// Do not show things
|
||||||
if(renderer.StartThings(true))
|
if(renderer.StartThings(true))
|
||||||
|
@ -159,6 +161,8 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing
|
||||||
renderer.Finish();
|
renderer.Finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renderer.RedrawSurface();
|
||||||
|
|
||||||
renderer.Present();
|
renderer.Present();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,6 +191,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render labels
|
// Render labels
|
||||||
|
/*
|
||||||
if(renderer.StartOverlay(true))
|
if(renderer.StartOverlay(true))
|
||||||
{
|
{
|
||||||
if(labelpos != null)
|
if(labelpos != null)
|
||||||
|
@ -197,6 +202,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing
|
||||||
|
|
||||||
renderer.Finish();
|
renderer.Finish();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
renderer.Present();
|
renderer.Present();
|
||||||
|
|
||||||
|
@ -299,8 +305,17 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing
|
||||||
// Item highlighted?
|
// Item highlighted?
|
||||||
if((highlighted != null) && !highlighted.IsDisposed)
|
if((highlighted != null) && !highlighted.IsDisposed)
|
||||||
{
|
{
|
||||||
|
Sector s = highlighted;
|
||||||
|
|
||||||
|
// Remove highlight to avoid confusion
|
||||||
|
Highlight(null);
|
||||||
|
|
||||||
// Get a triangulator and bind events
|
// Get a triangulator and bind events
|
||||||
Triangulation t = Triangulation.Create(highlighted);
|
Triangulation t = new Triangulation();
|
||||||
|
t.OnShowPolygon = ShowPolygon;
|
||||||
|
t.OnShowEarClip = ShowEarClip;
|
||||||
|
//t.OnShowRemaining = ShowRemaining;
|
||||||
|
t.Triangulate(s);
|
||||||
|
|
||||||
// Start with a clear display
|
// Start with a clear display
|
||||||
if(renderer.StartPlotter(true))
|
if(renderer.StartPlotter(true))
|
||||||
|
@ -392,15 +407,53 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing
|
||||||
}
|
}
|
||||||
|
|
||||||
// This shows a polygon
|
// This shows a polygon
|
||||||
private void ShowPolygon(EarClipPolygon p, PixelColor c)
|
private void ShowPolygon(EarClipPolygon p)
|
||||||
|
{
|
||||||
|
LinkedListNode<EarClipVertex> v = p.First;
|
||||||
|
LinkedListNode<EarClipVertex> v2 = p.Last;
|
||||||
|
|
||||||
|
// Go for all vertices in the polygon
|
||||||
|
while(v != null)
|
||||||
|
{
|
||||||
|
for(int a = 0; a < 10; a++)
|
||||||
|
{
|
||||||
|
OnRedrawDisplay();
|
||||||
|
Thread.Sleep(10);
|
||||||
|
|
||||||
|
// Start with a clear display
|
||||||
|
if(renderer.StartPlotter(true))
|
||||||
|
{
|
||||||
|
// Render lines and vertices
|
||||||
|
renderer.PlotLinedefSet(General.Map.Map.Linedefs);
|
||||||
|
renderer.PlotVerticesSet(General.Map.Map.Vertices);
|
||||||
|
|
||||||
|
// Show line
|
||||||
|
renderer.PlotLine(v.Value.Position, v2.Value.Position, PixelColor.FromColor(Color.Orange));
|
||||||
|
|
||||||
|
// Done
|
||||||
|
renderer.Finish();
|
||||||
|
renderer.Present();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wait a bit
|
||||||
|
Thread.Sleep(60);
|
||||||
|
}
|
||||||
|
|
||||||
|
v2 = v;
|
||||||
|
v = v.Next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// This shows a polygon
|
||||||
|
private void ShowRemaining(LinkedList<EarClipVertex> remains)
|
||||||
{
|
{
|
||||||
LinkedListNode<EarClipVertex> v;
|
LinkedListNode<EarClipVertex> v;
|
||||||
|
|
||||||
for(int a = 0; a < 5; a++)
|
for(int a = 0; a < 100; a++)
|
||||||
{
|
{
|
||||||
OnRedrawDisplay();
|
OnRedrawDisplay();
|
||||||
Thread.Sleep(10);
|
Thread.Sleep(10);
|
||||||
|
|
||||||
// Start with a clear display
|
// Start with a clear display
|
||||||
if(renderer.StartPlotter(true))
|
if(renderer.StartPlotter(true))
|
||||||
{
|
{
|
||||||
|
@ -409,24 +462,24 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing
|
||||||
renderer.PlotVerticesSet(General.Map.Map.Vertices);
|
renderer.PlotVerticesSet(General.Map.Map.Vertices);
|
||||||
|
|
||||||
// Go for all vertices in the polygon
|
// Go for all vertices in the polygon
|
||||||
v = p.First;
|
v = remains.First;
|
||||||
while(v != null)
|
while(v != null)
|
||||||
{
|
{
|
||||||
// Show the line
|
// Show the line
|
||||||
if(v.Next != null) renderer.PlotLine(v.Value.Position, v.Next.Value.Position, c);
|
if(v.Next != null) renderer.PlotLine(v.Value.Position, v.Next.Value.Position, PixelColor.FromColor(Color.Yellow));
|
||||||
v = v.Next;
|
v = v.Next;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show last line as well
|
// Show last line as well
|
||||||
renderer.PlotLine(p.Last.Value.Position, p.First.Value.Position, c);
|
renderer.PlotLine(remains.Last.Value.Position, remains.First.Value.Position, PixelColor.FromColor(Color.Yellow));
|
||||||
|
|
||||||
// Done
|
// Done
|
||||||
renderer.Finish();
|
renderer.Finish();
|
||||||
renderer.Present();
|
renderer.Present();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait a bit
|
// Wait a bit
|
||||||
Thread.Sleep(50);
|
Thread.Sleep(60);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -449,7 +502,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing
|
||||||
foreach(EarClipVertex v in remains)
|
foreach(EarClipVertex v in remains)
|
||||||
{
|
{
|
||||||
// Show the line
|
// Show the line
|
||||||
if(prev != null) renderer.PlotLine(v.Position, prev.Position, PixelColor.FromColor(Color.OrangeRed));
|
if(prev != null) renderer.PlotLine(v.Position, prev.Position, PixelColor.FromColor(Color.Yellow));
|
||||||
if(prev == null) first = v;
|
if(prev == null) first = v;
|
||||||
prev = v;
|
prev = v;
|
||||||
|
|
||||||
|
@ -458,13 +511,13 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing
|
||||||
else
|
else
|
||||||
renderer.PlotVertexAt(v.Position, ColorCollection.VERTICES);
|
renderer.PlotVertexAt(v.Position, ColorCollection.VERTICES);
|
||||||
}
|
}
|
||||||
if(first != null) renderer.PlotLine(first.Position, prev.Position, PixelColor.FromColor(Color.OrangeRed));
|
if(first != null) renderer.PlotLine(first.Position, prev.Position, PixelColor.FromColor(Color.Yellow));
|
||||||
|
|
||||||
if(found != null)
|
if(found != null)
|
||||||
{
|
{
|
||||||
renderer.PlotLine(found[0].Position, found[1].Position, PixelColor.FromColor(Color.SkyBlue));
|
renderer.PlotLine(found[0].Position, found[1].Position, PixelColor.FromColor(Color.BlueViolet));
|
||||||
renderer.PlotLine(found[1].Position, found[2].Position, PixelColor.FromColor(Color.SkyBlue));
|
renderer.PlotLine(found[1].Position, found[2].Position, PixelColor.FromColor(Color.BlueViolet));
|
||||||
renderer.PlotLine(found[2].Position, found[0].Position, PixelColor.FromColor(Color.SkyBlue));
|
renderer.PlotLine(found[2].Position, found[0].Position, PixelColor.FromColor(Color.BlueViolet));
|
||||||
renderer.PlotVertexAt(found[1].Position, ColorCollection.INDICATION);
|
renderer.PlotVertexAt(found[1].Position, ColorCollection.INDICATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -472,7 +525,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing
|
||||||
renderer.Finish();
|
renderer.Finish();
|
||||||
renderer.Present();
|
renderer.Present();
|
||||||
}
|
}
|
||||||
Thread.Sleep(10);
|
Thread.Sleep(50);
|
||||||
|
|
||||||
// Start with a clear display
|
// Start with a clear display
|
||||||
if(renderer.StartPlotter(true))
|
if(renderer.StartPlotter(true))
|
||||||
|
@ -486,7 +539,7 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing
|
||||||
foreach(EarClipVertex v in remains)
|
foreach(EarClipVertex v in remains)
|
||||||
{
|
{
|
||||||
// Show the line
|
// Show the line
|
||||||
if(prev != null) renderer.PlotLine(v.Position, prev.Position, PixelColor.FromColor(Color.OrangeRed));
|
if(prev != null) renderer.PlotLine(v.Position, prev.Position, PixelColor.FromColor(Color.Yellow));
|
||||||
if(prev == null) first = v;
|
if(prev == null) first = v;
|
||||||
prev = v;
|
prev = v;
|
||||||
|
|
||||||
|
@ -495,13 +548,13 @@ namespace CodeImp.DoomBuilder.BuilderModes.Editing
|
||||||
else
|
else
|
||||||
renderer.PlotVertexAt(v.Position, ColorCollection.VERTICES);
|
renderer.PlotVertexAt(v.Position, ColorCollection.VERTICES);
|
||||||
}
|
}
|
||||||
if(first != null) renderer.PlotLine(first.Position, prev.Position, PixelColor.FromColor(Color.OrangeRed));
|
if(first != null) renderer.PlotLine(first.Position, prev.Position, PixelColor.FromColor(Color.Yellow));
|
||||||
|
|
||||||
// Done
|
// Done
|
||||||
renderer.Finish();
|
renderer.Finish();
|
||||||
renderer.Present();
|
renderer.Present();
|
||||||
}
|
}
|
||||||
Thread.Sleep(20);
|
Thread.Sleep(10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
BIN
Source/BuilderModes/Resources/TriangulatorMode.png
Normal file
BIN
Source/BuilderModes/Resources/TriangulatorMode.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 924 B |
Loading…
Reference in a new issue