FTEX : Keep texture instance intact when replace all is used
This commit is contained in:
parent
bb5599bfd7
commit
f443ae4f14
@ -230,7 +230,7 @@ namespace Bfres.Structs
|
|||||||
{
|
{
|
||||||
if (setting.TexName == ftex.Text)
|
if (setting.TexName == ftex.Text)
|
||||||
{
|
{
|
||||||
if (setting.GenerateMipmaps)
|
if (setting.GenerateMipmaps && !setting.IsFinishedCompressing)
|
||||||
{
|
{
|
||||||
setting.DataBlockOutput.Clear();
|
setting.DataBlockOutput.Clear();
|
||||||
setting.DataBlockOutput.Add(setting.GenerateMips());
|
setting.DataBlockOutput.Add(setting.GenerateMips());
|
||||||
@ -238,12 +238,11 @@ namespace Bfres.Structs
|
|||||||
|
|
||||||
if (setting.DataBlockOutput != null)
|
if (setting.DataBlockOutput != null)
|
||||||
{
|
{
|
||||||
ftex.texture = new ResU.Texture();
|
|
||||||
var surface = GTXSwizzle.CreateGx2Texture(setting.DataBlockOutput[0], setting);
|
var surface = GTXSwizzle.CreateGx2Texture(setting.DataBlockOutput[0], setting);
|
||||||
var tex = FTEX.FromGx2Surface(surface, setting.TexName);
|
var tex = FTEX.FromGx2Surface(surface, setting.TexName);
|
||||||
ftex.UpdateTex(tex);
|
ftex.UpdateTex(tex);
|
||||||
|
tex.Name = Text;
|
||||||
ftex.IsEdited = true;
|
ftex.IsEdited = true;
|
||||||
|
|
||||||
ftex.Read(ftex.texture);
|
ftex.Read(ftex.texture);
|
||||||
ftex.LoadOpenGLTexture();
|
ftex.LoadOpenGLTexture();
|
||||||
}
|
}
|
||||||
|
@ -94,9 +94,6 @@ namespace LayoutBXLYT
|
|||||||
shader.SetInt("textures1", 0);
|
shader.SetInt("textures1", 0);
|
||||||
shader.SetInt("textures2", 0);
|
shader.SetInt("textures2", 0);
|
||||||
|
|
||||||
if (Runtime.DEVELOPER_DEBUG_MODE)
|
|
||||||
return;
|
|
||||||
|
|
||||||
BindTextureUniforms(shader, material);
|
BindTextureUniforms(shader, material);
|
||||||
|
|
||||||
if (material.TextureMaps.Length > 0 || Runtime.LayoutEditor.Shading == Runtime.LayoutEditor.DebugShading.UVTestPattern)
|
if (material.TextureMaps.Length > 0 || Runtime.LayoutEditor.Shading == Runtime.LayoutEditor.DebugShading.UVTestPattern)
|
||||||
|
Loading…
Reference in New Issue
Block a user