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

View file

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

View file

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

View file

@ -71,7 +71,6 @@ namespace CodeImp.DoomBuilder.Plugins
try try
{ {
// Load assembly // Load assembly
//asm = Assembly.LoadFile(filename); //mxd
asm = Assembly.LoadFrom(filename); asm = Assembly.LoadFrom(filename);
} }
catch(Exception) catch(Exception)
@ -95,8 +94,30 @@ namespace CodeImp.DoomBuilder.Plugins
plug = CreateObject<Plug>(t); plug = CreateObject<Plug>(t);
plug.Plugin = this; plug.Plugin = this;
// Verify minimum revision number // Verify revision numbers
int thisrevision = General.ThisAssembly.GetName().Version.Revision; 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)) if((thisrevision != 0) && (plug.MinimumRevision > thisrevision))
{ {
// Can't load this plugin because it is meant for a newer version // 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 // Build Number
// Revision // 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 (stream.Length == 0)
{ {
if (!string.IsNullOrEmpty(sourcename)) if (!string.IsNullOrEmpty(sourcename) && sourcename != sourcefilename)
{
LogWarning("Include file \"" + sourcefilename + "\" is empty"); LogWarning("Include file \"" + sourcefilename + "\" is empty");
}
else else
{
sourcename = sourcefilename; // LogWarning() needs "sourcename" property to properly log the warning...
LogWarning("File is empty"); LogWarning("File is empty");
return true; }
} }
datastream = stream; datastream = stream;
@ -525,9 +529,9 @@ namespace CodeImp.DoomBuilder.ZDoom
//mxd. This adds a warning to the ErrorLogger //mxd. This adds a warning to the ErrorLogger
protected internal void LogWarning(string message) protected internal void LogWarning(string message)
{ {
// Add a warning // Add a warning
int errline = GetCurrentLineNumber(); int errline = (datastream != null ? GetCurrentLineNumber() : CompilerError.NO_LINE_NUMBER);
General.ErrorLogger.Add(ErrorType.Warning, GetLanguageType() + " warning in '" + sourcename General.ErrorLogger.Add(ErrorType.Warning, GetLanguageType() + " warning in '" + sourcename
+ (errline != CompilerError.NO_LINE_NUMBER ? "', line " + (errline + 1) : "'") + ". " + (errline != CompilerError.NO_LINE_NUMBER ? "', line " + (errline + 1) : "'") + ". "
+ message + "."); + message + ".");
} }

View file

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

View file

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