1
0
mirror of synced 2024-12-01 02:27:22 +01:00

FTEX : Keep texture instance intact when replace all is used

This commit is contained in:
KillzXGaming 2019-11-23 16:35:08 -05:00
parent bb5599bfd7
commit f443ae4f14
2 changed files with 2 additions and 6 deletions

View File

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

View File

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