Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General housekeeping #791

Merged
merged 7 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
run: |
dotnet restore
dotnet test --filter TestCategory!=OriginalIO
dotnet publish -c Release -a x64 --property:PublishDir=build
dotnet publish TRRandomizerView -c Release -a x64 --property:PublishDir=build --self-contained false

- name: Package the build
run: |
Expand Down
5 changes: 4 additions & 1 deletion LocationExport/LocationExport.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@
<ProjectReference Include="..\TRLevelControl\TRLevelControl.csproj" />
<ProjectReference Include="..\TRRandomizerCore\TRRandomizerCore.csproj" />
</ItemGroup>
</Project>
<PropertyGroup>
<NoWarn>IDE0130</NoWarn>
</PropertyGroup>
</Project>
5 changes: 4 additions & 1 deletion ModelExport/ModelExport.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@
<ProjectReference Include="..\TRImageControl\TRImageControl.csproj" />
<ProjectReference Include="..\TRLevelControl\TRLevelControl.csproj" />
</ItemGroup>
</Project>
<PropertyGroup>
<NoWarn>IDE0130</NoWarn>
</PropertyGroup>
</Project>
5 changes: 4 additions & 1 deletion SFXExport/SFXExport.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@
<ItemGroup>
<ProjectReference Include="..\TRLevelControl\TRLevelControl.csproj" />
</ItemGroup>
</Project>
<PropertyGroup>
<NoWarn>IDE0130</NoWarn>
</PropertyGroup>
</Project>
5 changes: 4 additions & 1 deletion TRDataControl/TRDataControl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@
<HintPath>..\Deps\RectanglePacker.dll</HintPath>
</Reference>
</ItemGroup>
</Project>
<PropertyGroup>
<NoWarn>IDE0130</NoWarn>
</PropertyGroup>
</Project>
9 changes: 6 additions & 3 deletions TRDataControlTests/TRDataControlTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<Copyright>Copyright © Tomb Raider Community 2024</Copyright>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.5.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.5.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.3" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand All @@ -25,4 +25,7 @@
<ItemGroup>
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
</ItemGroup>
<PropertyGroup>
<NoWarn>IDE0130</NoWarn>
</PropertyGroup>
</Project>
3 changes: 3 additions & 0 deletions TRImageControl/TRImageControl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@
<HintPath>..\Deps\RectanglePacker.dll</HintPath>
</Reference>
</ItemGroup>
<PropertyGroup>
<NoWarn>IDE0130</NoWarn>
</PropertyGroup>
</Project>
9 changes: 6 additions & 3 deletions TRImageControlTests/TRImageControlTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<Copyright>Copyright © Tomb Raider Community 2024</Copyright>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.5.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.5.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.3" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand All @@ -31,4 +31,7 @@
<ItemGroup>
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
</ItemGroup>
<PropertyGroup>
<NoWarn>IDE0130</NoWarn>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion TRLevelControl/Build/TRModelBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ private void TestTR5Changes(IEnumerable<TRModel> models)

