Skip to content

Commit

Permalink
misc: 调整保存流程
Browse files Browse the repository at this point in the history
Signed-off-by: MATRIX-feather <[email protected]>
  • Loading branch information
MATRIX-feather committed Mar 4, 2022
1 parent a79ed3c commit 470195c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
17 changes: 9 additions & 8 deletions Generator/TextureGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,17 @@ public void Generate(TexGenConfig texGenConfig)
if (texGenConfig.OutputTargets?.Length > 0 && !string.IsNullOrEmpty(texGenConfig.OutputTarget))
throw new InvalidOperationException("为什么要同时设置output_target和output_targets?");

if (texGenConfig.OutputTargets != null)
{
foreach (var fname in texGenConfig.OutputTargets)
baseImage.Save(fname);
}
var outputTargets = texGenConfig.OutputTargets?.ToList() ?? new List<string>();

if (texGenConfig.OutputTargets == null && !string.IsNullOrEmpty(texGenConfig.OutputTarget))
outputTargets.Add(texGenConfig.OutputTarget);

if (!string.IsNullOrEmpty(texGenConfig.OutputTarget))
baseImage.Save(texGenConfig.OutputTarget);
foreach (var fname in outputTargets)
{
if (!Directory.Exists(fname)) Directory.CreateDirectory(Path.GetDirectoryName(fname));

//overlayImage.Save(texGenConfig.OutputTarget + "_OVERLAY.png");
baseImage.Save(fname);
}
}

private void overlayColor(Image source, Color color)
Expand Down
2 changes: 0 additions & 2 deletions TextureOverlayer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2021.3.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="ppy.osu.Framework" Version="2022.126.0" />
<PackageReference Include="ppy.osuTK.NS20" Version="1.0.187" />
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.4" />
</ItemGroup>

Expand Down

0 comments on commit 470195c

Please sign in to comment.