Fixed(?), PK3: SharpCompress doesn't like it when several threads try to read PK3 archive entries at the same time.

Fixed, Visual mode, 3d floors: floor and ceiling alpha calculation was broken.
This commit is contained in:
MaxED 2015-05-28 10:04:42 +00:00
parent eb17a8fe8a
commit 118551c70d
4 changed files with 25 additions and 22 deletions

View file

@ -421,12 +421,14 @@ namespace CodeImp.DoomBuilder.Data
if (sevenzipentries.ContainsKey(fn)) filedata = new MemoryStream(sevenzipentries[fn]);
}
else
{
lock (this)
{
UpdateArchive(true);
foreach (var entry in archive.Entries)
{
if (entry.IsDirectory) continue;
if(entry.IsDirectory) continue;
// Is this the entry we are looking for?
if(string.Compare(entry.Key, fn, true) == 0)
@ -439,6 +441,7 @@ namespace CodeImp.DoomBuilder.Data
UpdateArchive(false);
}
}
// Nothing found?
if (filedata == null)

View file

@ -87,7 +87,7 @@ namespace CodeImp.DoomBuilder.Plugins
if(FindClasses(typeof(Plug)).Length > 1)
{
// Show a warning
General.ErrorLogger.Add(ErrorType.Warning, "Plugin \"" + shortfilename + "\" has more than one plug. The following class is used to create in instance: " + t.FullName);
General.ErrorLogger.Add(ErrorType.Warning, "Plugin \"" + shortfilename + "\" has more than one Plug class. The following class is used to create in instance: " + t.FullName);
}
// Make plug instance
@ -99,14 +99,14 @@ namespace CodeImp.DoomBuilder.Plugins
if((thisrevision != 0) && (plug.MinimumRevision > thisrevision))
{
// Can't load this plugin because it is meant for a newer version
General.ErrorLogger.Add(ErrorType.Error, "Could not load plugin \"" + shortfilename + "\", the Plugin is made for Doom Builder 2 core revision " + plug.MinimumRevision + " and you are running revision " + thisrevision + ".");
General.ErrorLogger.Add(ErrorType.Error, "Could not load plugin \"" + shortfilename + "\", the Plugin is made for GZDoom Builder R" + plug.MinimumRevision + " or newer and you are running R" + thisrevision + ".");
throw new InvalidProgramException();
}
}
else
{
// How can we plug something in without a plug?
General.ErrorLogger.Add(ErrorType.Error, "Could not load plugin \"" + shortfilename + "\", plugin is missing the plug. This file is not supposed to be in the Plugins subdirectory.");
General.ErrorLogger.Add(ErrorType.Error, "Could not load plugin \"" + shortfilename + "\", plugin is missing the Plug class. This file is not supposed to be in the Plugins subdirectory.");
throw new InvalidProgramException();
}

View file

@ -123,7 +123,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(s.CeilTexture == General.Map.Config.SkyFlatName)
color = -1; // That's white. With alpha. Not very impressive, eh?
else
color = (int)((level.color | General.Clamp(level.alpha, 0, 255) << 24) & 0xffffffff); // Byte offset shinanigans! Yay!
color = PixelColor.FromInt(level.color).WithAlpha((byte)General.Clamp(level.alpha, 0, 255)).ToInt();
// Make vertices
ReadOnlyCollection<Vector2D> triverts = base.Sector.Sector.Triangles.Vertices;

View file

@ -125,7 +125,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(s.FloorTexture == General.Map.Config.SkyFlatName)
color = -1; // That's white. With alpha. Not very impressive, eh?
else
color = (int)((level.color | General.Clamp(level.alpha, 0, 255) << 24) & 0xffffffff); // Byte offset shinanigans! Yay!
color = PixelColor.FromInt(level.color).WithAlpha((byte)General.Clamp(level.alpha, 0, 255)).ToInt();
// Make vertices
ReadOnlyCollection<Vector2D> triverts = base.Sector.Sector.Triangles.Vertices;
@ -138,7 +138,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Vertex coordinates
verts[i].x = triverts[i].x;
verts[i].y = triverts[i].y;
verts[i].z = level.plane.GetZ(triverts[i]); //(float)s.FloorHeight;
verts[i].z = level.plane.GetZ(triverts[i]);
// Texture coordinates
Vector2D pos = triverts[i];