From: James Turner Date: Wed, 7 Jan 2015 11:30:44 +0000 (+0000) Subject: Launcher: hook up MSAA checkbox. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=55b092771f8960800722e9a961ff60bbf056f8b5;p=flightgear.git Launcher: hook up MSAA checkbox. --- diff --git a/src/GUI/QtLauncher.cxx b/src/GUI/QtLauncher.cxx index 8edcc1643..49ead834a 100644 --- a/src/GUI/QtLauncher.cxx +++ b/src/GUI/QtLauncher.cxx @@ -661,6 +661,11 @@ QtLauncher::QtLauncher() : this, SLOT(updateSettingsSummary())); connect(m_ui->startPausedCheck, SIGNAL(toggled(bool)), this, SLOT(updateSettingsSummary())); + connect(m_ui->msaaCheckbox, SIGNAL(toggled(bool)), + this, SLOT(updateSettingsSummary())); + + connect(m_ui->rembrandtCheckbox, SIGNAL(toggled(bool)), + this, SLOT(onRembrandtToggled(bool))); updateSettingsSummary(); @@ -783,6 +788,16 @@ void QtLauncher::onRun() setEnableDisableOptionFromCheckbox(m_ui->fullScreenCheckbox, "fullscreen"); setEnableDisableOptionFromCheckbox(m_ui->startPausedCheck, "freeze"); + // MSAA is more complex + if (!m_ui->rembrandtCheckbox->isChecked()) { + if (m_ui->msaaCheckbox->isChecked()) { + globals->get_props()->setIntValue("/sim/rendering/multi-sample-buffers", 1); + globals->get_props()->setIntValue("/sim/rendering/multi-samples", 4); + } else { + globals->get_props()->setIntValue("/sim/rendering/multi-sample-buffers", 0); + } + } + // aircraft if (!m_selectedAircraft.isEmpty()) { QFileInfo setFileInfo(m_selectedAircraft); @@ -1097,6 +1112,8 @@ void QtLauncher::updateSettingsSummary() if (m_ui->rembrandtCheckbox->isChecked()) { summary.append("Rembrandt enabled"); + } else if (m_ui->msaaCheckbox->isChecked()) { + summary.append("anti-aliasing"); } if (m_ui->fetchRealWxrCheckbox->isChecked()) { @@ -1133,5 +1150,11 @@ void QtLauncher::onRemoveSceneryPath() } } +void QtLauncher::onRembrandtToggled(bool b) +{ + // Rembrandt and multi-sample are exclusive + m_ui->msaaCheckbox->setEnabled(!b); +} + #include "QtLauncher.moc" diff --git a/src/GUI/QtLauncher.hxx b/src/GUI/QtLauncher.hxx index 62b630aaa..81dab0ee3 100644 --- a/src/GUI/QtLauncher.hxx +++ b/src/GUI/QtLauncher.hxx @@ -50,6 +50,8 @@ private slots: void onAddSceneryPath(); void onRemoveSceneryPath(); + + void onRembrandtToggled(bool b); private: void setAirport(FGAirportRef ref); void updateSelectedAircraft();