Adjustments for ftex replace settings

This commit is contained in:
KillzXGaming 2019-05-16 20:10:58 -04:00
parent d311562793
commit 639aabb997
11 changed files with 12 additions and 12 deletions

Binary file not shown.

View file

@ -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();

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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);

View file

@ -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;

View file

@ -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;

View file

@ -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;
} }