Compare commits
2 Commits
261d5fe399
...
9605c36303
Author | SHA1 | Date |
---|---|---|
Jarrod Doyle | 9605c36303 | |
Jarrod Doyle | d3e58af75c |
|
@ -66,7 +66,7 @@ public partial class Mission : Node3D
|
||||||
{
|
{
|
||||||
if (Build)
|
if (Build)
|
||||||
{
|
{
|
||||||
RebuildMap();
|
Timing.TimeStage("Build", () => RebuildMap());
|
||||||
Build = false;
|
Build = false;
|
||||||
}
|
}
|
||||||
if (Clear)
|
if (Clear)
|
||||||
|
@ -104,7 +104,16 @@ public partial class Mission : Node3D
|
||||||
Timing.TimeStage("Load FAM", () => UseChunk<TxList>("TXLIST", LoadTextures));
|
Timing.TimeStage("Load FAM", () => UseChunk<TxList>("TXLIST", LoadTextures));
|
||||||
Timing.TimeStage("Build WR", () => UseChunk<WorldRep>("WREXT", BuildWrMeshes));
|
Timing.TimeStage("Build WR", () => UseChunk<WorldRep>("WREXT", BuildWrMeshes));
|
||||||
|
|
||||||
// TODO: Sort this out so I can time it lol
|
if (_file.Chunks.TryGetValue("BRLIST", out var brList))
|
||||||
|
{
|
||||||
|
var objHierarchy = Timing.TimeStage("Hierarchy", BuildHierarchy);
|
||||||
|
Timing.TimeStage("Object Placement", () => PlaceObjects((BrList)brList, objHierarchy));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: Make this less of a mess
|
||||||
|
private ObjectHierarchy BuildHierarchy()
|
||||||
|
{
|
||||||
ObjectHierarchy objHierarchy;
|
ObjectHierarchy objHierarchy;
|
||||||
if (_file.Chunks.TryGetValue("GAM_FILE", out var gamFileChunk))
|
if (_file.Chunks.TryGetValue("GAM_FILE", out var gamFileChunk))
|
||||||
{
|
{
|
||||||
|
@ -125,11 +134,7 @@ public partial class Mission : Node3D
|
||||||
{
|
{
|
||||||
objHierarchy = new ObjectHierarchy(_file);
|
objHierarchy = new ObjectHierarchy(_file);
|
||||||
}
|
}
|
||||||
|
return objHierarchy;
|
||||||
if (_file.Chunks.TryGetValue("BRLIST", out var brList))
|
|
||||||
{
|
|
||||||
Timing.TimeStage("Object Placement", () => PlaceObjects((BrList)brList, objHierarchy));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UseChunk<T>(string name, Action<T> action)
|
private void UseChunk<T>(string name, Action<T> action)
|
||||||
|
|
Loading…
Reference in New Issue