SHA256
Refactor
This commit is contained in:
10 files changed
+27
-13
No files matched your search
@@ -7,6 +7,7 @@
|
|||||||
<EnableSourceControlManagerQueries>false</EnableSourceControlManagerQueries>
|
<EnableSourceControlManagerQueries>false</EnableSourceControlManagerQueries>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||||
|
<LangVersion>9</LangVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ namespace ADOFAIRenderer.Core
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Thread and Queue State
|
// Thread and Queue State
|
||||||
internal SortedList<long, CapturedFrame> ImageQueue = new SortedList<long, CapturedFrame>();
|
internal SortedList<long, CapturedFrame> ImageQueue = new();
|
||||||
public Thread? RenderThread;
|
public Thread? RenderThread;
|
||||||
public long passCount;
|
public long passCount;
|
||||||
public bool endRequested;
|
public bool endRequested;
|
||||||
@@ -111,7 +111,7 @@ namespace ADOFAIRenderer.Core
|
|||||||
|
|
||||||
// Private Instance Fields
|
// Private Instance Fields
|
||||||
private FFmpegNativeEncoder? _activeVideoFFmpeg;
|
private FFmpegNativeEncoder? _activeVideoFFmpeg;
|
||||||
private readonly List<FFmpegNativeEncoder> _allVideoFFmpegInstances = new List<FFmpegNativeEncoder>();
|
private readonly List<FFmpegNativeEncoder> _allVideoFFmpegInstances = new();
|
||||||
private int _originalInputOffset;
|
private int _originalInputOffset;
|
||||||
private GameObject? _debugMonitorObj;
|
private GameObject? _debugMonitorObj;
|
||||||
private GameObject? _escapeHandlerObj;
|
private GameObject? _escapeHandlerObj;
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace ADOFAIRenderer.Data
|
||||||
|
{
|
||||||
|
public class PositiveIntegerValidator
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace ADOFAIRenderer.Configuration
|
||||||
|
{
|
||||||
|
public class RenderConfig
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,7 +2,6 @@ using System.Diagnostics.CodeAnalysis;
|
|||||||
using ADOFAIRenderer.Core;
|
using ADOFAIRenderer.Core;
|
||||||
using ADOFAIRenderer.Util;
|
using ADOFAIRenderer.Util;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using MelonLoader;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace ADOFAIRenderer.Patch.Engine
|
namespace ADOFAIRenderer.Patch.Engine
|
||||||
|
|||||||
@@ -15,13 +15,13 @@ namespace ADOFAIRenderer.UI
|
|||||||
private const float BarPosX = 0f;
|
private const float BarPosX = 0f;
|
||||||
private const float BarPosY = -420f; // Y position relative to screen center (Reference: 1920x1080)
|
private const float BarPosY = -420f; // Y position relative to screen center (Reference: 1920x1080)
|
||||||
private const int BarTextFontSize = 16; // 눈에 띄게 증가된 텍스트 크기
|
private const int BarTextFontSize = 16; // 눈에 띄게 증가된 텍스트 크기
|
||||||
private static readonly Color BarBackgroundColor = new Color(0.08f, 0.08f, 0.1f, 1.0f);
|
private static readonly Color BarBackgroundColor = new(0.08f, 0.08f, 0.1f, 1.0f);
|
||||||
private static readonly Color BarFillColor = new Color(0.0f, 0.8f, 1.0f, 1.0f); // Sleek cyan/blue
|
private static readonly Color BarFillColor = new(0.0f, 0.8f, 1.0f, 1.0f); // Sleek cyan/blue
|
||||||
private static readonly Color BarTextColor = new Color(1.0f, 1.0f, 1.0f, 1.0f);
|
private static readonly Color BarTextColor = new(1.0f, 1.0f, 1.0f, 1.0f);
|
||||||
|
|
||||||
// --- Progress Bar Outline Configuration Constants ---
|
// --- Progress Bar Outline Configuration Constants ---
|
||||||
private static readonly Color BarOutlineColor = Color.white; // 대비되는 흰색 윤곽선
|
private static readonly Color BarOutlineColor = Color.white; // 대비되는 흰색 윤곽선
|
||||||
private static readonly Vector2 BarOutlineDistance = new Vector2(3.0f, -3.0f); // 3px의 굵고 직관적인 윤곽선 두께
|
private static readonly Vector2 BarOutlineDistance = new(3.0f, -3.0f); // 3px의 굵고 직관적인 윤곽선 두께
|
||||||
|
|
||||||
private TextMeshProUGUI _text = null!;
|
private TextMeshProUGUI _text = null!;
|
||||||
private GameObject _progressBarObj = null!;
|
private GameObject _progressBarObj = null!;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace ADOFAIRenderer.Util
|
|||||||
public static int TotalSamples { get; private set; }
|
public static int TotalSamples { get; private set; }
|
||||||
|
|
||||||
private static long _cachedFrame = -1;
|
private static long _cachedFrame = -1;
|
||||||
private static readonly Dictionary<int, float[]> CachedSpectrums = new Dictionary<int, float[]>();
|
private static readonly Dictionary<int, float[]> CachedSpectrums = new();
|
||||||
|
|
||||||
public static void Initialize(AudioClip? clip)
|
public static void Initialize(AudioClip? clip)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ namespace ADOFAIRenderer.Util.FFmpeg
|
|||||||
private bool _disposed;
|
private bool _disposed;
|
||||||
|
|
||||||
/// <summary>멀티스레딩 환경에서 인코더 상태 및 리소스 접근을 동기화하기 위한 락 객체.</summary>
|
/// <summary>멀티스레딩 환경에서 인코더 상태 및 리소스 접근을 동기화하기 위한 락 객체.</summary>
|
||||||
private readonly object _lock = new object();
|
private readonly object _lock = new();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// QSV 인코더에서 hw_frames_ctx 모드(GPU 프레임 풀)가 활성화되었는지 여부.
|
/// QSV 인코더에서 hw_frames_ctx 모드(GPU 프레임 풀)가 활성화되었는지 여부.
|
||||||
|
|||||||
+3
-3
@@ -15,9 +15,9 @@ namespace ADOFAIRenderer.Util
|
|||||||
{
|
{
|
||||||
private const int InitialBufferSize = 16;
|
private const int InitialBufferSize = 16;
|
||||||
|
|
||||||
private readonly Stack<ReadbackRequestState> _statePool = new Stack<ReadbackRequestState>();
|
private readonly Stack<ReadbackRequestState> _statePool = new();
|
||||||
private readonly List<ReadbackRequestState> _allocatedStates = new List<ReadbackRequestState>();
|
private readonly List<ReadbackRequestState> _allocatedStates = new();
|
||||||
private readonly object _poolLock = new object();
|
private readonly object _poolLock = new();
|
||||||
private bool _isInitialized;
|
private bool _isInitialized;
|
||||||
private volatile bool _isDisposed;
|
private volatile bool _isDisposed;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ namespace ADOFAIRenderer.Util
|
|||||||
private const string IntelPattern =
|
private const string IntelPattern =
|
||||||
@"^Intel(?>\(R\))* (?>U*HD Graphics [0-9]+$|Arc\(TM\) [A-C][0-9]+ Graphics)";
|
@"^Intel(?>\(R\))* (?>U*HD Graphics [0-9]+$|Arc\(TM\) [A-C][0-9]+ Graphics)";
|
||||||
|
|
||||||
private static readonly Dictionary<Codec, List<(GPUVendor, string)>> CodecMap = new Dictionary<Codec, List<(GPUVendor, string)>>
|
private static readonly Dictionary<Codec, List<(GPUVendor, string)>> CodecMap = new()
|
||||||
{
|
{
|
||||||
[Codec.H264] = new List<(GPUVendor, string)> { (GPUVendor.NVIDIA, "h264_nvenc"), (GPUVendor.Intel, "h264_qsv"), (GPUVendor.AMD, "h264_amf"), (GPUVendor.Unknown, "libx264") },
|
[Codec.H264] = new List<(GPUVendor, string)> { (GPUVendor.NVIDIA, "h264_nvenc"), (GPUVendor.Intel, "h264_qsv"), (GPUVendor.AMD, "h264_amf"), (GPUVendor.Unknown, "libx264") },
|
||||||
[Codec.H265] = new List<(GPUVendor, string)> { (GPUVendor.NVIDIA, "hevc_nvenc"), (GPUVendor.Intel, "hevc_qsv"), (GPUVendor.AMD, "hevc_amf"), (GPUVendor.Unknown, "libx265") },
|
[Codec.H265] = new List<(GPUVendor, string)> { (GPUVendor.NVIDIA, "hevc_nvenc"), (GPUVendor.Intel, "hevc_qsv"), (GPUVendor.AMD, "hevc_amf"), (GPUVendor.Unknown, "libx265") },
|
||||||
|
|||||||
Reference in new issue
Block a user