1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-26 06:28:35 +01:00

Made RuntimeTexturePacker restore texture region name and pivot when packing

This commit is contained in:
Ell 2022-08-03 10:37:59 +02:00
parent b012c65990
commit b2898a8eae
2 changed files with 5 additions and 1 deletions

View file

@ -25,6 +25,7 @@ Improvements
### MLEM.Data ### MLEM.Data
Improvements Improvements
- Allow data texture atlas pivots and offsets to be negative - Allow data texture atlas pivots and offsets to be negative
- Made RuntimeTexturePacker restore texture region name and pivot when packing
Fixes Fixes
- Fixed data texture atlases not allowing most characters in their region names - Fixed data texture atlases not allowing most characters in their region names

View file

@ -199,7 +199,10 @@ namespace MLEM.Data {
// invoke callbacks // invoke callbacks
foreach (var request in this.alreadyPackedTextures) { foreach (var request in this.alreadyPackedTextures) {
var packedArea = request.PackedArea.Shrink(new Point(request.Padding, request.Padding)); var packedArea = request.PackedArea.Shrink(new Point(request.Padding, request.Padding));
request.Result.Invoke(new TextureRegion(this.PackedTexture, packedArea)); request.Result.Invoke(new TextureRegion(this.PackedTexture, packedArea) {
Pivot = request.Texture.Pivot,
Name = request.Texture.Name
});
if (this.disposeTextures) if (this.disposeTextures)
request.Texture.Texture.Dispose(); request.Texture.Texture.Dispose();
} }