Merge pull request #3452 from Morph1984/anisotropic-filtering
frontend/Graphics: Add "Advanced" graphics tab and experimental Anisotropic Filtering supportmaster
commit
84e9f9f395
@ -0,0 +1,48 @@
|
|||||||
|
// Copyright 2020 yuzu Emulator Project
|
||||||
|
// Licensed under GPLv2 or any later version
|
||||||
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include "core/core.h"
|
||||||
|
#include "core/settings.h"
|
||||||
|
#include "ui_configure_graphics_advanced.h"
|
||||||
|
#include "yuzu/configuration/configure_graphics_advanced.h"
|
||||||
|
|
||||||
|
ConfigureGraphicsAdvanced::ConfigureGraphicsAdvanced(QWidget* parent)
|
||||||
|
: QWidget(parent), ui(new Ui::ConfigureGraphicsAdvanced) {
|
||||||
|
|
||||||
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
SetConfiguration();
|
||||||
|
}
|
||||||
|
|
||||||
|
ConfigureGraphicsAdvanced::~ConfigureGraphicsAdvanced() = default;
|
||||||
|
|
||||||
|
void ConfigureGraphicsAdvanced::SetConfiguration() {
|
||||||
|
const bool runtime_lock = !Core::System::GetInstance().IsPoweredOn();
|
||||||
|
ui->use_accurate_gpu_emulation->setChecked(Settings::values.use_accurate_gpu_emulation);
|
||||||
|
ui->use_vsync->setEnabled(runtime_lock);
|
||||||
|
ui->use_vsync->setChecked(Settings::values.use_vsync);
|
||||||
|
ui->force_30fps_mode->setEnabled(runtime_lock);
|
||||||
|
ui->force_30fps_mode->setChecked(Settings::values.force_30fps_mode);
|
||||||
|
ui->anisotropic_filtering_combobox->setEnabled(runtime_lock);
|
||||||
|
ui->anisotropic_filtering_combobox->setCurrentIndex(Settings::values.max_anisotropy);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConfigureGraphicsAdvanced::ApplyConfiguration() {
|
||||||
|
Settings::values.use_accurate_gpu_emulation = ui->use_accurate_gpu_emulation->isChecked();
|
||||||
|
Settings::values.use_vsync = ui->use_vsync->isChecked();
|
||||||
|
Settings::values.force_30fps_mode = ui->force_30fps_mode->isChecked();
|
||||||
|
Settings::values.max_anisotropy = ui->anisotropic_filtering_combobox->currentIndex();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConfigureGraphicsAdvanced::changeEvent(QEvent* event) {
|
||||||
|
if (event->type() == QEvent::LanguageChange) {
|
||||||
|
RetranslateUI();
|
||||||
|
}
|
||||||
|
|
||||||
|
QWidget::changeEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConfigureGraphicsAdvanced::RetranslateUI() {
|
||||||
|
ui->retranslateUi(this);
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
// Copyright 2020 yuzu Emulator Project
|
||||||
|
// Licensed under GPLv2 or any later version
|
||||||
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class ConfigureGraphicsAdvanced;
|
||||||
|
}
|
||||||
|
|
||||||
|
class ConfigureGraphicsAdvanced : public QWidget {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit ConfigureGraphicsAdvanced(QWidget* parent = nullptr);
|
||||||
|
~ConfigureGraphicsAdvanced() override;
|
||||||
|
|
||||||
|
void ApplyConfiguration();
|
||||||
|
|
||||||
|
private:
|
||||||
|
void changeEvent(QEvent* event) override;
|
||||||
|
void RetranslateUI();
|
||||||
|
|
||||||
|
void SetConfiguration();
|
||||||
|
|
||||||
|
std::unique_ptr<Ui::ConfigureGraphicsAdvanced> ui;
|
||||||
|
};
|
@ -0,0 +1,111 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>ConfigureGraphicsAdvanced</class>
|
||||||
|
<widget class="QWidget" name="ConfigureGraphicsAdvanced">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>321</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Form</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_1">
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox_1">
|
||||||
|
<property name="title">
|
||||||
|
<string>Advanced Graphics Settings</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="use_accurate_gpu_emulation">
|
||||||
|
<property name="text">
|
||||||
|
<string>Use accurate GPU emulation (slow)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="use_vsync">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>VSync prevents the screen from tearing, but some graphics cards have lower performance with VSync enabled. Keep it enabled if you don't notice a performance difference.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Use VSync (OpenGL only)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="force_30fps_mode">
|
||||||
|
<property name="text">
|
||||||
|
<string>Force 30 FPS mode</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_1">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="af_label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Anisotropic Filtering:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="anisotropic_filtering_combobox">
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Default</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>2x</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>4x</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>8x</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>16x</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
Loading…
Reference in New Issue