mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-05-31 00:51:37 +00:00
Added support for 'sprites' types in TEXTURES lump
This commit is contained in:
parent
8625573ca2
commit
216e99850a
4 changed files with 151 additions and 38 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue