diff --git a/src/duckstation-qt/postprocessingshaderconfigwidget.cpp b/src/duckstation-qt/postprocessingshaderconfigwidget.cpp index 872ed6cf3..b858401ef 100644 --- a/src/duckstation-qt/postprocessingshaderconfigwidget.cpp +++ b/src/duckstation-qt/postprocessingshaderconfigwidget.cpp @@ -27,14 +27,14 @@ void PostProcessingShaderConfigWidget::createUi() if (option.type == PostProcessingShader::Option::Type::Bool) { QCheckBox* checkbox = new QCheckBox(QString::fromStdString(option.ui_name), this); - checkbox->setChecked(option.value[0].bool_value); + checkbox->setChecked(option.value[0].int_value != 0); connect(checkbox, &QCheckBox::stateChanged, [this, &option](int state) { - option.value[0].bool_value = (state == Qt::Checked); + option.value[0].int_value = (state == Qt::Checked) ? 1 : 0; configChanged(); }); connect(this, &PostProcessingShaderConfigWidget::resettingtoDefaults, [&option, checkbox]() { QSignalBlocker sb(checkbox); - checkbox->setChecked(option.default_value[0].bool_value); + checkbox->setChecked(option.default_value[0].int_value != 0); option.value = option.default_value; }); m_layout->addWidget(checkbox, row, 0, 1, 3, Qt::AlignLeft); diff --git a/src/frontend-common/postprocessing_shader.cpp b/src/frontend-common/postprocessing_shader.cpp index 50855fc42..8cbcd50b8 100644 --- a/src/frontend-common/postprocessing_shader.cpp +++ b/src/frontend-common/postprocessing_shader.cpp @@ -166,7 +166,7 @@ std::string PostProcessingShader::GetConfigString() const switch (option.type) { case Option::Type::Bool: - ss << option.value[i].bool_value ? "true" : "false"; + ss << (option.value[i].int_value != 0) ? "true" : "false"; break; case Option::Type::Int: @@ -209,7 +209,7 @@ void PostProcessingShader::SetConfigString(const std::string_view& str) switch (option->type) { case Option::Type::Bool: - option->value[0].bool_value = StringUtil::FromChars(value).value_or(false); + option->value[0].int_value = StringUtil::FromChars(value).value_or(false) ? 1 : 0; break; case Option::Type::Int: @@ -389,7 +389,7 @@ void PostProcessingShader::LoadOptions() u32 size = 0; if (current_option.type == Option::Type::Bool) - (*dst_array)[size++].bool_value = StringUtil::FromChars(value).value_or(false); + (*dst_array)[size++].int_value = StringUtil::FromChars(value).value_or(false) ? 1 : 0; else if (current_option.type == Option::Type::Float) size = ParseVector(value, dst_array); else if (current_option.type == Option::Type::Int) diff --git a/src/frontend-common/postprocessing_shader.h b/src/frontend-common/postprocessing_shader.h index 0a708c638..4f6905900 100644 --- a/src/frontend-common/postprocessing_shader.h +++ b/src/frontend-common/postprocessing_shader.h @@ -33,7 +33,6 @@ public: union Value { - bool bool_value; s32 int_value; float float_value; };