mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-22 20:43:09 +00:00
Adjustments for ftex replace settings
This commit is contained in:
parent
d311562793
commit
639aabb997
11 changed files with 12 additions and 12 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -182,11 +182,11 @@ namespace Bfres.Structs
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Replace(string FileName) {
|
public override void Replace(string FileName) {
|
||||||
ReplaceTexture(FileName);
|
ReplaceTexture(FileName, Format);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReplaceTexture(string FileName, uint MipMapCount = 0, TEX_FORMAT[] SupportedFormats = null,
|
public void ReplaceTexture(string FileName, TEX_FORMAT DefaultFormat = TEX_FORMAT.UNKNOWN, uint MipMapCount = 0, TEX_FORMAT[] SupportedFormats = null,
|
||||||
bool IsSwizzleReadOnly = false, bool IsTileModeReadOnly = false, bool IsFormatReadOnly = false, TEX_FORMAT DefaultFormat = TEX_FORMAT.UNKNOWN, uint SwizzlePattern = 0)
|
bool IsSwizzleReadOnly = false, bool IsTileModeReadOnly = false, bool IsFormatReadOnly = false, uint SwizzlePattern = 0)
|
||||||
{
|
{
|
||||||
string ext = System.IO.Path.GetExtension(FileName);
|
string ext = System.IO.Path.GetExtension(FileName);
|
||||||
ext = ext.ToLower();
|
ext = ext.ToLower();
|
||||||
|
|
|
@ -354,7 +354,7 @@ namespace FirstPlugin
|
||||||
int size = data.Length;
|
int size = data.Length;
|
||||||
|
|
||||||
FTEX ftex = new FTEX();
|
FTEX ftex = new FTEX();
|
||||||
ftex.ReplaceTexture(FileName, MipCount, SupportedFormats, true, true, true, Format);
|
ftex.ReplaceTexture(FileName, Format, MipCount, SupportedFormats, true, true, true);
|
||||||
if (ftex.texture != null)
|
if (ftex.texture != null)
|
||||||
{
|
{
|
||||||
byte[] ImageData = ftex.texture.Data;
|
byte[] ImageData = ftex.texture.Data;
|
||||||
|
|
|
@ -333,7 +333,7 @@ namespace FirstPlugin
|
||||||
int size = data.Length;
|
int size = data.Length;
|
||||||
|
|
||||||
FTEX ftex = new FTEX();
|
FTEX ftex = new FTEX();
|
||||||
ftex.ReplaceTexture(FileName, MipCount, SupportedFormats, true, true, true, Format);
|
ftex.ReplaceTexture(FileName, Format, MipCount, SupportedFormats, true, true, true);
|
||||||
if (ftex.texture != null)
|
if (ftex.texture != null)
|
||||||
{
|
{
|
||||||
byte[] ImageData = ftex.texture.Data;
|
byte[] ImageData = ftex.texture.Data;
|
||||||
|
|
|
@ -258,7 +258,7 @@ namespace FirstPlugin
|
||||||
if (ofd.ShowDialog() == DialogResult.OK)
|
if (ofd.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
Bfres.Structs.FTEX ftex = new Bfres.Structs.FTEX();
|
Bfres.Structs.FTEX ftex = new Bfres.Structs.FTEX();
|
||||||
ftex.ReplaceTexture(ofd.FileName, 1, SupportedFormats, true, true, false, Format, (uint)(SheetIndex * 2));
|
ftex.ReplaceTexture(ofd.FileName, Format, 1, SupportedFormats, true, true, false, (uint)(SheetIndex * 2));
|
||||||
if (ftex.texture != null)
|
if (ftex.texture != null)
|
||||||
{
|
{
|
||||||
TextureTGLP.Format = (ushort)ConvertToGx2(Format);
|
TextureTGLP.Format = (ushort)ConvertToGx2(Format);
|
||||||
|
|
|
@ -150,7 +150,7 @@ namespace FirstPlugin
|
||||||
if (ofd.ShowDialog() == DialogResult.OK)
|
if (ofd.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
FTEX ftex = new FTEX();
|
FTEX ftex = new FTEX();
|
||||||
ftex.ReplaceTexture(ofd.FileName, 1, SupportedFormats, true, true, false, Format);
|
ftex.ReplaceTexture(ofd.FileName, Format, 1, SupportedFormats, true, true, false);
|
||||||
if (ftex.texture != null)
|
if (ftex.texture != null)
|
||||||
{
|
{
|
||||||
image.BCLIMFormat = ConvertFormatGenericToBflim(ftex.Format);
|
image.BCLIMFormat = ConvertFormatGenericToBflim(ftex.Format);
|
||||||
|
|
|
@ -169,7 +169,7 @@ namespace FirstPlugin
|
||||||
if (ofd.ShowDialog() != DialogResult.OK) return;
|
if (ofd.ShowDialog() != DialogResult.OK) return;
|
||||||
|
|
||||||
FTEX ftex = new FTEX();
|
FTEX ftex = new FTEX();
|
||||||
ftex.ReplaceTexture(ofd.FileName, 1, bflim.SupportedFormats, true, true, false, TEX_FORMAT.BC3_UNORM_SRGB);
|
ftex.ReplaceTexture(ofd.FileName, TEX_FORMAT.BC3_UNORM_SRGB, 1, bflim.SupportedFormats, true, true, false);
|
||||||
if (ftex.texture != null)
|
if (ftex.texture != null)
|
||||||
{
|
{
|
||||||
bflim.Text = ftex.texture.Name;
|
bflim.Text = ftex.texture.Name;
|
||||||
|
@ -199,7 +199,7 @@ namespace FirstPlugin
|
||||||
if (ofd.ShowDialog() == DialogResult.OK)
|
if (ofd.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
FTEX ftex = new FTEX();
|
FTEX ftex = new FTEX();
|
||||||
ftex.ReplaceTexture(ofd.FileName, 1, SupportedFormats, true, true, false, Format);
|
ftex.ReplaceTexture(ofd.FileName, Format, 1, SupportedFormats, true, true, false);
|
||||||
if (ftex.texture != null)
|
if (ftex.texture != null)
|
||||||
{
|
{
|
||||||
image.Swizzle = (byte)ftex.texture.Swizzle;
|
image.Swizzle = (byte)ftex.texture.Swizzle;
|
||||||
|
|
|
@ -528,7 +528,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, 1, SupportedFormats, true, true);
|
ftex.ReplaceTexture(FileName, Format, 1, SupportedFormats, true, true);
|
||||||
if (ftex.texture != null)
|
if (ftex.texture != null)
|
||||||
{
|
{
|
||||||
surface.swizzle = ftex.texture.Swizzle;
|
surface.swizzle = ftex.texture.Swizzle;
|
||||||
|
|
|
@ -150,12 +150,12 @@ void main()
|
||||||
|
|
||||||
if (RigidSkinning == 1)
|
if (RigidSkinning == 1)
|
||||||
{
|
{
|
||||||
position = mtxCam * (bones[index.x] * vec4(vPosition.xyz, 1.0));
|
position = mtxCam * mtxMdl * (bones[index.x] * vec4(vPosition.xyz, 1.0));
|
||||||
normal = mat3(bones[index.x]) * vNormal.xyz * 1;
|
normal = mat3(bones[index.x]) * vNormal.xyz * 1;
|
||||||
}
|
}
|
||||||
if (NoSkinning == 1)
|
if (NoSkinning == 1)
|
||||||
{
|
{
|
||||||
position = mtxCam * (SingleBoneBindTransform * vec4(vPosition.xyz, 1.0));
|
position = mtxCam * mtxMdl * (SingleBoneBindTransform * vec4(vPosition.xyz, 1.0));
|
||||||
normal = mat3(SingleBoneBindTransform) * vNormal.xyz * 1;
|
normal = mat3(SingleBoneBindTransform) * vNormal.xyz * 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue