Compare commits

..

No commits in common. "00c2d14a06ff118b2a50bdd541aae7e8d07e1062" and "1b962831a025497dadf75e067e358c28c8ad2fff" have entirely different histories.

2 changed files with 20 additions and 23 deletions

View File

@ -5,13 +5,10 @@
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<SelfContained>true</SelfContained>
<PublishTrimmed>true</PublishTrimmed>
<PublishAot>true</PublishAot>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="DotMake.CommandLine" Version="1.8.8" /> <PackageReference Include="clifx" Version="2.3.5" />
<PackageReference Include="TinyEmbree" Version="1.0.3" /> <PackageReference Include="TinyEmbree" Version="1.0.3" />
</ItemGroup> </ItemGroup>

View File

@ -1,36 +1,36 @@
using DotMake.CommandLine; using CliFx;
using CliFx.Attributes;
using IConsole = CliFx.Infrastructure.IConsole;
namespace KeepersCompound.Lightmapper; namespace KeepersCompound.Lightmapper;
internal static class Program internal static class Program
{ {
public static async Task<int> Main(string[] args) => public static async Task<int> Main() =>
await Cli.RunAsync<LightCommand>(args); await new CliApplicationBuilder().AddCommandsFromThisAssembly().Build().RunAsync();
} }
[CliCommand(Description = "Compute lightmaps for a NewDark .MIS/.COW")] [Command(Description = "Compute lightmaps for a NewDark .MIS/.COW")]
public class LightCommand public class LightCommand : ICommand
{ {
[CliArgument(Description = "The path to the root Thief installation.")] [CommandParameter(0, Description = "The path to the root Thief installation.")]
public required string InstallPath { get; set; } public required string InstallPath { get; init; }
[CommandParameter(1, Description = "The folder name of the fan mission. For OMs this is blank.")]
[CliArgument(Description = "The folder name of the fan mission. For OMs this is blank.")] public required string CampaignName { get; init; }
public required string CampaignName { get; set; } [CommandParameter(2, Description = "The name of the mission file including extension.")]
public required string MissionName { get; init; }
[CliArgument(Description = "The name of the mission file including extension.")] [CommandOption("output", 'o', Description = "Name of output file excluding extension.")]
public required string MissionName { get; set; } public string OutputName { get; init; } = "kc_lit";
[CliOption(Description = "Name of output file excluding extension.")]
public string OutputName { get; set; } = "kc_lit";
public void Run() public ValueTask ExecuteAsync(IConsole console)
{ {
Timing.Reset(); Timing.Reset();
var lightMapper = new LightMapper(InstallPath, CampaignName, MissionName); var lightMapper = new LightMapper(InstallPath, CampaignName, MissionName);
lightMapper.Light(); lightMapper.Light();
lightMapper.Save(OutputName); lightMapper.Save(OutputName);
Timing.LogAll(); Timing.LogAll();
return default;
} }
} }