summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/common/settings_enums.h4
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.cpp2
-rw-r--r--src/yuzu/main.cpp11
3 files changed, 8 insertions, 9 deletions
diff --git a/src/common/settings_enums.h b/src/common/settings_enums.h
index 71515257a..cc5c929cf 100644
--- a/src/common/settings_enums.h
+++ b/src/common/settings_enums.h
@@ -122,9 +122,9 @@ ENUM(NvdecEmulation, Off, Cpu, Gpu);
ENUM(ResolutionSetup, Res1_2X, Res3_4X, Res1X, Res3_2X, Res2X, Res3X, Res4X, Res5X, Res6X, Res7X,
Res8X);
-ENUM(ScalingFilter, NearestNeighbor, Bilinear, Bicubic, Gaussian, ScaleForce, Fsr, LastFilter);
+ENUM(ScalingFilter, NearestNeighbor, Bilinear, Bicubic, Gaussian, ScaleForce, Fsr, MaxEnum);
-ENUM(AntiAliasing, None, Fxaa, Smaa, LastAA);
+ENUM(AntiAliasing, None, Fxaa, Smaa, MaxEnum);
ENUM(AspectRatio, R16_9, R4_3, R21_9, R16_10, Stretch);
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp
index 2a74c1d05..6b8d4e554 100644
--- a/src/video_core/renderer_opengl/renderer_opengl.cpp
+++ b/src/video_core/renderer_opengl/renderer_opengl.cpp
@@ -473,7 +473,7 @@ void RendererOpenGL::DrawScreen(const Layout::FramebufferLayout& layout) {
glBindTextureUnit(0, screen_info.display_texture);
auto anti_aliasing = Settings::values.anti_aliasing.GetValue();
- if (anti_aliasing > Settings::AntiAliasing::LastAA) {
+ if (anti_aliasing >= Settings::AntiAliasing::MaxEnum) {
LOG_ERROR(Render_OpenGL, "Invalid antialiasing option selected {}", anti_aliasing);
anti_aliasing = Settings::AntiAliasing::None;
Settings::values.anti_aliasing.SetValue(anti_aliasing);
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 2922b3347..97ae9e49a 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -24,6 +24,7 @@
#include "applets/qt_software_keyboard.h"
#include "applets/qt_web_browser.h"
#include "common/nvidia_flags.h"
+#include "common/settings_enums.h"
#include "configuration/configure_input.h"
#include "configuration/configure_per_game.h"
#include "configuration/configure_tas.h"
@@ -1095,10 +1096,9 @@ void GMainWindow::InitializeWidgets() {
aa_status_button->setFocusPolicy(Qt::NoFocus);
connect(aa_status_button, &QPushButton::clicked, [&] {
auto aa_mode = Settings::values.anti_aliasing.GetValue();
- if (aa_mode == Settings::AntiAliasing::LastAA) {
+ aa_mode = static_cast<Settings::AntiAliasing>(static_cast<u32>(aa_mode) + 1);
+ if (aa_mode == Settings::AntiAliasing::MaxEnum) {
aa_mode = Settings::AntiAliasing::None;
- } else {
- aa_mode = static_cast<Settings::AntiAliasing>(static_cast<u32>(aa_mode) + 1);
}
Settings::values.anti_aliasing.SetValue(aa_mode);
aa_status_button->setChecked(true);
@@ -3702,10 +3702,9 @@ void GMainWindow::OnIncreaseVolume() {
void GMainWindow::OnToggleAdaptingFilter() {
auto filter = Settings::values.scaling_filter.GetValue();
- if (filter == Settings::ScalingFilter::LastFilter) {
+ filter = static_cast<Settings::ScalingFilter>(static_cast<u32>(filter) + 1);
+ if (filter == Settings::ScalingFilter::MaxEnum) {
filter = Settings::ScalingFilter::NearestNeighbor;
- } else {
- filter = static_cast<Settings::ScalingFilter>(static_cast<u32>(filter) + 1);
}
Settings::values.scaling_filter.SetValue(filter);
filter_status_button->setChecked(true);