Skip to content

Commit

Permalink
Enable --gen-checksums if you pass --compare-checksums.
Browse files Browse the repository at this point in the history
Else it doesn't work.
  • Loading branch information
PJB3005 committed Feb 1, 2022
1 parent 5b922e8 commit da2b236
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Drizzle.ConsoleApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -53,9 +54,11 @@ int DoCmdRender(CommandLineArgs.VerbRender options)
MaxDegreeOfParallelism = options.MaxParallelism == 0 ? -1 : options.MaxParallelism
};

var doChecksums = options.Checksums;
Dictionary<string, Dictionary<string, string>>? checksums = null;
if (options.CompareChecksums is { } chkFileName)
{
doChecksums = true;
using var chkFile = File.OpenRead(chkFileName);
checksums = JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(chkFile);
}
Expand All @@ -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();
Expand Down

0 comments on commit da2b236

Please sign in to comment.