Added support for 'sprites' types in TEXTURES lump

This commit is contained in:
codeimp 2010-08-18 09:07:54 +00:00
parent 8625573ca2
commit 216e99850a
4 changed files with 151 additions and 38 deletions

View file

@ -311,6 +311,44 @@ namespace CodeImp.DoomBuilder.Data
#endregion
#region ================== Sprites
// This loads the textures
public override ICollection<ImageData> LoadSprites()
{
Dictionary<long, ImageData> images = new Dictionary<long, ImageData>();
ICollection<ImageData> collection;
List<ImageData> imgset = new List<ImageData>();
// Error when suspended
if(issuspended) throw new Exception("Data reader is suspended");
// Load from wad files
// Note the backward order, because the last wad's images have priority
for(int i = wads.Count - 1; i >= 0; i--)
{
collection = wads[i].LoadSprites();
AddImagesToList(images, collection);
}
// Load TEXTURES lump file
imgset.Clear();
string[] alltexturefiles = GetAllFilesWithTitle("", "TEXTURES", false);
foreach(string texturesfile in alltexturefiles)
{
MemoryStream filedata = LoadFile(texturesfile);
WADReader.LoadHighresSprites(filedata, texturesfile, ref imgset, null, null);
filedata.Dispose();
}
// Add images from TEXTURES lump file
AddImagesToList(images, imgset);
return new List<ImageData>(images.Values);
}
#endregion
#region ================== Colormaps
// This loads the textures