Fix some dialog issues and paste the full data size for IGZ to prevent size issues

This commit is contained in:
KillzXGaming 2019-08-04 21:12:36 -04:00
parent 15ab766a56
commit aa92482f15
5 changed files with 26 additions and 5 deletions

View file

@ -91,6 +91,9 @@ namespace FirstPlugin
file.Read(reader);
files.Add(file);
// if (Utils.GetExtension(file.FileName) == ".igz")
// file.OpenFileFormatOnLoad = true;
//Remove this stupid long pointless path
file.FileName = file.FileName.Replace("temporary/octane/data/nx/output/", string.Empty);

View file

@ -77,7 +77,7 @@ namespace FirstPlugin
{ 0x994608DE, new FormatInfo(TEX_FORMAT.R32G32B32_FLOAT) }, //PC
{ 0x1B282851, new FormatInfo(TEX_FORMAT.BC1_UNORM, PlatformSwizzle.Platform_Switch) },
{ 0x37456ECD, new FormatInfo(TEX_FORMAT.BC3_UNORM, PlatformSwizzle.Platform_Switch) },
{ 0xD0124568, new FormatInfo(TEX_FORMAT.BC5_UNORM, PlatformSwizzle.Platform_Switch) },
{ 0xD0124568, new FormatInfo(TEX_FORMAT.BC3_UNORM, PlatformSwizzle.Platform_Switch) },
{ 0x8EBE8CF2, new FormatInfo(TEX_FORMAT.R32G32B32_FLOAT, PlatformSwizzle.Platform_Switch) },
{ 0xF8313483, new FormatInfo(TEX_FORMAT.BC1_UNORM, PlatformSwizzle.Platform_Ps4) },
{ 0xF0B976CF, new FormatInfo(TEX_FORMAT.BC3_UNORM, PlatformSwizzle.Platform_Ps4) },
@ -164,6 +164,8 @@ namespace FirstPlugin
TextureFormat = Formats[FormatCode];
else
throw new Exception("Unsupported format code!" + FormatCode.ToString("X"));
Console.WriteLine($"TextureFormat {FormatCode.ToString("X")}");
break;
case "RVTB":
break;
@ -198,13 +200,18 @@ namespace FirstPlugin
//Seek to start of image block
reader.Seek(84);
ImageData = reader.ReadBytes((int)ImageSize);
long dataPos = reader.Position;
long ImageSizeReal = reader.BaseStream.Length - dataPos;
ImageData = reader.ReadBytes((int)ImageSizeReal);
Width = width;
Height = height;
Depth = depth;
ArrayCount = arrayCount;
Format = TextureFormat.Format;
PlatformSwizzle = TextureFormat.Platform;
// PlatformSwizzle = TextureFormat.Platform;
Console.WriteLine($"PlatformSwizzle " + PlatformSwizzle);
}
}

View file

@ -5,7 +5,7 @@ using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using System.Windows.Forms;
namespace Toolbox.Library.Forms
@ -104,7 +104,18 @@ namespace Toolbox.Library.Forms
private void btnCopy_Click(object sender, EventArgs e)
{
Clipboard.SetText(tbDetails.Text);
string text = tbDetails.Text;
Thread STAThread = new Thread(
delegate ()
{
// Use a fully qualified name for Clipboard otherwise it
// will end up calling itself.
System.Windows.Forms.Clipboard.SetText(text);
});
STAThread.SetApartmentState(ApartmentState.STA);
STAThread.Start();
STAThread.Join();
}
}
}