diff --git a/API/RenderSession.cs b/API/RenderSession.cs index 95e4d91..2399faa 100644 --- a/API/RenderSession.cs +++ b/API/RenderSession.cs @@ -1,12 +1,13 @@ using System; using ADOFAIRenderer.Core; +using ADOFAIRenderer.Data; namespace ADOFAIRenderer.API; /// /// Fluent builder for configuring and starting a render session. /// -public class RenderSessionBuilder +public class RenderSession { private bool _auto = true; @@ -18,14 +19,14 @@ public class RenderSessionBuilder /// Sets whether automatic rendering is enabled. /// /// true to enable automatic rendering; otherwise, false. Default is true. - /// The current instance for method chaining. - public RenderSessionBuilder WithAuto(bool enabled = true) + /// The current instance for method chaining. + public RenderSession WithAuto(bool enabled = true) { _auto = enabled; return this; } - public RenderSessionBuilder WithPatch(PatchType patchType, bool enabled = true) + public RenderSession WithPatch(PatchType patchType, bool enabled = true) { switch (patchType) { @@ -40,10 +41,16 @@ public class RenderSessionBuilder /// /// Applies the configured flags and initiates the render session. /// - public void Start() + public void Start(RenderConfig renderConfig, string levelPath) { - RenderFlags.Auto = _auto; - RenderFlags.TimePatch = _timePatch; - RenderFlags.ScreenPatch = _screenPatch; + RenderContext.Auto = _auto; + RenderContext.TimePatch = _timePatch; + RenderContext.ScreenPatch = _screenPatch; + + RenderManager.Instance.levelPath = levelPath; + RenderManager.Instance.Configuration = renderConfig; + + RenderManager.Instance.SetupCaptureDirectory(); + RenderManager.Instance.SetupGameScene(); } } \ No newline at end of file