mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-22 04:23:09 +00:00
Keep original SRGB usage on .astc replace
This commit is contained in:
parent
72286ab95a
commit
0e52ac9ac6
1 changed files with 8 additions and 2 deletions
|
@ -1564,6 +1564,9 @@ namespace FirstPlugin
|
|||
ImageDataCached.Add(sliceData);
|
||||
}
|
||||
|
||||
//Check if current texture is SRGB
|
||||
bool srgb = Texture != null && Texture.UseSRGB;
|
||||
|
||||
switch (ext)
|
||||
{
|
||||
case ".bftex":
|
||||
|
@ -1577,7 +1580,8 @@ namespace FirstPlugin
|
|||
break;
|
||||
case ".astc":
|
||||
setting.LoadASTC(FileName);
|
||||
ApplyImportSettings(setting, STCompressionMode.Normal, false);
|
||||
//Keep original SRGB setting as .astc has no SRGB flags
|
||||
ApplyImportSettings(setting, STCompressionMode.Normal, false, srgb);
|
||||
break;
|
||||
default:
|
||||
setting.LoadBitMap(FileName);
|
||||
|
@ -1610,7 +1614,7 @@ namespace FirstPlugin
|
|||
Texture.TextureData.Add(ImageDataCached[i]);
|
||||
}
|
||||
}
|
||||
public void ApplyImportSettings(TextureImporterSettings setting,STCompressionMode CompressionMode, bool multiThread)
|
||||
public void ApplyImportSettings(TextureImporterSettings setting,STCompressionMode CompressionMode, bool multiThread, bool force_srgb = false)
|
||||
{
|
||||
Cursor.Current = Cursors.WaitCursor;
|
||||
|
||||
|
@ -1627,6 +1631,8 @@ namespace FirstPlugin
|
|||
}
|
||||
|
||||
tex.Name = Text;
|
||||
if (force_srgb)
|
||||
tex.UseSRGB = true;
|
||||
|
||||
Texture = tex;
|
||||
Load(tex);
|
||||
|
|
Loading…
Reference in a new issue