memory reports
This commit is contained in:
@@ -54,11 +54,32 @@ namespace SplashEdit.RuntimeCode
|
||||
|
||||
private PSXObjectExporter[] _exporters;
|
||||
private TextureAtlas[] _atlases;
|
||||
|
||||
|
||||
// Component arrays
|
||||
private PSXInteractable[] _interactables;
|
||||
private PSXAudioClip[] _audioSources;
|
||||
private PSXTriggerBox[] _triggerBoxes;
|
||||
|
||||
// ── Post-export data for memory analysis ──
|
||||
/// <summary>Texture atlases from the last export (null before first export).</summary>
|
||||
public TextureAtlas[] LastExportAtlases => _atlases;
|
||||
/// <summary>Custom font data from the last export.</summary>
|
||||
public PSXFontData[] LastExportFonts => _fonts;
|
||||
/// <summary>Audio clip ADPCM sizes from the last export.</summary>
|
||||
public long[] LastExportAudioSizes => _lastAudioSizes;
|
||||
private long[] _lastAudioSizes;
|
||||
/// <summary>Total triangle count from the last export.</summary>
|
||||
public int LastExportTriangleCount
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_exporters == null) return 0;
|
||||
int count = 0;
|
||||
foreach (var exp in _exporters)
|
||||
if (exp.Mesh != null) count += exp.Mesh.Triangles.Count;
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
||||
// Phase 3+4: World collision and nav regions
|
||||
private PSXCollisionExporter _collisionExporter;
|
||||
@@ -271,6 +292,18 @@ namespace SplashEdit.RuntimeCode
|
||||
audioExports = list.ToArray();
|
||||
}
|
||||
|
||||
// Cache audio sizes for memory analysis
|
||||
if (audioExports != null)
|
||||
{
|
||||
_lastAudioSizes = new long[audioExports.Length];
|
||||
for (int i = 0; i < audioExports.Length; i++)
|
||||
_lastAudioSizes[i] = audioExports[i].adpcmData != null ? audioExports[i].adpcmData.Length : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
_lastAudioSizes = null;
|
||||
}
|
||||
|
||||
var scene = new PSXSceneWriter.SceneData
|
||||
{
|
||||
exporters = _exporters,
|
||||
|
||||
Reference in New Issue
Block a user