2024-10-29 07:43:32 +00:00
|
|
|
using CliFx;
|
|
|
|
using CliFx.Attributes;
|
|
|
|
using IConsole = CliFx.Infrastructure.IConsole;
|
2024-10-28 20:40:06 +00:00
|
|
|
|
2024-09-22 10:14:34 +00:00
|
|
|
namespace KeepersCompound.Lightmapper;
|
|
|
|
|
2024-10-29 07:43:32 +00:00
|
|
|
internal static class Program
|
2024-09-22 10:14:34 +00:00
|
|
|
{
|
2024-10-29 07:43:32 +00:00
|
|
|
public static async Task<int> Main() =>
|
|
|
|
await new CliApplicationBuilder().AddCommandsFromThisAssembly().Build().RunAsync();
|
|
|
|
}
|
2024-09-29 09:22:43 +00:00
|
|
|
|
2024-10-29 07:43:32 +00:00
|
|
|
[Command(Description = "Compute lightmaps for a NewDark .MIS/.COW")]
|
|
|
|
public class LightCommand : ICommand
|
|
|
|
{
|
|
|
|
[CommandParameter(0, Description = "The path to the root Thief installation.")]
|
|
|
|
public required string InstallPath { get; init; }
|
|
|
|
[CommandParameter(1, Description = "The folder name of the fan mission. For OMs this is blank.")]
|
|
|
|
public required string CampaignName { get; init; }
|
|
|
|
[CommandParameter(2, Description = "The name of the mission file including extension.")]
|
|
|
|
public required string MissionName { get; init; }
|
|
|
|
[CommandOption("output", 'o', Description = "Name of output file excluding extension.")]
|
|
|
|
public string OutputName { get; init; } = "kc_lit";
|
2024-09-22 10:14:34 +00:00
|
|
|
|
2024-10-29 07:43:32 +00:00
|
|
|
public ValueTask ExecuteAsync(IConsole console)
|
|
|
|
{
|
|
|
|
Timing.Reset();
|
|
|
|
|
|
|
|
var lightMapper = new LightMapper(InstallPath, CampaignName, MissionName);
|
2024-10-29 18:01:50 +00:00
|
|
|
lightMapper.Light();
|
2024-10-29 07:43:32 +00:00
|
|
|
lightMapper.Save(OutputName);
|
|
|
|
|
|
|
|
Timing.LogAll();
|
|
|
|
return default;
|
2024-09-23 15:57:02 +00:00
|
|
|
}
|
2024-09-22 10:14:34 +00:00
|
|
|
}
|