Add more detailed model loading timings

This commit is contained in:
Jarrod Doyle 2024-08-30 17:47:19 +01:00
parent 8237a46989
commit 89cc70345e
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
2 changed files with 2 additions and 2 deletions

View File

@ -245,7 +245,7 @@ public partial class Mission : Node3D
var rawRot = brush.angle;
var rot = new Vector3(rawRot.Y, rawRot.Z, rawRot.X) * 360 / ushort.MaxValue;
var scale = scaleProp == null ? Vector3.One : scaleProp.scale.ToGodotVec3(false);
var model = Timing.TimeStage("Load Models", () => { return _modelLoader.Load(_campaignName, modelName); });
var model = Timing.TimeStage("Get Models", () => { return _modelLoader.Load(_campaignName, modelName); });
if (model != null)
{
model.Position = pos;

View File

@ -32,7 +32,7 @@ public class ModelLoader
}
// We don't care if this is null actually, we'll still cache that it's null lol
var model = LoadModel(_pathManager, ref campaignName, modelName);
var model = Timing.TimeStage("Load Models", () => { return LoadModel(_pathManager, ref campaignName, modelName); });
_cache[(campaignName, modelName)] = model;
return model == null ? model : model.Duplicate() as MeshInstance3D;
}