Add option to export images in "assetName@hash" name format

- Redesigned spriteHelper & texture2DConverter
- Improved speed of texture2D preview a bit
This commit is contained in:
VaDiM
2026-03-13 13:27:47 +03:00
parent 94090a997a
commit 61d9bc8f15
16 changed files with 611 additions and 407 deletions
+18 -2
View File
@@ -20,12 +20,28 @@ namespace AssetStudioGUI
m_bitmap = new Bitmap(Width, Height, Stride, PixelFormat.Format32bppArgb, m_handle.AddrOfPinnedObject());
}
public DirectBitmap(Texture2D texture2D, bool flip)
{
Width = texture2D.m_Width;
Height = texture2D.m_Height;
var converter = new Texture2DConverter(texture2D);
Bits = BigArrayPool<byte>.Shared.Rent(converter.OutputDataSize);
if (converter.GetBgra32RawImageData(Bits, flip))
{
m_handle = GCHandle.Alloc(Bits, GCHandleType.Pinned);
m_bitmap = new Bitmap(Width, Height, Stride, PixelFormat.Format32bppArgb, m_handle.AddrOfPinnedObject());
}
}
private void Dispose(bool disposing)
{
if (disposing)
{
m_bitmap.Dispose();
m_handle.Free();
if (m_bitmap != null)
{
m_bitmap.Dispose();
m_handle.Free();
}
BigArrayPool<byte>.Shared.Return(Bits);
}
m_bitmap = null;