1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-22 04:53:29 +01:00

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) ## 6.2.0 (In Development)
### MLEM.Data
Improvements
- Improved RuntimeTexturePacker speed when using many distinct texture sizes
## 6.1.0 ## 6.1.0
### MLEM ### MLEM

View file

@ -238,12 +238,7 @@ namespace MLEM.Data {
size.X += request.Padding * 2; size.X += request.Padding * 2;
size.Y += request.Padding * 2; size.Y += request.Padding * 2;
// initialize our search position from the cache, or use default (zero) var pos = this.firstPossiblePosForSize.TryGetValue(size, out var first) ? first : Point.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 lowestY = int.MaxValue; var lowestY = int.MaxValue;
while (true) { while (true) {
var intersected = false; var intersected = false;