public void BuildStandAloneAsync(SourceModule Module) { if (Module == null) return; var dir=Path.GetDirectoryName(Module.AbsoluteFileName); BuildModuleAsync(Module, dir, dir, true, true); }
public BuildResult BuildStandAlone(string file) { var sm = new SourceModule(); sm.FileName = file; BuildStandAlone(sm); return sm.LastBuildResult; }
public void BuildModuleAsync(SourceModule Module, string OutputDirectory, string ExecDirectory, bool Debug, bool LinkToStandAlone) { if (Module == null) return; StopBuilding(); buildThread = new Thread(delegate() { BuildModule(Module, OutputDirectory,ExecDirectory,Debug, LinkToStandAlone); OnBuildFinished(Module.LastBuildResult); }); buildThread.IsBackground = true; buildThread.Start(); }
public static void AppendDissassembly(StringBuilder sb, out int hiStart, out int hiEnd, SourceModule module, SourceFileSegment segment) { hiStart = 0; hiEnd = 0; int lineCount = 0; if (module == null) { return; } sb.Append("Disassembly of "); sb.AppendLine(module.Name); sb.AppendLine(); foreach (var section in module.Sections) { int sectionHiStart, sectionHiEnd; AppendDissassembly(sb, out sectionHiStart, out sectionHiEnd, section, segment, module, ref lineCount); if (sectionHiEnd > sectionHiStart) { hiStart = sectionHiStart; hiEnd = sectionHiEnd; } } }
public override double GetWrapped(double x, double y, int wrap) { return(SourceModule.GetWrapped(-x, -y, wrap)); }
public override double GetValue(double x, double y, double z) { double value = SourceModule.GetValue(x, y, z); return(value < LowerBound ? LowerBound : (value > UpperBound ? UpperBound : value)); }
public override double GetWrapped(double x, double y, int wrap) { // Read: return(SourceModule.GetColour(x, y).a); }
public override double GetValue(double x, double y) { return(1.0 - SourceModule.GetValue(x, y)); }
public override double GetValue(double x, double y) { return(SourceModule.GetColour(x, y).r); }
public override UnityEngine.Color GetColour(double x, double y) { return(SourceModule.GetColour(x, y)); }
public void BuildStandAlone(SourceModule Module) { BuildModule(Module, Path.GetDirectoryName(Module.FileName), Path.GetDirectoryName(Module.FileName), true, true); }
public abstract void BuildModule(SourceModule Module, string OutputDirectory, string ExecDirectory, bool DebugCompile, bool LinkToStandAlone);
public override void BuildModule(SourceModule Module, string OutputDirectory,string ExecDir, bool DebugCompile, bool Link) { var dmd = CurrentDMDConfig; var dmd_exe = dmd.SoureCompiler; var src = Module.AbsoluteFileName; var outputDir = Path.IsPathRooted(OutputDirectory) ? OutputDirectory : Path.Combine(Path.GetDirectoryName(src), OutputDirectory); // Ensure that target directory exists Util.CreateDirectoryRecursively(outputDir); // Compile .d source file to obj var obj = Path.Combine(outputDir, Path.GetFileNameWithoutExtension(src) + ".obj"); // Check if creation can be skipped if (GlobalProperties.Instance.EnableIncrementalBuild && !Link && !Module.Modified && File.Exists(obj)) { Module.LastBuildResult = new BuildResult() { SourceFile=src, TargetFile=obj,Successful = true, NoBuildNeeded=true}; return; } var br =Module.LastBuildResult= CompileSource(Module,dmd,DebugCompile,obj,ExecDir); if (br.Successful) Module.ResetModifiedTime(); if (Link && br.Successful) { br.Successful = false; #region Link To StandAlone executable var exe = OutputDirectory + "\\" + Path.GetFileNameWithoutExtension(src) + ".exe"; br.TargetFile = exe; if (GlobalProperties.Instance.EnableIncrementalBuild && br.NoBuildNeeded && File.Exists(br.TargetFile)) { return; } var br_ = LinkFiles(dmd,dmd.ExeLinker, dmd.BuildArguments(DebugCompile).ExeLinker, Path.GetDirectoryName(obj), exe, DebugCompile, obj); br.BuildErrors.AddRange(br_.BuildErrors); br.AdditionalFiles = br_.AdditionalFiles; br.Successful = br_.Successful; #endregion } }
public BuildResult CompileSource(SourceModule Module,DMDConfig dmd,bool DebugCompile, string objFile, string execDirectory) { var obj = Path.ChangeExtension(objFile, ".obj"); var br = new BuildResult() { SourceFile = Module.AbsoluteFileName,TargetFile=obj,Successful=true }; ErrorLogger.Log("Compile " + (Module.Project!=null?Module.Project.ToRelativeFileName( Module.FileName):Module.FileName),ErrorType.Information,ErrorOrigin.Build); var dmd_exe = dmd.SoureCompiler; // Always enable it to use environment paths to find dmd.exe if (!Path.IsPathRooted(dmd_exe) && Directory.Exists(dmd.BaseDirectory)) dmd_exe = Path.Combine(dmd.BaseDirectory, dmd.SoureCompiler); TempPrc = FileExecution.ExecuteSilentlyAsync(dmd_exe, BuildDSourceCompileArgumentString(dmd.BuildArguments(DebugCompile).SoureCompiler, Module.AbsoluteFileName, obj,dmd.ImportDirectories), // Compile our program always in debug mode execDirectory, OnOutput, delegate(string s) { var err = ParseErrorMessage(s); if (Module.Project != null && Module.Project.ContainsFile(err.FileName)) err.Project = Module.Project; if (err.Type == GenericError.ErrorType.Error) br.Successful = false; br.BuildErrors.Add(err); }, OnExit); if (TempPrc != null && !TempPrc.HasExited) TempPrc.WaitForExit(MaxCompilationTime); br.Successful = br.Successful && TempPrc!=null && TempPrc.ExitCode==0 && File.Exists(obj); return br; }
public override double GetValue(double x, double y) { return(SourceModule.GetValue(-x, -y)); }
public static void AppendDissassembly(StringBuilder sb, out int hiStart, out int hiEnd, AssemblySection section, SourceFileSegment segment, SourceModule module, ref int lineCount) { sb.AppendLine(); sb.AppendLine(section.FunctionName); sb.AppendLine(); hiStart = 0; hiEnd = 0; foreach (var s in section.Segments) { if (section.FunctionName == segment.Function.Name && lineCount == segment.LineNumber) { hiStart = sb.Length; hiEnd = hiStart + s.Length; } sb.AppendLine(s); if (section.FunctionName == segment.Function.Name) { lineCount++; } } }
/// <summary> /// Returns the output of the two source modules added together. /// </summary> public override double GetValue(double x, double y) { return(SourceModule.GetValue(x, y) + AlphaModule.GetValue(x, y)); }
public override void BuildModule(SourceModule Module, string OutputDirectory, string ExecDirectory, bool DebugCompile, bool LinkToStandAlone) { var src = Module.AbsoluteFileName; var outputDir = Path.IsPathRooted(OutputDirectory) ? OutputDirectory : Path.Combine(Path.GetDirectoryName(src), OutputDirectory); // Ensure that target directory exists Util.CreateDirectoryRecursively(outputDir); // Compile .rc source file to res var res = Path.Combine(outputDir, Path.GetFileNameWithoutExtension(src) + ".res"); // Check if creation can be skipped if (GlobalProperties.Instance.EnableIncrementalBuild && !Module.Modified && File.Exists(res)) { Module.LastBuildResult = new BuildResult() { SourceFile = src, TargetFile = res, Successful = true, NoBuildNeeded = true }; return; } // Init returned BuildResult-object var br = new BuildResult() { SourceFile = src, TargetFile = res, Successful = true }; // Print verbose information message ErrorLogger.Log("Compile " + (Module.Project != null ? Module.Project.ToRelativeFileName(Module.FileName) : Module.FileName), ErrorType.Information, ErrorOrigin.Build); var resourceCompiler = ResConfig.Instance.ResourceCompilerPath; // Prefer the resource compiler located in D-IDE's bin root // Otherwise let the system search along the %PATH% environment variable to find the resource compiler if (!Path.IsPathRooted(resourceCompiler) && File.Exists(Path.Combine(Util.ApplicationStartUpPath, resourceCompiler))) { resourceCompiler = Path.Combine(Util.ApplicationStartUpPath, resourceCompiler); } TempPrc = FileExecution.ExecuteSilentlyAsync(resourceCompiler, BuildResArgumentString( ResConfig.Instance.ResourceCompilerArguments, src, res, outputDir), ExecDirectory, // Output handling delegate(string s) { var err = ParseErrorMessage(s); if (Module.Project != null && Module.Project.ContainsFile(err.FileName)) { err.Project = Module.Project; } br.BuildErrors.Add(err); br.Successful = false; if (!GlobalProperties.Instance.VerboseBuildOutput) { ErrorLogger.Log(s, ErrorType.Message, ErrorOrigin.Build); } }, // Error handling delegate(string s) { br.Successful = false; ErrorLogger.Log(s, ErrorType.Error, ErrorOrigin.Build); }, OnExit); if (TempPrc != null && !TempPrc.HasExited) { TempPrc.WaitForExit(MaxCompilationTime); } br.Successful = br.Successful && TempPrc != null && TempPrc.ExitCode == 0 && File.Exists(res); if (br.Successful) { Module.ResetModifiedTime(); } Module.LastBuildResult = br; }
public override double GetValue(double x, double y, double z) { return(SourceModule.GetValue(x, y, z)); }
public override double GetWrapped(double x, double y, int wrap) { double baseValue = SourceModule.GetWrapped(x, y, wrap); return(baseValue); }
public override double GetWrapped(double x, double y, int wrap) { return(1.0 - SourceModule.GetWrapped(x, y, wrap)); }
public override double GetValue(double x, double y) { double baseValue = SourceModule.GetValue(x, y); return(baseValue); }
public override double GetValue(double t) { return(1.0 - SourceModule.GetValue(t)); }
/// <summary> /// Returns the absolute value of noise from the source module at the given coordinates. /// </summary> public override double GetValue(double x, double y) { return(System.Math.Abs(SourceModule.GetValue(x, y))); }
public override double GetValue(double x, double y) { // Read: return(SourceModule.GetColour(x, y).a); }
public override void BuildModule(SourceModule Module, string OutputDirectory, string ExecDirectory, bool DebugCompile, bool LinkToStandAlone) { var src = Module.AbsoluteFileName; var outputDir = Path.IsPathRooted(OutputDirectory) ? OutputDirectory : Path.Combine(Path.GetDirectoryName(src), OutputDirectory); // Ensure that target directory exists Util.CreateDirectoryRecursively(outputDir); // Compile .rc source file to res var res = Path.Combine(outputDir, Path.GetFileNameWithoutExtension(src) + ".res"); // Check if creation can be skipped if (GlobalProperties.Instance.EnableIncrementalBuild && !Module.Modified && File.Exists(res)) { Module.LastBuildResult = new BuildResult() { SourceFile = src, TargetFile = res, Successful = true, NoBuildNeeded = true }; return; } // Init returned BuildResult-object var br = new BuildResult() { SourceFile = src, TargetFile = res, Successful = true }; // Print verbose information message ErrorLogger.Log("Compile " + (Module.Project != null ? Module.Project.ToRelativeFileName(Module.FileName) : Module.FileName), ErrorType.Information, ErrorOrigin.Build); var resourceCompiler = ResConfig.Instance.ResourceCompilerPath; // Prefer the resource compiler located in D-IDE's bin root // Otherwise let the system search along the %PATH% environment variable to find the resource compiler if (!Path.IsPathRooted(resourceCompiler) && File.Exists(Path.Combine(Util.ApplicationStartUpPath,resourceCompiler))) resourceCompiler = Path.Combine(Util.ApplicationStartUpPath, resourceCompiler); TempPrc = FileExecution.ExecuteSilentlyAsync(resourceCompiler, BuildResArgumentString( ResConfig.Instance.ResourceCompilerArguments, src, res, outputDir), ExecDirectory, // Output handling delegate(string s) { var err = ParseErrorMessage(s); if (Module.Project != null && Module.Project.ContainsFile(err.FileName)) err.Project = Module.Project; br.BuildErrors.Add(err); br.Successful = false; if (!GlobalProperties.Instance.VerboseBuildOutput) ErrorLogger.Log(s, ErrorType.Message, ErrorOrigin.Build); }, // Error handling delegate(string s) { br.Successful = false; ErrorLogger.Log(s, ErrorType.Error, ErrorOrigin.Build); }, OnExit); if (TempPrc != null && !TempPrc.HasExited) TempPrc.WaitForExit(MaxCompilationTime); br.Successful = br.Successful && TempPrc != null && TempPrc.ExitCode == 0 && File.Exists(res); if (br.Successful) Module.ResetModifiedTime(); Module.LastBuildResult = br; }
public override double GetWrapped(double x, double y, int wrap) { return(System.Math.Tan(SourceModule.GetWrapped(x, y, wrap))); }
public override double GetValue(double x, double y, double z) { return(System.Math.Log(SourceModule.GetValue(x, y, z), BaseModule.GetValue(x, y, z))); }