Revert "Improved RuntimeTexturePacker speed when using many distinct texture sizes"

This reverts commit ca9c8e6cfd.
This commit is contained in:
Ell 2023-01-30 22:51:15 +01:00
parent ca9c8e6cfd
commit 7f7a9c6415
2 changed files with 1 additions and 10 deletions

View File

@ -12,10 +12,6 @@ Jump to version:
## 6.2.0 (In Development)
### MLEM.Data
Improvements
- Improved RuntimeTexturePacker speed when using many distinct texture sizes
## 6.1.0
### MLEM

View File

@ -238,12 +238,7 @@ namespace MLEM.Data {
size.X += request.Padding * 2;
size.Y += request.Padding * 2;
// initialize our search position from the cache, or use default (zero)
if (!this.firstPossiblePosForSize.TryGetValue(size, out var pos)) {
// if our size hasn't been recordet yet, check if a size has been recorded that is smaller in both axes, before which our size definitely won't fit
pos = this.firstPossiblePosForSize.OrderByDescending(s => s.Key.X * s.Key.Y).FirstOrDefault(s => s.Key.X <= size.X && s.Key.Y <= size.Y).Value;
}
var pos = this.firstPossiblePosForSize.TryGetValue(size, out var first) ? first : Point.Zero;
var lowestY = int.MaxValue;
while (true) {
var intersected = false;