Merged in GZDB r2500.

This commit is contained in:
MascaraSnake 2016-04-08 19:50:00 +02:00
parent 2dba78a3d2
commit ea2d439b87
3 changed files with 60 additions and 33 deletions

View file

@ -33,7 +33,8 @@ namespace CodeImp.DoomBuilder.Data
// Members
public int type;
public string location;
public bool option1;
private string name; //mxd
public bool option1;
public bool option2;
public bool notfortesting;
@ -46,7 +47,8 @@ namespace CodeImp.DoomBuilder.Data
this.option1 = option1;
this.option2 = option2;
this.notfortesting = notfortesting;
}
this.name = string.Empty; //mxd
}
// This displays the struct as string
public override string ToString()
@ -55,8 +57,33 @@ namespace CodeImp.DoomBuilder.Data
return location;
}
// This compares two locations
public int CompareTo(DataLocation other)
//mxd. This returns short location name
public string GetShortName()
{
if (string.IsNullOrEmpty(name))
{
// Make shorter name for display purposes
switch (type)
{
case RESOURCE_DIRECTORY:
name = location.Substring(location.LastIndexOf(Path.DirectorySeparatorChar) + 1);
break;
case RESOURCE_WAD:
case RESOURCE_PK3:
name = Path.GetFileName(location);
break;
default:
throw new NotImplementedException("Unknown location type: " + type);
}
}
return name;
}
// This compares two locations
public int CompareTo(DataLocation other)
{
return string.Compare(this.location, other.location, true);
}
@ -88,8 +115,8 @@ namespace CodeImp.DoomBuilder.Data
break;
default:
throw new NotImplementedException("ResourceListEditor.FixedResourceLocationList: got unknown location type: " + type);
}
throw new NotImplementedException("Unknown location type: " + type);
}
return true;
}

View file

@ -1521,10 +1521,10 @@ namespace CodeImp.DoomBuilder.Data
{
// Parse the data
group.Value.Seek(0, SeekOrigin.Begin);
decorate.Parse(group.Value, group.Key, true);
//mxd. DECORATE lumps are interdepandable. Can't carry on...
if(decorate.HasError)
decorate.Parse(group.Value, Path.Combine(currentreader.Location.GetShortName(), group.Key), true);
//mxd. DECORATE lumps are interdepandable. Can't carry on...
if (decorate.HasError)
{
decorate.LogError(); //mxd
return counter;
@ -1850,11 +1850,11 @@ namespace CodeImp.DoomBuilder.Data
Dictionary<string, Stream> decostreams = currentreader.GetDecorateData(location);
foreach(KeyValuePair<string, Stream> group in decostreams)
{
// Parse this data
parser.Parse(group.Value, Path.Combine(currentreader.Location.location, group.Key), false);
// Parse this data
parser.Parse(group.Value, group.Key, false);
//mxd. DECORATE lumps are interdepandable. Can't carry on...
if(parser.HasError)
//mxd. DECORATE lumps are interdepandable. Can't carry on...
if (parser.HasError)
{
parser.LogError();
return;
@ -1995,7 +1995,7 @@ namespace CodeImp.DoomBuilder.Data
foreach(KeyValuePair<string, Stream> group in streams)
{
// Parse the data
if(parser.Parse(group.Value, Path.Combine(currentreader.Location.location, group.Key), true))
if (parser.Parse(group.Value, Path.Combine(currentreader.Location.GetShortName(), group.Key), true))
{
foreach(KeyValuePair<string, ModelData> g in parser.Entries)
{
@ -2078,8 +2078,8 @@ namespace CodeImp.DoomBuilder.Data
KeyValuePair<string, Stream> group = dr.GetVoxeldefData();
if(group.Value != null)
{
if(parser.Parse(group.Value, group.Key, true))
{
if (parser.Parse(group.Value, Path.Combine(currentreader.Location.GetShortName(), group.Key), true))
{
foreach(KeyValuePair<string, ModelData> entry in parser.Entries)
{
foreach(KeyValuePair<string, List<int>> sc in sprites)
@ -2135,10 +2135,10 @@ namespace CodeImp.DoomBuilder.Data
foreach(KeyValuePair<string, Stream> group in streams)
{
parser.Parse(group.Value, group.Key, false);
// Gldefs can be interdependable. Can't carry on
if(parser.HasError)
parser.Parse(group.Value, Path.Combine(currentreader.Location.GetShortName(), group.Key), false);
// Gldefs can be interdependable. Can't carry on
if (parser.HasError)
{
parser.LogError();
return;
@ -2272,11 +2272,11 @@ namespace CodeImp.DoomBuilder.Data
Dictionary<string, Stream> streams = dr.GetReverbsData();
foreach(KeyValuePair<string, Stream> group in streams)
{
// Parse the data
parser.Parse(group.Value, group.Key, true);
// Parse the data
parser.Parse(group.Value, Path.Combine(currentreader.Location.GetShortName(), group.Key), true);
// Report errors?
if(parser.HasError) parser.LogError();
// Report errors?
if (parser.HasError) parser.LogError();
}
}
@ -2301,10 +2301,10 @@ namespace CodeImp.DoomBuilder.Data
// Parse the data
foreach(KeyValuePair<string, Stream> group in streams)
{
parser.Parse(group.Value, group.Key, true);
parser.Parse(group.Value, Path.Combine(currentreader.Location.GetShortName(), group.Key), true);
// Report errors?
if(parser.HasError) parser.LogError();
// Report errors?
if (parser.HasError) parser.LogError();
}
}
@ -2327,10 +2327,10 @@ namespace CodeImp.DoomBuilder.Data
// Parse the data
foreach(KeyValuePair<string, Stream> group in streams)
{
parser.Parse(group.Value, group.Key, true);
parser.Parse(group.Value, Path.Combine(currentreader.Location.GetShortName(), group.Key), true);
// Report errors?
if(parser.HasError) parser.LogError();
// Report errors?
if (parser.HasError) parser.LogError();
// Create images
foreach(var g in parser.CameraTextures)

View file

@ -200,8 +200,8 @@ namespace CodeImp.DoomBuilder.Data
if(General.Map.Config.MixTexturesFlats)
{
ImageData img = General.Map.Data.GetTextureImage(p.lumpname);
if(!(img is UnknownImage))
{
if (!(img is UnknownImage) && img != this)
{
if(!img.IsImageLoaded) img.LoadImage();
//mxd. Apply transformations from TexturePatch. We don't want to modify the original bitmap here, so make a copy