Test screenshots through ViewportCapture: sRGB instead of the dark linear HDR frame
This commit is contained in:
1 parent
3b2c1ddb95
commit
6ca1fff35f
2 files changed
+4
-3
No files matched your search
@@ -10,6 +10,7 @@ using Cthangover.Mods.Dialog;
|
||||
using Cthangover.Tools.Common;
|
||||
using Cthangover.Tools.SceneEditor;
|
||||
using Cthangover.Tools.Services;
|
||||
using Cthangover.Mods.Interface.View;
|
||||
using Godot;
|
||||
|
||||
namespace Cthangover.Tools.Tests.NovelFlow
|
||||
@@ -341,7 +342,7 @@ namespace Cthangover.Tools.Tests.NovelFlow
|
||||
if (string.IsNullOrEmpty(shotsDir) || DisplayServer.GetName() == "headless")
|
||||
return;
|
||||
DirAccess.MakeDirRecursiveAbsolute(shotsDir);
|
||||
GetViewport().GetTexture().GetImage()?.SavePng(shotsDir.TrimEnd('/') + "/novel_flow_" + name + ".png");
|
||||
ViewportCapture.SavePng(GetViewport(), shotsDir.TrimEnd('/') + "/novel_flow_" + name + ".png");
|
||||
}
|
||||
|
||||
private void Finish()
|
||||
|
||||
@@ -7,6 +7,7 @@ using Cthangover.Core.Utils;
|
||||
using Cthangover.Mods.Interface.Menu;
|
||||
using Cthangover.Mods.Interface.Tool;
|
||||
using Cthangover.Tools.Hub;
|
||||
using Cthangover.Mods.Interface.View;
|
||||
using Godot;
|
||||
|
||||
namespace Cthangover.Tools.Tests.Windows
|
||||
@@ -190,9 +191,8 @@ namespace Cthangover.Tools.Tests.Windows
|
||||
|
||||
var dir = ProjectSettings.GlobalizePath(_shotsDir);
|
||||
Directory.CreateDirectory(dir);
|
||||
var image = GetViewport().GetTexture().GetImage();
|
||||
var path = Path.Combine(dir, id + ".png");
|
||||
image.SavePng(path);
|
||||
ViewportCapture.SavePng(GetViewport(), path);
|
||||
Log($"screenshot {path}");
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user