Add basic command line interface
This commit is contained in:
parent
0ea00fa109
commit
350a891118
|
@ -8,6 +8,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
|
||||||
<PackageReference Include="TinyEmbree" Version="1.0.3" />
|
<PackageReference Include="TinyEmbree" Version="1.0.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
|
@ -1,25 +1,46 @@
|
||||||
|
using System.CommandLine;
|
||||||
|
|
||||||
namespace KeepersCompound.Lightmapper;
|
namespace KeepersCompound.Lightmapper;
|
||||||
|
|
||||||
class Program
|
class Program
|
||||||
{
|
{
|
||||||
static void Main(string[] args)
|
private static void Main(string[] args)
|
||||||
|
{
|
||||||
|
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();
|
Timing.Reset();
|
||||||
|
|
||||||
// TODO: Read this from args
|
|
||||||
var installPath = "/stuff/Games/thief/drive_c/GOG Games/TG ND 1.27 (MAPPING)/";
|
|
||||||
var campaignName = "JAYRUDE_Tests";
|
|
||||||
var missionName = "lm_test.cow";
|
|
||||||
|
|
||||||
// campaignName = "JAYRUDE_1MIL_Mages";
|
|
||||||
// campaignName = "TDP20AC_a_burrick_in_a_room";
|
|
||||||
// campaignName = "AtdV";
|
|
||||||
// missionName = "miss20.mis";
|
|
||||||
|
|
||||||
var lightMapper = new LightMapper(installPath, campaignName, missionName);
|
var lightMapper = new LightMapper(installPath, campaignName, missionName);
|
||||||
lightMapper.Light(false);
|
lightMapper.Light(multiSampling);
|
||||||
lightMapper.Save("kc_lit");
|
lightMapper.Save(outputFile);
|
||||||
|
|
||||||
Timing.LogAll();
|
Timing.LogAll();
|
||||||
|
}, installPathArg, campaignNameArg, missionNameArg, outputFileOption, multiSamplingOption);
|
||||||
|
|
||||||
|
rootCommand.Invoke(args);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue