This commit is contained in:
Nayla Hanegan 2023-05-26 15:52:58 -04:00
commit 871da4e307
No known key found for this signature in database
GPG key ID: BAFE9001DA16CFA2
275 changed files with 33002 additions and 27474 deletions

View file

@ -15,9 +15,9 @@
#include "Core/ConfigManager.h"
#include "Core/Core.h"
#include "DolphinQt/Config/Graphics/GraphicsBool.h"
#include "DolphinQt/Config/Graphics/GraphicsChoice.h"
#include "DolphinQt/Config/Graphics/GraphicsInteger.h"
#include "DolphinQt/Config/ConfigControls/ConfigBool.h"
#include "DolphinQt/Config/ConfigControls/ConfigChoice.h"
#include "DolphinQt/Config/ConfigControls/ConfigInteger.h"
#include "DolphinQt/Config/Graphics/GraphicsWindow.h"
#include "DolphinQt/Config/ToolTipControls/ToolTipCheckBox.h"
#include "DolphinQt/QtUtils/SignalBlocking.h"
@ -50,17 +50,17 @@ void AdvancedWidget::CreateWidgets()
auto* performance_layout = new QGridLayout();
performance_box->setLayout(performance_layout);
m_show_fps = new GraphicsBool(tr("Show FPS"), Config::GFX_SHOW_FPS);
m_show_ftimes = new GraphicsBool(tr("Show Frame Times"), Config::GFX_SHOW_FTIMES);
m_show_vps = new GraphicsBool(tr("Show VPS"), Config::GFX_SHOW_VPS);
m_show_vtimes = new GraphicsBool(tr("Show VBlank Times"), Config::GFX_SHOW_VTIMES);
m_show_graphs = new GraphicsBool(tr("Show Performance Graphs"), Config::GFX_SHOW_GRAPHS);
m_show_speed = new GraphicsBool(tr("Show % Speed"), Config::GFX_SHOW_SPEED);
m_show_speed_colors = new GraphicsBool(tr("Show Speed Colors"), Config::GFX_SHOW_SPEED_COLORS);
m_perf_samp_window = new GraphicsInteger(0, 10000, Config::GFX_PERF_SAMP_WINDOW, 100);
m_show_fps = new ConfigBool(tr("Show FPS"), Config::GFX_SHOW_FPS);
m_show_ftimes = new ConfigBool(tr("Show Frame Times"), Config::GFX_SHOW_FTIMES);
m_show_vps = new ConfigBool(tr("Show VPS"), Config::GFX_SHOW_VPS);
m_show_vtimes = new ConfigBool(tr("Show VBlank Times"), Config::GFX_SHOW_VTIMES);
m_show_graphs = new ConfigBool(tr("Show Performance Graphs"), Config::GFX_SHOW_GRAPHS);
m_show_speed = new ConfigBool(tr("Show % Speed"), Config::GFX_SHOW_SPEED);
m_show_speed_colors = new ConfigBool(tr("Show Speed Colors"), Config::GFX_SHOW_SPEED_COLORS);
m_perf_samp_window = new ConfigInteger(0, 10000, Config::GFX_PERF_SAMP_WINDOW, 100);
m_perf_samp_window->SetTitle(tr("Performance Sample Window (ms)"));
m_log_render_time =
new GraphicsBool(tr("Log Render Time to File"), Config::GFX_LOG_RENDER_TIME_TO_FILE);
new ConfigBool(tr("Log Render Time to File"), Config::GFX_LOG_RENDER_TIME_TO_FILE);
performance_layout->addWidget(m_show_fps, 0, 0);
performance_layout->addWidget(m_show_ftimes, 0, 1);
@ -78,12 +78,12 @@ void AdvancedWidget::CreateWidgets()
auto* debugging_layout = new QGridLayout();
debugging_box->setLayout(debugging_layout);
m_enable_wireframe = new GraphicsBool(tr("Enable Wireframe"), Config::GFX_ENABLE_WIREFRAME);
m_show_statistics = new GraphicsBool(tr("Show Statistics"), Config::GFX_OVERLAY_STATS);
m_enable_wireframe = new ConfigBool(tr("Enable Wireframe"), Config::GFX_ENABLE_WIREFRAME);
m_show_statistics = new ConfigBool(tr("Show Statistics"), Config::GFX_OVERLAY_STATS);
m_enable_format_overlay =
new GraphicsBool(tr("Texture Format Overlay"), Config::GFX_TEXFMT_OVERLAY_ENABLE);
new ConfigBool(tr("Texture Format Overlay"), Config::GFX_TEXFMT_OVERLAY_ENABLE);
m_enable_api_validation =
new GraphicsBool(tr("Enable API Validation Layers"), Config::GFX_ENABLE_VALIDATION_LAYER);
new ConfigBool(tr("Enable API Validation Layers"), Config::GFX_ENABLE_VALIDATION_LAYER);
debugging_layout->addWidget(m_enable_wireframe, 0, 0);
debugging_layout->addWidget(m_show_statistics, 0, 1);
@ -95,13 +95,13 @@ void AdvancedWidget::CreateWidgets()
auto* utility_layout = new QGridLayout();
utility_box->setLayout(utility_layout);
m_load_custom_textures = new GraphicsBool(tr("Load Custom Textures"), Config::GFX_HIRES_TEXTURES);
m_load_custom_textures = new ConfigBool(tr("Load Custom Textures"), Config::GFX_HIRES_TEXTURES);
m_prefetch_custom_textures =
new GraphicsBool(tr("Prefetch Custom Textures"), Config::GFX_CACHE_HIRES_TEXTURES);
m_dump_efb_target = new GraphicsBool(tr("Dump EFB Target"), Config::GFX_DUMP_EFB_TARGET);
m_dump_xfb_target = new GraphicsBool(tr("Dump XFB Target"), Config::GFX_DUMP_XFB_TARGET);
new ConfigBool(tr("Prefetch Custom Textures"), Config::GFX_CACHE_HIRES_TEXTURES);
m_dump_efb_target = new ConfigBool(tr("Dump EFB Target"), Config::GFX_DUMP_EFB_TARGET);
m_dump_xfb_target = new ConfigBool(tr("Dump XFB Target"), Config::GFX_DUMP_XFB_TARGET);
m_disable_vram_copies =
new GraphicsBool(tr("Disable EFB VRAM Copies"), Config::GFX_HACK_DISABLE_COPY_TO_VRAM);
new ConfigBool(tr("Disable EFB VRAM Copies"), Config::GFX_HACK_DISABLE_COPY_TO_VRAM);
m_enable_graphics_mods = new ToolTipCheckBox(tr("Enable Graphics Mods"));
utility_layout->addWidget(m_load_custom_textures, 0, 0);
@ -117,9 +117,9 @@ void AdvancedWidget::CreateWidgets()
auto* texture_dump_box = new QGroupBox(tr("Texture Dumping"));
auto* texture_dump_layout = new QGridLayout();
texture_dump_box->setLayout(texture_dump_layout);
m_dump_textures = new GraphicsBool(tr("Enable"), Config::GFX_DUMP_TEXTURES);
m_dump_base_textures = new GraphicsBool(tr("Dump Base Textures"), Config::GFX_DUMP_BASE_TEXTURES);
m_dump_mip_textures = new GraphicsBool(tr("Dump Mip Maps"), Config::GFX_DUMP_MIP_TEXTURES);
m_dump_textures = new ConfigBool(tr("Enable"), Config::GFX_DUMP_TEXTURES);
m_dump_base_textures = new ConfigBool(tr("Dump Base Textures"), Config::GFX_DUMP_BASE_TEXTURES);
m_dump_mip_textures = new ConfigBool(tr("Dump Mip Maps"), Config::GFX_DUMP_MIP_TEXTURES);
texture_dump_layout->addWidget(m_dump_textures, 0, 0);
@ -131,11 +131,11 @@ void AdvancedWidget::CreateWidgets()
auto* dump_layout = new QGridLayout();
dump_box->setLayout(dump_layout);
m_use_fullres_framedumps = new GraphicsBool(tr("Dump at Internal Resolution"),
Config::GFX_INTERNAL_RESOLUTION_FRAME_DUMPS);
m_dump_use_ffv1 = new GraphicsBool(tr("Use Lossless Codec (FFV1)"), Config::GFX_USE_FFV1);
m_dump_bitrate = new GraphicsInteger(0, 1000000, Config::GFX_BITRATE_KBPS, 1000);
m_png_compression_level = new GraphicsInteger(0, 9, Config::GFX_PNG_COMPRESSION_LEVEL);
m_use_fullres_framedumps = new ConfigBool(tr("Dump at Internal Resolution"),
Config::GFX_INTERNAL_RESOLUTION_FRAME_DUMPS);
m_dump_use_ffv1 = new ConfigBool(tr("Use Lossless Codec (FFV1)"), Config::GFX_USE_FFV1);
m_dump_bitrate = new ConfigInteger(0, 1000000, Config::GFX_BITRATE_KBPS, 1000);
m_png_compression_level = new ConfigInteger(0, 9, Config::GFX_PNG_COMPRESSION_LEVEL);
dump_layout->addWidget(m_use_fullres_framedumps, 0, 0);
#if defined(HAVE_FFMPEG)
@ -152,14 +152,14 @@ void AdvancedWidget::CreateWidgets()
auto* misc_layout = new QGridLayout();
misc_box->setLayout(misc_layout);
m_enable_cropping = new GraphicsBool(tr("Crop"), Config::GFX_CROP);
m_enable_cropping = new ConfigBool(tr("Crop"), Config::GFX_CROP);
m_enable_prog_scan = new ToolTipCheckBox(tr("Enable Progressive Scan"));
m_backend_multithreading =
new GraphicsBool(tr("Backend Multithreading"), Config::GFX_BACKEND_MULTITHREADING);
m_prefer_vs_for_point_line_expansion = new GraphicsBool(
new ConfigBool(tr("Backend Multithreading"), Config::GFX_BACKEND_MULTITHREADING);
m_prefer_vs_for_point_line_expansion = new ConfigBool(
// i18n: VS is short for vertex shaders.
tr("Prefer VS for Point/Line Expansion"), Config::GFX_PREFER_VS_FOR_LINE_POINT_EXPANSION);
m_cpu_cull = new GraphicsBool(tr("Cull Vertices on the CPU"), Config::GFX_CPU_CULL);
m_cpu_cull = new ConfigBool(tr("Cull Vertices on the CPU"), Config::GFX_CPU_CULL);
misc_layout->addWidget(m_enable_cropping, 0, 0);
misc_layout->addWidget(m_enable_prog_scan, 0, 1);
@ -168,7 +168,7 @@ void AdvancedWidget::CreateWidgets()
misc_layout->addWidget(m_cpu_cull, 2, 0);
#ifdef _WIN32
m_borderless_fullscreen =
new GraphicsBool(tr("Borderless Fullscreen"), Config::GFX_BORDERLESS_FULLSCREEN);
new ConfigBool(tr("Borderless Fullscreen"), Config::GFX_BORDERLESS_FULLSCREEN);
misc_layout->addWidget(m_borderless_fullscreen, 2, 1);
#endif
@ -179,9 +179,9 @@ void AdvancedWidget::CreateWidgets()
experimental_box->setLayout(experimental_layout);
m_defer_efb_access_invalidation =
new GraphicsBool(tr("Defer EFB Cache Invalidation"), Config::GFX_HACK_EFB_DEFER_INVALIDATION);
new ConfigBool(tr("Defer EFB Cache Invalidation"), Config::GFX_HACK_EFB_DEFER_INVALIDATION);
m_manual_texture_sampling =
new GraphicsBool(tr("Manual Texture Sampling"), Config::GFX_HACK_FAST_TEXTURE_SAMPLING, true);
new ConfigBool(tr("Manual Texture Sampling"), Config::GFX_HACK_FAST_TEXTURE_SAMPLING, true);
experimental_layout->addWidget(m_defer_efb_access_invalidation, 0, 0);
experimental_layout->addWidget(m_manual_texture_sampling, 0, 1);

View file

@ -3,26 +3,26 @@
#pragma once
#include "DolphinQt/Config/Graphics/GraphicsWidget.h"
#include <QWidget>
class GraphicsBool;
class GraphicsChoice;
class GraphicsInteger;
class ConfigBool;
class ConfigChoice;
class ConfigInteger;
class GraphicsWindow;
class QCheckBox;
class QComboBox;
class QSpinBox;
class ToolTipCheckBox;
class AdvancedWidget final : public GraphicsWidget
class AdvancedWidget final : public QWidget
{
Q_OBJECT
public:
explicit AdvancedWidget(GraphicsWindow* parent);
private:
void LoadSettings() override;
void SaveSettings() override;
void LoadSettings();
void SaveSettings();
void CreateWidgets();
void ConnectWidgets();
@ -31,48 +31,48 @@ private:
void OnEmulationStateChanged(bool running);
// Debugging
GraphicsBool* m_enable_wireframe;
GraphicsBool* m_show_statistics;
GraphicsBool* m_enable_format_overlay;
GraphicsBool* m_enable_api_validation;
GraphicsBool* m_show_fps;
GraphicsBool* m_show_ftimes;
GraphicsBool* m_show_vps;
GraphicsBool* m_show_vtimes;
GraphicsBool* m_show_graphs;
GraphicsBool* m_show_speed;
GraphicsBool* m_show_speed_colors;
GraphicsInteger* m_perf_samp_window;
GraphicsBool* m_log_render_time;
ConfigBool* m_enable_wireframe;
ConfigBool* m_show_statistics;
ConfigBool* m_enable_format_overlay;
ConfigBool* m_enable_api_validation;
ConfigBool* m_show_fps;
ConfigBool* m_show_ftimes;
ConfigBool* m_show_vps;
ConfigBool* m_show_vtimes;
ConfigBool* m_show_graphs;
ConfigBool* m_show_speed;
ConfigBool* m_show_speed_colors;
ConfigInteger* m_perf_samp_window;
ConfigBool* m_log_render_time;
// Utility
GraphicsBool* m_prefetch_custom_textures;
GraphicsBool* m_dump_efb_target;
GraphicsBool* m_dump_xfb_target;
GraphicsBool* m_disable_vram_copies;
GraphicsBool* m_load_custom_textures;
ConfigBool* m_prefetch_custom_textures;
ConfigBool* m_dump_efb_target;
ConfigBool* m_dump_xfb_target;
ConfigBool* m_disable_vram_copies;
ConfigBool* m_load_custom_textures;
ToolTipCheckBox* m_enable_graphics_mods;
// Texture dumping
GraphicsBool* m_dump_textures;
GraphicsBool* m_dump_mip_textures;
GraphicsBool* m_dump_base_textures;
ConfigBool* m_dump_textures;
ConfigBool* m_dump_mip_textures;
ConfigBool* m_dump_base_textures;
// Frame dumping
GraphicsBool* m_dump_use_ffv1;
GraphicsBool* m_use_fullres_framedumps;
GraphicsInteger* m_dump_bitrate;
GraphicsInteger* m_png_compression_level;
ConfigBool* m_dump_use_ffv1;
ConfigBool* m_use_fullres_framedumps;
ConfigInteger* m_dump_bitrate;
ConfigInteger* m_png_compression_level;
// Misc
GraphicsBool* m_enable_cropping;
ConfigBool* m_enable_cropping;
ToolTipCheckBox* m_enable_prog_scan;
GraphicsBool* m_backend_multithreading;
GraphicsBool* m_prefer_vs_for_point_line_expansion;
GraphicsBool* m_cpu_cull;
GraphicsBool* m_borderless_fullscreen;
ConfigBool* m_backend_multithreading;
ConfigBool* m_prefer_vs_for_point_line_expansion;
ConfigBool* m_cpu_cull;
ConfigBool* m_borderless_fullscreen;
// Experimental
GraphicsBool* m_defer_efb_access_invalidation;
GraphicsBool* m_manual_texture_sampling;
ConfigBool* m_defer_efb_access_invalidation;
ConfigBool* m_manual_texture_sampling;
};

View file

@ -14,10 +14,10 @@
#include "Core/Config/GraphicsSettings.h"
#include "Core/ConfigManager.h"
#include "DolphinQt/Config/Graphics/GraphicsBool.h"
#include "DolphinQt/Config/Graphics/GraphicsChoice.h"
#include "DolphinQt/Config/Graphics/GraphicsRadio.h"
#include "DolphinQt/Config/Graphics/GraphicsSlider.h"
#include "DolphinQt/Config/ConfigControls/ConfigBool.h"
#include "DolphinQt/Config/ConfigControls/ConfigChoice.h"
#include "DolphinQt/Config/ConfigControls/ConfigRadio.h"
#include "DolphinQt/Config/ConfigControls/ConfigSlider.h"
#include "DolphinQt/Config/Graphics/GraphicsWindow.h"
#include "DolphinQt/Config/Graphics/PostProcessingConfigWindow.h"
#include "DolphinQt/QtUtils/NonDefaultQPushButton.h"
@ -82,7 +82,7 @@ void EnhancementsWidget::CreateWidgets()
QString::number(static_cast<int>(EFB_HEIGHT) * scale)));
}
m_ir_combo = new GraphicsChoice(resolution_options, Config::GFX_EFB_SCALE);
m_ir_combo = new ConfigChoice(resolution_options, Config::GFX_EFB_SCALE);
m_ir_combo->setMaxVisibleItems(visible_resolution_option_count);
m_aa_combo = new ToolTipComboBox();
@ -106,18 +106,18 @@ void EnhancementsWidget::CreateWidgets()
m_pp_effect = new ToolTipComboBox();
m_configure_pp_effect = new NonDefaultQPushButton(tr("Configure"));
m_scaled_efb_copy = new GraphicsBool(tr("Scaled EFB Copy"), Config::GFX_HACK_COPY_EFB_SCALED);
m_scaled_efb_copy = new ConfigBool(tr("Scaled EFB Copy"), Config::GFX_HACK_COPY_EFB_SCALED);
m_per_pixel_lighting =
new GraphicsBool(tr("Per-Pixel Lighting"), Config::GFX_ENABLE_PIXEL_LIGHTING);
new ConfigBool(tr("Per-Pixel Lighting"), Config::GFX_ENABLE_PIXEL_LIGHTING);
m_widescreen_hack = new GraphicsBool(tr("Widescreen Hack"), Config::GFX_WIDESCREEN_HACK);
m_disable_fog = new GraphicsBool(tr("Disable Fog"), Config::GFX_DISABLE_FOG);
m_widescreen_hack = new ConfigBool(tr("Widescreen Hack"), Config::GFX_WIDESCREEN_HACK);
m_disable_fog = new ConfigBool(tr("Disable Fog"), Config::GFX_DISABLE_FOG);
m_force_24bit_color =
new GraphicsBool(tr("Force 24-Bit Color"), Config::GFX_ENHANCE_FORCE_TRUE_COLOR);
new ConfigBool(tr("Force 24-Bit Color"), Config::GFX_ENHANCE_FORCE_TRUE_COLOR);
m_disable_copy_filter =
new GraphicsBool(tr("Disable Copy Filter"), Config::GFX_ENHANCE_DISABLE_COPY_FILTER);
m_arbitrary_mipmap_detection = new GraphicsBool(tr("Arbitrary Mipmap Detection"),
Config::GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION);
new ConfigBool(tr("Disable Copy Filter"), Config::GFX_ENHANCE_DISABLE_COPY_FILTER);
m_arbitrary_mipmap_detection = new ConfigBool(tr("Arbitrary Mipmap Detection"),
Config::GFX_ENHANCE_ARBITRARY_MIPMAP_DETECTION);
int row = 0;
enhancements_layout->addWidget(new QLabel(tr("Internal Resolution:")), row, 0);
@ -157,13 +157,13 @@ void EnhancementsWidget::CreateWidgets()
auto* stereoscopy_layout = new QGridLayout();
stereoscopy_box->setLayout(stereoscopy_layout);
m_3d_mode = new GraphicsChoice({tr("Off"), tr("Side-by-Side"), tr("Top-and-Bottom"),
tr("Anaglyph"), tr("HDMI 3D"), tr("Passive")},
Config::GFX_STEREO_MODE);
m_3d_depth = new GraphicsSlider(0, Config::GFX_STEREO_DEPTH_MAXIMUM, Config::GFX_STEREO_DEPTH);
m_3d_convergence = new GraphicsSlider(0, Config::GFX_STEREO_CONVERGENCE_MAXIMUM,
Config::GFX_STEREO_CONVERGENCE, 100);
m_3d_swap_eyes = new GraphicsBool(tr("Swap Eyes"), Config::GFX_STEREO_SWAP_EYES);
m_3d_mode = new ConfigChoice({tr("Off"), tr("Side-by-Side"), tr("Top-and-Bottom"), tr("Anaglyph"),
tr("HDMI 3D"), tr("Passive")},
Config::GFX_STEREO_MODE);
m_3d_depth = new ConfigSlider(0, Config::GFX_STEREO_DEPTH_MAXIMUM, Config::GFX_STEREO_DEPTH);
m_3d_convergence = new ConfigSlider(0, Config::GFX_STEREO_CONVERGENCE_MAXIMUM,
Config::GFX_STEREO_CONVERGENCE, 100);
m_3d_swap_eyes = new ConfigBool(tr("Swap Eyes"), Config::GFX_STEREO_SWAP_EYES);
stereoscopy_layout->addWidget(new QLabel(tr("Stereoscopic 3D Mode:")), 0, 0);
stereoscopy_layout->addWidget(m_3d_mode, 0, 1);

View file

@ -5,11 +5,11 @@
#include <array>
#include "DolphinQt/Config/Graphics/GraphicsWidget.h"
#include <QWidget>
class GraphicsBool;
class GraphicsChoice;
class GraphicsSlider;
class ConfigBool;
class ConfigChoice;
class ConfigSlider;
class GraphicsWindow;
class QCheckBox;
class QComboBox;
@ -17,15 +17,15 @@ class QPushButton;
class QSlider;
class ToolTipComboBox;
class EnhancementsWidget final : public GraphicsWidget
class EnhancementsWidget final : public QWidget
{
Q_OBJECT
public:
explicit EnhancementsWidget(GraphicsWindow* parent);
private:
void LoadSettings() override;
void SaveSettings() override;
void LoadSettings();
void SaveSettings();
void CreateWidgets();
void ConnectWidgets();
@ -34,24 +34,24 @@ private:
void LoadPPShaders();
// Enhancements
GraphicsChoice* m_ir_combo;
ConfigChoice* m_ir_combo;
ToolTipComboBox* m_aa_combo;
ToolTipComboBox* m_texture_filtering_combo;
ToolTipComboBox* m_pp_effect;
QPushButton* m_configure_pp_effect;
GraphicsBool* m_scaled_efb_copy;
GraphicsBool* m_per_pixel_lighting;
GraphicsBool* m_widescreen_hack;
GraphicsBool* m_disable_fog;
GraphicsBool* m_force_24bit_color;
GraphicsBool* m_disable_copy_filter;
GraphicsBool* m_arbitrary_mipmap_detection;
ConfigBool* m_scaled_efb_copy;
ConfigBool* m_per_pixel_lighting;
ConfigBool* m_widescreen_hack;
ConfigBool* m_disable_fog;
ConfigBool* m_force_24bit_color;
ConfigBool* m_disable_copy_filter;
ConfigBool* m_arbitrary_mipmap_detection;
// Stereoscopy
GraphicsChoice* m_3d_mode;
GraphicsSlider* m_3d_depth;
GraphicsSlider* m_3d_convergence;
GraphicsBool* m_3d_swap_eyes;
ConfigChoice* m_3d_mode;
ConfigSlider* m_3d_depth;
ConfigSlider* m_3d_convergence;
ConfigBool* m_3d_swap_eyes;
int m_msaa_modes;
bool m_block_save;

View file

@ -18,21 +18,18 @@
#include "Core/ConfigManager.h"
#include "Core/Core.h"
#include "DolphinQt/Config/Graphics/GraphicsBool.h"
#include "DolphinQt/Config/Graphics/GraphicsChoice.h"
#include "DolphinQt/Config/Graphics/GraphicsRadio.h"
#include "DolphinQt/Config/ConfigControls/ConfigBool.h"
#include "DolphinQt/Config/ConfigControls/ConfigChoice.h"
#include "DolphinQt/Config/ConfigControls/ConfigRadio.h"
#include "DolphinQt/Config/Graphics/GraphicsWindow.h"
#include "DolphinQt/Config/ToolTipControls/ToolTipComboBox.h"
#include "DolphinQt/QtUtils/ModalMessageBox.h"
#include "DolphinQt/Settings.h"
#include "UICommon/VideoUtils.h"
#include "VideoCommon/VideoBackendBase.h"
#include "VideoCommon/VideoConfig.h"
GeneralWidget::GeneralWidget(X11Utils::XRRConfiguration* xrr_config, GraphicsWindow* parent)
: m_xrr_config(xrr_config)
GeneralWidget::GeneralWidget(GraphicsWindow* parent)
{
CreateWidgets();
LoadSettings();
@ -57,11 +54,11 @@ void GeneralWidget::CreateWidgets()
m_backend_combo = new ToolTipComboBox();
m_aspect_combo =
new GraphicsChoice({tr("Auto"), tr("Force 16:9"), tr("Force 4:3"), tr("Stretch to Window")},
Config::GFX_ASPECT_RATIO);
new ConfigChoice({tr("Auto"), tr("Force 16:9"), tr("Force 4:3"), tr("Stretch to Window")},
Config::GFX_ASPECT_RATIO);
m_adapter_combo = new ToolTipComboBox;
m_enable_vsync = new GraphicsBool(tr("V-Sync"), Config::GFX_VSYNC);
m_enable_fullscreen = new GraphicsBool(tr("Start in Fullscreen"), Config::MAIN_FULLSCREEN);
m_enable_vsync = new ConfigBool(tr("V-Sync"), Config::GFX_VSYNC);
m_enable_fullscreen = new ConfigBool(tr("Start in Fullscreen"), Config::MAIN_FULLSCREEN);
m_video_box->setLayout(m_video_layout);
@ -87,12 +84,11 @@ void GeneralWidget::CreateWidgets()
auto* m_options_box = new QGroupBox(tr("Other"));
auto* m_options_layout = new QGridLayout();
m_show_ping = new GraphicsBool(tr("Show NetPlay Ping"), Config::GFX_SHOW_NETPLAY_PING);
m_show_ping = new ConfigBool(tr("Show NetPlay Ping"), Config::GFX_SHOW_NETPLAY_PING);
m_autoadjust_window_size =
new GraphicsBool(tr("Auto-Adjust Window Size"), Config::MAIN_RENDER_WINDOW_AUTOSIZE);
m_show_messages =
new GraphicsBool(tr("Show NetPlay Messages"), Config::GFX_SHOW_NETPLAY_MESSAGES);
m_render_main_window = new GraphicsBool(tr("Render to Main Window"), Config::MAIN_RENDER_TO_MAIN);
new ConfigBool(tr("Auto-Adjust Window Size"), Config::MAIN_RENDER_WINDOW_AUTOSIZE);
m_show_messages = new ConfigBool(tr("Show NetPlay Messages"), Config::GFX_SHOW_NETPLAY_MESSAGES);
m_render_main_window = new ConfigBool(tr("Render to Main Window"), Config::MAIN_RENDER_TO_MAIN);
m_options_box->setLayout(m_options_layout);
@ -114,13 +110,13 @@ void GeneralWidget::CreateWidgets()
}};
for (size_t i = 0; i < modes.size(); i++)
{
m_shader_compilation_mode[i] = new GraphicsRadioInt(
tr(modes[i]), Config::GFX_SHADER_COMPILATION_MODE, static_cast<int>(i));
m_shader_compilation_mode[i] =
new ConfigRadioInt(tr(modes[i]), Config::GFX_SHADER_COMPILATION_MODE, static_cast<int>(i));
shader_compilation_layout->addWidget(m_shader_compilation_mode[i], static_cast<int>(i / 2),
static_cast<int>(i % 2));
}
m_wait_for_shaders = new GraphicsBool(tr("Compile Shaders Before Starting"),
Config::GFX_WAIT_FOR_SHADERS_BEFORE_STARTING);
m_wait_for_shaders = new ConfigBool(tr("Compile Shaders Before Starting"),
Config::GFX_WAIT_FOR_SHADERS_BEFORE_STARTING);
shader_compilation_layout->addWidget(m_wait_for_shaders);
shader_compilation_box->setLayout(shader_compilation_layout);

View file

@ -4,11 +4,12 @@
#pragma once
#include <array>
#include "DolphinQt/Config/Graphics/GraphicsWidget.h"
class GraphicsBool;
class GraphicsChoice;
class GraphicsRadioInt;
#include <QWidget>
class ConfigBool;
class ConfigChoice;
class ConfigRadioInt;
class GraphicsWindow;
class QCheckBox;
class QComboBox;
@ -16,22 +17,17 @@ class QRadioButton;
class QGridLayout;
class ToolTipComboBox;
namespace X11Utils
{
class XRRConfiguration;
}
class GeneralWidget final : public GraphicsWidget
class GeneralWidget final : public QWidget
{
Q_OBJECT
public:
explicit GeneralWidget(X11Utils::XRRConfiguration* xrr_config, GraphicsWindow* parent);
explicit GeneralWidget(GraphicsWindow* parent);
signals:
void BackendChanged(const QString& backend);
private:
void LoadSettings() override;
void SaveSettings() override;
void LoadSettings();
void SaveSettings();
void CreateWidgets();
void ConnectWidgets();
@ -44,17 +40,15 @@ private:
QGridLayout* m_video_layout;
ToolTipComboBox* m_backend_combo;
ToolTipComboBox* m_adapter_combo;
GraphicsChoice* m_aspect_combo;
GraphicsBool* m_enable_vsync;
GraphicsBool* m_enable_fullscreen;
ConfigChoice* m_aspect_combo;
ConfigBool* m_enable_vsync;
ConfigBool* m_enable_fullscreen;
// Options
GraphicsBool* m_show_ping;
GraphicsBool* m_autoadjust_window_size;
GraphicsBool* m_show_messages;
GraphicsBool* m_render_main_window;
std::array<GraphicsRadioInt*, 4> m_shader_compilation_mode{};
GraphicsBool* m_wait_for_shaders;
X11Utils::XRRConfiguration* m_xrr_config;
ConfigBool* m_show_ping;
ConfigBool* m_autoadjust_window_size;
ConfigBool* m_show_messages;
ConfigBool* m_render_main_window;
std::array<ConfigRadioInt*, 4> m_shader_compilation_mode{};
ConfigBool* m_wait_for_shaders;
};

View file

@ -1,33 +0,0 @@
// Copyright 2017 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "DolphinQt/Config/Graphics/GraphicsBool.h"
#include <QEvent>
#include <QFont>
#include <QSignalBlocker>
#include "Common/Config/Config.h"
#include "DolphinQt/Settings.h"
GraphicsBool::GraphicsBool(const QString& label, const Config::Info<bool>& setting, bool reverse)
: ToolTipCheckBox(label), m_setting(setting), m_reverse(reverse)
{
connect(this, &QCheckBox::toggled, this, &GraphicsBool::Update);
setChecked(Config::Get(m_setting) ^ reverse);
connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this] {
QFont bf = font();
bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base);
setFont(bf);
const QSignalBlocker blocker(this);
setChecked(Config::Get(m_setting) ^ m_reverse);
});
}
void GraphicsBool::Update()
{
Config::SetBaseOrCurrent(m_setting, static_cast<bool>(isChecked() ^ m_reverse));
}

View file

@ -1,25 +0,0 @@
// Copyright 2017 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "DolphinQt/Config/ToolTipControls/ToolTipCheckBox.h"
namespace Config
{
template <typename T>
class Info;
}
class GraphicsBool : public ToolTipCheckBox
{
Q_OBJECT
public:
GraphicsBool(const QString& label, const Config::Info<bool>& setting, bool reverse = false);
private:
void Update();
const Config::Info<bool>& m_setting;
bool m_reverse;
};

View file

@ -1,32 +0,0 @@
// Copyright 2017 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "DolphinQt/Config/Graphics/GraphicsChoice.h"
#include <QSignalBlocker>
#include "Common/Config/Config.h"
#include "DolphinQt/Settings.h"
GraphicsChoice::GraphicsChoice(const QStringList& options, const Config::Info<int>& setting)
: m_setting(setting)
{
addItems(options);
connect(this, qOverload<int>(&QComboBox::currentIndexChanged), this, &GraphicsChoice::Update);
setCurrentIndex(Config::Get(m_setting));
connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this] {
QFont bf = font();
bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base);
setFont(bf);
const QSignalBlocker blocker(this);
setCurrentIndex(Config::Get(m_setting));
});
}
void GraphicsChoice::Update(int choice)
{
Config::SetBaseOrCurrent(m_setting, choice);
}

View file

@ -1,20 +0,0 @@
// Copyright 2017 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "DolphinQt/Config/ToolTipControls/ToolTipComboBox.h"
#include "Common/Config/Config.h"
class GraphicsChoice : public ToolTipComboBox
{
Q_OBJECT
public:
GraphicsChoice(const QStringList& options, const Config::Info<int>& setting);
private:
void Update(int choice);
Config::Info<int> m_setting;
};

View file

@ -1,36 +0,0 @@
// Copyright 2019 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "DolphinQt/Config/Graphics/GraphicsInteger.h"
#include <QSignalBlocker>
#include "Common/Config/Config.h"
#include "DolphinQt/Settings.h"
GraphicsInteger::GraphicsInteger(int minimum, int maximum, const Config::Info<int>& setting,
int step)
: ToolTipSpinBox(), m_setting(setting)
{
setMinimum(minimum);
setMaximum(maximum);
setSingleStep(step);
setValue(Config::Get(setting));
connect(this, qOverload<int>(&GraphicsInteger::valueChanged), this, &GraphicsInteger::Update);
connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this] {
QFont bf = font();
bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base);
setFont(bf);
const QSignalBlocker blocker(this);
setValue(Config::Get(m_setting));
});
}
void GraphicsInteger::Update(int value)
{
Config::SetBaseOrCurrent(m_setting, value);
}

View file

@ -1,23 +0,0 @@
// Copyright 2019 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "DolphinQt/Config/ToolTipControls/ToolTipSpinBox.h"
namespace Config
{
template <typename T>
class Info;
}
class GraphicsInteger : public ToolTipSpinBox
{
Q_OBJECT
public:
GraphicsInteger(int minimum, int maximum, const Config::Info<int>& setting, int step = 1);
void Update(int value);
private:
const Config::Info<int>& m_setting;
};

View file

@ -1,35 +0,0 @@
// Copyright 2018 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "DolphinQt/Config/Graphics/GraphicsRadio.h"
#include <QSignalBlocker>
#include "Common/Config/Config.h"
#include "DolphinQt/Settings.h"
GraphicsRadioInt::GraphicsRadioInt(const QString& label, const Config::Info<int>& setting,
int value)
: ToolTipRadioButton(label), m_setting(setting), m_value(value)
{
setChecked(Config::Get(m_setting) == m_value);
connect(this, &QRadioButton::toggled, this, &GraphicsRadioInt::Update);
connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this] {
QFont bf = font();
bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base);
setFont(bf);
const QSignalBlocker blocker(this);
setChecked(Config::Get(m_setting) == m_value);
});
}
void GraphicsRadioInt::Update()
{
if (!isChecked())
return;
Config::SetBaseOrCurrent(m_setting, m_value);
}

View file

@ -1,21 +0,0 @@
// Copyright 2018 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "DolphinQt/Config/ToolTipControls/ToolTipRadioButton.h"
#include "Common/Config/Config.h"
class GraphicsRadioInt : public ToolTipRadioButton
{
Q_OBJECT
public:
GraphicsRadioInt(const QString& label, const Config::Info<int>& setting, int value);
private:
void Update();
Config::Info<int> m_setting;
int m_value;
};

View file

@ -1,36 +0,0 @@
// Copyright 2017 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "DolphinQt/Config/Graphics/GraphicsSlider.h"
#include <QSignalBlocker>
#include "Common/Config/Config.h"
#include "DolphinQt/Settings.h"
GraphicsSlider::GraphicsSlider(int minimum, int maximum, const Config::Info<int>& setting, int tick)
: ToolTipSlider(Qt::Horizontal), m_setting(setting)
{
setMinimum(minimum);
setMaximum(maximum);
setTickInterval(tick);
setValue(Config::Get(setting));
connect(this, &GraphicsSlider::valueChanged, this, &GraphicsSlider::Update);
connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this] {
QFont bf = font();
bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base);
setFont(bf);
const QSignalBlocker blocker(this);
setValue(Config::Get(m_setting));
});
}
void GraphicsSlider::Update(int value)
{
Config::SetBaseOrCurrent(m_setting, value);
}

View file

@ -1,23 +0,0 @@
// Copyright 2017 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "DolphinQt/Config/ToolTipControls/ToolTipSlider.h"
namespace Config
{
template <typename T>
class Info;
}
class GraphicsSlider : public ToolTipSlider
{
Q_OBJECT
public:
GraphicsSlider(int minimum, int maximum, const Config::Info<int>& setting, int tick = 0);
void Update(int value);
private:
const Config::Info<int>& m_setting;
};

View file

@ -1,14 +0,0 @@
// Copyright 2017 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <QWidget>
class GraphicsWidget : public QWidget
{
Q_OBJECT
protected:
virtual void LoadSettings() = 0;
virtual void SaveSettings() = 0;
};

View file