// Some levels have an unreferenced state change at the end with a state ID that doesn't match
// anything in the game. Need to observe for tests.
int totalChanges = models.Sum(m => m.Animations.Sum(a => a.Changes.Count));
int totalChanges = models.Sum(m => m.TotalChangeCount);
if (totalChanges == _placeholderChanges.Count - 1)
{
PlaceholderChange finalChange = _placeholderChanges[^1];
Expand Down
2 changes: 2 additions & 0 deletions TRLevelControl/Model/Common/TRAnimation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public class TRAnimation : ICloneable
public List<TRAnimCommand> Commands { get; set; } = new();
public List<TRAnimFrame> Frames { get; set; } = new();

public int TotalDispatchCount => Changes.Sum(c => c.Dispatches.Count);

public TRAnimation Clone()
{
return new()
Expand Down
5 changes: 5 additions & 0 deletions TRLevelControl/Model/Common/TRModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ public class TRModel : ICloneable
public List<TRMeshTreeNode> MeshTrees { get; set; } = new();
public List<TRMesh> Meshes { get; set; } = new();

public int TotalCommandCount => Animations.Sum(a => a.Commands.Count);
public int TotalChangeCount => Animations.Sum(a => a.Changes.Count);
public int TotalDispatchCount => Animations.Sum(a => a.TotalDispatchCount);
public int TotalFrameCount => Animations.Sum(a => a.Frames.Count);

public TRModel Clone()
{
return new()
Expand Down
5 changes: 4 additions & 1 deletion TRLevelControl/TRLevelControl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@
<ItemGroup>
<PackageReference Include="SharpZipLib" version="1.4.2" />
</ItemGroup>
</Project>
<PropertyGroup>
<NoWarn>IDE0130</NoWarn>
</PropertyGroup>
</Project>
11 changes: 7 additions & 4 deletions TRLevelControlTests/TRLevelControlTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<None Remove="Properties\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.5.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.5.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.3" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down Expand Up @@ -58,4 +58,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
<PropertyGroup>
<NoWarn>IDE0130</NoWarn>
</PropertyGroup>
</Project>
4 changes: 2 additions & 2 deletions TRLevelToolset/Components/VersionComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ public class VersionComponent : IDrawable
{
public void Draw()
{
ImGui.BeginChildFrame(0, new System.Numerics.Vector2(1280, 45));
ImGui.BeginChild(0, new System.Numerics.Vector2(1280, 45), ImGuiChildFlags.FrameStyle);
ImGui.Text("Level: " + IOManager.FileName);
ImGui.Text("Version: " + IOManager.CurrentLevel?.Version.File.ToString("X8"));
ImGui.EndChildFrame();
ImGui.EndChild();
}
}
8 changes: 4 additions & 4 deletions TRLevelToolset/Controls/DataControls/TR/TRAnimationControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ public void Draw()
if (ImGui.TreeNodeEx("Animations Data", ImGuiTreeNodeFlags.OpenOnArrow))
{
ImGui.Text("Animations count: " + IOManager.CurrentLevelAsTR1?.Models.Values.Sum(m => m.Animations.Count));
ImGui.Text("State change count: " + IOManager.CurrentLevelAsTR1?.Models.Values.Sum(m => m.Animations.Sum(a => a.Changes.Count)));
ImGui.Text("Animation dispatch count: " + IOManager.CurrentLevelAsTR1?.Models.Values.Sum(m => m.Animations.Sum(a => a.Changes.Sum(c => c.Dispatches.Count))));
ImGui.Text("Animation command count: " + IOManager.CurrentLevelAsTR1?.Models.Values.Sum(m => m.Animations.Sum(a => a.Commands.Count)));
ImGui.Text("State change count: " + IOManager.CurrentLevelAsTR1?.Models.Values.Sum(m => m.TotalChangeCount));
ImGui.Text("Animation dispatch count: " + IOManager.CurrentLevelAsTR1?.Models.Values.Sum(m => m.TotalDispatchCount));
ImGui.Text("Animation command count: " + IOManager.CurrentLevelAsTR1?.Models.Values.Sum(m => m.TotalCommandCount));
ImGui.Text("Mesh tree count: " + IOManager.CurrentLevelAsTR1?.Models.Values.Sum(m => m.MeshTrees.Count));
ImGui.Text("Total frames count: " + IOManager.CurrentLevelAsTR1?.Models.Values.Sum(m => m.Animations.Sum(a => a.Frames.Count)));
ImGui.Text("Total frames count: " + IOManager.CurrentLevelAsTR1?.Models.Values.Sum(m => m.TotalFrameCount));

ImGui.TreePop();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void Draw()
{
ImGui.Text("Camera count: " + IOManager.CurrentLevelAsTR1?.Cameras.Count);

ImGui.BeginChild("cam_property_display", new Vector2(400, 200), true);
ImGui.BeginChild("cam_property_display", new Vector2(400, 200), ImGuiChildFlags.Border);

if (ImGui.InputInt("Camera ID", ref _index, 1, 1))
{
Expand Down
12 changes: 7 additions & 5 deletions TRLevelToolset/TRLevelToolset.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ImGui.NET" Version="1.86.0" />
<PackageReference Include="Veldrid" Version="4.8.0" />
<PackageReference Include="ImGui.NET" Version="1.91.0.1" />
<PackageReference Include="Veldrid" Version="4.9.0" />
<PackageReference Include="Veldrid.ImGui" Version="5.72.0" />
<PackageReference Include="Veldrid.SPIRV" Version="1.0.14" />
<PackageReference Include="Veldrid.StartupUtilities" Version="4.8.0" />
<PackageReference Include="Veldrid.SPIRV" Version="1.0.15" />
<PackageReference Include="Veldrid.StartupUtilities" Version="4.9.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\TRDataControl\TRDataControl.csproj" />
<ProjectReference Include="..\TRLevelControl\TRLevelControl.csproj" />
</ItemGroup>

<PropertyGroup>
<NoWarn>IDE0130</NoWarn>
</PropertyGroup>
</Project>
4 changes: 3 additions & 1 deletion TRRandomizerCore/TRRandomizerCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Drawing.Common" Version="8.0.10" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TRDataControl\TRDataControl.csproj" />
Expand All @@ -32,4 +31,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<PropertyGroup>
<NoWarn>IDE0130</NoWarn>
</PropertyGroup>
</Project>
7 changes: 5 additions & 2 deletions TRRandomizerCoreTests/TRRandomizerCoreTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TRRandomizerCore\TRRandomizerCore.csproj" />
</ItemGroup>
<ItemGroup>
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
</ItemGroup>
<PropertyGroup>
<NoWarn>IDE0130</NoWarn>
</PropertyGroup>
</Project>
3 changes: 3 additions & 0 deletions TRRandomizerView/TRRandomizerView.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,7 @@
<Resource Include="Resources\rando_sm.png" />
<Resource Include="Resources\up.png" />
</ItemGroup>
<PropertyGroup>
<NoWarn>IDE0130</NoWarn>
</PropertyGroup>
</Project>
5 changes: 4 additions & 1 deletion TextureExport/TextureExport.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>
<PropertyGroup>
<NoWarn>IDE0130</NoWarn>
</PropertyGroup>
</Project>