diff options
| author | 2018-01-11 19:21:20 -0700 | |
|---|---|---|
| committer | 2018-01-12 19:11:03 -0700 | |
| commit | ebf9a784a9f7f4148a669dbb39e7cd50df779a14 (patch) | |
| tree | d585685a1c0a34b903af1d086d62560bf56bb29f /src/citra_qt/configuration/configure_graphics.cpp | |
| parent | config: Default CPU core to Unicorn. (diff) | |
| download | yuzu-ebf9a784a9f7f4148a669dbb39e7cd50df779a14.tar.gz yuzu-ebf9a784a9f7f4148a669dbb39e7cd50df779a14.tar.xz yuzu-ebf9a784a9f7f4148a669dbb39e7cd50df779a14.zip | |
Massive removal of unused modules
Diffstat (limited to 'src/citra_qt/configuration/configure_graphics.cpp')
| -rw-r--r-- | src/citra_qt/configuration/configure_graphics.cpp | 115 |
1 files changed, 0 insertions, 115 deletions
diff --git a/src/citra_qt/configuration/configure_graphics.cpp b/src/citra_qt/configuration/configure_graphics.cpp deleted file mode 100644 index b5a5ab1e1..000000000 --- a/src/citra_qt/configuration/configure_graphics.cpp +++ /dev/null | |||
| @@ -1,115 +0,0 @@ | |||
| 1 | // Copyright 2016 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "citra_qt/configuration/configure_graphics.h" | ||
| 6 | #include "core/core.h" | ||
| 7 | #include "core/settings.h" | ||
| 8 | #include "ui_configure_graphics.h" | ||
| 9 | |||
| 10 | ConfigureGraphics::ConfigureGraphics(QWidget* parent) | ||
| 11 | : QWidget(parent), ui(new Ui::ConfigureGraphics) { | ||
| 12 | |||
| 13 | ui->setupUi(this); | ||
| 14 | this->setConfiguration(); | ||
| 15 | |||
| 16 | ui->toggle_vsync->setEnabled(!Core::System::GetInstance().IsPoweredOn()); | ||
| 17 | |||
| 18 | ui->layoutBox->setEnabled(!Settings::values.custom_layout); | ||
| 19 | } | ||
| 20 | |||
| 21 | ConfigureGraphics::~ConfigureGraphics() {} | ||
| 22 | |||
| 23 | enum class Resolution : int { | ||
| 24 | Auto, | ||
| 25 | Scale1x, | ||
| 26 | Scale2x, | ||
| 27 | Scale3x, | ||
| 28 | Scale4x, | ||
| 29 | Scale5x, | ||
| 30 | Scale6x, | ||
| 31 | Scale7x, | ||
| 32 | Scale8x, | ||
| 33 | Scale9x, | ||
| 34 | Scale10x, | ||
| 35 | }; | ||
| 36 | |||
| 37 | float ToResolutionFactor(Resolution option) { | ||
| 38 | switch (option) { | ||
| 39 | case Resolution::Auto: | ||
| 40 | return 0.f; | ||
| 41 | case Resolution::Scale1x: | ||
| 42 | return 1.f; | ||
| 43 | case Resolution::Scale2x: | ||
| 44 | return 2.f; | ||
| 45 | case Resolution::Scale3x: | ||
| 46 | return 3.f; | ||
| 47 | case Resolution::Scale4x: | ||
| 48 | return 4.f; | ||
| 49 | case Resolution::Scale5x: | ||
| 50 | return 5.f; | ||
| 51 | case Resolution::Scale6x: | ||
| 52 | return 6.f; | ||
| 53 | case Resolution::Scale7x: | ||
| 54 | return 7.f; | ||
| 55 | case Resolution::Scale8x: | ||
| 56 | return 8.f; | ||
| 57 | case Resolution::Scale9x: | ||
| 58 | return 9.f; | ||
| 59 | case Resolution::Scale10x: | ||
| 60 | return 10.f; | ||
| 61 | } | ||
| 62 | return 0.f; | ||
| 63 | } | ||
| 64 | |||
| 65 | Resolution FromResolutionFactor(float factor) { | ||
| 66 | if (factor == 0.f) { | ||
| 67 | return Resolution::Auto; | ||
| 68 | } else if (factor == 1.f) { | ||
| 69 | return Resolution::Scale1x; | ||
| 70 | } else if (factor == 2.f) { | ||
| 71 | return Resolution::Scale2x; | ||
| 72 | } else if (factor == 3.f) { | ||
| 73 | return Resolution::Scale3x; | ||
| 74 | } else if (factor == 4.f) { | ||
| 75 | return Resolution::Scale4x; | ||
| 76 | } else if (factor == 5.f) { | ||
| 77 | return Resolution::Scale5x; | ||
| 78 | } else if (factor == 6.f) { | ||
| 79 | return Resolution::Scale6x; | ||
| 80 | } else if (factor == 7.f) { | ||
| 81 | return Resolution::Scale7x; | ||
| 82 | } else if (factor == 8.f) { | ||
| 83 | return Resolution::Scale8x; | ||
| 84 | } else if (factor == 9.f) { | ||
| 85 | return Resolution::Scale9x; | ||
| 86 | } else if (factor == 10.f) { | ||
| 87 | return Resolution::Scale10x; | ||
| 88 | } | ||
| 89 | return Resolution::Auto; | ||
| 90 | } | ||
| 91 | |||
| 92 | void ConfigureGraphics::setConfiguration() { | ||
| 93 | ui->toggle_hw_renderer->setChecked(Settings::values.use_hw_renderer); | ||
| 94 | ui->resolution_factor_combobox->setEnabled(Settings::values.use_hw_renderer); | ||
| 95 | ui->toggle_shader_jit->setChecked(Settings::values.use_shader_jit); | ||
| 96 | ui->resolution_factor_combobox->setCurrentIndex( | ||
| 97 | static_cast<int>(FromResolutionFactor(Settings::values.resolution_factor))); | ||
| 98 | ui->toggle_vsync->setChecked(Settings::values.use_vsync); | ||
| 99 | ui->toggle_framelimit->setChecked(Settings::values.toggle_framelimit); | ||
| 100 | ui->layout_combobox->setCurrentIndex(static_cast<int>(Settings::values.layout_option)); | ||
| 101 | ui->swap_screen->setChecked(Settings::values.swap_screen); | ||
| 102 | } | ||
| 103 | |||
| 104 | void ConfigureGraphics::applyConfiguration() { | ||
| 105 | Settings::values.use_hw_renderer = ui->toggle_hw_renderer->isChecked(); | ||
| 106 | Settings::values.use_shader_jit = ui->toggle_shader_jit->isChecked(); | ||
| 107 | Settings::values.resolution_factor = | ||
| 108 | ToResolutionFactor(static_cast<Resolution>(ui->resolution_factor_combobox->currentIndex())); | ||
| 109 | Settings::values.use_vsync = ui->toggle_vsync->isChecked(); | ||
| 110 | Settings::values.toggle_framelimit = ui->toggle_framelimit->isChecked(); | ||
| 111 | Settings::values.layout_option = | ||
| 112 | static_cast<Settings::LayoutOption>(ui->layout_combobox->currentIndex()); | ||
| 113 | Settings::values.swap_screen = ui->swap_screen->isChecked(); | ||
| 114 | Settings::Apply(); | ||
| 115 | } | ||