mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-17 01:22:18 +00:00
"Texture 'XXX' is double defined in resource 'YYY'." warning is no longer displayed if a texture contains a patch with the same name as the texture.
This commit is contained in:
parent
f2c0d0a4c8
commit
a485b40bee
2 changed files with 12 additions and 5 deletions
|
@ -18,6 +18,7 @@
|
|||
|
||||
using System.Collections.Generic;
|
||||
using CodeImp.DoomBuilder.Data;
|
||||
using CodeImp.DoomBuilder.IO;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -64,7 +65,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
// Add a texture
|
||||
internal void AddTexture(ImageData image)
|
||||
{
|
||||
if(textures.ContainsKey(image.LongName))
|
||||
if(textures.ContainsKey(image.LongName) && (!(image is HighResImage) || !(image as HighResImage).ContainsPatch(image.Name)) )
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Texture \"" + image.Name + "\" is double defined in resource \"" + this.Location.location + "\".");
|
||||
textures[image.LongName] = image;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
{
|
||||
#region ================== Variables
|
||||
|
||||
private List<TexturePatch> patches;
|
||||
private Dictionary<string, TexturePatch> patches; //mxd
|
||||
private bool gotFullName;//mxd
|
||||
private string type;
|
||||
|
||||
|
@ -49,7 +49,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
this.scale.x = scalex;
|
||||
this.scale.y = scaley;
|
||||
this.worldpanning = worldpanning;
|
||||
this.patches = new List<TexturePatch>();
|
||||
this.patches = new Dictionary<string, TexturePatch>(1);
|
||||
this.type = type;
|
||||
SetName(name);
|
||||
|
||||
|
@ -65,7 +65,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
public void AddPatch(TexturePatch patch)
|
||||
{
|
||||
// Add it
|
||||
patches.Add(patch);
|
||||
patches.Add(patch.lumpname, patch);
|
||||
|
||||
//mxd. Get full name from first patch
|
||||
if (!gotFullName) {
|
||||
|
@ -111,7 +111,7 @@ namespace CodeImp.DoomBuilder.Data
|
|||
if(!loadfailed)
|
||||
{
|
||||
// Go for all patches
|
||||
foreach(TexturePatch p in patches)
|
||||
foreach(TexturePatch p in patches.Values)
|
||||
{
|
||||
// Get the patch data stream
|
||||
Stream patchdata;
|
||||
|
@ -338,6 +338,12 @@ namespace CodeImp.DoomBuilder.Data
|
|||
}
|
||||
}
|
||||
|
||||
//mxd
|
||||
public bool ContainsPatch(string name)
|
||||
{
|
||||
return patches.ContainsKey(name);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue