Merge commit '433d9459e09cd9ce3a1d02cc78d901b66d25335f' into qt-style-test

This commit is contained in:
tomboylover93 2024-12-22 13:16:48 -03:00
commit cb661bdad7
5 changed files with 28 additions and 8 deletions

View File

@ -34,6 +34,7 @@ namespace Config {
static bool isNeo = false; static bool isNeo = false;
static bool isFullscreen = false; static bool isFullscreen = false;
static bool playBGM = false; static bool playBGM = false;
static bool isTrophyPopupDisabled = false;
static int BGMvolume = 50; static int BGMvolume = 50;
static bool enableDiscordRPC = false; static bool enableDiscordRPC = false;
static u32 screenWidth = 1280; static u32 screenWidth = 1280;
@ -99,6 +100,10 @@ bool isFullscreenMode() {
return isFullscreen; return isFullscreen;
} }
bool getisTrophyPopupDisabled() {
return isTrophyPopupDisabled;
}
bool getPlayBGM() { bool getPlayBGM() {
return playBGM; return playBGM;
} }
@ -299,6 +304,10 @@ void setFullscreenMode(bool enable) {
isFullscreen = enable; isFullscreen = enable;
} }
void setisTrophyPopupDisabled(bool disable) {
isTrophyPopupDisabled = disable;
}
void setPlayBGM(bool enable) { void setPlayBGM(bool enable) {
playBGM = enable; playBGM = enable;
} }
@ -558,6 +567,7 @@ void load(const std::filesystem::path& path) {
isNeo = toml::find_or<bool>(general, "isPS4Pro", false); isNeo = toml::find_or<bool>(general, "isPS4Pro", false);
isFullscreen = toml::find_or<bool>(general, "Fullscreen", false); isFullscreen = toml::find_or<bool>(general, "Fullscreen", false);
playBGM = toml::find_or<bool>(general, "playBGM", false); playBGM = toml::find_or<bool>(general, "playBGM", false);
isTrophyPopupDisabled = toml::find_or<bool>(general, "isTrophyPopupDisabled", false);
BGMvolume = toml::find_or<int>(general, "BGMvolume", 50); BGMvolume = toml::find_or<int>(general, "BGMvolume", 50);
enableDiscordRPC = toml::find_or<bool>(general, "enableDiscordRPC", true); enableDiscordRPC = toml::find_or<bool>(general, "enableDiscordRPC", true);
logFilter = toml::find_or<std::string>(general, "logFilter", ""); logFilter = toml::find_or<std::string>(general, "logFilter", "");
@ -677,6 +687,7 @@ void save(const std::filesystem::path& path) {
data["General"]["isPS4Pro"] = isNeo; data["General"]["isPS4Pro"] = isNeo;
data["General"]["Fullscreen"] = isFullscreen; data["General"]["Fullscreen"] = isFullscreen;
data["General"]["isTrophyPopupDisabled"] = isTrophyPopupDisabled;
data["General"]["playBGM"] = playBGM; data["General"]["playBGM"] = playBGM;
data["General"]["BGMvolume"] = BGMvolume; data["General"]["BGMvolume"] = BGMvolume;
data["General"]["enableDiscordRPC"] = enableDiscordRPC; data["General"]["enableDiscordRPC"] = enableDiscordRPC;
@ -774,6 +785,7 @@ void saveMainWindow(const std::filesystem::path& path) {
void setDefaultValues() { void setDefaultValues() {
isNeo = false; isNeo = false;
isFullscreen = false; isFullscreen = false;
isTrophyPopupDisabled = false;
playBGM = false; playBGM = false;
BGMvolume = 50; BGMvolume = 50;
enableDiscordRPC = true; enableDiscordRPC = true;

View File

@ -19,6 +19,7 @@ bool isNeoMode();
bool isFullscreenMode(); bool isFullscreenMode();
bool getPlayBGM(); bool getPlayBGM();
int getBGMvolume(); int getBGMvolume();
bool getisTrophyPopupDisabled();
bool getEnableDiscordRPC(); bool getEnableDiscordRPC();
bool getSeparateUpdateEnabled(); bool getSeparateUpdateEnabled();
bool getCompatibilityEnabled(); bool getCompatibilityEnabled();
@ -63,6 +64,7 @@ void setGpuId(s32 selectedGpuId);
void setScreenWidth(u32 width); void setScreenWidth(u32 width);
void setScreenHeight(u32 height); void setScreenHeight(u32 height);
void setFullscreenMode(bool enable); void setFullscreenMode(bool enable);
void setisTrophyPopupDisabled(bool disable);
void setPlayBGM(bool enable); void setPlayBGM(bool enable);
void setBGMvolume(int volume); void setBGMvolume(int volume);
void setEnableDiscordRPC(bool enable); void setEnableDiscordRPC(bool enable);

View File

@ -5,6 +5,7 @@
#include <mutex> #include <mutex>
#include <imgui.h> #include <imgui.h>
#include "common/assert.h" #include "common/assert.h"
#include "common/config.h"
#include "common/singleton.h" #include "common/singleton.h"
#include "imgui/imgui_std.h" #include "imgui/imgui_std.h"
#include "trophy_ui.h" #include "trophy_ui.h"
@ -82,7 +83,10 @@ void TrophyUI::Draw() {
void AddTrophyToQueue(const std::filesystem::path& trophyIconPath, const std::string& trophyName) { void AddTrophyToQueue(const std::filesystem::path& trophyIconPath, const std::string& trophyName) {
std::lock_guard<std::mutex> lock(queueMtx); std::lock_guard<std::mutex> lock(queueMtx);
if (current_trophy_ui.has_value()) {
if (Config::getisTrophyPopupDisabled()) {
return;
} else if (current_trophy_ui.has_value()) {
TrophyInfo new_trophy; TrophyInfo new_trophy;
new_trophy.trophy_icon_path = trophyIconPath; new_trophy.trophy_icon_path = trophyIconPath;
new_trophy.trophy_name = trophyName; new_trophy.trophy_name = trophyName;

View File

@ -266,6 +266,8 @@ void SettingsDialog::LoadValuesFromConfig() {
ui->dumpShadersCheckBox->setChecked(toml::find_or<bool>(data, "GPU", "dumpShaders", false)); ui->dumpShadersCheckBox->setChecked(toml::find_or<bool>(data, "GPU", "dumpShaders", false));
ui->nullGpuCheckBox->setChecked(toml::find_or<bool>(data, "GPU", "nullGpu", false)); ui->nullGpuCheckBox->setChecked(toml::find_or<bool>(data, "GPU", "nullGpu", false));
ui->playBGMCheckBox->setChecked(toml::find_or<bool>(data, "General", "playBGM", false)); ui->playBGMCheckBox->setChecked(toml::find_or<bool>(data, "General", "playBGM", false));
ui->disableTrophycheckBox->setChecked(
toml::find_or<bool>(data, "General", "isTrophyPopupDisabled", false));
ui->BGMVolumeSlider->setValue(toml::find_or<int>(data, "General", "BGMvolume", 50)); ui->BGMVolumeSlider->setValue(toml::find_or<int>(data, "General", "BGMvolume", 50));
ui->currentwidgetComboBox->setCurrentText( ui->currentwidgetComboBox->setCurrentText(
QString::fromStdString(toml::find_or<std::string>(data, "GUI", "widgetStyle", "fusion"))); QString::fromStdString(toml::find_or<std::string>(data, "GUI", "widgetStyle", "fusion")));
@ -496,6 +498,7 @@ void SettingsDialog::UpdateSettings() {
Config::setBackButtonBehavior(TouchPadIndex[ui->backButtonBehaviorComboBox->currentIndex()]); Config::setBackButtonBehavior(TouchPadIndex[ui->backButtonBehaviorComboBox->currentIndex()]);
Config::setNeoMode(ui->ps4proCheckBox->isChecked()); Config::setNeoMode(ui->ps4proCheckBox->isChecked());
Config::setFullscreenMode(ui->fullscreenCheckBox->isChecked()); Config::setFullscreenMode(ui->fullscreenCheckBox->isChecked());
Config::setisTrophyPopupDisabled(ui->disableTrophycheckBox->isChecked());
Config::setPlayBGM(ui->playBGMCheckBox->isChecked()); Config::setPlayBGM(ui->playBGMCheckBox->isChecked());
Config::setNeoMode(ui->ps4proCheckBox->isChecked()); Config::setNeoMode(ui->ps4proCheckBox->isChecked());
Config::setLogType(ui->logTypeComboBox->currentText().toStdString()); Config::setLogType(ui->logTypeComboBox->currentText().toStdString());

View File

@ -152,8 +152,9 @@ RenderState Rasterizer::PrepareRenderState(u32 mrt_mask) {
image.binding.is_target = 1u; image.binding.is_target = 1u;
const auto slice = image_view.info.range.base.layer; const auto slice = image_view.info.range.base.layer;
const bool is_clear = regs.depth_render_control.depth_clear_enable || const bool is_depth_clear = regs.depth_render_control.depth_clear_enable ||
texture_cache.IsMetaCleared(htile_address, slice); texture_cache.IsMetaCleared(htile_address, slice);
const bool is_stencil_clear = regs.depth_render_control.stencil_clear_enable;
ASSERT(desc.view_info.range.extent.layers == 1); ASSERT(desc.view_info.range.extent.layers == 1);
state.width = std::min<u32>(state.width, image.info.size.width); state.width = std::min<u32>(state.width, image.info.size.width);
@ -161,16 +162,14 @@ RenderState Rasterizer::PrepareRenderState(u32 mrt_mask) {
state.depth_attachment = { state.depth_attachment = {
.imageView = *image_view.image_view, .imageView = *image_view.image_view,
.imageLayout = vk::ImageLayout::eUndefined, .imageLayout = vk::ImageLayout::eUndefined,
.loadOp = is_clear && regs.depth_control.depth_enable ? vk::AttachmentLoadOp::eClear .loadOp = is_depth_clear ? vk::AttachmentLoadOp::eClear : vk::AttachmentLoadOp::eLoad,
: vk::AttachmentLoadOp::eLoad,
.storeOp = vk::AttachmentStoreOp::eStore, .storeOp = vk::AttachmentStoreOp::eStore,
.clearValue = vk::ClearValue{.depthStencil = {.depth = regs.depth_clear}}, .clearValue = vk::ClearValue{.depthStencil = {.depth = regs.depth_clear}},
}; };
state.stencil_attachment = { state.stencil_attachment = {
.imageView = *image_view.image_view, .imageView = *image_view.image_view,
.imageLayout = vk::ImageLayout::eUndefined, .imageLayout = vk::ImageLayout::eUndefined,
.loadOp = is_clear && regs.depth_control.stencil_enable ? vk::AttachmentLoadOp::eClear .loadOp = is_stencil_clear ? vk::AttachmentLoadOp::eClear : vk::AttachmentLoadOp::eLoad,
: vk::AttachmentLoadOp::eLoad,
.storeOp = vk::AttachmentStoreOp::eStore, .storeOp = vk::AttachmentStoreOp::eStore,
.clearValue = vk::ClearValue{.depthStencil = {.stencil = regs.stencil_clear}}, .clearValue = vk::ClearValue{.depthStencil = {.stencil = regs.stencil_clear}},
}; };