@ Changed the MapSet to work with arrays instead of linkedlists. Because the index is now know for each element and can be retrieved in O(1) efficiency it has become a property (Index) for all map elements. GetIndexFor* functions have been removed. Get*ByIndex are now also of O(1) efficiency.

This commit is contained in:
codeimp 2009-06-05 19:03:56 +00:00
parent 45ad5f5943
commit f09bfff419
34 changed files with 461 additions and 408 deletions

View file

@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion> <ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}</ProjectGuid> <ProjectGuid>{818B3D10-F791-4C3F-9AF5-BB2D0079B63C}</ProjectGuid>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
@ -676,6 +676,7 @@
<Compile Include="General\ErrorLogger.cs" /> <Compile Include="General\ErrorLogger.cs" />
<Compile Include="IO\DoomColormapReader.cs" /> <Compile Include="IO\DoomColormapReader.cs" />
<Compile Include="Map\SelectionType.cs" /> <Compile Include="Map\SelectionType.cs" />
<Compile Include="Map\MapElementCollection.cs" />
<Compile Include="Rendering\SurfaceBufferSet.cs" /> <Compile Include="Rendering\SurfaceBufferSet.cs" />
<Compile Include="Rendering\SurfaceEntry.cs" /> <Compile Include="Rendering\SurfaceEntry.cs" />
<Compile Include="Rendering\SurfaceManager.cs" /> <Compile Include="Rendering\SurfaceManager.cs" />
@ -877,4 +878,4 @@
<PostBuildEvent> <PostBuildEvent>
</PostBuildEvent> </PostBuildEvent>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View file

@ -107,7 +107,7 @@ namespace CodeImp.DoomBuilder.Controls
peggedness = "None"; peggedness = "None";
// Linedef info // Linedef info
infopanel.Text = " Linedef " + l.Map.GetIndexForLinedef(l) + " "; infopanel.Text = " Linedef " + l.Index + " ";
action.Text = act.ToString(); action.Text = act.ToString();
length.Text = l.Length.ToString("0.##"); length.Text = l.Length.ToString("0.##");
angle.Text = l.AngleDeg.ToString() + "\u00B0"; angle.Text = l.AngleDeg.ToString() + "\u00B0";
@ -145,7 +145,7 @@ namespace CodeImp.DoomBuilder.Controls
if(l.Front != null) if(l.Front != null)
{ {
// Show sidedef info // Show sidedef info
frontpanel.Text = " Front Sidedef " + l.Map.GetIndexForSidedef(l.Front) + " "; frontpanel.Text = " Front Sidedef " + l.Index + " ";
frontoffset.Text = l.Front.OffsetX + ", " + l.Front.OffsetY; frontoffset.Text = l.Front.OffsetX + ", " + l.Front.OffsetY;
fronthighname.Text = l.Front.HighTexture; fronthighname.Text = l.Front.HighTexture;
frontmidname.Text = l.Front.MiddleTexture; frontmidname.Text = l.Front.MiddleTexture;
@ -177,7 +177,7 @@ namespace CodeImp.DoomBuilder.Controls
if(l.Back != null) if(l.Back != null)
{ {
// Show sidedef info // Show sidedef info
backpanel.Text = " Back Sidedef " + l.Map.GetIndexForSidedef(l.Back) + " "; backpanel.Text = " Back Sidedef " + l.Index + " ";
backoffset.Text = l.Back.OffsetX + ", " + l.Back.OffsetY; backoffset.Text = l.Back.OffsetX + ", " + l.Back.OffsetY;
backhighname.Text = l.Back.HighTexture; backhighname.Text = l.Back.HighTexture;
backmidname.Text = l.Back.MiddleTexture; backmidname.Text = l.Back.MiddleTexture;

View file

@ -56,7 +56,7 @@ namespace CodeImp.DoomBuilder.Controls
effectinfo = s.Effect.ToString() + " - Unknown"; effectinfo = s.Effect.ToString() + " - Unknown";
// Sector info // Sector info
sectorinfo.Text = " Sector " + s.Map.GetIndexForSector(s) + " "; sectorinfo.Text = " Sector " + s.Index + " ";
effect.Text = effectinfo; effect.Text = effectinfo;
ceiling.Text = s.CeilHeight.ToString(); ceiling.Text = s.CeilHeight.ToString();
floor.Text = s.FloorHeight.ToString(); floor.Text = s.FloorHeight.ToString();

View file

@ -139,7 +139,7 @@ namespace CodeImp.DoomBuilder.Controls
} }
// Thing info // Thing info
infopanel.Text = " Thing " + t.Map.GetIndexForThing(t) + " "; infopanel.Text = " Thing " + t.Index + " ";
type.Text = t.Type + " - " + ti.Title; type.Text = t.Type + " - " + ti.Title;
action.Text = actioninfo; action.Text = actioninfo;
position.Text = t.Position.x.ToString() + ", " + t.Position.y.ToString() + ", " + zinfo; position.Text = t.Position.x.ToString() + ", " + t.Position.y.ToString() + ", " + zinfo;

View file

@ -44,7 +44,7 @@ namespace CodeImp.DoomBuilder.Controls
public void ShowInfo(Vertex v) public void ShowInfo(Vertex v)
{ {
// Vertex info // Vertex info
vertexinfo.Text = " Vertex " + v.Map.GetIndexForVertex(v) + " "; vertexinfo.Text = " Vertex " + v.Index + " ";
position.Text = v.Position.x.ToString("0.##") + ", " + v.Position.y.ToString("0.##"); position.Text = v.Position.x.ToString("0.##") + ", " + v.Position.y.ToString("0.##");
// Show the whole thing // Show the whole thing

View file

@ -344,6 +344,7 @@ namespace CodeImp.DoomBuilder
mapwad.Dispose(); mapwad.Dispose();
// Read the map from temp file // Read the map from temp file
map.BeginAddRemove();
General.WriteLogLine("Initializing map format interface " + config.FormatInterface + "..."); General.WriteLogLine("Initializing map format interface " + config.FormatInterface + "...");
io = MapSetIO.Create(config.FormatInterface, tempwad, this); io = MapSetIO.Create(config.FormatInterface, tempwad, this);
General.WriteLogLine("Reading map data structures from file..."); General.WriteLogLine("Reading map data structures from file...");
@ -354,6 +355,7 @@ namespace CodeImp.DoomBuilder
General.ShowErrorMessage("Unable to read the map data structures with the specified configuration.", MessageBoxButtons.OK); General.ShowErrorMessage("Unable to read the map data structures with the specified configuration.", MessageBoxButtons.OK);
return false; return false;
} }
map.EndAddRemove();
// Load data manager // Load data manager
General.WriteLogLine("Loading data resources..."); General.WriteLogLine("Loading data resources...");

View file

@ -923,8 +923,10 @@ namespace CodeImp.DoomBuilder.Geometry
} }
// Join merge vertices so that overlapping vertices in the draw become one. // Join merge vertices so that overlapping vertices in the draw become one.
map.BeginAddRemove();
MapSet.JoinVertices(mergeverts, mergeverts, false, MapSet.STITCH_DISTANCE); MapSet.JoinVertices(mergeverts, mergeverts, false, MapSet.STITCH_DISTANCE);
map.EndAddRemove();
/***************************************************\ /***************************************************\
Find a way to close the drawing Find a way to close the drawing
\***************************************************/ \***************************************************/
@ -1157,9 +1159,11 @@ namespace CodeImp.DoomBuilder.Geometry
// Merge intersetion vertices with the new lines. This completes the // Merge intersetion vertices with the new lines. This completes the
// self intersections for which splits were made above. // self intersections for which splits were made above.
map.Update(true, false); map.Update(true, false);
map.BeginAddRemove();
MapSet.SplitLinesByVertices(newlines, intersectverts, MapSet.STITCH_DISTANCE, null); MapSet.SplitLinesByVertices(newlines, intersectverts, MapSet.STITCH_DISTANCE, null);
MapSet.SplitLinesByVertices(newlines, mergeverts, MapSet.STITCH_DISTANCE, null); MapSet.SplitLinesByVertices(newlines, mergeverts, MapSet.STITCH_DISTANCE, null);
map.EndAddRemove();
/***************************************************\ /***************************************************\
Determine drawing interior Determine drawing interior
\***************************************************/ \***************************************************/

