From da2b23626504a045eeb3f2945589dfd6ab652660 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Tue, 1 Feb 2022 01:10:54 +0100 Subject: [PATCH] Enable --gen-checksums if you pass --compare-checksums. Else it doesn't work. --- Drizzle.ConsoleApp/Program.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Drizzle.ConsoleApp/Program.cs b/Drizzle.ConsoleApp/Program.cs index e7ef60a..0c57650 100644 --- a/Drizzle.ConsoleApp/Program.cs +++ b/Drizzle.ConsoleApp/Program.cs @@ -45,6 +45,7 @@ int DoCmdRender(CommandLineArgs.VerbRender options) Console.WriteLine($"Starting render of {options.Levels.Count} levels"); var sw = Stopwatch.StartNew(); + var errors = 0; var success = 0; @@ -53,9 +54,11 @@ int DoCmdRender(CommandLineArgs.VerbRender options) MaxDegreeOfParallelism = options.MaxParallelism == 0 ? -1 : options.MaxParallelism }; + var doChecksums = options.Checksums; Dictionary>? checksums = null; if (options.CompareChecksums is { } chkFileName) { + doChecksums = true; using var chkFile = File.OpenRead(chkFileName); checksums = JsonSerializer.Deserialize>>(chkFile); } @@ -72,7 +75,7 @@ int DoCmdRender(CommandLineArgs.VerbRender options) EditorRuntimeHelpers.RunLoadLevel(renderRuntime, s); var renderer = new LevelRenderer(renderRuntime, null); - if (options.Checksums) + if (doChecksums) renderer.OnScreenRenderCompleted += (cam, img) => HandleChecksum(levelName, cam, img, checksums); renderer.DoRender();