Skip to content

Commit 657c12f

Browse files
committed
Merge branch 'master' into dotrecast-update
2 parents 017f38b + e69a0e9 commit 657c12f

File tree

9 files changed

+437
-316
lines changed

9 files changed

+437
-316
lines changed

meshtool/Program.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using DotRecast.Detour.Io;
2+
3+
internal class Program
4+
{
5+
private static int Main(string[] args)
6+
{
7+
switch (args) {
8+
case ["export", var path]:
9+
DoExport(path);
10+
return 0;
11+
default:
12+
Console.WriteLine($"Usage: {Environment.ProcessPath} export <path-to-file>");
13+
return 1;
14+
}
15+
16+
}
17+
18+
static void DoExport(string cachePath)
19+
{
20+
var cacheFile = new FileInfo(cachePath);
21+
using var stream = cacheFile.OpenRead();
22+
using var reader = new BinaryReader(stream);
23+
var mesh = Navmesh.Navmesh.Deserialize(reader, 1);
24+
25+
var outFile = new FileInfo(cacheFile.Name);
26+
using var s2 = outFile.OpenWrite();
27+
using var writer = new BinaryWriter(s2);
28+
new DtMeshSetWriter().Write(writer, mesh.Mesh, DotRecast.Core.RcByteOrder.LITTLE_ENDIAN, false);
29+
30+
Console.WriteLine($"wrote converted mesh to {outFile.FullName}");
31+
}
32+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"profiles": {
3+
"meshtool": {
4+
"commandName": "Project",
5+
"workingDirectory": "$(SolutionDir)",
6+
"remoteDebugEnabled": false
7+
}
8+
}
9+
}

meshtool/meshtool.csproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0-windows</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<ProjectReference Include="..\vnavmesh\vnavmesh.csproj" />
12+
</ItemGroup>
13+
14+
</Project>

vnavmesh.sln

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
2424
.github\workflows\publish.yml = .github\workflows\publish.yml
2525
EndProjectSection
2626
EndProject
27+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "meshtool", "meshtool\meshtool.csproj", "{F4E1A085-2233-48D0-A19E-4E863FF8D1AA}"
28+
ProjectSection(ProjectDependencies) = postProject
29+
{2FFA240D-4F85-467D-BA78-3A98204D3AF9} = {2FFA240D-4F85-467D-BA78-3A98204D3AF9}
30+
{34BBFC6C-C3AC-4848-98C9-E6DEEF2BC26A} = {34BBFC6C-C3AC-4848-98C9-E6DEEF2BC26A}
31+
{99DB06BA-F9E0-4544-A285-649DD3CC66B0} = {99DB06BA-F9E0-4544-A285-649DD3CC66B0}
32+
{A15D7C63-D8B7-4433-9F05-4832BB2F29C0} = {A15D7C63-D8B7-4433-9F05-4832BB2F29C0}
33+
EndProjectSection
34+
EndProject
2735
Global
2836
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2937
Debug|Any CPU = Debug|Any CPU
@@ -96,6 +104,14 @@ Global
96104
{7A5349FA-A2CE-40A5-804B-DFA52D13336A}.Release|Any CPU.Build.0 = Release|Any CPU
97105
{7A5349FA-A2CE-40A5-804B-DFA52D13336A}.Release|x64.ActiveCfg = Release|Any CPU
98106
{7A5349FA-A2CE-40A5-804B-DFA52D13336A}.Release|x64.Build.0 = Release|Any CPU
107+
{F4E1A085-2233-48D0-A19E-4E863FF8D1AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
108+
{F4E1A085-2233-48D0-A19E-4E863FF8D1AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
109+
{F4E1A085-2233-48D0-A19E-4E863FF8D1AA}.Debug|x64.ActiveCfg = Debug|Any CPU
110+
{F4E1A085-2233-48D0-A19E-4E863FF8D1AA}.Debug|x64.Build.0 = Debug|Any CPU
111+
{F4E1A085-2233-48D0-A19E-4E863FF8D1AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
112+
{F4E1A085-2233-48D0-A19E-4E863FF8D1AA}.Release|Any CPU.Build.0 = Release|Any CPU
113+
{F4E1A085-2233-48D0-A19E-4E863FF8D1AA}.Release|x64.ActiveCfg = Release|Any CPU
114+
{F4E1A085-2233-48D0-A19E-4E863FF8D1AA}.Release|x64.Build.0 = Release|Any CPU
99115
EndGlobalSection
100116
GlobalSection(SolutionProperties) = preSolution
101117
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)