From f443ae4f14b5adbf4d3119779cf6f8e58d760035 Mon Sep 17 00:00:00 2001 From: KillzXGaming Date: Sat, 23 Nov 2019 16:35:08 -0500 Subject: [PATCH] FTEX : Keep texture instance intact when replace all is used --- File_Format_Library/FileFormats/BFRES/BFRESGroupNode.cs | 5 ++--- File_Format_Library/FileFormats/Layout/CAFE/BflytShader.cs | 3 --- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/File_Format_Library/FileFormats/BFRES/BFRESGroupNode.cs b/File_Format_Library/FileFormats/BFRES/BFRESGroupNode.cs index dc568045..506a9ef7 100644 --- a/File_Format_Library/FileFormats/BFRES/BFRESGroupNode.cs +++ b/File_Format_Library/FileFormats/BFRES/BFRESGroupNode.cs @@ -230,7 +230,7 @@ namespace Bfres.Structs { if (setting.TexName == ftex.Text) { - if (setting.GenerateMipmaps) + if (setting.GenerateMipmaps && !setting.IsFinishedCompressing) { setting.DataBlockOutput.Clear(); setting.DataBlockOutput.Add(setting.GenerateMips()); @@ -238,12 +238,11 @@ namespace Bfres.Structs if (setting.DataBlockOutput != null) { - ftex.texture = new ResU.Texture(); var surface = GTXSwizzle.CreateGx2Texture(setting.DataBlockOutput[0], setting); var tex = FTEX.FromGx2Surface(surface, setting.TexName); ftex.UpdateTex(tex); + tex.Name = Text; ftex.IsEdited = true; - ftex.Read(ftex.texture); ftex.LoadOpenGLTexture(); } diff --git a/File_Format_Library/FileFormats/Layout/CAFE/BflytShader.cs b/File_Format_Library/FileFormats/Layout/CAFE/BflytShader.cs index d17baf0d..172e9255 100644 --- a/File_Format_Library/FileFormats/Layout/CAFE/BflytShader.cs +++ b/File_Format_Library/FileFormats/Layout/CAFE/BflytShader.cs @@ -94,9 +94,6 @@ namespace LayoutBXLYT shader.SetInt("textures1", 0); shader.SetInt("textures2", 0); - if (Runtime.DEVELOPER_DEBUG_MODE) - return; - BindTextureUniforms(shader, material); if (material.TextureMaps.Length > 0 || Runtime.LayoutEditor.Shading == Runtime.LayoutEditor.DebugShading.UVTestPattern)