stuff Arisotura said

This commit is contained in:
RSDuck 2022-10-17 22:21:24 +02:00
parent c9dc1e8f4d
commit d90471aded
3 changed files with 22 additions and 2 deletions

View File

@ -78,6 +78,7 @@ VideoSettingsDialog::VideoSettingsDialog(QWidget* parent) : QDialog(parent), ui(
if (!Config::ScreenVSync)
ui->sbVSyncInterval->setEnabled(false);
setVsyncControlEnable(UsesGL());
if (Config::_3DRenderer == 0)
{
@ -124,6 +125,12 @@ void VideoSettingsDialog::on_VideoSettingsDialog_rejected()
closeDlg();
}
void VideoSettingsDialog::setVsyncControlEnable(bool hasOGL)
{
ui->cbVSync->setEnabled(hasOGL);
ui->sbVSyncInterval->setEnabled(hasOGL);
}
void VideoSettingsDialog::onChange3DRenderer(int renderer)
{
bool old_gl = (Config::ScreenUseGL != 0) || (Config::_3DRenderer != 0);
@ -154,6 +161,8 @@ void VideoSettingsDialog::on_cbGLDisplay_stateChanged(int state)
Config::ScreenUseGL = (state != 0);
setVsyncControlEnable(UsesGL());
emit updateVideoSettings(old_gl != UsesGL());
}
@ -185,6 +194,8 @@ void VideoSettingsDialog::on_cbxGLResolution_currentIndexChanged(int idx)
Config::GL_ScaleFactor = idx+1;
setVsyncControlEnable(UsesGL());
emit updateVideoSettings(false);
}

View File

@ -67,8 +67,9 @@ private slots:
void on_cbBetterPolygons_stateChanged(int state);
void on_cbSoftwareThreaded_stateChanged(int state);
private:
void setVsyncControlEnable(bool hasOGL);
Ui::VideoSettingsDialog* ui;
QButtonGroup* grp3DRenderer;

View File

@ -569,7 +569,10 @@ void EmuThread::run()
if (EmuRunning == 3) EmuRunning = 2;
// update render settings if needed
if (videoSettingsDirty)
// HACK:
// once the fast forward hotkey is released, we need to update vsync
// to the old setting again
if (videoSettingsDirty || Input::HotkeyReleased(HK_FastForward))
{
if (oglContext)
{
@ -674,6 +677,11 @@ void EmuThread::run()
bool fastforward = Input::HotkeyDown(HK_FastForward);
if (fastforward && oglContext && Config::ScreenVSync)
{
oglContext->SetSwapInterval(0);
}
if (Config::AudioSync && !fastforward && audioDevice)
{
SDL_LockMutex(audioSyncLock);