mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2024-11-10 06:41:49 +00:00
Internal: removed now unneeded CopyAllLumpsExceptMap
This commit is contained in:
parent
ec90554cf4
commit
0cc6cf2e64
1 changed files with 0 additions and 47 deletions
|
@ -1432,53 +1432,6 @@ namespace CodeImp.DoomBuilder
|
|||
foreach(Lump lump in toRemove) target.Remove(lump);
|
||||
}
|
||||
|
||||
// This copies all lumps, except those of a specific map. mxd. Returns the index of skipped map's header lump
|
||||
private static int CopyAllLumpsExceptMap(WAD source, WAD target, GameConfiguration mapconfig, string sourcemapname)
|
||||
{
|
||||
// Go for all lumps
|
||||
bool skipping = false;
|
||||
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
|
||||
if(skipping)
|
||||
{
|
||||
//mxd
|
||||
string srclumpname = srclump.Name;
|
||||
if(srclumpname.Contains(sourcemapname)) srclumpname = srclumpname.Replace(sourcemapname, CONFIG_MAP_HEADER);
|
||||
|
||||
if(!mapconfig.MapLumps.ContainsKey(srclumpname))
|
||||
{
|
||||
// Stop skipping
|
||||
skipping = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if we should start skipping lumps here
|
||||
//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!
|
||||
skipping = true;
|
||||
headerpos = i;
|
||||
}
|
||||
|
||||
// Not skipping this lump?
|
||||
if(!skipping)
|
||||
{
|
||||
// Copy lump over!
|
||||
Lump tgtlump = target.Insert(srclump.Name, target.Lumps.Count, srclump.Length, false);
|
||||
srclump.CopyTo(tgtlump);
|
||||
}
|
||||
}
|
||||
|
||||
target.WriteHeaders(); //mxd
|
||||
|
||||
return headerpos;
|
||||
}
|
||||
|
||||
// This copies specific map lumps from one WAD to another
|
||||
private void CopyLumpsByType(WAD source, string sourcemapname,
|
||||
WAD target, string targetmapname,
|
||||
|
|
Loading…
Reference in a new issue