From 0cc6cf2e64ff5d29703d42446536d9ef7165582c Mon Sep 17 00:00:00 2001 From: ZZYZX <zzyzx@virtual> Date: Tue, 14 Feb 2017 11:57:46 +0200 Subject: [PATCH] Internal: removed now unneeded CopyAllLumpsExceptMap --- Source/Core/General/MapManager.cs | 47 ------------------------------- 1 file changed, 47 deletions(-) diff --git a/Source/Core/General/MapManager.cs b/Source/Core/General/MapManager.cs index a7c0ee69..bb557754 100644 --- a/Source/Core/General/MapManager.cs +++ b/Source/Core/General/MapManager.cs @@ -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, -- GitLab