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:
@@ -120,8 +120,7 @@ namespace OpenRA.Mods.Cnc.SpriteLoaders
|
||||
for (var j = 0; j < size.Height; j++)
|
||||
{
|
||||
var start = (j - frameBounds.Y) * frameBounds.Width + (size.Width - width) / 2 - frameBounds.X;
|
||||
for (var i = 0; i < width; i++)
|
||||
data[start + i] = s.ReadUInt8();
|
||||
s.ReadBytes(data, start, width);
|
||||
|
||||
width += (j < size.Height / 2 - 1 ? 1 : -1) * 4;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user