diff --git a/Source/Core/Data/WADReader.cs b/Source/Core/Data/WADReader.cs index 8ee5b81e..dc8fd83b 100755 --- a/Source/Core/Data/WADReader.cs +++ b/Source/Core/Data/WADReader.cs @@ -1206,25 +1206,6 @@ namespace CodeImp.DoomBuilder.Data return result; } - //mxd - private List GetAllLumpsDataWithPrefix(string prefix) - { - List result = new List(); - - // Find all lumps with given name - int lumpindex = file.FindLumpIndexWithPrefix(prefix); - while (lumpindex > -1) - { - // Add to collection - result.Add(new TextResourceData(this, file.Lumps[lumpindex].GetSafeStream(), prefix, lumpindex, true)); - - // Find next entry - lumpindex = file.FindLumpIndexWithPrefix(prefix, lumpindex + 1); - } - - return result; - } - //sphere private List GetAllPrefixedLumps(string prefix) { @@ -1233,10 +1214,10 @@ namespace CodeImp.DoomBuilder.Data // Loop through the lumps for (int i = 0; i < file.Lumps.Count - 1; i++) { - // Check if the lump name matches + // Check if the lump name contains the given prefix if (file.Lumps[i].Name.StartsWith(prefix)) { - // Found the lump! + // Found a matching lump! result.Add(new TextResourceData(this, file.Lumps[i].GetSafeStream(), file.Lumps[i].Name, i, true)); } } diff --git a/Source/Core/IO/WAD.cs b/Source/Core/IO/WAD.cs index 95bb73ee..43f4a76f 100755 --- a/Source/Core/IO/WAD.cs +++ b/Source/Core/IO/WAD.cs @@ -568,44 +568,6 @@ namespace CodeImp.DoomBuilder.IO return -1; } - // This finds a lump with given prefix, returns -1 when not found - public int FindLumpIndexWithPrefix(string prefix) - { - // Do search - return FindLumpIndexWithPrefix(prefix, 0, lumps.Count - 1); - } - - // This finds a lump with given prefix, returns -1 when not found - public int FindLumpIndexWithPrefix(string prefix, int start) - { - // Do search - return FindLumpIndex(prefix, start, lumps.Count - 1); - } - - // This finds a lump with given prefix, returns -1 when not found - public int FindLumpIndexWithPrefix(string prefix, int start, int end) - { - if (prefix.Length > 8 || lumps.Count == 0 || start > lumps.Count - 1) return -1; //mxd. Can't be here. Go away! - - // Fix start/end when they exceed safe bounds - start = Math.Max(start, 0); - end = General.Clamp(end, 0, lumps.Count - 1); - - // Loop through the lumps - for (int i = start; i < end + 1; i++) - { - // Check if the lump name matches - if (lumps[i].Name.StartsWith(prefix)) - { - // Found the lump! - return i; - } - } - - // Nothing found - return -1; - } - //mxd. Same as above, but searches in reversed order // This finds a lump by name, returns null when not found