Skip to content

Commit

Permalink
close #479
Browse files Browse the repository at this point in the history
  • Loading branch information
4sval committed Jul 2, 2024
1 parent 9c50e2b commit c6383a1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
25 changes: 19 additions & 6 deletions FModel/ViewModels/TabControlViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,18 +240,31 @@ public void SoftReset(string header, string directory)

public void AddImage(UTexture texture, bool save, bool updateUi)
{
var img = texture.Decode(UserSettings.Default.CurrentDir.TexturePlatform);
if (texture is UTextureCube)
var appendLayerNumber = false;
var img = new SKBitmap[1];
if (texture is UTexture2DArray textureArray)
{
img = img?.ToPanorama();
img = textureArray.DecodeTextureArray(UserSettings.Default.CurrentDir.TexturePlatform);
appendLayerNumber = true;
}
else
{
img[0] = texture.Decode(UserSettings.Default.CurrentDir.TexturePlatform);
if (texture is UTextureCube)
{
img[0] = img[0]?.ToPanorama();
}
}

AddImage(texture.Name, texture.RenderNearestNeighbor, img, save, updateUi);
AddImage(texture.Name, texture.RenderNearestNeighbor, img, save, updateUi, appendLayerNumber);
}

public void AddImage(string name, bool rnn, SKBitmap[] img, bool save, bool updateUi)
public void AddImage(string name, bool rnn, SKBitmap[] img, bool save, bool updateUi, bool appendLayerNumber = false)
{
foreach (var i in img) AddImage(name, rnn, i, save, updateUi);
for (var i = 0; i < img.Length; i++)
{
AddImage($"{name}{(appendLayerNumber ? $"_{i}" : "")}", rnn, img[i], save, updateUi);
}
}

public void AddImage(string name, bool rnn, SKBitmap img, bool save, bool updateUi)
Expand Down

0 comments on commit c6383a1

Please sign in to comment.