PostProcessing: Use ints-for-bools CPU-side as well

This commit is contained in:
Connor McLaughlin
2020-09-16 11:51:42 +10:00
parent 3bd9f85af8
commit 3096f0953f
3 changed files with 6 additions and 7 deletions

View File

@ -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);