GTX : Fix channel properties and add default mip target

This commit is contained in:
KillzXGaming 2022-10-29 12:47:56 -04:00
parent 0a9520d1f2
commit 423463d082

View file

@ -719,7 +719,7 @@ namespace FirstPlugin
public override void Replace(string FileName) public override void Replace(string FileName)
{ {
FTEX ftex = new FTEX(); FTEX ftex = new FTEX();
ftex.ReplaceTexture(FileName, Format); ftex.ReplaceTexture(FileName, Format, surface.mipSize <= 1 ? 1 : 0);
if (ftex.texture != null) if (ftex.texture != null)
{ {
surface.swizzle = ftex.texture.Swizzle; surface.swizzle = ftex.texture.Swizzle;
@ -777,7 +777,13 @@ namespace FirstPlugin
editor.Text = Text; editor.Text = Text;
var tex = FTEX.FromGx2Surface(surface, Text); var tex = FTEX.FromGx2Surface(surface, Text);
tex.MipCount = MipCount; tex.MipCount = MipCount;
editor.LoadProperties(tex); editor.LoadProperties(tex, () =>
{
surface.compSel[0] = (byte)tex.CompSelR;
surface.compSel[1] = (byte)tex.CompSelG;
surface.compSel[2] = (byte)tex.CompSelB;
surface.compSel[3] = (byte)tex.CompSelA;
});
editor.LoadImage(this); editor.LoadImage(this);
} }
} }