Skip to content

Commit

Permalink
show error if missing shadergen dll
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedro413 committed Jun 6, 2024
1 parent a710826 commit 6d7d784
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions TagTool/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,21 @@ static void Main(string[] args)
Console.WriteLine("https://github.com/TheGuardians-CI/TagTool/issues");
}

// Provide user with warnings if there are missing assemblies
// HaloShaderGenerator.dll:
try
{
TestShaderGeneratorAssembly();
}
catch (Exception ex)
{
Console.WriteLine();
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("ERROR: Could not load shader generator. Most shader related operations will fail");
Console.WriteLine("Please confirm \"HaloShaderGenerator.dll\" is up to date and present in the \"Tools\" folder of your TagTool directory");
Console.ForegroundColor = ConsoleColor.White;
}

start:
// Get the file path from the first argument
// If no argument is given, load tags.dat
Expand Down Expand Up @@ -235,5 +250,10 @@ public static DateTime GetLinkerTimestampUtc(string filePath)
var dt = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
return dt.AddSeconds(secondsSince1970);
}

private static void TestShaderGeneratorAssembly()
{
var hlslFloat = HaloShaderGenerator.Globals.HLSLType.Float;
}
}
}

0 comments on commit 6d7d784

Please sign in to comment.