feat: Implement 32:9 aspect ratio

This commit introduces support for a 32:9 aspect ratio throughout Citron.

Key changes include:

-   **Enum Updates**: Added `R32_9` to `Settings::AspectRatio` and `Layout::AspectRatio` enums, ensuring consistent integer mapping for casting between them.
-   **Core Logic**:
    -   Modified `UISettings::CalculateWidth` to correctly compute width for the 32:9 ratio.
    -   Updated `Layout::EmulationAspectRatio` to handle the new `R32_9` case and return the appropriate float value (9.0f / 32.0f).
-   **Android Integration**:
    -   Updated `EmulationFragment.kt` and `EmulationActivity.kt` (for Picture-in-Picture) to recognize and apply the 32:9 aspect ratio (mapping setting value `4` to `Rational(32, 9)`).
-   **UI Configuration**:
    -   Added "Force 32:9" to the aspect ratio selection in the graphics settings UI via `shared_translation.cpp`. This string is translatable.

This enhancement allows users to utilize ultra-widescreen 32:9 displays for a more immersive experience.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
This commit is contained in:
Zephyron
2025-05-18 15:10:47 +10:00
parent 0d46968e6c
commit c5604ced4f
7 changed files with 22 additions and 7 deletions

View File

@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include <cmath>
@@ -70,6 +71,8 @@ float EmulationAspectRatio(AspectRatio aspect, float window_aspect_ratio) {
return 9.0f / 21.0f;
case AspectRatio::R16_10:
return 10.0f / 16.0f;
case AspectRatio::R32_9:
return 9.0f / 32.0f;
case AspectRatio::StretchToWindow:
return window_aspect_ratio;
default:

View File

@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
@@ -28,6 +29,7 @@ enum class AspectRatio {
R4_3,
R21_9,
R16_10,
R32_9,
StretchToWindow,
};