Map saving: map lumps position in the wad is now kept persistent when saving it (previously / in DB2 map lumps were always pushed to the end of the wad when saving it).

Internal: added NeutralResourcesLanguageAttribute to all assemblies. Theoretically this should result in a bit better performance when accessing embedded resources.
Updated ZDoom_DECORATE.cfg (A_Chase flags).
This commit is contained in:
MaxED 2016-03-17 23:58:08 +00:00 committed by spherallic
parent 9cb14fc80b
commit a4fe857710
11 changed files with 61 additions and 21 deletions

View file

@ -1086,6 +1086,11 @@ constants
CHF_NIGHTMAREFAST; CHF_NIGHTMAREFAST;
CHF_NOPLAYACTIVE; CHF_NOPLAYACTIVE;
CHF_RESURRECT; CHF_RESURRECT;
CHF_NORANDOMTURN;
CHF_NODIRECTIONTURN;
CHF_NOPOSTATTACKTURN;
CHF_STOPIFBLOCKED;
CHF_DONTTURN;
CLOFF_AIM_VERT_NOOFFSET; CLOFF_AIM_VERT_NOOFFSET;
CLOFF_ALLOWNULL; CLOFF_ALLOWNULL;
CLOFF_BEYONDTARGET; CLOFF_BEYONDTARGET;

View file