View file

@ -129,6 +129,7 @@ namespace CodeImp.DoomBuilder.IO
reader = new BinaryReader(mem); reader = new BinaryReader(mem);
// Read items from the lump // Read items from the lump
map.SetCapacity(0, 0, 0, 0, num);
for(i = 0; i < num; i++) for(i = 0; i < num; i++)
{ {
// Read properties from stream // Read properties from stream
@ -178,6 +179,7 @@ namespace CodeImp.DoomBuilder.IO
link = new Dictionary<int, Vertex>(num); link = new Dictionary<int, Vertex>(num);
// Read items from the lump // Read items from the lump
map.SetCapacity(num, 0, 0, 0, 0);
for(i = 0; i < num; i++) for(i = 0; i < num; i++)
{ {
// Read properties from stream // Read properties from stream
@ -222,6 +224,7 @@ namespace CodeImp.DoomBuilder.IO
link = new Dictionary<int, Sector>(num); link = new Dictionary<int, Sector>(num);
// Read items from the lump // Read items from the lump
map.SetCapacity(0, 0, 0, num, 0);
for(i = 0; i < num; i++) for(i = 0; i < num; i++)
{ {
// Read properties from stream // Read properties from stream
@ -255,7 +258,7 @@ namespace CodeImp.DoomBuilder.IO
MemoryStream linedefsmem, sidedefsmem; MemoryStream linedefsmem, sidedefsmem;
BinaryReader readline, readside; BinaryReader readline, readside;
Lump linedefslump, sidedefslump; Lump linedefslump, sidedefslump;
int num, i, offsetx, offsety, v1, v2; int num, numsides, i, offsetx, offsety, v1, v2;
int s1, s2, flags, action, tag, sc; int s1, s2, flags, action, tag, sc;
Dictionary<string, bool> stringflags; Dictionary<string, bool> stringflags;
string thigh, tmid, tlow; string thigh, tmid, tlow;
@ -274,10 +277,12 @@ namespace CodeImp.DoomBuilder.IO
linedefsmem = new MemoryStream(linedefslump.Stream.ReadAllBytes()); linedefsmem = new MemoryStream(linedefslump.Stream.ReadAllBytes());
sidedefsmem = new MemoryStream(sidedefslump.Stream.ReadAllBytes()); sidedefsmem = new MemoryStream(sidedefslump.Stream.ReadAllBytes());
num = (int)linedefslump.Stream.Length / 14; num = (int)linedefslump.Stream.Length / 14;
numsides = (int)sidedefslump.Stream.Length / 30;
readline = new BinaryReader(linedefsmem); readline = new BinaryReader(linedefsmem);
readside = new BinaryReader(sidedefsmem); readside = new BinaryReader(sidedefsmem);
// Read items from the lump // Read items from the lump
map.SetCapacity(0, num, numsides, 0, 0);
for(i = 0; i < num; i++) for(i = 0; i < num; i++)
{ {
// Read properties from stream // Read properties from stream

View file

@ -131,6 +131,7 @@ namespace CodeImp.DoomBuilder.IO
reader = new BinaryReader(mem); reader = new BinaryReader(mem);
// Read items from the lump // Read items from the lump
map.SetCapacity(0, 0, 0, 0, num);
for(i = 0; i < num; i++) for(i = 0; i < num; i++)
{ {
// Read properties from stream // Read properties from stream
@ -188,6 +189,7 @@ namespace CodeImp.DoomBuilder.IO
link = new Dictionary<int, Vertex>(num); link = new Dictionary<int, Vertex>(num);
// Read items from the lump // Read items from the lump
map.SetCapacity(num, 0, 0, 0, 0);
for(i = 0; i < num; i++) for(i = 0; i < num; i++)
{ {
// Read properties from stream // Read properties from stream
@ -232,6 +234,7 @@ namespace CodeImp.DoomBuilder.IO
link = new Dictionary<int, Sector>(num); link = new Dictionary<int, Sector>(num);
// Read items from the lump // Read items from the lump
map.SetCapacity(0, 0, 0, num, 0);
for(i = 0; i < num; i++) for(i = 0; i < num; i++)
{ {
// Read properties from stream // Read properties from stream
@ -265,7 +268,7 @@ namespace CodeImp.DoomBuilder.IO
MemoryStream linedefsmem, sidedefsmem; MemoryStream linedefsmem, sidedefsmem;
BinaryReader readline, readside; BinaryReader readline, readside;
Lump linedefslump, sidedefslump; Lump linedefslump, sidedefslump;
int num, i, offsetx, offsety, v1, v2; int num, numsides, i, offsetx, offsety, v1, v2;
int s1, s2, flags, action, sc; int s1, s2, flags, action, sc;
int[] args = new int[Linedef.NUM_ARGS]; int[] args = new int[Linedef.NUM_ARGS];
Dictionary<string, bool> stringflags; Dictionary<string, bool> stringflags;
@ -285,10 +288,12 @@ namespace CodeImp.DoomBuilder.IO
linedefsmem = new MemoryStream(linedefslump.Stream.ReadAllBytes()); linedefsmem = new MemoryStream(linedefslump.Stream.ReadAllBytes());
sidedefsmem = new MemoryStream(sidedefslump.Stream.ReadAllBytes()); sidedefsmem = new MemoryStream(sidedefslump.Stream.ReadAllBytes());
num = (int)linedefslump.Stream.Length / 16; num = (int)linedefslump.Stream.Length / 16;
numsides = (int)sidedefslump.Stream.Length / 30;
readline = new BinaryReader(linedefsmem); readline = new BinaryReader(linedefsmem);
readside = new BinaryReader(sidedefsmem); readside = new BinaryReader(sidedefsmem);
// Read items from the lump // Read items from the lump
map.SetCapacity(0, num, numsides, 0, 0);
for(i = 0; i < num; i++) for(i = 0; i < num; i++)
{ {
// Read properties from stream // Read properties from stream

View file

@ -150,6 +150,7 @@ namespace CodeImp.DoomBuilder.IO
List<UniversalCollection> collections = GetNamedCollections(textmap.Root, "thing"); List<UniversalCollection> collections = GetNamedCollections(textmap.Root, "thing");
// Go for all collections // Go for all collections
map.SetCapacity(0, 0, 0, 0, collections.Count);
for(int i = 0; i < collections.Count; i++) for(int i = 0; i < collections.Count; i++)
{ {
// Read fields // Read fields
@ -196,6 +197,7 @@ namespace CodeImp.DoomBuilder.IO
List<UniversalCollection> sidescolls = GetNamedCollections(textmap.Root, "sidedef"); List<UniversalCollection> sidescolls = GetNamedCollections(textmap.Root, "sidedef");
// Go for all lines // Go for all lines
map.SetCapacity(0, linescolls.Count, sidescolls.Count, 0, 0);
for(int i = 0; i < linescolls.Count; i++) for(int i = 0; i < linescolls.Count; i++)
{ {
// Read fields // Read fields
@ -308,6 +310,7 @@ namespace CodeImp.DoomBuilder.IO
link = new Dictionary<int, Sector>(collections.Count); link = new Dictionary<int, Sector>(collections.Count);
// Go for all collections // Go for all collections
map.SetCapacity(0, 0, 0, collections.Count, 0);
for(int i = 0; i < collections.Count; i++) for(int i = 0; i < collections.Count; i++)
{ {
// Read fields // Read fields
@ -347,6 +350,7 @@ namespace CodeImp.DoomBuilder.IO
link = new Dictionary<int, Vertex>(collections.Count); link = new Dictionary<int, Vertex>(collections.Count);
// Go for all collections // Go for all collections
map.SetCapacity(collections.Count, 0, 0, 0, 0);
for(int i = 0; i < collections.Count; i++) for(int i = 0; i < collections.Count; i++)
{ {
// Read fields // Read fields

View file

@ -47,7 +47,6 @@ namespace CodeImp.DoomBuilder.Map
private MapSet map; private MapSet map;
// List items // List items
private LinkedListNode<Linedef> mainlistitem;
private LinkedListNode<Linedef> startvertexlistitem; private LinkedListNode<Linedef> startvertexlistitem;
private LinkedListNode<Linedef> endvertexlistitem; private LinkedListNode<Linedef> endvertexlistitem;
private LinkedListNode<Linedef> selecteditem; private LinkedListNode<Linedef> selecteditem;
@ -109,11 +108,11 @@ namespace CodeImp.DoomBuilder.Map
#region ================== Constructor / Disposer #region ================== Constructor / Disposer
// Constructor // Constructor
internal Linedef(MapSet map, LinkedListNode<Linedef> listitem, Vertex start, Vertex end) internal Linedef(MapSet map, int listindex, Vertex start, Vertex end)
{ {
// Initialize // Initialize
this.map = map; this.map = map;
this.mainlistitem = listitem; this.listindex = listindex;
this.start = start; this.start = start;
this.end = end; this.end = end;
this.updateneeded = true; this.updateneeded = true;
@ -129,11 +128,11 @@ namespace CodeImp.DoomBuilder.Map
} }
// Constructor // Constructor
internal Linedef(MapSet map, LinkedListNode<Linedef> listitem, Vertex start, Vertex end, IReadWriteStream stream) internal Linedef(MapSet map, int listindex, Vertex start, Vertex end, IReadWriteStream stream)
{ {
// Initialize // Initialize
this.map = map; this.map = map;
this.mainlistitem = listitem; this.listindex = listindex;
this.start = start; this.start = start;
this.end = end; this.end = end;
this.updateneeded = true; this.updateneeded = true;
@ -159,7 +158,7 @@ namespace CodeImp.DoomBuilder.Map
isdisposed = true; isdisposed = true;
// Remove from main list // Remove from main list
mainlistitem.List.Remove(mainlistitem); map.RemoveLinedef(listindex);
// Detach from vertices // Detach from vertices
start.DetachLinedef(startvertexlistitem); start.DetachLinedef(startvertexlistitem);
@ -172,7 +171,6 @@ namespace CodeImp.DoomBuilder.Map
if(back != null) back.Dispose(); if(back != null) back.Dispose();
// Clean up // Clean up
mainlistitem = null;
start = null; start = null;
end = null; end = null;
front = null; front = null;
@ -222,14 +220,6 @@ namespace CodeImp.DoomBuilder.Map
for(int i = 0; i < NUM_ARGS; i++) s.rwInt(ref args[i]); for(int i = 0; i < NUM_ARGS; i++) s.rwInt(ref args[i]);
} }
/// <summary>
/// Returns the index of this linedef. This is a O(n) operation.
/// </summary>
public int GetIndex()
{
return map.GetIndexForLinedef(this);
}
// This sets new start vertex // This sets new start vertex
public void SetStartVertex(Vertex v) public void SetStartVertex(Vertex v)
{ {
@ -941,7 +931,7 @@ namespace CodeImp.DoomBuilder.Map
// String representation // String representation
public override string ToString() public override string ToString()
{ {
return "Linedef " + GetIndex(); return "Linedef " + listindex;
} }
#endregion #endregion

View file

@ -38,7 +38,10 @@ namespace CodeImp.DoomBuilder.Map
#endregion #endregion
#region ================== Variables #region ================== Variables
// List index
protected int listindex;
// Univeral fields // Univeral fields
private UniFields fields; private UniFields fields;
@ -51,7 +54,8 @@ namespace CodeImp.DoomBuilder.Map
#endregion #endregion
#region ================== Properties #region ================== Properties
public int Index { get { return listindex; } internal set { listindex = value; } }
public UniFields Fields { get { return fields; } } public UniFields Fields { get { return fields; } }
public bool Marked { get { return marked; } set { marked = value; } } public bool Marked { get { return marked; } set { marked = value; } }
public bool IsDisposed { get { return isdisposed; } } public bool IsDisposed { get { return isdisposed; } }

View file

@ -0,0 +1,82 @@
#region ================== Copyright (c) 2007 Pascal vd Heiden
/*
* Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com
* This program is released under GNU General Public License
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#endregion
#region ================== Namespaces
using System;
using System.Drawing;
using SlimDX.Direct3D9;
using SlimDX;
using System.Collections;
using System.Collections.Generic;
#endregion
namespace CodeImp.DoomBuilder.Map
{
public sealed class MapElementCollection<T> : ICollection<T> where T: MapElement
{
// Members
private int numitems;
private T[] array;
// Constructor
public MapElementCollection(ref T[] array, int numitems)
{
this.numitems = numitems;
this.array = array;
}
public void Add(T item)
{
throw new NotSupportedException();
}
public void Clear()
{
throw new NotSupportedException();
}
public bool Contains(T item)
{
throw new NotSupportedException();
}
public void CopyTo(T[] array, int arrayIndex)
{
this.array.CopyTo(array, arrayIndex);
}
public int Count { get { return numitems; } }
public bool IsReadOnly { get { return true; } }
public bool Remove(T item)
{
throw new NotSupportedException();
}
public IEnumerator<T> GetEnumerator()
{
throw new NotSupportedException("This array is locked for modification and cannot currently be enumerated.");
}
IEnumerator IEnumerable.GetEnumerator()
{
throw new NotSupportedException("This array is locked for modification and cannot currently be enumerated.");
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -45,7 +45,6 @@ namespace CodeImp.DoomBuilder.Map
private MapSet map; private MapSet map;
// List items // List items
private LinkedListNode<Sector> mainlistitem;
private LinkedListNode<Sector> selecteditem; private LinkedListNode<Sector> selecteditem;
// Sidedefs // Sidedefs
@ -109,11 +108,11 @@ namespace CodeImp.DoomBuilder.Map
#region ================== Constructor / Disposer #region ================== Constructor / Disposer
// Constructor // Constructor
internal Sector(MapSet map, LinkedListNode<Sector> listitem, int index) internal Sector(MapSet map, int listindex, int index)
{ {
// Initialize // Initialize
this.map = map; this.map = map;
this.mainlistitem = listitem; this.listindex = listindex;
this.sidedefs = new LinkedList<Sidedef>(); this.sidedefs = new LinkedList<Sidedef>();
this.fixedindex = index; this.fixedindex = index;
this.floortexname = "-"; this.floortexname = "-";
@ -121,19 +120,21 @@ namespace CodeImp.DoomBuilder.Map
this.longfloortexname = MapSet.EmptyLongName; this.longfloortexname = MapSet.EmptyLongName;
this.longceiltexname = MapSet.EmptyLongName; this.longceiltexname = MapSet.EmptyLongName;
this.triangulationneeded = true; this.triangulationneeded = true;
this.surfaceentry = new SurfaceEntry(-1, -1, -1);
// We have no destructor // We have no destructor
GC.SuppressFinalize(this); GC.SuppressFinalize(this);
} }
// Constructor // Constructor
internal Sector(MapSet map, LinkedListNode<Sector> listitem, IReadWriteStream stream) internal Sector(MapSet map, int listindex, IReadWriteStream stream)
{ {
// Initialize // Initialize
this.map = map; this.map = map;
this.mainlistitem = listitem; this.listindex = listindex;
this.sidedefs = new LinkedList<Sidedef>(); this.sidedefs = new LinkedList<Sidedef>();
this.triangulationneeded = true; this.triangulationneeded = true;
this.surfaceentry = new SurfaceEntry(-1, -1, -1);
ReadWrite(stream); ReadWrite(stream);
@ -151,7 +152,7 @@ namespace CodeImp.DoomBuilder.Map
isdisposed = true; isdisposed = true;
// Remove from main list // Remove from main list
mainlistitem.List.Remove(mainlistitem); map.RemoveSector(listindex);
// Register the index as free // Register the index as free
map.AddSectorIndexHole(fixedindex); map.AddSectorIndexHole(fixedindex);
@ -164,7 +165,6 @@ namespace CodeImp.DoomBuilder.Map
General.Map.CRenderer2D.Surfaces.FreeSurfaces(surfaceentry); General.Map.CRenderer2D.Surfaces.FreeSurfaces(surfaceentry);
// Clean up // Clean up
mainlistitem = null;
sidedefs = null; sidedefs = null;
map = null; map = null;
@ -250,14 +250,6 @@ namespace CodeImp.DoomBuilder.Map
base.CopyPropertiesTo(s); base.CopyPropertiesTo(s);
} }
/// <summary>
/// Returns the index of this sector. This is a O(n) operation.
/// </summary>
public int GetIndex()
{
return map.GetIndexForSector(this);
}
// This attaches a sidedef and returns the listitem // This attaches a sidedef and returns the listitem
public LinkedListNode<Sidedef> AttachSidedef(Sidedef sd) public LinkedListNode<Sidedef> AttachSidedef(Sidedef sd)
{ {
@ -506,7 +498,7 @@ namespace CodeImp.DoomBuilder.Map
// String representation // String representation
public override string ToString() public override string ToString()
{ {
return "Sector " + GetIndex(); return "Sector " + listindex;
} }
#endregion #endregion

View file

@ -41,7 +41,6 @@ namespace CodeImp.DoomBuilder.Map
private MapSet map; private MapSet map;
// List items // List items
private LinkedListNode<Sidedef> mainlistitem;
private LinkedListNode<Sidedef> sectorlistitem; private LinkedListNode<Sidedef> sectorlistitem;
// Owner // Owner
@ -88,11 +87,11 @@ namespace CodeImp.DoomBuilder.Map
#region ================== Constructor / Disposer #region ================== Constructor / Disposer
// Constructor // Constructor
internal Sidedef(MapSet map, LinkedListNode<Sidedef> listitem, Linedef l, bool front, Sector s) internal Sidedef(MapSet map, int listindex, Linedef l, bool front, Sector s)
{ {
// Initialize // Initialize
this.map = map; this.map = map;
this.mainlistitem = listitem; this.listindex = listindex;
this.linedef = l; this.linedef = l;
this.sector = s; this.sector = s;
this.texnamehigh = "-"; this.texnamehigh = "-";
@ -113,11 +112,11 @@ namespace CodeImp.DoomBuilder.Map
} }
// Constructor // Constructor
internal Sidedef(MapSet map, LinkedListNode<Sidedef> listitem, Linedef l, bool front, Sector s, IReadWriteStream stream) internal Sidedef(MapSet map, int listindex, Linedef l, bool front, Sector s, IReadWriteStream stream)
{ {
// Initialize // Initialize
this.map = map; this.map = map;
this.mainlistitem = listitem; this.listindex = listindex;
this.linedef = l; this.linedef = l;
this.sector = s; this.sector = s;
@ -143,7 +142,7 @@ namespace CodeImp.DoomBuilder.Map
isdisposed = true; isdisposed = true;
// Remove from main list // Remove from main list
mainlistitem.List.Remove(mainlistitem); map.RemoveSidedef(listindex);
// Detach from linedef // Detach from linedef
linedef.DetachSidedef(this); linedef.DetachSidedef(this);
@ -152,7 +151,6 @@ namespace CodeImp.DoomBuilder.Map
sector.DetachSidedef(sectorlistitem); sector.DetachSidedef(sectorlistitem);
// Clean up // Clean up
mainlistitem = null;
sectorlistitem = null; sectorlistitem = null;
linedef = null; linedef = null;
map = null; map = null;
@ -203,14 +201,6 @@ namespace CodeImp.DoomBuilder.Map
base.CopyPropertiesTo(s); base.CopyPropertiesTo(s);
} }
/// <summary>
/// Returns the index of this sidedef. This is a O(n) operation.
/// </summary>
public int GetIndex()
{
return map.GetIndexForSidedef(this);
}
// This creates a checksum from the sidedef properties // This creates a checksum from the sidedef properties
// Used for faster sidedefs compression // Used for faster sidedefs compression
public uint GetChecksum() public uint GetChecksum()

View file

@ -49,7 +49,6 @@ namespace CodeImp.DoomBuilder.Map
private Sector sector = null; private Sector sector = null;
// List items // List items
private LinkedListNode<Thing> mainlistitem;
private LinkedListNode<Thing> selecteditem; private LinkedListNode<Thing> selecteditem;
// Properties // Properties
@ -91,11 +90,11 @@ namespace CodeImp.DoomBuilder.Map
#region ================== Constructor / Disposer #region ================== Constructor / Disposer
// Constructor // Constructor
internal Thing(MapSet map, LinkedListNode<Thing> listitem) internal Thing(MapSet map, int listindex)
{ {
// Initialize // Initialize
this.map = map; this.map = map;
this.mainlistitem = listitem; this.listindex = listindex;
this.flags = new Dictionary<string, bool>(); this.flags = new Dictionary<string, bool>();
this.args = new int[NUM_ARGS]; this.args = new int[NUM_ARGS];
@ -113,13 +112,12 @@ namespace CodeImp.DoomBuilder.Map
isdisposed = true; isdisposed = true;
// Remove from main list // Remove from main list
mainlistitem.List.Remove(mainlistitem); map.RemoveThing(listindex);
// Remove from sector // Remove from sector
//if(sector != null) sector.DetachThing(sectorlistitem); //if(sector != null) sector.DetachThing(sectorlistitem);
// Clean up // Clean up
mainlistitem = null;
map = null; map = null;
sector = null; sector = null;
@ -186,14 +184,6 @@ namespace CodeImp.DoomBuilder.Map
base.CopyPropertiesTo(t); base.CopyPropertiesTo(t);
} }
/// <summary>
/// Returns the index of the specified thing. This is a O(n) operation.
/// </summary>
public int GetIndex()
{
return map.GetIndexForThing(this);
}
// This determines which sector the thing is in and links it // This determines which sector the thing is in and links it
public void DetermineSector() public void DetermineSector()
{ {

View file

@ -46,7 +46,6 @@ namespace CodeImp.DoomBuilder.Map
private MapSet map; private MapSet map;
// List items // List items
private LinkedListNode<Vertex> mainlistitem;
private LinkedListNode<Vertex> selecteditem; private LinkedListNode<Vertex> selecteditem;
// Position // Position
@ -74,12 +73,12 @@ namespace CodeImp.DoomBuilder.Map
#region ================== Constructor / Disposer #region ================== Constructor / Disposer
// Constructor // Constructor
internal Vertex(MapSet map, LinkedListNode<Vertex> listitem, Vector2D pos) internal Vertex(MapSet map, int listindex, Vector2D pos)
{ {
// Initialize // Initialize
this.map = map; this.map = map;
this.linedefs = new LinkedList<Linedef>(); this.linedefs = new LinkedList<Linedef>();
this.mainlistitem = listitem; this.listindex = listindex;
this.pos = pos; this.pos = pos;
// We have no destructor // We have no destructor
@ -87,12 +86,12 @@ namespace CodeImp.DoomBuilder.Map
} }
// Constructor // Constructor
internal Vertex(MapSet map, LinkedListNode<Vertex> listitem, IReadWriteStream stream) internal Vertex(MapSet map, int listindex, IReadWriteStream stream)
{ {
// Initialize // Initialize
this.map = map; this.map = map;
this.linedefs = new LinkedList<Linedef>(); this.linedefs = new LinkedList<Linedef>();
this.mainlistitem = listitem; this.listindex = listindex;
ReadWrite(stream); ReadWrite(stream);
@ -110,7 +109,7 @@ namespace CodeImp.DoomBuilder.Map
isdisposed = true; isdisposed = true;
// Remove from main list // Remove from main list
mainlistitem.List.Remove(mainlistitem); map.RemoveVertex(listindex);
// Dispose the lines that are attached to this vertex // Dispose the lines that are attached to this vertex
// because a linedef cannot exist without 2 vertices. // because a linedef cannot exist without 2 vertices.
@ -118,7 +117,6 @@ namespace CodeImp.DoomBuilder.Map
// Clean up // Clean up
linedefs = null; linedefs = null;
mainlistitem = null;
map = null; map = null;
// Dispose base // Dispose base
@ -178,14 +176,6 @@ namespace CodeImp.DoomBuilder.Map
#region ================== Methods #region ================== Methods
/// <summary>
/// Returns the index of this vertex. This is a O(n) operation.
/// </summary>
public int GetIndex()
{
return map.GetIndexForVertex(this);
}
// This copies all properties to another thing // This copies all properties to another thing
public void CopyPropertiesTo(Vertex v) public void CopyPropertiesTo(Vertex v)
{ {

View file

@ -167,7 +167,7 @@ namespace CodeImp.DoomBuilder.Windows
fronthigh.Required = fl.Front.HighRequired(); fronthigh.Required = fl.Front.HighRequired();
frontmid.Required = fl.Front.MiddleRequired(); frontmid.Required = fl.Front.MiddleRequired();
frontlow.Required = fl.Front.LowRequired(); frontlow.Required = fl.Front.LowRequired();
frontsector.Text = fl.Map.GetIndexForSector(fl.Front.Sector).ToString(); frontsector.Text = fl.Front.Sector.Index.ToString();
frontoffsetx.Text = fl.Front.OffsetX.ToString(); frontoffsetx.Text = fl.Front.OffsetX.ToString();
frontoffsety.Text = fl.Front.OffsetY.ToString(); frontoffsety.Text = fl.Front.OffsetY.ToString();
} }
@ -181,7 +181,7 @@ namespace CodeImp.DoomBuilder.Windows
backhigh.Required = fl.Back.HighRequired(); backhigh.Required = fl.Back.HighRequired();
backmid.Required = fl.Back.MiddleRequired(); backmid.Required = fl.Back.MiddleRequired();
backlow.Required = fl.Back.LowRequired(); backlow.Required = fl.Back.LowRequired();
backsector.Text = fl.Map.GetIndexForSector(fl.Back.Sector).ToString(); backsector.Text = fl.Back.Sector.Index.ToString();
backoffsetx.Text = fl.Back.OffsetX.ToString(); backoffsetx.Text = fl.Back.OffsetX.ToString();
backoffsety.Text = fl.Back.OffsetY.ToString(); backoffsety.Text = fl.Back.OffsetY.ToString();
} }
@ -266,7 +266,7 @@ namespace CodeImp.DoomBuilder.Windows
if(fronthigh.Required != l.Front.HighRequired()) fronthigh.Required = false; if(fronthigh.Required != l.Front.HighRequired()) fronthigh.Required = false;
if(frontmid.Required != l.Front.MiddleRequired()) frontmid.Required = false; if(frontmid.Required != l.Front.MiddleRequired()) frontmid.Required = false;
if(frontlow.Required != l.Front.LowRequired()) frontlow.Required = false; if(frontlow.Required != l.Front.LowRequired()) frontlow.Required = false;
if(frontsector.Text != l.Map.GetIndexForSector(l.Front.Sector).ToString()) frontsector.Text = ""; if(frontsector.Text != l.Front.Sector.Index.ToString()) frontsector.Text = "";
if(frontoffsetx.Text != l.Front.OffsetX.ToString()) frontoffsetx.Text = ""; if(frontoffsetx.Text != l.Front.OffsetX.ToString()) frontoffsetx.Text = "";
if(frontoffsety.Text != l.Front.OffsetY.ToString()) frontoffsety.Text = ""; if(frontoffsety.Text != l.Front.OffsetY.ToString()) frontoffsety.Text = "";
} }
@ -280,7 +280,7 @@ namespace CodeImp.DoomBuilder.Windows
if(backhigh.Required != l.Back.HighRequired()) backhigh.Required = false; if(backhigh.Required != l.Back.HighRequired()) backhigh.Required = false;
if(backmid.Required != l.Back.MiddleRequired()) backmid.Required = false; if(backmid.Required != l.Back.MiddleRequired()) backmid.Required = false;
if(backlow.Required != l.Back.LowRequired()) backlow.Required = false; if(backlow.Required != l.Back.LowRequired()) backlow.Required = false;
if(backsector.Text != l.Map.GetIndexForSector(l.Back.Sector).ToString()) backsector.Text = ""; if(backsector.Text != l.Back.Sector.Index.ToString()) backsector.Text = "";
if(backoffsetx.Text != l.Back.OffsetX.ToString()) backoffsetx.Text = ""; if(backoffsetx.Text != l.Back.OffsetX.ToString()) backoffsetx.Text = "";
if(backoffsety.Text != l.Back.OffsetY.ToString()) backoffsety.Text = ""; if(backoffsety.Text != l.Back.OffsetY.ToString()) backoffsety.Text = "";
if(General.Map.FormatInterface.HasCustomFields) custombackbutton.Visible = true; if(General.Map.FormatInterface.HasCustomFields) custombackbutton.Visible = true;
@ -407,7 +407,7 @@ namespace CodeImp.DoomBuilder.Windows
else if(frontside.CheckState == CheckState.Checked) else if(frontside.CheckState == CheckState.Checked)
{ {
// Make sure we have a valid sector (make a new one if needed) // Make sure we have a valid sector (make a new one if needed)
if(l.Front != null) index = l.Map.GetIndexForSector(l.Front.Sector); else index = -1; if(l.Front != null) index = l.Front.Sector.Index; else index = -1;
s = General.Map.Map.GetSectorByIndex(frontsector.GetResult(index)); s = General.Map.Map.GetSectorByIndex(frontsector.GetResult(index));
if(s == null) s = General.Map.Map.CreateSector(); if(s == null) s = General.Map.Map.CreateSector();
@ -434,7 +434,7 @@ namespace CodeImp.DoomBuilder.Windows
else if(backside.CheckState == CheckState.Checked) else if(backside.CheckState == CheckState.Checked)
{ {
// Make sure we have a valid sector (make a new one if needed) // Make sure we have a valid sector (make a new one if needed)
if(l.Back != null) index = l.Map.GetIndexForSector(l.Back.Sector); else index = -1; if(l.Back != null) index = l.Back.Sector.Index; else index = -1;
s = General.Map.Map.GetSectorByIndex(backsector.GetResult(index)); s = General.Map.Map.GetSectorByIndex(backsector.GetResult(index));
if(s == null) s = General.Map.Map.CreateSector(); if(s == null) s = General.Map.Map.CreateSector();

View file

@ -63,7 +63,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
this.viewobjects.Add(s); this.viewobjects.Add(s);
foreach(Vertex vv in v) this.viewobjects.Add(vv); foreach(Vertex vv in v) this.viewobjects.Add(vv);
this.description = "This sector is not a closed region and could cause problems with clipping and rendering in the game. The 'leaks' in the sector are indicated by the colored vertices."; this.description = "This sector is not a closed region and could cause problems with clipping and rendering in the game. The 'leaks' in the sector are indicated by the colored vertices.";
this.index = s.Map.GetIndexForSector(s); this.index = s.Index;
} }
#endregion #endregion

View file

@ -119,14 +119,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
{ {
// Replace and add to list // Replace and add to list
if(replacewith != null) s.SetCeilTexture(replacewith); if(replacewith != null) s.SetCeilTexture(replacewith);
objs.Add(new FindReplaceObject(s, "Sector " + s.GetIndex() + " (ceiling)")); objs.Add(new FindReplaceObject(s, "Sector " + s.Index + " (ceiling)"));
} }
if(s.LongFloorTexture == longfind) if(s.LongFloorTexture == longfind)
{ {
// Replace and add to list // Replace and add to list
if(replacewith != null) s.SetFloorTexture(replacewith); if(replacewith != null) s.SetFloorTexture(replacewith);
objs.Add(new FindReplaceObject(s, "Sector " + s.GetIndex() + " (floor)")); objs.Add(new FindReplaceObject(s, "Sector " + s.Index + " (floor)"));
} }
} }
@ -139,21 +139,21 @@ namespace CodeImp.DoomBuilder.BuilderModes
{ {
// Replace and add to list // Replace and add to list
if(replacewith != null) sd.SetTextureHigh(replacewith); if(replacewith != null) sd.SetTextureHigh(replacewith);
objs.Add(new FindReplaceObject(sd, "Sidedef " + sd.GetIndex() + " (" + side + ", high)")); objs.Add(new FindReplaceObject(sd, "Sidedef " + sd.Index + " (" + side + ", high)"));
} }
if(sd.LongMiddleTexture == longfind) if(sd.LongMiddleTexture == longfind)
{ {
// Replace and add to list // Replace and add to list
if(replacewith != null) sd.SetTextureMid(replacewith); if(replacewith != null) sd.SetTextureMid(replacewith);
objs.Add(new FindReplaceObject(sd, "Sidedef " + sd.GetIndex() + " (" + side + ", middle)")); objs.Add(new FindReplaceObject(sd, "Sidedef " + sd.Index + " (" + side + ", middle)"));
} }
if(sd.LongLowTexture == longfind) if(sd.LongLowTexture == longfind)
{ {
// Replace and add to list // Replace and add to list
if(replacewith != null) sd.SetTextureLow(replacewith); if(replacewith != null) sd.SetTextureLow(replacewith);
objs.Add(new FindReplaceObject(sd, "Sidedef " + sd.GetIndex() + " (" + side + ", low)")); objs.Add(new FindReplaceObject(sd, "Sidedef " + sd.Index + " (" + side + ", low)"));
} }
} }

View file

@ -142,9 +142,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
{ {
// Add to list // Add to list
if(!info.IsNull) if(!info.IsNull)
objs.Add(new FindReplaceObject(l, "Linedef " + l.GetIndex() + " (" + info.Title + ")")); objs.Add(new FindReplaceObject(l, "Linedef " + l.Index + " (" + info.Title + ")"));
else else
objs.Add(new FindReplaceObject(l, "Linedef " + l.GetIndex())); objs.Add(new FindReplaceObject(l, "Linedef " + l.Index));
} }
} }
} }

View file

@ -125,9 +125,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Add to list // Add to list
LinedefActionInfo info = General.Map.Config.GetLinedefActionInfo(l.Action); LinedefActionInfo info = General.Map.Config.GetLinedefActionInfo(l.Action);
if(!info.IsNull) if(!info.IsNull)
objs.Add(new FindReplaceObject(l, "Linedef " + l.GetIndex() + " (" + info.Title + ")")); objs.Add(new FindReplaceObject(l, "Linedef " + l.Index + " (" + info.Title + ")"));
else else
objs.Add(new FindReplaceObject(l, "Linedef " + l.GetIndex())); objs.Add(new FindReplaceObject(l, "Linedef " + l.Index));
} }
} }
} }

View file

@ -142,9 +142,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
{ {
// Add to list // Add to list
if(!info.IsNull) if(!info.IsNull)
objs.Add(new FindReplaceObject(l, "Linedef " + l.GetIndex() + " (" + info.Title + ")")); objs.Add(new FindReplaceObject(l, "Linedef " + l.Index + " (" + info.Title + ")"));
else else
objs.Add(new FindReplaceObject(l, "Linedef " + l.GetIndex())); objs.Add(new FindReplaceObject(l, "Linedef " + l.Index));
} }
} }
} }

View file

@ -120,9 +120,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Add to list // Add to list
LinedefActionInfo info = General.Map.Config.GetLinedefActionInfo(l.Action); LinedefActionInfo info = General.Map.Config.GetLinedefActionInfo(l.Action);
if(!info.IsNull) if(!info.IsNull)
objs.Add(new FindReplaceObject(l, "Linedef " + l.GetIndex() + " (" + info.Title + ")")); objs.Add(new FindReplaceObject(l, "Linedef " + l.Index + " (" + info.Title + ")"));
else else
objs.Add(new FindReplaceObject(l, "Linedef " + l.GetIndex())); objs.Add(new FindReplaceObject(l, "Linedef " + l.Index));
} }
} }
} }

View file

@ -120,9 +120,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
SectorEffectInfo info = General.Map.Config.GetSectorEffectInfo(s.Effect); SectorEffectInfo info = General.Map.Config.GetSectorEffectInfo(s.Effect);
if(!info.IsNull) if(!info.IsNull)
objs.Add(new FindReplaceObject(s, "Sector " + s.GetIndex() + " (" + info.Title + ")")); objs.Add(new FindReplaceObject(s, "Sector " + s.Index + " (" + info.Title + ")"));
else else
objs.Add(new FindReplaceObject(s, "Sector " + s.GetIndex())); objs.Add(new FindReplaceObject(s, "Sector " + s.Index));
} }
} }
} }

View file

@ -111,14 +111,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
{ {
// Replace and add to list // Replace and add to list
if(replacewith != null) s.SetCeilTexture(replacewith); if(replacewith != null) s.SetCeilTexture(replacewith);
objs.Add(new FindReplaceObject(s, "Sector " + s.GetIndex() + " (ceiling)")); objs.Add(new FindReplaceObject(s, "Sector " + s.Index + " (ceiling)"));
} }
if(s.LongFloorTexture == longfind) if(s.LongFloorTexture == longfind)
{ {
// Replace and add to list // Replace and add to list
if(replacewith != null) s.SetFloorTexture(replacewith); if(replacewith != null) s.SetFloorTexture(replacewith);
objs.Add(new FindReplaceObject(s, "Sector " + s.GetIndex() + " (floor)")); objs.Add(new FindReplaceObject(s, "Sector " + s.Index + " (floor)"));
} }
} }

View file

@ -117,9 +117,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
SectorEffectInfo info = General.Map.Config.GetSectorEffectInfo(s.Effect); SectorEffectInfo info = General.Map.Config.GetSectorEffectInfo(s.Effect);
if(!info.IsNull) if(!info.IsNull)
objs.Add(new FindReplaceObject(s, "Sector " + s.GetIndex() + " (" + info.Title + ")")); objs.Add(new FindReplaceObject(s, "Sector " + s.Index + " (" + info.Title + ")"));
else else
objs.Add(new FindReplaceObject(s, "Sector " + s.GetIndex())); objs.Add(new FindReplaceObject(s, "Sector " + s.Index));
} }
} }
} }

View file

@ -112,21 +112,21 @@ namespace CodeImp.DoomBuilder.BuilderModes
{ {
// Replace and add to list // Replace and add to list
if(replacewith != null) sd.SetTextureHigh(replacewith); if(replacewith != null) sd.SetTextureHigh(replacewith);
objs.Add(new FindReplaceObject(sd, "Sidedef " + sd.GetIndex() + " (" + side + ", high)")); objs.Add(new FindReplaceObject(sd, "Sidedef " + sd.Index + " (" + side + ", high)"));
} }
if(sd.LongMiddleTexture == longfind) if(sd.LongMiddleTexture == longfind)
{ {
// Replace and add to list // Replace and add to list
if(replacewith != null) sd.SetTextureMid(replacewith); if(replacewith != null) sd.SetTextureMid(replacewith);
objs.Add(new FindReplaceObject(sd, "Sidedef " + sd.GetIndex() + " (" + side + ", middle)")); objs.Add(new FindReplaceObject(sd, "Sidedef " + sd.Index + " (" + side + ", middle)"));
} }
if(sd.LongLowTexture == longfind) if(sd.LongLowTexture == longfind)
{ {
// Replace and add to list // Replace and add to list
if(replacewith != null) sd.SetTextureLow(replacewith); if(replacewith != null) sd.SetTextureLow(replacewith);
objs.Add(new FindReplaceObject(sd, "Sidedef " + sd.GetIndex() + " (" + side + ", low)")); objs.Add(new FindReplaceObject(sd, "Sidedef " + sd.Index + " (" + side + ", low)"));
} }
} }

View file

@ -127,7 +127,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Add to list // Add to list
ThingTypeInfo ti = General.Map.Data.GetThingInfo(t.Type); ThingTypeInfo ti = General.Map.Data.GetThingInfo(t.Type);
objs.Add(new FindReplaceObject(t, "Thing " + t.GetIndex() + " (" + ti.Title + ")")); objs.Add(new FindReplaceObject(t, "Thing " + t.Index + " (" + ti.Title + ")"));
} }
} }
} }

View file

@ -142,7 +142,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{ {
// Add to list // Add to list
ThingTypeInfo ti = General.Map.Data.GetThingInfo(t.Type); ThingTypeInfo ti = General.Map.Data.GetThingInfo(t.Type);
objs.Add(new FindReplaceObject(t, "Thing " + t.GetIndex() + " (" + ti.Title + ")")); objs.Add(new FindReplaceObject(t, "Thing " + t.Index + " (" + ti.Title + ")"));
} }
} }
} }

View file

@ -124,7 +124,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Add to list // Add to list
ThingTypeInfo ti = General.Map.Data.GetThingInfo(t.Type); ThingTypeInfo ti = General.Map.Data.GetThingInfo(t.Type);
objs.Add(new FindReplaceObject(t, "Thing " + t.GetIndex() + " (" + ti.Title + ")")); objs.Add(new FindReplaceObject(t, "Thing " + t.Index + " (" + ti.Title + ")"));
} }
} }
} }

View file

@ -142,7 +142,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
{ {
// Add to list // Add to list
ThingTypeInfo ti = General.Map.Data.GetThingInfo(t.Type); ThingTypeInfo ti = General.Map.Data.GetThingInfo(t.Type);
objs.Add(new FindReplaceObject(t, "Thing " + t.GetIndex() + " (" + ti.Title + ")")); objs.Add(new FindReplaceObject(t, "Thing " + t.Index + " (" + ti.Title + ")"));
} }
} }
} }

View file

@ -124,7 +124,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Add to list // Add to list
ThingTypeInfo ti = General.Map.Data.GetThingInfo(t.Type); ThingTypeInfo ti = General.Map.Data.GetThingInfo(t.Type);
objs.Add(new FindReplaceObject(t, "Thing " + t.GetIndex() + " (" + ti.Title + ")")); objs.Add(new FindReplaceObject(t, "Thing " + t.Index + " (" + ti.Title + ")"));
} }
} }
} }