@@ -237,23 +237,21 @@ void CSettings::ResetGuiPointers()
237237 m_pBrightness = NULL ;
238238 m_pBrightnessValueLabel = NULL ;
239239 m_pBorderlessGammaToggle = NULL ;
240- m_pBorderlessGammaLabel = NULL ;
241240 m_pBorderlessGamma = NULL ;
242241 m_pBorderlessGammaValueLabel = NULL ;
243242 m_pBorderlessBrightnessToggle = NULL ;
244- m_pBorderlessBrightnessLabel = NULL ;
245243 m_pBorderlessBrightness = NULL ;
246244 m_pBorderlessBrightnessValueLabel = NULL ;
247245 m_pBorderlessContrastToggle = NULL ;
248- m_pBorderlessContrastLabel = NULL ;
249246 m_pBorderlessContrast = NULL ;
250247 m_pBorderlessContrastValueLabel = NULL ;
251248 m_pBorderlessSaturationToggle = NULL ;
252- m_pBorderlessSaturationLabel = NULL ;
253249 m_pBorderlessSaturation = NULL ;
254250 m_pBorderlessSaturationValueLabel = NULL ;
255251 m_pCheckBoxApplyBorderless = NULL ;
256252 m_pCheckBoxApplyFullscreen = NULL ;
253+ m_pPostFXDefButton = NULL ;
254+
257255 m_pAnisotropicLabel = NULL ;
258256 m_pAnisotropic = NULL ;
259257 m_pAnisotropicValueLabel = NULL ;
@@ -1435,34 +1433,26 @@ void CSettings::CreateGUI()
14351433 const float postFxSliderWidth = ComputeSliderWidth (tabPanelSize.fX , postFxSliderColumnX, 220 .0f , postFxValueColumnReserve);
14361434 const float postFxValueColumnX = postFxSliderColumnX + postFxSliderWidth + postFxValueColumnPadding;
14371435
1438- m_pBorderlessGammaToggle = reinterpret_cast <CGUICheckBox*>(pManager->CreateCheckBox (m_pTabPostFX, " " ));
1436+ m_pBorderlessGammaToggle = reinterpret_cast <CGUICheckBox*>(pManager->CreateCheckBox (m_pTabPostFX, _ ( " Gamma: " ) ));
14391437 m_pBorderlessGammaToggle->SetPosition (CVector2D (postFxCheckboxColumnX, postFxPos.fY ));
14401438 m_pBorderlessGammaToggle->AutoSize (nullptr , 20 .0f );
14411439
1442- m_pBorderlessGammaLabel = reinterpret_cast <CGUILabel*>(pManager->CreateLabel (m_pTabPostFX, _ (" Gamma:" )));
1443- m_pBorderlessGammaLabel->SetPosition (CVector2D (postFxLabelColumnX, postFxPos.fY + 2 .0f ));
1444- m_pBorderlessGammaLabel->AutoSize ();
1445-
14461440 m_pBorderlessGamma = reinterpret_cast <CGUIScrollBar*>(pManager->CreateScrollBar (true , m_pTabPostFX));
14471441 m_pBorderlessGamma->SetPosition (CVector2D (postFxSliderColumnX, postFxPos.fY ));
14481442 m_pBorderlessGamma->SetSize (CVector2D (postFxSliderWidth, 20 .0f ));
14491443 m_pBorderlessGamma->SetProperty (" StepSize" , " 0.01" );
14501444
14511445 m_pBorderlessGammaValueLabel = reinterpret_cast <CGUILabel*>(pManager->CreateLabel (m_pTabPostFX, " " ));
14521446 m_pBorderlessGammaValueLabel->SetPosition (CVector2D (postFxValueColumnX, postFxPos.fY + 2 .0f ));
1453- m_pBorderlessGammaValueLabel->AutoSize (" 2.00 " );
1454- FinalizeSliderRow (tabPanelSize.fX , m_pBorderlessGamma, m_pBorderlessGammaValueLabel, 220 .0f , kSliderLabelSpacing , m_pBorderlessGammaLabel );
1447+ m_pBorderlessGammaValueLabel->AutoSize (" 2.00x " );
1448+ FinalizeSliderRow (tabPanelSize.fX , m_pBorderlessGamma, m_pBorderlessGammaValueLabel, 220 .0f , kSliderLabelSpacing );
14551449
14561450 postFxPos.fY += postFxRowHeight;
14571451
1458- m_pBorderlessBrightnessToggle = reinterpret_cast <CGUICheckBox*>(pManager->CreateCheckBox (m_pTabPostFX, " " ));
1452+ m_pBorderlessBrightnessToggle = reinterpret_cast <CGUICheckBox*>(pManager->CreateCheckBox (m_pTabPostFX, _ ( " Brightness: " ) ));
14591453 m_pBorderlessBrightnessToggle->SetPosition (CVector2D (postFxCheckboxColumnX, postFxPos.fY ));
14601454 m_pBorderlessBrightnessToggle->AutoSize (nullptr , 20 .0f );
14611455
1462- m_pBorderlessBrightnessLabel = reinterpret_cast <CGUILabel*>(pManager->CreateLabel (m_pTabPostFX, _ (" Brightness:" )));
1463- m_pBorderlessBrightnessLabel->SetPosition (CVector2D (postFxLabelColumnX, postFxPos.fY + 2 .0f ));
1464- m_pBorderlessBrightnessLabel->AutoSize ();
1465-
14661456 m_pBorderlessBrightness = reinterpret_cast <CGUIScrollBar*>(pManager->CreateScrollBar (true , m_pTabPostFX));
14671457 m_pBorderlessBrightness->SetPosition (CVector2D (postFxSliderColumnX, postFxPos.fY ));
14681458 m_pBorderlessBrightness->SetSize (CVector2D (postFxSliderWidth, 20 .0f ));
@@ -1471,18 +1461,14 @@ void CSettings::CreateGUI()
14711461 m_pBorderlessBrightnessValueLabel = reinterpret_cast <CGUILabel*>(pManager->CreateLabel (m_pTabPostFX, " " ));
14721462 m_pBorderlessBrightnessValueLabel->SetPosition (CVector2D (postFxValueColumnX, postFxPos.fY + 2 .0f ));
14731463 m_pBorderlessBrightnessValueLabel->AutoSize (" 2.00x" );
1474- FinalizeSliderRow (tabPanelSize.fX , m_pBorderlessBrightness, m_pBorderlessBrightnessValueLabel, 220 .0f , kSliderLabelSpacing , m_pBorderlessBrightnessLabel );
1464+ FinalizeSliderRow (tabPanelSize.fX , m_pBorderlessBrightness, m_pBorderlessBrightnessValueLabel, 220 .0f , kSliderLabelSpacing );
14751465
14761466 postFxPos.fY += postFxRowHeight;
14771467
1478- m_pBorderlessContrastToggle = reinterpret_cast <CGUICheckBox*>(pManager->CreateCheckBox (m_pTabPostFX, " " ));
1468+ m_pBorderlessContrastToggle = reinterpret_cast <CGUICheckBox*>(pManager->CreateCheckBox (m_pTabPostFX, _ ( " Contrast: " ) ));
14791469 m_pBorderlessContrastToggle->SetPosition (CVector2D (postFxCheckboxColumnX, postFxPos.fY ));
14801470 m_pBorderlessContrastToggle->AutoSize (nullptr , 20 .0f );
14811471
1482- m_pBorderlessContrastLabel = reinterpret_cast <CGUILabel*>(pManager->CreateLabel (m_pTabPostFX, _ (" Contrast:" )));
1483- m_pBorderlessContrastLabel->SetPosition (CVector2D (postFxLabelColumnX, postFxPos.fY + 2 .0f ));
1484- m_pBorderlessContrastLabel->AutoSize ();
1485-
14861472 m_pBorderlessContrast = reinterpret_cast <CGUIScrollBar*>(pManager->CreateScrollBar (true , m_pTabPostFX));
14871473 m_pBorderlessContrast->SetPosition (CVector2D (postFxSliderColumnX, postFxPos.fY ));
14881474 m_pBorderlessContrast->SetSize (CVector2D (postFxSliderWidth, 20 .0f ));
@@ -1491,18 +1477,14 @@ void CSettings::CreateGUI()
14911477 m_pBorderlessContrastValueLabel = reinterpret_cast <CGUILabel*>(pManager->CreateLabel (m_pTabPostFX, " " ));
14921478 m_pBorderlessContrastValueLabel->SetPosition (CVector2D (postFxValueColumnX, postFxPos.fY + 2 .0f ));
14931479 m_pBorderlessContrastValueLabel->AutoSize (" 2.00x" );
1494- FinalizeSliderRow (tabPanelSize.fX , m_pBorderlessContrast, m_pBorderlessContrastValueLabel, 220 .0f , kSliderLabelSpacing , m_pBorderlessContrastLabel );
1480+ FinalizeSliderRow (tabPanelSize.fX , m_pBorderlessContrast, m_pBorderlessContrastValueLabel, 220 .0f , kSliderLabelSpacing );
14951481
14961482 postFxPos.fY += postFxRowHeight;
14971483
1498- m_pBorderlessSaturationToggle = reinterpret_cast <CGUICheckBox*>(pManager->CreateCheckBox (m_pTabPostFX, " " ));
1484+ m_pBorderlessSaturationToggle = reinterpret_cast <CGUICheckBox*>(pManager->CreateCheckBox (m_pTabPostFX, _ ( " Saturation: " ) ));
14991485 m_pBorderlessSaturationToggle->SetPosition (CVector2D (postFxCheckboxColumnX, postFxPos.fY ));
15001486 m_pBorderlessSaturationToggle->AutoSize (nullptr , 20 .0f );
15011487
1502- m_pBorderlessSaturationLabel = reinterpret_cast <CGUILabel*>(pManager->CreateLabel (m_pTabPostFX, _ (" Saturation:" )));
1503- m_pBorderlessSaturationLabel->SetPosition (CVector2D (postFxLabelColumnX, postFxPos.fY + 2 .0f ));
1504- m_pBorderlessSaturationLabel->AutoSize ();
1505-
15061488 m_pBorderlessSaturation = reinterpret_cast <CGUIScrollBar*>(pManager->CreateScrollBar (true , m_pTabPostFX));
15071489 m_pBorderlessSaturation->SetPosition (CVector2D (postFxSliderColumnX, postFxPos.fY ));
15081490 m_pBorderlessSaturation->SetSize (CVector2D (postFxSliderWidth, 20 .0f ));
@@ -1511,11 +1493,11 @@ void CSettings::CreateGUI()
15111493 m_pBorderlessSaturationValueLabel = reinterpret_cast <CGUILabel*>(pManager->CreateLabel (m_pTabPostFX, " " ));
15121494 m_pBorderlessSaturationValueLabel->SetPosition (CVector2D (postFxValueColumnX, postFxPos.fY + 2 .0f ));
15131495 m_pBorderlessSaturationValueLabel->AutoSize (" 2.00x" );
1514- FinalizeSliderRow (tabPanelSize.fX , m_pBorderlessSaturation, m_pBorderlessSaturationValueLabel, 220 .0f , kSliderLabelSpacing , m_pBorderlessSaturationLabel );
1496+ FinalizeSliderRow (tabPanelSize.fX , m_pBorderlessSaturation, m_pBorderlessSaturationValueLabel, 220 .0f , kSliderLabelSpacing );
15151497
15161498 postFxPos.fY += postFxRowHeight + 8 .0f ;
15171499
1518- m_pCheckBoxApplyBorderless = reinterpret_cast <CGUICheckBox*>(pManager->CreateCheckBox (m_pTabPostFX, _ (" Apply adjustments in windowed mode" )));
1500+ m_pCheckBoxApplyBorderless = reinterpret_cast <CGUICheckBox*>(pManager->CreateCheckBox (m_pTabPostFX, _ (" Apply adjustments in windowed/borderless mode" )));
15191501 m_pCheckBoxApplyBorderless->SetPosition (CVector2D (postFxCheckboxColumnX, postFxPos.fY ));
15201502 m_pCheckBoxApplyBorderless->AutoSize (nullptr , 20 .0f );
15211503
@@ -1525,6 +1507,13 @@ void CSettings::CreateGUI()
15251507 m_pCheckBoxApplyFullscreen->SetPosition (CVector2D (postFxCheckboxColumnX, postFxPos.fY ));
15261508 m_pCheckBoxApplyFullscreen->AutoSize (nullptr , 20 .0f );
15271509
1510+ m_pPostFXDefButton = reinterpret_cast <CGUIButton*>(pManager->CreateButton (m_pTabPostFX, _ (" Load defaults" )));
1511+ m_pPostFXDefButton->SetClickHandler (GUI_CALLBACK (&CSettings::OnPostFXDefaultClick, this ));
1512+ m_pPostFXDefButton->AutoSize (NULL , 20 .0f , 8 .0f );
1513+ m_pPostFXDefButton->GetSize (vecSize);
1514+ placeBottomRightButton (m_pPostFXDefButton);
1515+ m_pPostFXDefButton->SetZOrderingEnabled (false );
1516+
15281517 /* *
15291518 * Interface/chat Tab
15301519 **/
@@ -2539,7 +2528,7 @@ void CSettings::UpdatePostFxTab()
25392528 if (m_pBorderlessGamma)
25402529 m_pBorderlessGamma->SetScrollPosition (NormalizeSliderValue (gammaValue, kBorderlessGammaMin , kBorderlessGammaMax ));
25412530 if (m_pBorderlessGammaValueLabel)
2542- m_pBorderlessGammaValueLabel->SetText (SString (" %.2f " , gammaValue).c_str ());
2531+ m_pBorderlessGammaValueLabel->SetText (SString (" %.2fx " , gammaValue).c_str ());
25432532
25442533 if (m_pBorderlessBrightness)
25452534 m_pBorderlessBrightness->SetScrollPosition (NormalizeSliderValue (brightnessValue, kBorderlessBrightnessMin , kBorderlessBrightnessMax ));
@@ -2737,31 +2726,28 @@ void CSettings::UpdateBorderlessAdjustmentControls()
27372726
27382727 if (m_pBorderlessGamma)
27392728 m_pBorderlessGamma->SetEnabled (gammaEnabled);
2740- if (m_pBorderlessGammaLabel)
2741- m_pBorderlessGammaLabel->SetEnabled (gammaEnabled);
27422729 if (m_pBorderlessGammaValueLabel)
27432730 m_pBorderlessGammaValueLabel->SetEnabled (gammaEnabled);
27442731
27452732 if (m_pBorderlessBrightness)
27462733 m_pBorderlessBrightness->SetEnabled (brightnessEnabled);
2747- if (m_pBorderlessBrightnessLabel)
2748- m_pBorderlessBrightnessLabel->SetEnabled (brightnessEnabled);
27492734 if (m_pBorderlessBrightnessValueLabel)
27502735 m_pBorderlessBrightnessValueLabel->SetEnabled (brightnessEnabled);
27512736
27522737 if (m_pBorderlessContrast)
27532738 m_pBorderlessContrast->SetEnabled (contrastEnabled);
2754- if (m_pBorderlessContrastLabel)
2755- m_pBorderlessContrastLabel->SetEnabled (contrastEnabled);
27562739 if (m_pBorderlessContrastValueLabel)
27572740 m_pBorderlessContrastValueLabel->SetEnabled (contrastEnabled);
27582741
27592742 if (m_pBorderlessSaturation)
27602743 m_pBorderlessSaturation->SetEnabled (saturationEnabled);
2761- if (m_pBorderlessSaturationLabel)
2762- m_pBorderlessSaturationLabel->SetEnabled (saturationEnabled);
27632744 if (m_pBorderlessSaturationValueLabel)
27642745 m_pBorderlessSaturationValueLabel->SetEnabled (saturationEnabled);
2746+
2747+ m_pBorderlessGammaToggle->SetEnabled (applyAdjustments);
2748+ m_pBorderlessBrightnessToggle->SetEnabled (applyAdjustments);
2749+ m_pBorderlessContrastToggle->SetEnabled (applyAdjustments);
2750+ m_pBorderlessSaturationToggle->SetEnabled (applyAdjustments);
27652751}
27662752
27672753void CSettings::ResetGTAVolume ()
@@ -5283,7 +5269,7 @@ bool CSettings::OnBrightnessChanged(CGUIElement* pElement)
52835269bool CSettings::OnBorderlessGammaChanged (CGUIElement* pElement)
52845270{
52855271 const float gammaValue = DenormalizeSliderValue (m_pBorderlessGamma->GetScrollPosition (), kBorderlessGammaMin , kBorderlessGammaMax );
5286- m_pBorderlessGammaValueLabel->SetText (SString (" %.2f " , gammaValue).c_str ());
5272+ m_pBorderlessGammaValueLabel->SetText (SString (" %.2fx " , gammaValue).c_str ());
52875273 CVARS_SET (" borderless_gamma_power" , gammaValue);
52885274 RefreshBorderlessDisplayCalibration ();
52895275 return true ;
@@ -5372,6 +5358,25 @@ bool CSettings::OnBorderlessApplyFullscreenClicked(CGUIElement* pElement)
53725358 return true ;
53735359}
53745360
5361+ bool CSettings::OnPostFXDefaultClick (CGUIElement* pElement)
5362+ {
5363+ CVARS_SET (" borderless_gamma_power" , 1 .0f );
5364+ CVARS_SET (" borderless_brightness_scale" , 1 .0f );
5365+ CVARS_SET (" borderless_contrast_scale" , 1 .0f );
5366+ CVARS_SET (" borderless_saturation_scale" , 1 .0f );
5367+
5368+ CVARS_SET (" borderless_gamma_enabled" , false );
5369+ CVARS_SET (" borderless_brightness_enabled" , false );
5370+ CVARS_SET (" borderless_contrast_enabled" , false );
5371+ CVARS_SET (" borderless_saturation_enabled" , false );
5372+
5373+ CVARS_SET (" borderless_apply_windowed" , false );
5374+ CVARS_SET (" borderless_apply_fullscreen" , false );
5375+
5376+ UpdatePostFxTab ();
5377+ return true ;
5378+ }
5379+
53755380bool CSettings::OnAnisotropicChanged (CGUIElement* pElement)
53765381{
53775382 int iAnisotropic = std::min<int >(m_iMaxAnisotropic, (m_pAnisotropic->GetScrollPosition ()) * (m_iMaxAnisotropic + 1 ));
0 commit comments