ThiefLightmapper/KeepersCompound.Lightmapper/Program.cs

46 lines
1.7 KiB
C#
Raw Normal View History

2024-10-28 20:40:06 +00:00
using System.CommandLine;
namespace KeepersCompound.Lightmapper;
class Program
{
2024-10-28 20:40:06 +00:00
private static void Main(string[] args)
{
2024-10-28 20:40:06 +00:00
var installPathArg = new Argument<string>(
"installPath",
"The path to the root Thief installation.");
var campaignNameArg = new Argument<string>(
"campaignName",
"The folder name of the fan mission. For OMs this is blank.");
var missionNameArg = new Argument<string>(
"missionName",
"The name of the mission file including extension.");
var outputFileOption = new Option<string>(
["-o", "--output"],
() => "kc_lit",
"Name of output file excluding extension.");
var multiSamplingOption = new Option<bool>(
"--multiSampling",
() => false,
"Enables multi-sampled shadows. Higher quality but slower.");
var rootCommand = new RootCommand("Compute lightmaps for a NewDark .MIS/.COW");
rootCommand.AddArgument(installPathArg);
rootCommand.AddArgument(campaignNameArg);
rootCommand.AddArgument(missionNameArg);
rootCommand.AddOption(outputFileOption);
rootCommand.AddOption(multiSamplingOption);
rootCommand.SetHandler((installPath, campaignName, missionName, outputFile, multiSampling) =>
{
Timing.Reset();
2024-10-28 20:40:06 +00:00
var lightMapper = new LightMapper(installPath, campaignName, missionName);
lightMapper.Light(multiSampling);
lightMapper.Save(outputFile);
2024-09-29 09:22:43 +00:00
2024-10-28 20:40:06 +00:00
Timing.LogAll();
}, installPathArg, campaignNameArg, missionNameArg, outputFileOption, multiSamplingOption);
2024-10-28 20:40:06 +00:00
rootCommand.Invoke(args);
2024-09-23 15:57:02 +00:00
}
}