@ -24,8 +24,7 @@
#include "VideoCommon/VideoBackendBase.h"
#include "VideoCommon/VideoConfig.h"
GraphicsWindow::GraphicsWindow(X11Utils::XRRConfiguration* xrr_config, MainWindow* parent)
: QDialog(parent), m_xrr_config(xrr_config)
GraphicsWindow::GraphicsWindow(MainWindow* parent) : QDialog(parent)
{
CreateMainLayout();
@ -37,32 +36,31 @@ GraphicsWindow::GraphicsWindow(X11Utils::XRRConfiguration* xrr_config, MainWindo
void GraphicsWindow::CreateMainLayout()
{
auto* main_layout = new QVBoxLayout();
m_tab_widget = new QTabWidget();
m_button_box = new QDialogButtonBox(QDialogButtonBox::Close);
auto* const main_layout = new QVBoxLayout();
auto* const tab_widget = new QTabWidget();
auto* const button_box = new QDialogButtonBox(QDialogButtonBox::Close);
connect(m_button_box, &QDialogButtonBox::rejected, this, &QDialog::reject);
connect(button_box, &QDialogButtonBox::rejected, this, &QDialog::reject);
main_layout->addWidget(m_tab_widget);
main_layout->addWidget(m_button_box);
main_layout->addWidget(tab_widget);
main_layout->addWidget(button_box);
m_general_widget = new GeneralWidget(m_xrr_config, this);
m_enhancements_widget = new EnhancementsWidget(this);
m_hacks_widget = new HacksWidget(this);
m_advanced_widget = new AdvancedWidget(this);
auto* const general_widget = new GeneralWidget(this);
auto* const enhancements_widget = new EnhancementsWidget(this);
auto* const hacks_widget = new HacksWidget(this);
auto* const advanced_widget = new AdvancedWidget(this);
connect(m_general_widget, &GeneralWidget::BackendChanged, this,
&GraphicsWindow::OnBackendChanged);
connect(general_widget, &GeneralWidget::BackendChanged, this, &GraphicsWindow::OnBackendChanged);
m_wrapped_general = GetWrappedWidget(m_general_widget, this, 50, 100);
m_wrapped_enhancements = GetWrappedWidget(m_enhancements_widget, this, 50, 100);
m_wrapped_hacks = GetWrappedWidget(m_hacks_widget, this, 50, 100);
m_wrapped_advanced = GetWrappedWidget(m_advanced_widget, this, 50, 100);
QWidget* const wrapped_general = GetWrappedWidget(general_widget, this, 50, 100);
QWidget* const wrapped_enhancements = GetWrappedWidget(enhancements_widget, this, 50, 100);
QWidget* const wrapped_hacks = GetWrappedWidget(hacks_widget, this, 50, 100);
QWidget* const wrapped_advanced = GetWrappedWidget(advanced_widget, this, 50, 100);
m_tab_widget->addTab(m_wrapped_general, tr("General"));
m_tab_widget->addTab(m_wrapped_enhancements, tr("Enhancements"));
m_tab_widget->addTab(m_wrapped_hacks, tr("Hacks"));
m_tab_widget->addTab(m_wrapped_advanced, tr("Advanced"));
tab_widget->addTab(wrapped_general, tr("General"));
tab_widget->addTab(wrapped_enhancements, tr("Enhancements"));
tab_widget->addTab(wrapped_hacks, tr("Hacks"));
tab_widget->addTab(wrapped_advanced, tr("Advanced"));
setLayout(main_layout);
}

View file

@ -16,16 +16,11 @@ class QTabWidget;
class QDialogButtonBox;
class SoftwareRendererWidget;
namespace X11Utils
{
class XRRConfiguration;
}
class GraphicsWindow final : public QDialog
{
Q_OBJECT
public:
explicit GraphicsWindow(X11Utils::XRRConfiguration* xrr_config, MainWindow* parent);
explicit GraphicsWindow(MainWindow* parent);
signals:
void BackendChanged(const QString& backend);
@ -33,21 +28,4 @@ signals:
private:
void CreateMainLayout();
void OnBackendChanged(const QString& backend);
QTabWidget* m_tab_widget;
QDialogButtonBox* m_button_box;
AdvancedWidget* m_advanced_widget;
EnhancementsWidget* m_enhancements_widget;
HacksWidget* m_hacks_widget;
GeneralWidget* m_general_widget;
SoftwareRendererWidget* m_software_renderer;
QWidget* m_wrapped_advanced;
QWidget* m_wrapped_enhancements;
QWidget* m_wrapped_hacks;
QWidget* m_wrapped_general;
QWidget* m_wrapped_software;
X11Utils::XRRConfiguration* m_xrr_config;
};

View file

@ -13,8 +13,8 @@
#include "Core/Config/MainSettings.h"
#include "Core/ConfigManager.h"
#include "DolphinQt/Config/Graphics/GraphicsBool.h"
#include "DolphinQt/Config/Graphics/GraphicsSlider.h"
#include "DolphinQt/Config/ConfigControls/ConfigBool.h"
#include "DolphinQt/Config/ConfigControls/ConfigSlider.h"
#include "DolphinQt/Config/Graphics/GraphicsWindow.h"
#include "DolphinQt/Config/ToolTipControls/ToolTipSlider.h"
#include "DolphinQt/Settings.h"
@ -42,13 +42,13 @@ void HacksWidget::CreateWidgets()
auto* efb_layout = new QGridLayout();
efb_box->setLayout(efb_layout);
m_skip_efb_cpu =
new GraphicsBool(tr("Skip EFB Access from CPU"), Config::GFX_HACK_EFB_ACCESS_ENABLE, true);
m_ignore_format_changes = new GraphicsBool(tr("Ignore Format Changes"),
Config::GFX_HACK_EFB_EMULATE_FORMAT_CHANGES, true);
m_store_efb_copies = new GraphicsBool(tr("Store EFB Copies to Texture Only"),
Config::GFX_HACK_SKIP_EFB_COPY_TO_RAM);
new ConfigBool(tr("Skip EFB Access from CPU"), Config::GFX_HACK_EFB_ACCESS_ENABLE, true);
m_ignore_format_changes = new ConfigBool(tr("Ignore Format Changes"),
Config::GFX_HACK_EFB_EMULATE_FORMAT_CHANGES, true);
m_store_efb_copies =
new ConfigBool(tr("Store EFB Copies to Texture Only"), Config::GFX_HACK_SKIP_EFB_COPY_TO_RAM);
m_defer_efb_copies =
new GraphicsBool(tr("Defer EFB Copies to RAM"), Config::GFX_HACK_DEFER_EFB_COPIES);
new ConfigBool(tr("Defer EFB Copies to RAM"), Config::GFX_HACK_DEFER_EFB_COPIES);
efb_layout->addWidget(m_skip_efb_cpu, 0, 0);
efb_layout->addWidget(m_ignore_format_changes, 0, 1);
@ -66,7 +66,7 @@ void HacksWidget::CreateWidgets()
m_accuracy->setPageStep(1);
m_accuracy->setTickPosition(QSlider::TicksBelow);
m_gpu_texture_decoding =
new GraphicsBool(tr("GPU Texture Decoding"), Config::GFX_ENABLE_GPU_TEXTURE_DECODING);
new ConfigBool(tr("GPU Texture Decoding"), Config::GFX_ENABLE_GPU_TEXTURE_DECODING);
auto* safe_label = new QLabel(tr("Safe"));
safe_label->setAlignment(Qt::AlignRight);
@ -84,11 +84,11 @@ void HacksWidget::CreateWidgets()
auto* xfb_layout = new QVBoxLayout();
xfb_box->setLayout(xfb_layout);
m_store_xfb_copies = new GraphicsBool(tr("Store XFB Copies to Texture Only"),
Config::GFX_HACK_SKIP_XFB_COPY_TO_RAM);
m_immediate_xfb = new GraphicsBool(tr("Immediately Present XFB"), Config::GFX_HACK_IMMEDIATE_XFB);
m_skip_duplicate_xfbs = new GraphicsBool(tr("Skip Presenting Duplicate Frames"),
Config::GFX_HACK_SKIP_DUPLICATE_XFBS);
m_store_xfb_copies =
new ConfigBool(tr("Store XFB Copies to Texture Only"), Config::GFX_HACK_SKIP_XFB_COPY_TO_RAM);
m_immediate_xfb = new ConfigBool(tr("Immediately Present XFB"), Config::GFX_HACK_IMMEDIATE_XFB);
m_skip_duplicate_xfbs =
new ConfigBool(tr("Skip Presenting Duplicate Frames"), Config::GFX_HACK_SKIP_DUPLICATE_XFBS);
xfb_layout->addWidget(m_store_xfb_copies);
xfb_layout->addWidget(m_immediate_xfb);
@ -100,13 +100,13 @@ void HacksWidget::CreateWidgets()
other_box->setLayout(other_layout);
m_fast_depth_calculation =
new GraphicsBool(tr("Fast Depth Calculation"), Config::GFX_FAST_DEPTH_CALC);
new ConfigBool(tr("Fast Depth Calculation"), Config::GFX_FAST_DEPTH_CALC);
m_disable_bounding_box =
new GraphicsBool(tr("Disable Bounding Box"), Config::GFX_HACK_BBOX_ENABLE, true);
m_vertex_rounding = new GraphicsBool(tr("Vertex Rounding"), Config::GFX_HACK_VERTEX_ROUNDING);
new ConfigBool(tr("Disable Bounding Box"), Config::GFX_HACK_BBOX_ENABLE, true);
m_vertex_rounding = new ConfigBool(tr("Vertex Rounding"), Config::GFX_HACK_VERTEX_ROUNDING);
m_save_texture_cache_state =
new GraphicsBool(tr("Save Texture Cache to State"), Config::GFX_SAVE_TEXTURE_CACHE_TO_STATE);
m_vi_skip = new GraphicsBool(tr("VBI Skip"), Config::GFX_HACK_VI_SKIP);
new ConfigBool(tr("Save Texture Cache to State"), Config::GFX_SAVE_TEXTURE_CACHE_TO_STATE);
m_vi_skip = new ConfigBool(tr("VBI Skip"), Config::GFX_HACK_VI_SKIP);
other_layout->addWidget(m_fast_depth_calculation, 0, 0);
other_layout->addWidget(m_disable_bounding_box, 0, 1);

View file

@ -3,47 +3,47 @@
#pragma once
#include "DolphinQt/Config/Graphics/GraphicsWidget.h"
#include <QWidget>
class GraphicsBool;
class ConfigBool;
class GraphicsWindow;
class QLabel;
class ToolTipSlider;
class HacksWidget final : public GraphicsWidget
class HacksWidget final : public QWidget
{
Q_OBJECT
public:
explicit HacksWidget(GraphicsWindow* parent);
private:
void LoadSettings() override;
void SaveSettings() override;
void LoadSettings();
void SaveSettings();
void OnBackendChanged(const QString& backend_name);
// EFB
GraphicsBool* m_skip_efb_cpu;
GraphicsBool* m_ignore_format_changes;
GraphicsBool* m_store_efb_copies;
GraphicsBool* m_defer_efb_copies;
ConfigBool* m_skip_efb_cpu;
ConfigBool* m_ignore_format_changes;
ConfigBool* m_store_efb_copies;
ConfigBool* m_defer_efb_copies;
// Texture Cache
QLabel* m_accuracy_label;
ToolTipSlider* m_accuracy;
GraphicsBool* m_gpu_texture_decoding;
ConfigBool* m_gpu_texture_decoding;
// External Framebuffer
GraphicsBool* m_store_xfb_copies;
GraphicsBool* m_immediate_xfb;
GraphicsBool* m_skip_duplicate_xfbs;
ConfigBool* m_store_xfb_copies;
ConfigBool* m_immediate_xfb;
ConfigBool* m_skip_duplicate_xfbs;
// Other
GraphicsBool* m_fast_depth_calculation;
GraphicsBool* m_disable_bounding_box;
GraphicsBool* m_vertex_rounding;
GraphicsBool* m_vi_skip;
GraphicsBool* m_save_texture_cache_state;
ConfigBool* m_fast_depth_calculation;
ConfigBool* m_disable_bounding_box;
ConfigBool* m_vertex_rounding;
ConfigBool* m_vi_skip;
ConfigBool* m_save_texture_cache_state;
void CreateWidgets();
void ConnectWidgets();

View file

@ -93,12 +93,17 @@ void PostProcessingConfigWindow::Create()
u32 row = 0;
bool add_general_page = false;
for (const auto& it : m_config_groups)
for (auto& it : m_config_groups)
{
if (it->HasSubGroups())
{
auto* const tab = CreateDependentTab(it);
m_tabs->addTab(tab, QString::fromStdString(it->GetGUIName()));
if (it->GetConfigurationOption()->m_type == OptionType::Bool)
{
it->EnableSuboptions(it->GetCheckboxValue());
}
}
else
{
@ -213,6 +218,12 @@ bool PostProcessingConfigWindow::ConfigGroup::HasSubGroups() const noexcept
return !m_subgroups.empty();
}
const ConfigurationOption*
PostProcessingConfigWindow::ConfigGroup::GetConfigurationOption() const noexcept
{
return m_config_option;
}
const std::vector<std::unique_ptr<PostProcessingConfigWindow::ConfigGroup>>&
PostProcessingConfigWindow::ConfigGroup::GetSubGroups() const noexcept
{
@ -300,11 +311,12 @@ u32 PostProcessingConfigWindow::ConfigGroup::AddFloat(PostProcessingConfigWindow
for (size_t i = 0; i < vector_size; ++i)
{
const int current_value =
m_config_option->m_float_values[i] / m_config_option->m_float_step_values[i];
const float range =
m_config_option->m_float_max_values[i] - m_config_option->m_float_min_values[i];
const int steps = std::ceil(range / m_config_option->m_float_step_values[i]);
const int current_value =
std::round((m_config_option->m_float_values[i] - m_config_option->m_float_min_values[i]) /
m_config_option->m_float_step_values[i]);
auto* const slider = new QSlider(Qt::Orientation::Horizontal);
slider->setMinimum(0);
@ -351,6 +363,11 @@ void PostProcessingConfigWindow::ConfigGroup::EnableSuboptions(const bool state)
}
}
int PostProcessingConfigWindow::ConfigGroup::GetCheckboxValue() const
{
return m_checkbox->isChecked();
}
int PostProcessingConfigWindow::ConfigGroup::GetSliderValue(size_t index) const
{
return m_sliders[index]->value();

View file

@ -41,9 +41,12 @@ private:
const std::string& GetOptionName() const noexcept;
void AddSubGroup(std::unique_ptr<ConfigGroup>&& subgroup);
bool HasSubGroups() const noexcept;
const VideoCommon::PostProcessingConfiguration::ConfigurationOption*
GetConfigurationOption() const noexcept;
const std::vector<std::unique_ptr<ConfigGroup>>& GetSubGroups() const noexcept;
u32 AddWidgets(PostProcessingConfigWindow* parent, QGridLayout* grid, u32 row);
void EnableSuboptions(bool state);
int GetCheckboxValue() const;
int GetSliderValue(size_t index) const;
void SetSliderText(size_t index, const QString& text);