@@ -695,20 +695,28 @@ void CSettings::CreateGUI()
695695
696696 m_pFullscreenStyleCombo = reinterpret_cast <CGUIComboBox*>(pManager->CreateComboBox (pTabVideo, " " ));
697697 m_pFullscreenStyleCombo->SetPosition (CVector2D (vecTemp.fX + fIndentX + 5 .0f , vecTemp.fY - 1 .0f ));
698+ m_pFullscreenStyleCombo->GetPosition (vecTemp, false );
698699 m_pFullscreenStyleCombo->SetSize (CVector2D (200 , 95 .0f ));
700+ m_pFullscreenStyleCombo->GetSize (vecSize);
699701 m_pFullscreenStyleCombo->AddItem (_ (" Standard" ))->SetData ((void *)FULLSCREEN_STANDARD);
700702 m_pFullscreenStyleCombo->AddItem (_ (" Borderless window" ))->SetData ((void *)FULLSCREEN_BORDERLESS);
701703 m_pFullscreenStyleCombo->AddItem (_ (" Borderless keep res" ))->SetData ((void *)FULLSCREEN_BORDERLESS_KEEP_RES);
702704 m_pFullscreenStyleCombo->SetReadOnly (true );
703- vecTemp.fY += 4 ;
704705
705706 m_pCheckBoxMipMapping = reinterpret_cast <CGUICheckBox*>(pManager->CreateCheckBox (pTabVideo, _ (" Mip Mapping" ), true ));
706707#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 ));
708709 m_pCheckBoxMipMapping->SetSize (CVector2D (224 .0f , 16 .0f ));
709710 m_pCheckBoxMipMapping->SetVisible (false );
710711#endif
711712
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+
712720 vecTemp.fY -= 5 ;
713721 m_pFieldOfViewLabel = reinterpret_cast <CGUILabel*>(pManager->CreateLabel (pTabVideo, _ (" FOV:" )));
714722 m_pFieldOfViewLabel->SetPosition (CVector2D (vecTemp.fX , vecTemp.fY + 30 .0f ));
@@ -1314,6 +1322,7 @@ void CSettings::CreateGUI()
13141322 m_pCheckBoxCustomizedSAFiles->SetClickHandler (GUI_CALLBACK (&CSettings::OnCustomizedSAFilesClick, this ));
13151323 m_pCheckBoxWindowed->SetClickHandler (GUI_CALLBACK (&CSettings::OnWindowedClick, this ));
13161324 m_pCheckBoxDPIAware->SetClickHandler (GUI_CALLBACK (&CSettings::OnDPIAwareClick, this ));
1325+ m_pCheckBoxVSync->SetClickHandler (GUI_CALLBACK (&CSettings::OnVSyncClick, this ));
13171326 m_pCheckBoxShowUnsafeResolutions->SetClickHandler (GUI_CALLBACK (&CSettings::ShowUnsafeResolutionsClick, this ));
13181327 m_pButtonBrowserBlacklistAdd->SetClickHandler (GUI_CALLBACK (&CSettings::OnBrowserBlacklistAdd, this ));
13191328 m_pButtonBrowserBlacklistRemove->SetClickHandler (GUI_CALLBACK (&CSettings::OnBrowserBlacklistRemove, this ));
@@ -3569,7 +3578,7 @@ void CSettings::SaveData()
35693578 const char * state = _ (" Main menu" );
35703579
35713580 if (g_pCore->IsConnected ())
3572- {
3581+ {
35733582 state = _ (" In-game" );
35743583
35753584 const SString& serverName = g_pCore->GetLastConnectedServerName ();
@@ -4793,6 +4802,15 @@ static void DPIAwareQuestionCallBack(void* userdata, unsigned int uiButton)
47934802 }
47944803}
47954804
4805+ //
4806+ // OnVSyncClick
4807+ //
4808+ bool CSettings::OnVSyncClick (CGUIElement* pElement)
4809+ {
4810+ CCore::GetSingleton ().GetFPSLimiter ()->SetDisplayVSync (m_pCheckBoxVSync->GetSelected ());
4811+ return true ;
4812+ }
4813+
47964814static void CPUAffinityQuestionCallBack (void * userdata, unsigned int button)
47974815{
47984816 CCore::GetSingleton ().GetLocalGUI ()->GetMainMenu ()->GetQuestionWindow ()->Reset ();
0 commit comments