Fixed, GLDEFS parser: we should check for duplicate entries within current resource, not globally.

Moved stuff around a bit in PK3Reader. Will it fix random crashes? I dunno, a least I was no longer able to trigger them...
Recompiled SharpCompress library using VS 2008, so it no longer references .net 4.0 stuff. Will it fix random crashes? See above.
This commit is contained in:
MaxED 2015-01-20 12:20:35 +00:00
parent 3676bd1a9b
commit 3080841766
6 changed files with 23 additions and 16 deletions

Binary file not shown.

View file

@ -1710,6 +1710,7 @@ namespace CodeImp.DoomBuilder.Data
foreach (DataReader dr in containers)
{
currentreader = dr;
parser.ClearIncludesList();
Dictionary<string, Stream> streams = dr.GetGldefsData(General.Map.Config.GameType);
foreach (KeyValuePair<string, Stream> group in streams)

View file

@ -460,17 +460,16 @@ namespace CodeImp.DoomBuilder.Data
// Make a copy
return General.Map.Data.Previews.GetPreviewCopy(previewindex);
}
// Loading failed?
else if(loadfailed)
if(loadfailed)
{
// Return error bitmap
return Properties.Resources.Failed;
}
else
{
// Return loading bitmap
return Properties.Resources.Hourglass;
}
// Return loading bitmap
return Properties.Resources.Hourglass;
}
}

View file

@ -78,9 +78,6 @@ namespace CodeImp.DoomBuilder.Data
sevenzipentries.Add(reader.Entry.Key.ToLowerInvariant(), s.ToArray());
fileentries.Add(new DirectoryFileEntry(reader.Entry.Key));
}
archive.Dispose();
archive = null;
}
else
{
@ -91,6 +88,10 @@ namespace CodeImp.DoomBuilder.Data
}
}
// Get rid of archive
archive.Dispose();
archive = null;
// Make files list
files = new DirectoryFilesList(fileentries);
@ -128,7 +129,7 @@ namespace CodeImp.DoomBuilder.Data
if (enable && archive == null)
{
archive = ArchiveFactory.Open(location.location, (bathmode ? Options.KeepStreamsOpen : Options.None));
archive = ArchiveFactory.Open(location.location);
}
else if(!enable && !bathmode && archive != null)
{

View file

@ -20,7 +20,6 @@ using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Drawing.Drawing2D;
#endregion
@ -145,7 +144,7 @@ namespace CodeImp.DoomBuilder.Data
Graphics g = Graphics.FromImage(preview);
g.PageUnit = GraphicsUnit.Pixel;
//g.CompositingQuality = CompositingQuality.HighQuality; //mxd
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.InterpolationMode = InterpolationMode.NearestNeighbor;
//g.SmoothingMode = SmoothingMode.HighQuality; //mxd
g.PixelOffsetMode = PixelOffsetMode.None;
//g.Clear(Color.Transparent); //mxd
@ -255,7 +254,7 @@ namespace CodeImp.DoomBuilder.Data
#if DEBUG
internal void DumpAtlases()
/*internal void DumpAtlases()
{
lock(images)
{
@ -269,7 +268,7 @@ namespace CodeImp.DoomBuilder.Data
}
}
}
}
}*/
#endif
#endregion

View file

@ -6,8 +6,10 @@ using CodeImp.DoomBuilder.ZDoom;
using CodeImp.DoomBuilder.GZBuilder.Data;
namespace CodeImp.DoomBuilder.GZBuilder.GZDoom {
public sealed class GldefsParser : ZDTextParser {
namespace CodeImp.DoomBuilder.GZBuilder.GZDoom
{
public sealed class GldefsParser : ZDTextParser
{
public delegate void IncludeDelegate(GldefsParser parser, string includefile);
public IncludeDelegate OnInclude;
@ -511,5 +513,10 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom {
return objects.Count > 0;
}
internal void ClearIncludesList()
{
parsedLumps.Clear();
}
}
}