]> git.mxchange.org Git - flightgear.git/commitdiff
Launcher: hook up MSAA checkbox.
authorJames Turner <zakalawe@mac.com>
Wed, 7 Jan 2015 11:30:44 +0000 (11:30 +0000)
committerJames Turner <zakalawe@mac.com>
Wed, 7 Jan 2015 11:30:44 +0000 (11:30 +0000)
src/GUI/QtLauncher.cxx
src/GUI/QtLauncher.hxx

index 8edcc16435c9ba03afd5c0abe0a6dc21b72dd529..49ead834ac9c5ff970ef27ca0310e2d37470b3b6 100644 (file)
@@ -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"
 
index 62b630aaa5c16546aef956a0d80bae2393acd669..81dab0ee3a9a189dd3f848a0c9e8cf6feca88448 100644 (file)
@@ -50,6 +50,8 @@ private slots:
 
     void onAddSceneryPath();
     void onRemoveSceneryPath();
+
+    void onRembrandtToggled(bool b);
 private:
     void setAirport(FGAirportRef ref);
     void updateSelectedAircraft();