mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-31 04:40:55 +00:00
This commit is contained in:
parent
d59f65d5dc
commit
1d46b7d654
12 changed files with 178 additions and 35 deletions
|
@ -71,7 +71,8 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
if(!isdisposed)
|
if(!isdisposed)
|
||||||
{
|
{
|
||||||
// Clean up
|
// Clean up
|
||||||
|
Unload();
|
||||||
|
|
||||||
// Done
|
// Done
|
||||||
isdisposed = true;
|
isdisposed = true;
|
||||||
}
|
}
|
||||||
|
@ -81,6 +82,31 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
|
|
||||||
#region ================== Loading / Unloading
|
#region ================== Loading / Unloading
|
||||||
|
|
||||||
|
// This loads all data resources
|
||||||
|
public void Load(DataLocationList configlist, DataLocationList maplist, DataLocation maplocation)
|
||||||
|
{
|
||||||
|
DataLocationList all;
|
||||||
|
|
||||||
|
// Create complete list
|
||||||
|
all = DataLocationList.Combined(configlist, maplist);
|
||||||
|
all.Add(maplocation);
|
||||||
|
|
||||||
|
// Load resources
|
||||||
|
Load(all);
|
||||||
|
}
|
||||||
|
|
||||||
|
// This loads all data resources
|
||||||
|
public void Load(DataLocationList configlist, DataLocationList maplist)
|
||||||
|
{
|
||||||
|
DataLocationList all;
|
||||||
|
|
||||||
|
// Create complete list
|
||||||
|
all = DataLocationList.Combined(configlist, maplist);
|
||||||
|
|
||||||
|
// Load resources
|
||||||
|
Load(all);
|
||||||
|
}
|
||||||
|
|
||||||
// This loads all data resources
|
// This loads all data resources
|
||||||
public void Load(DataLocationList locations)
|
public void Load(DataLocationList locations)
|
||||||
{
|
{
|
||||||
|
@ -91,7 +117,7 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
{
|
{
|
||||||
// Nothing chosen yet
|
// Nothing chosen yet
|
||||||
c = null;
|
c = null;
|
||||||
|
|
||||||
// Choose container type
|
// Choose container type
|
||||||
switch(dl.type)
|
switch(dl.type)
|
||||||
{
|
{
|
||||||
|
@ -125,6 +151,44 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
containers.Clear();
|
containers.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This suspends a data resource location
|
||||||
|
public void SuspendLocation(string location)
|
||||||
|
{
|
||||||
|
// Go for all containers
|
||||||
|
foreach(IDataReader d in containers)
|
||||||
|
{
|
||||||
|
// Check if this is the location to suspend
|
||||||
|
if(string.Compare(d.Location, location, true) == 0)
|
||||||
|
{
|
||||||
|
// Suspend
|
||||||
|
General.WriteLogLine("Suspended data resource '" + location + "'");
|
||||||
|
d.Suspend();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
General.WriteLogLine("WARNING: Cannot suspended data resource '" + location + "', no such location opened!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// This resume a data resource location
|
||||||
|
public void ResumeLocation(string location)
|
||||||
|
{
|
||||||
|
// Go for all containers
|
||||||
|
foreach(IDataReader d in containers)
|
||||||
|
{
|
||||||
|
// Check if this is the location to resume
|
||||||
|
if(string.Compare(d.Location, location, true) == 0)
|
||||||
|
{
|
||||||
|
// Resume
|
||||||
|
General.WriteLogLine("Resumed data resource '" + location + "'");
|
||||||
|
d.Resume();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
General.WriteLogLine("WARNING: Cannot resume data resource '" + location + "', no such location opened!");
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,16 +42,17 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
private string path;
|
private string path;
|
||||||
private bool readtextures;
|
private bool readtextures;
|
||||||
private bool readflats;
|
private bool readflats;
|
||||||
|
|
||||||
// Disposing
|
private bool issuspended = false;
|
||||||
private bool isdisposed = false;
|
private bool isdisposed = false;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ================== Properties
|
#region ================== Properties
|
||||||
|
|
||||||
// Disposing
|
public string Location { get { return path; } }
|
||||||
public bool IsDisposed { get { return isdisposed; } }
|
public bool IsDisposed { get { return isdisposed; } }
|
||||||
|
public bool IsSuspended { get { return issuspended; } }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -64,7 +65,9 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
this.path = dl.location;
|
this.path = dl.location;
|
||||||
this.readtextures = dl.textures;
|
this.readtextures = dl.textures;
|
||||||
this.readflats = dl.flats;
|
this.readflats = dl.flats;
|
||||||
|
|
||||||
|
General.WriteLogLine("Opening directory resource '" + dl.location + "'");
|
||||||
|
|
||||||
// We have no destructor
|
// We have no destructor
|
||||||
GC.SuppressFinalize(this);
|
GC.SuppressFinalize(this);
|
||||||
}
|
}
|
||||||
|
@ -75,6 +78,8 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
// Not already disposed?
|
// Not already disposed?
|
||||||
if(!isdisposed)
|
if(!isdisposed)
|
||||||
{
|
{
|
||||||
|
General.WriteLogLine("Closing directory resource '" + path + "'");
|
||||||
|
|
||||||
// Clean up
|
// Clean up
|
||||||
|
|
||||||
// Done
|
// Done
|
||||||
|
@ -84,6 +89,22 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region ================== Management
|
||||||
|
|
||||||
|
// This suspends use of this resource
|
||||||
|
public void Suspend()
|
||||||
|
{
|
||||||
|
issuspended = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// This resumes use of this resource
|
||||||
|
public void Resume()
|
||||||
|
{
|
||||||
|
issuspended = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region ================== Textures
|
#region ================== Textures
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
#region ================== Variables
|
#region ================== Variables
|
||||||
|
|
||||||
private IDataReader source;
|
private IDataReader source;
|
||||||
private int lumpindex;
|
private string lumpname;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -26,11 +26,11 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
#region ================== Constructor / Disposer
|
#region ================== Constructor / Disposer
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
public FlatImage(string name, IDataReader source, int lumpindex)
|
public FlatImage(string name, IDataReader source, string lumpname)
|
||||||
{
|
{
|
||||||
// Initialize
|
// Initialize
|
||||||
this.source = source;
|
this.source = source;
|
||||||
this.lumpindex = lumpindex;
|
this.lumpname = lumpname;
|
||||||
SetName(name);
|
SetName(name);
|
||||||
|
|
||||||
// We have no destructor
|
// We have no destructor
|
||||||
|
|
|
@ -34,9 +34,13 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
internal unsafe interface IDataReader : IDisposable
|
internal unsafe interface IDataReader : IDisposable
|
||||||
{
|
{
|
||||||
// Properties
|
// Properties
|
||||||
|
string Location { get; }
|
||||||
bool IsDisposed { get; }
|
bool IsDisposed { get; }
|
||||||
|
bool IsSuspended { get; }
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
void Dispose();
|
void Dispose();
|
||||||
|
void Suspend();
|
||||||
|
void Resume();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
#region ================== Variables
|
#region ================== Variables
|
||||||
|
|
||||||
private IDataReader source;
|
private IDataReader source;
|
||||||
private int lumpindex;
|
private string lumpname;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -26,11 +26,11 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
#region ================== Constructor / Disposer
|
#region ================== Constructor / Disposer
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
public SpriteImage(string name, IDataReader source, int lumpindex)
|
public SpriteImage(string name, IDataReader source, string lumpname)
|
||||||
{
|
{
|
||||||
// Initialize
|
// Initialize
|
||||||
this.source = source;
|
this.source = source;
|
||||||
this.lumpindex = lumpindex;
|
this.lumpname = lumpname;
|
||||||
SetName(name);
|
SetName(name);
|
||||||
|
|
||||||
// We have no destructor
|
// We have no destructor
|
||||||
|
|
|
@ -33,7 +33,7 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
internal struct TexturePatch
|
internal struct TexturePatch
|
||||||
{
|
{
|
||||||
private IDataReader source;
|
private IDataReader source;
|
||||||
private int lumpindex;
|
private string lumpname;
|
||||||
private Point position;
|
private Point position;
|
||||||
private Size size;
|
private Size size;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,17 +40,19 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
|
|
||||||
// Source
|
// Source
|
||||||
private WAD file;
|
private WAD file;
|
||||||
|
private string location;
|
||||||
private bool managefile;
|
private bool managefile;
|
||||||
|
|
||||||
// Disposing
|
private bool issuspended = false;
|
||||||
private bool isdisposed = false;
|
private bool isdisposed = false;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ================== Properties
|
#region ================== Properties
|
||||||
|
|
||||||
// Disposing
|
public string Location { get { return location; } }
|
||||||
public bool IsDisposed { get { return isdisposed; } }
|
public bool IsDisposed { get { return isdisposed; } }
|
||||||
|
public bool IsSuspended { get { return issuspended; } }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -60,9 +62,12 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
public WADReader(DataLocation dl)
|
public WADReader(DataLocation dl)
|
||||||
{
|
{
|
||||||
// Initialize
|
// Initialize
|
||||||
file = new WAD(dl.location, true);
|
this.location = dl.location;
|
||||||
|
file = new WAD(location, true);
|
||||||
managefile = true;
|
managefile = true;
|
||||||
|
|
||||||
|
General.WriteLogLine("Opening WAD resource '" + file.Filename + "'");
|
||||||
|
|
||||||
// We have no destructor
|
// We have no destructor
|
||||||
GC.SuppressFinalize(this);
|
GC.SuppressFinalize(this);
|
||||||
}
|
}
|
||||||
|
@ -74,6 +79,8 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
file = wadfile;
|
file = wadfile;
|
||||||
managefile = false;
|
managefile = false;
|
||||||
|
|
||||||
|
General.WriteLogLine("Opening WAD resource '" + file.Filename + "' (file already open)");
|
||||||
|
|
||||||
// We have no destructor
|
// We have no destructor
|
||||||
GC.SuppressFinalize(this);
|
GC.SuppressFinalize(this);
|
||||||
}
|
}
|
||||||
|
@ -84,6 +91,8 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
// Not already disposed?
|
// Not already disposed?
|
||||||
if(!isdisposed)
|
if(!isdisposed)
|
||||||
{
|
{
|
||||||
|
General.WriteLogLine("Closing WAD resource '" + file.Filename + "'");
|
||||||
|
|
||||||
// Clean up
|
// Clean up
|
||||||
if(managefile) file.Dispose();
|
if(managefile) file.Dispose();
|
||||||
|
|
||||||
|
@ -94,7 +103,25 @@ namespace CodeImp.DoomBuilder.Data
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ================== Methods
|
#region ================== Management
|
||||||
|
|
||||||
|
// This suspends use of this resource
|
||||||
|
public void Suspend()
|
||||||
|
{
|
||||||
|
issuspended = true;
|
||||||
|
if(managefile) file.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
// This resumes use of this resource
|
||||||
|
public void Resume()
|
||||||
|
{
|
||||||
|
issuspended = false;
|
||||||
|
if(managefile) file = new WAD(location, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region ================== Textures
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,8 +77,8 @@ namespace CodeImp.DoomBuilder.Editing
|
||||||
{
|
{
|
||||||
if(renderer.StartRendering())
|
if(renderer.StartRendering())
|
||||||
{
|
{
|
||||||
renderer.RenderLinedefs(General.Map.Data, General.Map.Data.Linedefs);
|
renderer.RenderLinedefs(General.Map.Map, General.Map.Map.Linedefs);
|
||||||
renderer.RenderVertices(General.Map.Data, General.Map.Data.Vertices);
|
renderer.RenderVertices(General.Map.Map, General.Map.Map.Vertices);
|
||||||
renderer.FinishRendering();
|
renderer.FinishRendering();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -175,7 +175,7 @@ namespace CodeImp.DoomBuilder.Editing
|
||||||
// Zoom now
|
// Zoom now
|
||||||
renderer.PositionView(renderer.OffsetX - diff.x, renderer.OffsetY + diff.y);
|
renderer.PositionView(renderer.OffsetX - diff.x, renderer.OffsetY + diff.y);
|
||||||
renderer.ScaleView(newscale);
|
renderer.ScaleView(newscale);
|
||||||
General.Map.Data.Update();
|
General.Map.Map.Update();
|
||||||
General.MainWindow.RedrawDisplay();
|
General.MainWindow.RedrawDisplay();
|
||||||
|
|
||||||
// Determine new unprojected mouse coordinates
|
// Determine new unprojected mouse coordinates
|
||||||
|
@ -188,7 +188,7 @@ namespace CodeImp.DoomBuilder.Editing
|
||||||
{
|
{
|
||||||
// Zoom now
|
// Zoom now
|
||||||
renderer.ScaleView(newscale);
|
renderer.ScaleView(newscale);
|
||||||
General.Map.Data.Update();
|
General.Map.Map.Update();
|
||||||
General.MainWindow.RedrawDisplay();
|
General.MainWindow.RedrawDisplay();
|
||||||
|
|
||||||
// Determine new unprojected mouse coordinates
|
// Determine new unprojected mouse coordinates
|
||||||
|
@ -207,7 +207,7 @@ namespace CodeImp.DoomBuilder.Editing
|
||||||
float width, height;
|
float width, height;
|
||||||
|
|
||||||
// Go for all vertices
|
// Go for all vertices
|
||||||
foreach(Vertex v in General.Map.Data.Vertices)
|
foreach(Vertex v in General.Map.Map.Vertices)
|
||||||
{
|
{
|
||||||
// Adjust boundaries by vertices
|
// Adjust boundaries by vertices
|
||||||
if(v.Position.x < left) left = v.Position.x;
|
if(v.Position.x < left) left = v.Position.x;
|
||||||
|
@ -228,7 +228,7 @@ namespace CodeImp.DoomBuilder.Editing
|
||||||
// Change the view to see the whole map
|
// Change the view to see the whole map
|
||||||
renderer.ScaleView(scale);
|
renderer.ScaleView(scale);
|
||||||
renderer.PositionView(left + (right - left) * 0.5f, top + (bottom - top) * 0.5f);
|
renderer.PositionView(left + (right - left) * 0.5f, top + (bottom - top) * 0.5f);
|
||||||
General.Map.Data.Update();
|
General.Map.Map.Update();
|
||||||
General.MainWindow.RedrawDisplay();
|
General.MainWindow.RedrawDisplay();
|
||||||
|
|
||||||
// Determine new unprojected mouse coordinates
|
// Determine new unprojected mouse coordinates
|
||||||
|
|
|
@ -30,6 +30,7 @@ using CodeImp.DoomBuilder.Map;
|
||||||
using CodeImp.DoomBuilder.Editing;
|
using CodeImp.DoomBuilder.Editing;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using CodeImp.DoomBuilder.Rendering;
|
using CodeImp.DoomBuilder.Rendering;
|
||||||
|
using CodeImp.DoomBuilder.Data;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -51,10 +52,11 @@ namespace CodeImp.DoomBuilder
|
||||||
// Map information
|
// Map information
|
||||||
private string filetitle;
|
private string filetitle;
|
||||||
private string filepathname;
|
private string filepathname;
|
||||||
private MapSet data;
|
private MapSet map;
|
||||||
private MapOptions options;
|
private MapOptions options;
|
||||||
private ConfigurationInfo configinfo;
|
private ConfigurationInfo configinfo;
|
||||||
private Configuration config;
|
private Configuration config;
|
||||||
|
private DataManager data;
|
||||||
private EditMode mode;
|
private EditMode mode;
|
||||||
private D3DGraphics graphics;
|
private D3DGraphics graphics;
|
||||||
private WAD tempwad;
|
private WAD tempwad;
|
||||||
|
@ -69,7 +71,7 @@ namespace CodeImp.DoomBuilder
|
||||||
public string FilePathName { get { return filepathname; } }
|
public string FilePathName { get { return filepathname; } }
|
||||||
public string FileTitle { get { return filetitle; } }
|
public string FileTitle { get { return filetitle; } }
|
||||||
public MapOptions Options { get { return options; } }
|
public MapOptions Options { get { return options; } }
|
||||||
public MapSet Data { get { return data; } }
|
public MapSet Map { get { return map; } }
|
||||||
public EditMode Mode { get { return mode; } }
|
public EditMode Mode { get { return mode; } }
|
||||||
public bool IsChanged { get { return changed; } set { changed = value; } }
|
public bool IsChanged { get { return changed; } set { changed = value; } }
|
||||||
public bool IsDisposed { get { return isdisposed; } }
|
public bool IsDisposed { get { return isdisposed; } }
|
||||||
|
@ -93,12 +95,19 @@ namespace CodeImp.DoomBuilder
|
||||||
if(!isdisposed)
|
if(!isdisposed)
|
||||||
{
|
{
|
||||||
// Dispose
|
// Dispose
|
||||||
tempwad.Dispose();
|
General.WriteLogLine("Unloading data resources...");
|
||||||
data.Dispose();
|
data.Dispose();
|
||||||
|
General.WriteLogLine("Closing temporary file...");
|
||||||
|
tempwad.Dispose();
|
||||||
|
General.WriteLogLine("Unloading map data...");
|
||||||
|
map.Dispose();
|
||||||
|
General.WriteLogLine("Stopping edit mode...");
|
||||||
mode.Dispose();
|
mode.Dispose();
|
||||||
|
General.WriteLogLine("Stopping graphics device...");
|
||||||
graphics.Dispose();
|
graphics.Dispose();
|
||||||
|
|
||||||
// Remove temp file
|
// Remove temp file
|
||||||
|
General.WriteLogLine("Removing temporary file...");
|
||||||
try { File.Delete(tempwad.Filename); } catch(Exception) { }
|
try { File.Delete(tempwad.Filename); } catch(Exception) { }
|
||||||
|
|
||||||
// We may spend some time to clean things up here
|
// We may spend some time to clean things up here
|
||||||
|
@ -137,13 +146,18 @@ namespace CodeImp.DoomBuilder
|
||||||
config = General.LoadGameConfiguration(options.ConfigFile);
|
config = General.LoadGameConfiguration(options.ConfigFile);
|
||||||
|
|
||||||
// Create map data
|
// Create map data
|
||||||
data = new MapSet();
|
map = new MapSet();
|
||||||
|
|
||||||
// Create temp wadfile
|
// Create temp wadfile
|
||||||
tempfile = General.MakeTempFilename();
|
tempfile = General.MakeTempFilename();
|
||||||
General.WriteLogLine("Creating temporary file: " + tempfile);
|
General.WriteLogLine("Creating temporary file: " + tempfile);
|
||||||
tempwad = new WAD(tempfile);
|
tempwad = new WAD(tempfile);
|
||||||
|
|
||||||
|
// Load data manager
|
||||||
|
General.WriteLogLine("Loading data resources...");
|
||||||
|
data = new DataManager();
|
||||||
|
data.Load(configinfo.Resources, options.Resources);
|
||||||
|
|
||||||
// Set default mode
|
// Set default mode
|
||||||
ChangeMode(typeof(FrozenOverviewMode));
|
ChangeMode(typeof(FrozenOverviewMode));
|
||||||
|
|
||||||
|
@ -159,6 +173,7 @@ namespace CodeImp.DoomBuilder
|
||||||
MapSetIO mapio;
|
MapSetIO mapio;
|
||||||
string tempfile;
|
string tempfile;
|
||||||
string iointerface;
|
string iointerface;
|
||||||
|
DataLocation maplocation;
|
||||||
|
|
||||||
// Apply settings
|
// Apply settings
|
||||||
this.filetitle = Path.GetFileName(filepathname);
|
this.filetitle = Path.GetFileName(filepathname);
|
||||||
|
@ -179,7 +194,7 @@ namespace CodeImp.DoomBuilder
|
||||||
config = General.LoadGameConfiguration(options.ConfigFile);
|
config = General.LoadGameConfiguration(options.ConfigFile);
|
||||||
|
|
||||||
// Create map data
|
// Create map data
|
||||||
data = new MapSet();
|
map = new MapSet();
|
||||||
|
|
||||||
// Create temp wadfile
|
// Create temp wadfile
|
||||||
tempfile = General.MakeTempFilename();
|
tempfile = General.MakeTempFilename();
|
||||||
|
@ -203,10 +218,16 @@ namespace CodeImp.DoomBuilder
|
||||||
General.WriteLogLine("Initializing map format interface " + iointerface + "...");
|
General.WriteLogLine("Initializing map format interface " + iointerface + "...");
|
||||||
mapio = MapSetIO.Create(iointerface, tempwad);
|
mapio = MapSetIO.Create(iointerface, tempwad);
|
||||||
General.WriteLogLine("Reading map data...");
|
General.WriteLogLine("Reading map data...");
|
||||||
data = mapio.Read(data, TEMP_MAP_HEADER);
|
map = mapio.Read(map, TEMP_MAP_HEADER);
|
||||||
|
|
||||||
// Update structures
|
// Update structures
|
||||||
data.Update();
|
map.Update();
|
||||||
|
|
||||||
|
// Load data manager
|
||||||
|
General.WriteLogLine("Loading data resources...");
|
||||||
|
data = new DataManager();
|
||||||
|
maplocation = new DataLocation(DataLocation.RESOURCE_WAD, filepathname, false, false);
|
||||||
|
data.Load(configinfo.Resources, options.Resources, maplocation);
|
||||||
|
|
||||||
// Set default mode
|
// Set default mode
|
||||||
ChangeMode(typeof(FrozenOverviewMode));
|
ChangeMode(typeof(FrozenOverviewMode));
|
||||||
|
@ -270,9 +291,14 @@ namespace CodeImp.DoomBuilder
|
||||||
if(lump != null)
|
if(lump != null)
|
||||||
{
|
{
|
||||||
// Copy the lump to the target
|
// Copy the lump to the target
|
||||||
|
General.WriteLogLine(ml.Key.ToString() + " copying");
|
||||||
newlump = target.Insert(ml.Key.ToString(), tgtindex++, lump.Length);
|
newlump = target.Insert(ml.Key.ToString(), tgtindex++, lump.Length);
|
||||||
lump.CopyTo(newlump);
|
lump.CopyTo(newlump);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
General.WriteLogLine("WARNING: " + ml.Key.ToString() + " should be copied but was not found!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -307,11 +333,12 @@ namespace CodeImp.DoomBuilder
|
||||||
lumpnodebuild = config.ReadSetting("maplumpnames." + nextlumpname + ".nodebuild", false);
|
lumpnodebuild = config.ReadSetting("maplumpnames." + nextlumpname + ".nodebuild", false);
|
||||||
lumpscript = config.ReadSetting("maplumpnames." + nextlumpname + ".script", "");
|
lumpscript = config.ReadSetting("maplumpnames." + nextlumpname + ".script", "");
|
||||||
|
|
||||||
// Check if this lump will be copied from source
|
// Check if this lump will be removed from target
|
||||||
if((lumprequired && copyrequired) || (lumpblindcopy && copyblindcopy) ||
|
if((lumprequired && copyrequired) || (lumpblindcopy && copyblindcopy) ||
|
||||||
(lumpnodebuild && copynodebuild) || ((lumpscript != "") && copyscript))
|
(lumpnodebuild && copynodebuild) || ((lumpscript != "") && copyscript))
|
||||||
{
|
{
|
||||||
// Then remove it from target
|
// Then remove it from target
|
||||||
|
General.WriteLogLine(nextlumpname + " removing");
|
||||||
source.RemoveAt(index);
|
source.RemoveAt(index);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -172,7 +172,7 @@ namespace CodeImp.DoomBuilder.Map
|
||||||
resources.Clear();
|
resources.Clear();
|
||||||
resources.AddRange(fromlist);
|
resources.AddRange(fromlist);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This displays the current map name
|
// This displays the current map name
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
|
|
|
@ -172,7 +172,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
||||||
General.MainWindow.UpdateZoom(scale);
|
General.MainWindow.UpdateZoom(scale);
|
||||||
|
|
||||||
// Recalculate linedefs (normal lengths must be adjusted)
|
// Recalculate linedefs (normal lengths must be adjusted)
|
||||||
foreach(Linedef l in General.Map.Data.Linedefs) l.NeedUpdate();
|
foreach(Linedef l in General.Map.Map.Linedefs) l.NeedUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
// This unprojects mouse coordinates into map coordinates
|
// This unprojects mouse coordinates into map coordinates
|
||||||
|
|
Loading…
Reference in a new issue