@@ -695,20 +695,28 @@ void CSettings::CreateGUI()
695
695
696
696
m_pFullscreenStyleCombo = reinterpret_cast <CGUIComboBox*>(pManager->CreateComboBox (pTabVideo, " " ));
697
697
m_pFullscreenStyleCombo->SetPosition (CVector2D (vecTemp.fX + fIndentX + 5 .0f , vecTemp.fY - 1 .0f ));
698
+ m_pFullscreenStyleCombo->GetPosition (vecTemp, false );
698
699
m_pFullscreenStyleCombo->SetSize (CVector2D (200 , 95 .0f ));
700
+ m_pFullscreenStyleCombo->GetSize (vecSize);
699
701
m_pFullscreenStyleCombo->AddItem (_ (" Standard" ))->SetData ((void *)FULLSCREEN_STANDARD);
700
702
m_pFullscreenStyleCombo->AddItem (_ (" Borderless window" ))->SetData ((void *)FULLSCREEN_BORDERLESS);
701
703
m_pFullscreenStyleCombo->AddItem (_ (" Borderless keep res" ))->SetData ((void *)FULLSCREEN_BORDERLESS_KEEP_RES);
702
704
m_pFullscreenStyleCombo->SetReadOnly (true );
703
- vecTemp.fY += 4 ;
704
705
705
706
m_pCheckBoxMipMapping = reinterpret_cast <CGUICheckBox*>(pManager->CreateCheckBox (pTabVideo, _ (" Mip Mapping" ), true ));
706
707
#ifndef MIP_MAPPING_SETTING_APPEARS_TO_DO_SOMETHING
707
- m_pCheckBoxMipMapping->SetPosition (CVector2D (vecTemp.fX + 340 . 0f , vecTemp.fY + 45 .0f ));
708
+ m_pCheckBoxMipMapping->SetPosition (CVector2D (vecTemp.fX + vecSize. fX , vecTemp.fY + 45 .0f ));
708
709
m_pCheckBoxMipMapping->SetSize (CVector2D (224 .0f , 16 .0f ));
709
710
m_pCheckBoxMipMapping->SetVisible (false );
710
711
#endif
711
712
713
+ m_pCheckBoxVSync = reinterpret_cast <CGUICheckBox*>(pManager->CreateCheckBox (pTabVideo, _ (" V-Sync" ), true ));
714
+ m_pCheckBoxVSync->SetPosition (CVector2D (vecTemp.fX + vecSize.fX + 10 .0f , vecTemp.fY + 3 .0f ));
715
+ m_pCheckBoxVSync->AutoSize (NULL , 20 .0f );
716
+
717
+ // Reset position to leftmost
718
+ m_pFullscreenStyleLabel->GetPosition (vecTemp, false );
719
+
712
720
vecTemp.fY -= 5 ;
713
721
m_pFieldOfViewLabel = reinterpret_cast <CGUILabel*>(pManager->CreateLabel (pTabVideo, _ (" FOV:" )));
714
722
m_pFieldOfViewLabel->SetPosition (CVector2D (vecTemp.fX , vecTemp.fY + 30 .0f ));
@@ -1314,6 +1322,7 @@ void CSettings::CreateGUI()
1314
1322
m_pCheckBoxCustomizedSAFiles->SetClickHandler (GUI_CALLBACK (&CSettings::OnCustomizedSAFilesClick, this ));
1315
1323
m_pCheckBoxWindowed->SetClickHandler (GUI_CALLBACK (&CSettings::OnWindowedClick, this ));
1316
1324
m_pCheckBoxDPIAware->SetClickHandler (GUI_CALLBACK (&CSettings::OnDPIAwareClick, this ));
1325
+ m_pCheckBoxVSync->SetClickHandler (GUI_CALLBACK (&CSettings::OnVSyncClick, this ));
1317
1326
m_pCheckBoxShowUnsafeResolutions->SetClickHandler (GUI_CALLBACK (&CSettings::ShowUnsafeResolutionsClick, this ));
1318
1327
m_pButtonBrowserBlacklistAdd->SetClickHandler (GUI_CALLBACK (&CSettings::OnBrowserBlacklistAdd, this ));
1319
1328
m_pButtonBrowserBlacklistRemove->SetClickHandler (GUI_CALLBACK (&CSettings::OnBrowserBlacklistRemove, this ));
@@ -3569,7 +3578,7 @@ void CSettings::SaveData()
3569
3578
const char * state = _ (" Main menu" );
3570
3579
3571
3580
if (g_pCore->IsConnected ())
3572
- {
3581
+ {
3573
3582
state = _ (" In-game" );
3574
3583
3575
3584
const SString& serverName = g_pCore->GetLastConnectedServerName ();
@@ -4793,6 +4802,15 @@ static void DPIAwareQuestionCallBack(void* userdata, unsigned int uiButton)
4793
4802
}
4794
4803
}
4795
4804
4805
+ //
4806
+ // OnVSyncClick
4807
+ //
4808
+ bool CSettings::OnVSyncClick (CGUIElement* pElement)
4809
+ {
4810
+ CCore::GetSingleton ().GetFPSLimiter ()->SetDisplayVSync (m_pCheckBoxVSync->GetSelected ());
4811
+ return true ;
4812
+ }
4813
+
4796
4814
static void CPUAffinityQuestionCallBack (void * userdata, unsigned int button)
4797
4815
{
4798
4816
CCore::GetSingleton ().GetLocalGUI ()->GetMainMenu ()->GetQuestionWindow ()->Reset ();
0 commit comments