mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2025-02-16 22:08:26 +00:00
Fix bffnt with bntx that changes the sheet size
This commit is contained in:
parent
46d729e2d8
commit
b5f50c824c
5 changed files with 17 additions and 16 deletions
|
@ -829,6 +829,13 @@ namespace FirstPlugin
|
|||
{
|
||||
long pos = writer.Position;
|
||||
|
||||
if (BinaryTextureFile != null)
|
||||
{
|
||||
var mem = new System.IO.MemoryStream();
|
||||
BinaryTextureFile.Save(mem);
|
||||
SheetDataList[0] = mem.ToArray();
|
||||
}
|
||||
|
||||
writer.WriteSignature("TGLP");
|
||||
writer.Write(uint.MaxValue);
|
||||
writer.Write(CellWidth);
|
||||
|
@ -850,13 +857,6 @@ namespace FirstPlugin
|
|||
else
|
||||
writer.Align(8192);
|
||||
|
||||
if (BinaryTextureFile != null)
|
||||
{
|
||||
var mem = new System.IO.MemoryStream();
|
||||
BinaryTextureFile.Save(mem);
|
||||
SheetDataList[0] = mem.ToArray();
|
||||
}
|
||||
|
||||
long DataPosition = writer.Position;
|
||||
using (writer.TemporarySeek(_ofsSheetBlocks, SeekOrigin.Begin))
|
||||
{
|
||||
|
|
|
@ -1407,15 +1407,16 @@ namespace FirstPlugin
|
|||
break;
|
||||
}
|
||||
|
||||
//After image data is replaced, use original and swap the specific array index
|
||||
for (int i = 0; i < ImageDataCached.Count; i++)
|
||||
{
|
||||
if (i == ArrayIndex)
|
||||
ImageDataCached[i] = Texture.TextureData[0];
|
||||
}
|
||||
|
||||
if (ImageDataCached.Count > 0)
|
||||
Texture.TextureData = ImageDataCached;
|
||||
{
|
||||
//After image data is replaced, use original and swap the specific array index
|
||||
ImageDataCached[(int)ArrayIndex] = Texture.TextureData[0];
|
||||
|
||||
Texture.TextureData.Clear();
|
||||
|
||||
for (int i = 0; i < ImageDataCached.Count; i++)
|
||||
Texture.TextureData.Add(ImageDataCached[i]);
|
||||
}
|
||||
}
|
||||
public void ApplyImportSettings(TextureImporterSettings setting,STCompressionMode CompressionMode)
|
||||
{
|
||||
|
|
|
@ -140,7 +140,7 @@ namespace Toolbox.Library
|
|||
public IFileFormat FileFormat = null; //Format attached for saving
|
||||
|
||||
[Browsable(false)]
|
||||
protected byte[] _fileData = null;
|
||||
private byte[] _fileData = null;
|
||||
|
||||
//Full File Name
|
||||
private string _fileName = string.Empty;
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Add table
Reference in a new issue