feat(app): load landblock from dats and upload mesh to GPU
GameWindow now owns a DatCollection + TerrainRenderer. On load it opens the dat directory passed as argv[0] (or ACDREAM_DAT_DIR), finds Holtburg (landblock 0xA9B4FFFF) by default with a fallback to the first landblock in the cell b-tree, builds the CPU mesh from LandblockMesh.Build, and uploads VBO+EBO+VAO with a 3f/3f/2f attribute layout. No draw call yet — shader and matrix uniforms land in Task 9. Enabled AllowUnsafeBlocks on the App csproj so the fixed-buffer upload in TerrainRenderer compiles. Uses dats.Get<LandBlock>(id) instead of TryGet(..., out T) to sidestep the [MaybeNullWhen(false)] analysis that TreatWarningsAsErrors was flagging. Smoke verified against the real retail dats: prints "loaded landblock 0xA9B4FFFF" and the window stays alive with no GL errors or exceptions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
6d18e0bd38
commit
8356fe65a0
4 changed files with 113 additions and 1 deletions
|
|
@ -1,5 +1,15 @@
|
|||
using AcDream.App.Rendering;
|
||||
|
||||
var window = new GameWindow();
|
||||
var datDir = args.FirstOrDefault()
|
||||
?? Environment.GetEnvironmentVariable("ACDREAM_DAT_DIR");
|
||||
|
||||
if (string.IsNullOrWhiteSpace(datDir))
|
||||
{
|
||||
Console.Error.WriteLine("usage: AcDream.App <dat-directory>");
|
||||
Console.Error.WriteLine(" or: set ACDREAM_DAT_DIR and run with no args");
|
||||
return 2;
|
||||
}
|
||||
|
||||
using var window = new GameWindow(datDir);
|
||||
window.Run();
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue