Improve loading performance for loader/compression classes.

- In RLEZerosCompression use dedicated Array.Clear method instead of open-coded loop.
- In VoxelLoader.GenerateSlicePlanes.Get use TryGetValue to avoid repeated array and dictionary lookups.
- In TmpTSLoader.UnpackTileData use ReadBytes to populate array with less overhead compared to repeated one byte reads.
- Resolve TODO in VqaVideo.
This commit is contained in:
RoosterDragon
2023-06-28 18:47:23 +01:00
committed by Gustas
parent dccb3ce9ce
commit 1c0885c636
4 changed files with 12 additions and 81 deletions

View File

@@ -108,10 +108,10 @@ namespace OpenRA.Mods.Cnc.Graphics
return null;
var v = l.VoxelMap[(byte)x, (byte)y];
if (v == null || !v.ContainsKey((byte)z))
if (v == null || !v.TryGetValue((byte)z, out var element))
return null;
return l.VoxelMap[(byte)x, (byte)y][(byte)z];
return element;
}
// Cull slices without any visible faces