From 1fdee67f9d082f592cd16a8176d29f1c2d0d2182c71d60c3dc7e7f7d50d2b602 Mon Sep 17 00:00:00 2001 From: copecone Date: Wed, 14 Oct 2026 20:20:16 +0900 Subject: [PATCH] Validate Even Render Resolution Before Starting --- Localization/Locale/en.json | 1 + Localization/Locale/ko.json | 1 + UI/Window/RenderConfigWindow.cs | 8 ++++++++ 3 files changed, 10 insertions(+) diff --git a/Localization/Locale/en.json b/Localization/Locale/en.json index 033d9d8..f40182b 100644 --- a/Localization/Locale/en.json +++ b/Localization/Locale/en.json @@ -45,6 +45,7 @@ "ui.render_config.random_seed": "Random Seed (Optional)", "ui.render_config.validation_title": "Invalid Settings", "ui.render_config.validation_error": "Please check your input values:\n- Width and Height must be integers > 0\n- Render FPS and Video FPS must be > 0\n- Delay After End must be >= 0", + "ui.render_config.validation_even_size": "Render width and height must be even numbers (current: {0} x {1}).", "ui.render_config.invalid_path": "Output directory path is invalid:\n{0}", "ui.render_config.planet_colors": "Planet Colors (Optional)", "ui.render_config.fire_planet": "Fire Planet", diff --git a/Localization/Locale/ko.json b/Localization/Locale/ko.json index 8c02196..a201e08 100644 --- a/Localization/Locale/ko.json +++ b/Localization/Locale/ko.json @@ -45,6 +45,7 @@ "ui.render_config.random_seed": "랜덤 시드 (선택 사항)", "ui.render_config.validation_title": "설정 오류", "ui.render_config.validation_error": "입력값을 확인해 주세요:\n- 너비와 높이는 0보다 큰 정수여야 합니다.\n- 렌더 FPS와 영상 FPS는 0보다 커야 합니다.\n- 종료 후 대기 시간은 0 이상이어야 합니다.", + "ui.render_config.validation_even_size": "렌더 해상도의 가로와 세로는 짝수여야 해요. (현재: {0} x {1})", "ui.render_config.invalid_path": "출력 디렉토리 경로가 올바르지 않습니다:\n{0}", "ui.render_config.planet_colors": "행성 색상 설정 (선택 사항)", "ui.render_config.fire_planet": "불 행성", diff --git a/UI/Window/RenderConfigWindow.cs b/UI/Window/RenderConfigWindow.cs index db8a826..087815c 100644 --- a/UI/Window/RenderConfigWindow.cs +++ b/UI/Window/RenderConfigWindow.cs @@ -846,6 +846,14 @@ internal static class RenderConfigWindow var config = UiConfig; SyncUItoConfig(config); + // The encoders use 4:2:0 chroma subsampling, which needs an even width and height. + if (config.RenderWidth % 2 != 0 || config.RenderHeight % 2 != 0) + { + ShowValidationError(LocalizationManager.Get( + "ui.render_config.validation_even_size", config.RenderWidth, config.RenderHeight)); + return; + } + // Sync Output Directory if (_outputDirInput != null) {