GZDoom Builder 1.12e:

Fixed: inability to change 3d-floor height when control sector is too far away (further than current View distance).
Fixed: "Frame" property wasn't red by MODELDEF parser.
Fixed: PK3 archives are no longer locked when GZDB is running, so you can change their contents without closing the editor.
This commit is contained in:
MaxED 2012-08-14 12:47:27 +00:00
parent eb86ab60af
commit 89fad3ee65
6 changed files with 42 additions and 22 deletions

View file

@ -40,7 +40,7 @@ namespace CodeImp.DoomBuilder.Data
#region ================== Variables
private DirectoryFilesList files;
private IArchive archive;//mxd
//private IArchive archive;//mxd
private ArchiveType archiveType; //mxd
private static Dictionary<string, byte[]> sevenZipEntries; //mxd
@ -60,7 +60,7 @@ namespace CodeImp.DoomBuilder.Data
List<DirectoryFileEntry> fileentries = new List<DirectoryFileEntry>();
//mxd
archive = ArchiveFactory.Open(location.location);
IArchive archive = ArchiveFactory.Open(location.location);
archiveType = archive.Type;
if (archive.Type == ArchiveType.SevenZip) { //random access of 7z archives works TERRIBLY slow in SharpCompress
@ -75,8 +75,8 @@ namespace CodeImp.DoomBuilder.Data
fileentries.Add(new DirectoryFileEntry(reader.Entry.FilePath));
}
}
archive.Dispose();
archive = null;
//archive.Dispose();
//archive = null;
} else {
foreach (IEntry entry in archive.Entries) {
@ -85,6 +85,9 @@ namespace CodeImp.DoomBuilder.Data
}
}
archive.Dispose();
archive = null;
// Make files list
files = new DirectoryFilesList(fileentries);
@ -102,7 +105,7 @@ namespace CodeImp.DoomBuilder.Data
if(!isdisposed)
{
General.WriteLogLine("Closing " + Path.GetExtension(location.location).ToUpper().Replace(".", "") + " resource '" + location.location + "'");
if(archive != null) archive.Dispose(); //mxd
//if(archive != null) archive.Dispose(); //mxd
// Done
base.Dispose();
@ -335,6 +338,8 @@ namespace CodeImp.DoomBuilder.Data
if (sevenZipEntries.ContainsKey(filename))
filedata = new MemoryStream(sevenZipEntries[filename]);
} else {
IArchive archive = ArchiveFactory.Open(location.location);
foreach (var entry in archive.Entries) {
if (!entry.IsDirectory) {
// Is this the entry we are looking for?

View file

@ -191,7 +191,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom {
break;
}
//frameindex
} else if (token == "frameindex") {
} else if(token == "frameindex" || token == "frame") {
//parsed all required fields. if got more than one model - find which one(s) should be displayed
int len = modelNames.GetLength(0);
if (!gotErrors && len > 1) {
@ -206,8 +206,9 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom {
while (parser.SkipWhitespace(true)) {
token = parser.StripTokenQuotes(parser.ReadToken()).ToLowerInvariant();
if (token == "frameindex") {
parser.SkipWhitespace(true);
if(token == "frameindex" || token == "frame") {
bool frameIndex = (token == "frameindex");
parser.SkipWhitespace(true);
//should be sprite lump
token = parser.StripTokenQuotes(parser.ReadToken()).ToLowerInvariant();
@ -270,15 +271,18 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom {
parser.SkipWhitespace(true);
//should be frame index. Currently I have no use for it
//should be frame name or index. Currently I have no use for it
token = parser.StripTokenQuotes(parser.ReadToken());
int frame;
if (!int.TryParse(token, NumberStyles.Integer, CultureInfo.InvariantCulture, out frame)) {
// Not numeric!
GZBuilder.GZGeneral.LogAndTraceWarning("Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected model frame, but got '" + token + "'");
gotErrors = true;
break;
}
if(frameIndex) {
int frame;
if(!int.TryParse(token, NumberStyles.Integer, CultureInfo.InvariantCulture, out frame)) {
// Not numeric!
GZBuilder.GZGeneral.LogAndTraceWarning("Error in " + parser.Source + " at line " + parser.GetCurrentLineNumber() + ": expected model frame, but got '" + token + "'");
gotErrors = true;
break;
}
}
} else {
//must be "}", step back

View file

@ -33,7 +33,7 @@ namespace CodeImp.DoomBuilder.GZBuilder
//version
public const float Version = 1.12f;
public const char Revision = 'd';
public const char Revision = 'e';
//debug console
#if DEBUG

View file

@ -957,7 +957,7 @@ namespace CodeImp.DoomBuilder.VisualModes
VisualPickResult target = PickObject(start, start + delta);
//not appropriate way to do this, but...
if (target.picked != null && target.picked.GetType().Name.IndexOf("Thing") != -1)
if (target.picked != null && target.picked is VisualThing)
selectedVisualThings.Add((VisualThing)target.picked);
}
}

View file

@ -432,11 +432,15 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
ChangeHeight(amount);
// Rebuild sector
if(mode.VisualSectorExists(level.sector))
{
BaseVisualSector vs = (BaseVisualSector)mode.GetVisualSector(level.sector);
vs.UpdateSectorGeometry(true);
BaseVisualSector vs;
if(mode.VisualSectorExists(level.sector)) {
vs = (BaseVisualSector)mode.GetVisualSector(level.sector);
//vs.UpdateSectorGeometry(true);
} else {//mxd. Need this to apply changes to 3d-floor even if control sector doesn't exist as BaseVisualSector
vs = mode.CreateBaseVisualSector(level.sector);
}
if(vs != null) vs.UpdateSectorGeometry(true);
}
// Sector brightness change

View file

@ -333,6 +333,13 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
}
}
//mxd. Need this to apply changes to 3d-floor even if control sector doesn't exist as BaseVisualSector
internal BaseVisualSector CreateBaseVisualSector(Sector s) {
BaseVisualSector vs = new BaseVisualSector(this, s);
if(vs != null) allsectors.Add(s, vs);
return vs;
}
// This creates a visual sector
protected override VisualSector CreateVisualSector(Sector s)
{