@ -48,6 +48,7 @@ namespace CodeImp.DoomBuilder
internal const string TEMP_MAP_HEADER = "TEMPMAP"; internal const string TEMP_MAP_HEADER = "TEMPMAP";
internal const string BUILD_MAP_HEADER = "MAP01"; internal const string BUILD_MAP_HEADER = "MAP01";
public const string CONFIG_MAP_HEADER = "~MAP"; public const string CONFIG_MAP_HEADER = "~MAP";
private const int REPLACE_TARGET_MAP = -1; //mxd
#endregion #endregion
@ -400,8 +401,7 @@ namespace CodeImp.DoomBuilder
// Copy the map lumps to the temp file // Copy the map lumps to the temp file
General.WriteLogLine("Copying map lumps to temporary file..."); General.WriteLogLine("Copying map lumps to temporary file...");
CopyLumpsByType(mapwad, options.CurrentName, tempwad, TEMP_MAP_HEADER, CopyLumpsByType(mapwad, options.CurrentName, tempwad, TEMP_MAP_HEADER, REPLACE_TARGET_MAP, true, true, true, true);
true, true, true, true);
// Close the map file // Close the map file
mapwad.Dispose(); mapwad.Dispose();
@ -504,7 +504,7 @@ namespace CodeImp.DoomBuilder
// Copy the map lumps to the temp file // Copy the map lumps to the temp file
General.WriteLogLine("Copying map lumps to temporary file..."); General.WriteLogLine("Copying map lumps to temporary file...");
CopyLumpsByType(mapwad, options.CurrentName, tempwad, TEMP_MAP_HEADER, true, true, true, true); CopyLumpsByType(mapwad, options.CurrentName, tempwad, TEMP_MAP_HEADER, REPLACE_TARGET_MAP, true, true, true, true);
// Close the map file // Close the map file
mapwad.Dispose(); mapwad.Dispose();
@ -866,6 +866,7 @@ namespace CodeImp.DoomBuilder
// Determine original map name // Determine original map name
string origmapname = (!string.IsNullOrEmpty(options.PreviousName) && purpose != SavePurpose.IntoFile) ? options.PreviousName : options.CurrentName; string origmapname = (!string.IsNullOrEmpty(options.PreviousName) && purpose != SavePurpose.IntoFile) ? options.PreviousName : options.CurrentName;
string origwadfile = string.Empty; //mxd string origwadfile = string.Empty; //mxd
int mapheaderindex = REPLACE_TARGET_MAP; //mxd. Lump index of the map file header in the source WAD
try try
{ {
@ -943,7 +944,7 @@ namespace CodeImp.DoomBuilder
origcfg = new GameConfiguration(ci.Configuration); origcfg = new GameConfiguration(ci.Configuration);
} }
CopyAllLumpsExceptMap(origwad, targetwad, origcfg, origmapname); mapheaderindex = CopyAllLumpsExceptMap(origwad, targetwad, origcfg, origmapname);
// Close original file and delete it // Close original file and delete it
origwad.Dispose(); origwad.Dispose();
@ -980,7 +981,7 @@ namespace CodeImp.DoomBuilder
} }
// Copy map lumps to target file // Copy map lumps to target file
CopyLumpsByType(tempwad, TEMP_MAP_HEADER, targetwad, origmapname, true, true, includenodes, true); CopyLumpsByType(tempwad, TEMP_MAP_HEADER, targetwad, origmapname, mapheaderindex, true, true, includenodes, true);
// mxd. Was the map renamed? // mxd. Was the map renamed?
if(options.LevelNameChanged) if(options.LevelNameChanged)
@ -1190,7 +1191,7 @@ namespace CodeImp.DoomBuilder
// Copy lumps to buildwad // Copy lumps to buildwad
General.WriteLogLine("Copying map lumps to temporary build file..."); General.WriteLogLine("Copying map lumps to temporary build file...");
CopyLumpsByType(tempwad, TEMP_MAP_HEADER, buildwad, BUILD_MAP_HEADER, true, false, false, true); CopyLumpsByType(tempwad, TEMP_MAP_HEADER, buildwad, BUILD_MAP_HEADER, REPLACE_TARGET_MAP, true, false, false, true);
// Close buildwad // Close buildwad
buildwad.Dispose(); buildwad.Dispose();
@ -1235,7 +1236,7 @@ namespace CodeImp.DoomBuilder
{ {
// Copy nodebuilder lumps to temp file // Copy nodebuilder lumps to temp file
General.WriteLogLine("Copying nodebuilder lumps to temporary file..."); General.WriteLogLine("Copying nodebuilder lumps to temporary file...");
CopyLumpsByType(buildwad, BUILD_MAP_HEADER, tempwad, TEMP_MAP_HEADER, false, false, true, false); CopyLumpsByType(buildwad, BUILD_MAP_HEADER, tempwad, TEMP_MAP_HEADER, REPLACE_TARGET_MAP, false, false, true, false);
} }
else else
{ {
@ -1430,13 +1431,16 @@ namespace CodeImp.DoomBuilder
foreach(Lump lump in toRemove) target.Remove(lump); foreach(Lump lump in toRemove) target.Remove(lump);
} }
// This copies all lumps, except those of a specific map // This copies all lumps, except those of a specific map. mxd. Returns the index of skipped map's header lump
private static void CopyAllLumpsExceptMap(WAD source, WAD target, GameConfiguration mapconfig, string sourcemapname) private static int CopyAllLumpsExceptMap(WAD source, WAD target, GameConfiguration mapconfig, string sourcemapname)
{ {
// Go for all lumps // Go for all lumps
bool skipping = false; bool skipping = false;
foreach(Lump srclump in source.Lumps) int headerpos = REPLACE_TARGET_MAP; //mxd
for(int i = 0; i < source.Lumps.Count; i++)
{ {
Lump srclump = source.Lumps[i];
// Check if we should stop skipping lumps here // Check if we should stop skipping lumps here
if(skipping) if(skipping)
{ {
@ -1452,10 +1456,12 @@ namespace CodeImp.DoomBuilder
} }
// Check if we should start skipping lumps here // Check if we should start skipping lumps here
if(!skipping && (srclump.Name == sourcemapname)) //TODO: I see a big, but kinda esoteric problem here if the source has several maps with the same name (mxd)
if(!skipping && headerpos == REPLACE_TARGET_MAP && srclump.Name == sourcemapname)
{ {
// We have encountered the map header, start skipping! // We have encountered the map header, start skipping!
skipping = true; skipping = true;
headerpos = i;
} }
// Not skipping this lump? // Not skipping this lump?
@ -1466,16 +1472,20 @@ namespace CodeImp.DoomBuilder
srclump.CopyTo(tgtlump); srclump.CopyTo(tgtlump);
} }
} }
return headerpos;
} }
// This copies specific map lumps from one WAD to another // This copies specific map lumps from one WAD to another
private void CopyLumpsByType(WAD source, string sourcemapname, private void CopyLumpsByType(WAD source, string sourcemapname,
WAD target, string targetmapname, WAD target, string targetmapname,
int targetheaderinsertindex, //mxd
bool copyrequired, bool copyblindcopy, bool copyrequired, bool copyblindcopy,
bool copynodebuild, bool copyscript) bool copynodebuild, bool copyscript)
{ {
// Find the map header in target // Find the map header in target (mxd. Or use the provided one)
int tgtheaderindex = target.FindLumpIndex(targetmapname); bool replacetargetmap = (targetheaderinsertindex == REPLACE_TARGET_MAP); //mxd
int tgtheaderindex = (replacetargetmap ? target.FindLumpIndex(targetmapname) : targetheaderinsertindex); //mxd
if(tgtheaderindex == -1) if(tgtheaderindex == -1)
{ {
// If this header doesnt exists in the target // If this header doesnt exists in the target
@ -1504,6 +1514,9 @@ namespace CodeImp.DoomBuilder
// Find the lump in the source // Find the lump in the source
int sourceindex = FindSpecificLump(source, srclumpname, srcheaderindex, sourcemapname, config.MapLumps); int sourceindex = FindSpecificLump(source, srclumpname, srcheaderindex, sourcemapname, config.MapLumps);
if(sourceindex > -1) if(sourceindex > -1)
{
//mxd. Don't do this when inserting a map (SaveMap() removes the old version of the map before calling CopyLumpsByType())
if(replacetargetmap)
{ {
// Remove lump at target // Remove lump at target
int lumpindex = RemoveSpecificLump(target, tgtlumpname, tgtheaderindex, targetmapname, config.MapLumps); int lumpindex = RemoveSpecificLump(target, tgtlumpname, tgtheaderindex, targetmapname, config.MapLumps);
@ -1512,6 +1525,7 @@ namespace CodeImp.DoomBuilder
// When original lump was found and removed then insert at that position // When original lump was found and removed then insert at that position
// otherwise insert after last insertion position // otherwise insert after last insertion position
if(lumpindex > -1) targetindex = lumpindex; else targetindex++; if(lumpindex > -1) targetindex = lumpindex; else targetindex++;
}
if(targetindex > target.Lumps.Count) targetindex = target.Lumps.Count; if(targetindex > target.Lumps.Count) targetindex = target.Lumps.Count;
// Copy the lump to the target // Copy the lump to the target
@ -1519,6 +1533,9 @@ namespace CodeImp.DoomBuilder
Lump lump = source.Lumps[sourceindex]; Lump lump = source.Lumps[sourceindex];
Lump newlump = target.Insert(tgtlumpname, targetindex, lump.Length); Lump newlump = target.Insert(tgtlumpname, targetindex, lump.Length);
lump.CopyTo(newlump); lump.CopyTo(newlump);
//mxd. We still need to increment targetindex...
if(!replacetargetmap) targetindex++;
} }
else else
{ {

View file

@ -1,5 +1,6 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Resources;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
@ -29,3 +30,4 @@ using System.Runtime.InteropServices;
// Revision // Revision
// //
[assembly: AssemblyVersion("2.14.0.2501")] [assembly: AssemblyVersion("2.14.0.2501")]
[assembly: NeutralResourcesLanguageAttribute("en")]

View file

@ -1,5 +1,6 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Resources;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
@ -33,3 +34,4 @@ using System.Runtime.InteropServices;
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: NeutralResourcesLanguageAttribute("en")]

View file

@ -1,5 +1,6 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Resources;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
@ -29,3 +30,4 @@ using System.Runtime.InteropServices;
// Revision // Revision
// //
[assembly: AssemblyVersion("2.14.0.2501")] [assembly: AssemblyVersion("2.14.0.2501")]
[assembly: NeutralResourcesLanguageAttribute("en")]

View file

@ -1,5 +1,6 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Resources;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
@ -32,3 +33,4 @@ using System.Runtime.InteropServices;
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: NeutralResourcesLanguageAttribute("en")]

View file

@ -1,5 +1,6 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Resources;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
@ -33,3 +34,4 @@ using System.Runtime.InteropServices;
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: NeutralResourcesLanguageAttribute("en")]

View file

@ -1,5 +1,6 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Resources;
// Allgemeine Informationen über eine Assembly werden über die folgenden // Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
@ -33,3 +34,4 @@ using System.Runtime.InteropServices;
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("0.1.0.0")] [assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: NeutralResourcesLanguageAttribute("en")]

View file

@ -1,5 +1,6 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Resources;
// Управление общими сведениями о сборке осуществляется с помощью // Управление общими сведениями о сборке осуществляется с помощью
// набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения, // набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения,
@ -33,3 +34,4 @@ using System.Runtime.InteropServices;
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: NeutralResourcesLanguageAttribute("en")]

View file

@ -1,5 +1,6 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Resources;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
@ -32,3 +33,4 @@ using System.Runtime.InteropServices;
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: NeutralResourcesLanguageAttribute("en")]

View file

@ -1,5 +1,6 @@
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Resources;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
@ -33,3 +34,4 @@ using System.Runtime.InteropServices;
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: NeutralResourcesLanguageAttribute("en")]