Fix tex2 files from loading mips in image editor
This commit is contained in:
parent
ea099ee2dd
commit
2f4b03a454
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -392,7 +392,7 @@ namespace Bfres.Structs
|
|||||||
if (!IsEdited && Tex1 != null && Tex1.Contains(".Tex1"))
|
if (!IsEdited && Tex1 != null && Tex1.Contains(".Tex1"))
|
||||||
{
|
{
|
||||||
string Tex2 = Tex1.Replace(".Tex1", ".Tex2");
|
string Tex2 = Tex1.Replace(".Tex1", ".Tex2");
|
||||||
Console.WriteLine(Tex2);
|
Console.WriteLine(Tex2 + " " + System.IO.File.Exists(Tex2));
|
||||||
|
|
||||||
if (System.IO.File.Exists(Tex2))
|
if (System.IO.File.Exists(Tex2))
|
||||||
{
|
{
|
||||||
@ -407,8 +407,12 @@ namespace Bfres.Structs
|
|||||||
{
|
{
|
||||||
resFile2 = new ResFile(Tex2);
|
resFile2 = new ResFile(Tex2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Console.WriteLine((resFile2.Textures.ContainsKey(texture.Name)));
|
||||||
|
|
||||||
if (resFile2.Textures.ContainsKey(texture.Name))
|
if (resFile2.Textures.ContainsKey(texture.Name))
|
||||||
{
|
{
|
||||||
|
MipCount = texture.MipCount;
|
||||||
texture.MipData = resFile2.Textures[texture.Name].MipData;
|
texture.MipData = resFile2.Textures[texture.Name].MipData;
|
||||||
texture.MipOffsets = resFile2.Textures[texture.Name].MipOffsets;
|
texture.MipOffsets = resFile2.Textures[texture.Name].MipOffsets;
|
||||||
surf.mipData = resFile2.Textures[texture.Name].MipData;
|
surf.mipData = resFile2.Textures[texture.Name].MipData;
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -432,6 +432,9 @@ namespace Switch_Toolbox.Library
|
|||||||
|
|
||||||
public static List<List<byte[]>> Decode(GX2Surface tex, string DebugTextureName = "")
|
public static List<List<byte[]>> Decode(GX2Surface tex, string DebugTextureName = "")
|
||||||
{
|
{
|
||||||
|
if (tex.data.Length <= 0)
|
||||||
|
throw new Exception("Invalid GX2 surface data. Make sure to not open Tex2 files if this is one. Those will load automatically next to Tex1!");
|
||||||
|
|
||||||
Console.WriteLine("DECODING TEX " + DebugTextureName);
|
Console.WriteLine("DECODING TEX " + DebugTextureName);
|
||||||
|
|
||||||
var surfdEBUG = getSurfaceInfo((GX2SurfaceFormat)tex.format, tex.width, tex.height, tex.depth, (uint)tex.dim, (uint)tex.tileMode, (uint)tex.aa, 0);
|
var surfdEBUG = getSurfaceInfo((GX2SurfaceFormat)tex.format, tex.width, tex.height, tex.depth, (uint)tex.dim, (uint)tex.tileMode, (uint)tex.aa, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user