Merged in GZDB r2480.

This commit is contained in:
MascaraSnake 2016-01-23 09:58:05 +01:00
parent 2e4150b3b4
commit 04527b3230
8 changed files with 81 additions and 52 deletions

View File

@ -381,8 +381,8 @@ namespace CodeImp.DoomBuilder.Data
while(lumpindex > -1)
{
MemoryStream filedata = new MemoryStream(file.Lumps[lumpindex].Stream.ReadAllBytes());
WADReader.LoadHighresTextures(filedata, "TEXTURES", ref images, null, null);
filedata.Dispose();
WADReader.LoadHighresTextures(filedata, Path.Combine(Path.GetFileName(file.Filename), "TEXTURES#" + lumpindex), ref images, null, null);
filedata.Dispose();
// Find next
lumpindex = file.FindLumpIndex("TEXTURES", lumpindex + 1);
@ -611,8 +611,8 @@ namespace CodeImp.DoomBuilder.Data
while(lumpindex > -1)
{
MemoryStream filedata = new MemoryStream(file.Lumps[lumpindex].Stream.ReadAllBytes());
WADReader.LoadHighresFlats(filedata, "TEXTURES", ref images, null, null);
filedata.Dispose();
WADReader.LoadHighresFlats(filedata, Path.Combine(Path.GetFileName(file.Filename), "TEXTURES#" + lumpindex), ref images, null, null);
filedata.Dispose();
// Find next
lumpindex = file.FindLumpIndex("TEXTURES", lumpindex + 1);
@ -676,8 +676,8 @@ namespace CodeImp.DoomBuilder.Data
while(lumpindex > -1)
{
MemoryStream filedata = new MemoryStream(file.Lumps[lumpindex].Stream.ReadAllBytes());
WADReader.LoadHighresSprites(filedata, "TEXTURES", ref images, null, null);
filedata.Dispose();
WADReader.LoadHighresSprites(filedata, Path.Combine(Path.GetFileName(file.Filename), "TEXTURES#" + lumpindex), ref images, null, null);
filedata.Dispose();
// Find next
lumpindex = file.FindLumpIndex("TEXTURES", lumpindex + 1);

View File

@ -1021,18 +1021,18 @@ namespace CodeImp.DoomBuilder
// Unbind static methods from actions
General.Actions.UnbindMethods(typeof(General));
// Save colors
colors.SaveColors(settings.Config);
// Save action controls
actions.SaveSettings();
// Save game configuration settings
foreach(ConfigurationInfo ci in configs) ci.SaveSettings();
// Save settings configuration
if(!General.NoSettings)
// Save colors
if (colors != null) colors.SaveColors(settings.Config);
// Save action controls
actions.SaveSettings();
// Save game configuration settings
if (configs != null) foreach (ConfigurationInfo ci in configs) ci.SaveSettings();
// Save settings configuration
if (!General.NoSettings)
settings.Save(Path.Combine(settingspath, SETTINGS_FILE));
// Clean up

View File

@ -51,27 +51,32 @@ namespace CodeImp.DoomBuilder.Plugins
/// </summary>
public virtual string Name { get { return plugin.Name; } }
/// <summary>
/// Override this to return the minimum revision of the Doom Builder 2 core that is
/// required to use this plugin. You can find the revision number in the About dialog,
/// it is the right most part of the version number.
/// </summary>
public virtual int MinimumRevision { get { return 0; } }
#endregion
/// <summary>
/// Override this to return the minimum revision of the Zone Builder core that is
/// required to use this plugin. You can find the revision number in the About dialog,
/// it is the right most part of the version number.
/// </summary>
public virtual int MinimumRevision { get { return 0; } }
#region ================== Constructor / Disposer
/// <summary>
/// Set to true to indicate that plugin revision number must match the main module revision number.
/// </summary>
public virtual bool StrictRevisionMatching { get { return false; } } //mxd
/// <summary>
/// This is the key link between the Doom Builder core and the plugin.
/// Every plugin must expose a single class that inherits this class.
/// <para>
/// NOTE: Some methods cannot be used in this constructor, because the plugin
/// is not yet fully initialized. Instead, use the Initialize method to do
/// your initializations.
/// </para>
/// </summary>
public Plug()
#endregion
#region ================== Constructor / Disposer
/// <summary>
/// This is the key link between the Doom Builder core and the plugin.
/// Every plugin must expose a single class that inherits this class.
/// <para>
/// NOTE: Some methods cannot be used in this constructor, because the plugin
/// is not yet fully initialized. Instead, use the Initialize method to do
/// your initializations.
/// </para>
/// </summary>
public Plug()
{
// Initialize

View File

@ -71,7 +71,6 @@ namespace CodeImp.DoomBuilder.Plugins
try
{
// Load assembly
//asm = Assembly.LoadFile(filename); //mxd
asm = Assembly.LoadFrom(filename);
}
catch(Exception)
@ -95,8 +94,30 @@ namespace CodeImp.DoomBuilder.Plugins
plug = CreateObject<Plug>(t);
plug.Plugin = this;
// Verify minimum revision number
int thisrevision = General.ThisAssembly.GetName().Version.Revision;
// Verify revision numbers
int thisrevision = General.ThisAssembly.GetName().Version.Revision;
//mxd. Revision numbers should match?
if (plug.StrictRevisionMatching && plug.MinimumRevision != thisrevision)
{
string message = shortfilename + " plugin's assembly version (" + plug.MinimumRevision + ") doesn't match main module version (" + thisrevision + ").";
if (General.ShowWarningMessage(message + Environment.NewLine +
"It's strongly recomended to update the editor." + Environment.NewLine +
"Program stability is not guaranteed." + Environment.NewLine + Environment.NewLine +
"Continue anyway?", MessageBoxButtons.YesNo, MessageBoxDefaultButton.Button2, false) == DialogResult.No)
{
General.WriteLogLine("Quiting on " + shortfilename + " module version mismatch");
General.Exit(General.Map != null);
return;
}
else
{
General.ErrorLogger.Add(ErrorType.Warning, message);
throw new InvalidProgramException();
}
}
// Verify minimum revision number
if((thisrevision != 0) && (plug.MinimumRevision > thisrevision))
{
// Can't load this plugin because it is meant for a newer version

View File

@ -28,4 +28,4 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.1.0.2462")]
[assembly: AssemblyVersion("1.1.0.2480")]

View File

@ -97,11 +97,15 @@ namespace CodeImp.DoomBuilder.ZDoom
if (stream.Length == 0)
{
if (!string.IsNullOrEmpty(sourcename))
if (!string.IsNullOrEmpty(sourcename) && sourcename != sourcefilename)
{
LogWarning("Include file \"" + sourcefilename + "\" is empty");
}
else
{
sourcename = sourcefilename; // LogWarning() needs "sourcename" property to properly log the warning...
LogWarning("File is empty");
return true;
}
}
datastream = stream;
@ -525,9 +529,9 @@ namespace CodeImp.DoomBuilder.ZDoom
//mxd. This adds a warning to the ErrorLogger
protected internal void LogWarning(string message)
{
// Add a warning
int errline = GetCurrentLineNumber();
General.ErrorLogger.Add(ErrorType.Warning, GetLanguageType() + " warning in '" + sourcename
// Add a warning
int errline = (datastream != null ? GetCurrentLineNumber() : CompilerError.NO_LINE_NUMBER);
General.ErrorLogger.Add(ErrorType.Warning, GetLanguageType() + " warning in '" + sourcename
+ (errline != CompilerError.NO_LINE_NUMBER ? "', line " + (errline + 1) : "'") + ". "
+ message + ".");
}

View File

@ -138,10 +138,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
public override string Name { get { return "Zone Builder"; } } //mxd
public static BuilderPlug Me { get { return me; } }
// It is only safe to do this dynamically because we compile and distribute both
// the core and this plugin together with the same revision number! In third party
// plugins this should just contain a fixed number.
public override int MinimumRevision { get { return Assembly.GetExecutingAssembly().GetName().Version.Revision; } }
//mxd. BuilderModes.dll revision should always match the main module revision
public override bool StrictRevisionMatching { get { return true; } }
public override int MinimumRevision { get { return Assembly.GetExecutingAssembly().GetName().Version.Revision; } }
public MenusForm MenusForm { get { return menusform; } }
public CurveLinedefsForm CurveLinedefsForm { get { return curvelinedefsform ?? (curvelinedefsform = new CurveLinedefsForm()); } }

View File

@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("CodeImp, MaxED")]
[assembly: AssemblyProduct("Doom Builder")]
[assembly: AssemblyCopyright("Copyright © 2007, 2014")]
[assembly: AssemblyCopyright("Copyright © 2007, 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@ -28,4 +28,4 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.3.0.1885")]
[assembly: AssemblyVersion("2.3.0.2480")]