Fixed, Script Editor: in some cases includes list was not updated before trying to compile the script leading to compilation failure.

Changed, ACC compiler: when building includes list, the compiler no longer tries to find/copy include files defined in current script configuration (previously it was hardcoded to skip "zcommon.acs" and "common.acs" only).
Fixed, Visual mode: things with Additive RenderStyle were rendered as additive only when their alpha was less than 1.0.
This commit is contained in:
MaxED 2015-11-13 21:42:41 +00:00
parent 9b87dc71e3
commit f452fca58c
7 changed files with 165 additions and 96 deletions

View file

@ -425,10 +425,12 @@ namespace CodeImp.DoomBuilder.Controls
navigator.Items.Clear();
AcsParserSE parser = new AcsParserSE();
parser.Parse(stream, "ACS");
navigator.Items.AddRange(parser.NamedScripts.ToArray());
navigator.Items.AddRange(parser.NumberedScripts.ToArray());
navigator.Items.AddRange(parser.Functions.ToArray());
if(parser.Parse(stream, "ACS"))
{
navigator.Items.AddRange(parser.NamedScripts.ToArray());
navigator.Items.AddRange(parser.NumberedScripts.ToArray());
navigator.Items.AddRange(parser.Functions.ToArray());
}
}
//mxd

View file

@ -22,7 +22,6 @@ using System.Windows.Forms;
using CodeImp.DoomBuilder.Config;
using System.IO;
using CodeImp.DoomBuilder.Compilers;
using CodeImp.DoomBuilder.GZBuilder.Data; //mxd
#endregion
@ -72,12 +71,19 @@ namespace CodeImp.DoomBuilder.Controls
// This compiles the script file
public override void Compile()
{
string inputfile, outputfile;
//mxd. List of errors. UpdateScriptNames can return errors and also updates acs includes list
List<CompilerError> errors = (config.ScriptType == ScriptType.ACS ? General.Map.UpdateScriptNames() : new List<CompilerError>());
//mxd. Errors already?..
if(errors.Count > 0)
{
// Feed errors to panel
panel.ShowErrors(errors);
return;
}
Compiler compiler;
// List of errors
List<CompilerError> errors = new List<CompilerError>();
try
{
// Initialize compiler
@ -91,11 +97,11 @@ namespace CodeImp.DoomBuilder.Controls
}
// Copy the source file into the temporary directory
inputfile = Path.Combine(compiler.Location, Path.GetFileName(filepathname));
string inputfile = Path.Combine(compiler.Location, Path.GetFileName(filepathname));
File.Copy(filepathname, inputfile);
// Make random output filename
outputfile = General.MakeTempFilename(compiler.Location, "tmp");
string outputfile = General.MakeTempFilename(compiler.Location, "tmp");
// Run compiler
compiler.Parameters = config.Parameters;
@ -117,15 +123,13 @@ namespace CodeImp.DoomBuilder.Controls
errors.Add(newerr);
}
//mxd. Should be called only if current script is compiled successfully
if (compiler.Errors.Length == 0 && config.ScriptType == ScriptType.ACS)
General.Map.UpdateScriptNames();
UpdateNavigator();
}
// Dispose compiler
compiler.Dispose();
//mxd. Update script navigator
UpdateNavigator();
// Feed errors to panel
panel.ShowErrors(errors);

View file

@ -16,10 +16,10 @@
#region ================== Namespaces
using System.Collections.Generic;
using CodeImp.DoomBuilder.Config;
using System.IO;
using CodeImp.DoomBuilder.Compilers;
using CodeImp.DoomBuilder.GZBuilder.Data; //mxd
#endregion
@ -33,8 +33,8 @@ namespace CodeImp.DoomBuilder.Controls
#region ================== Variables
private string lumpname;
private bool ismapheader;
private readonly string lumpname;
private readonly bool ismapheader;
#endregion
@ -87,16 +87,21 @@ namespace CodeImp.DoomBuilder.Controls
// Compile script
public override void Compile()
{
bool success; //mxd
//mxd. List of errors. UpdateScriptNames can return errors and also updates acs includes list
List<CompilerError> errors = (config.ScriptType == ScriptType.ACS ? General.Map.UpdateScriptNames() : new List<CompilerError>());
//mxd. Errors already?..
if(errors.Count > 0)
{
// Feed errors to panel
panel.ShowErrors(errors);
return;
}
// Compile
if(ismapheader)
success = General.Map.CompileLump(MapManager.CONFIG_MAP_HEADER, true);
else
success = General.Map.CompileLump(lumpname, true);
//mxd. Update script names cache and script navigator
if(success && config.ScriptType == ScriptType.ACS) General.Map.UpdateScriptNames();
General.Map.CompileLump((ismapheader ? MapManager.CONFIG_MAP_HEADER : lumpname), true);
//mxd. Update script navigator
UpdateNavigator();
// Feed errors to panel