aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Common/Configuration/AspectRatioExtensions.cs
diff options
context:
space:
mode:
authorTSR Berry <20988865+TSRBerry@users.noreply.github.com>2023-04-08 01:22:00 +0200
committerMary <thog@protonmail.com>2023-04-27 23:51:14 +0200
commitcee712105850ac3385cd0091a923438167433f9f (patch)
tree4a5274b21d8b7f938c0d0ce18736d3f2993b11b1 /Ryujinx.Common/Configuration/AspectRatioExtensions.cs
parentcd124bda587ef09668a971fa1cac1c3f0cfc9f21 (diff)
Move solution and projects to src
Diffstat (limited to 'Ryujinx.Common/Configuration/AspectRatioExtensions.cs')
-rw-r--r--Ryujinx.Common/Configuration/AspectRatioExtensions.cs63
1 files changed, 0 insertions, 63 deletions
diff --git a/Ryujinx.Common/Configuration/AspectRatioExtensions.cs b/Ryujinx.Common/Configuration/AspectRatioExtensions.cs
deleted file mode 100644
index 5e97ed19..00000000
--- a/Ryujinx.Common/Configuration/AspectRatioExtensions.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-using Ryujinx.Common.Utilities;
-using System.Text.Json.Serialization;
-
-namespace Ryujinx.Common.Configuration
-{
- [JsonConverter(typeof(TypedStringEnumConverter<AspectRatio>))]
- public enum AspectRatio
- {
- Fixed4x3,
- Fixed16x9,
- Fixed16x10,
- Fixed21x9,
- Fixed32x9,
- Stretched
- }
-
- public static class AspectRatioExtensions
- {
- public static float ToFloat(this AspectRatio aspectRatio)
- {
- return aspectRatio.ToFloatX() / aspectRatio.ToFloatY();
- }
-
- public static float ToFloatX(this AspectRatio aspectRatio)
- {
- return aspectRatio switch
- {
- AspectRatio.Fixed4x3 => 4.0f,
- AspectRatio.Fixed16x9 => 16.0f,
- AspectRatio.Fixed16x10 => 16.0f,
- AspectRatio.Fixed21x9 => 21.0f,
- AspectRatio.Fixed32x9 => 32.0f,
- _ => 16.0f
- };
- }
-
- public static float ToFloatY(this AspectRatio aspectRatio)
- {
- return aspectRatio switch
- {
- AspectRatio.Fixed4x3 => 3.0f,
- AspectRatio.Fixed16x9 => 9.0f,
- AspectRatio.Fixed16x10 => 10.0f,
- AspectRatio.Fixed21x9 => 9.0f,
- AspectRatio.Fixed32x9 => 9.0f,
- _ => 9.0f
- };
- }
-
- public static string ToText(this AspectRatio aspectRatio)
- {
- return aspectRatio switch
- {
- AspectRatio.Fixed4x3 => "4:3",
- AspectRatio.Fixed16x9 => "16:9",
- AspectRatio.Fixed16x10 => "16:10",
- AspectRatio.Fixed21x9 => "21:9",
- AspectRatio.Fixed32x9 => "32:9",
- _ => "Stretched"
- };
- }
- }
-} \ No newline at end of file