mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2024-11-14 13:27:41 -07:00
stuff Arisotura said
This commit is contained in:
parent
c9dc1e8f4d
commit
d90471aded
@ -78,6 +78,7 @@ VideoSettingsDialog::VideoSettingsDialog(QWidget* parent) : QDialog(parent), ui(
|
|||||||
|
|
||||||
if (!Config::ScreenVSync)
|
if (!Config::ScreenVSync)
|
||||||
ui->sbVSyncInterval->setEnabled(false);
|
ui->sbVSyncInterval->setEnabled(false);
|
||||||
|
setVsyncControlEnable(UsesGL());
|
||||||
|
|
||||||
if (Config::_3DRenderer == 0)
|
if (Config::_3DRenderer == 0)
|
||||||
{
|
{
|
||||||
@ -124,6 +125,12 @@ void VideoSettingsDialog::on_VideoSettingsDialog_rejected()
|
|||||||
closeDlg();
|
closeDlg();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VideoSettingsDialog::setVsyncControlEnable(bool hasOGL)
|
||||||
|
{
|
||||||
|
ui->cbVSync->setEnabled(hasOGL);
|
||||||
|
ui->sbVSyncInterval->setEnabled(hasOGL);
|
||||||
|
}
|
||||||
|
|
||||||
void VideoSettingsDialog::onChange3DRenderer(int renderer)
|
void VideoSettingsDialog::onChange3DRenderer(int renderer)
|
||||||
{
|
{
|
||||||
bool old_gl = (Config::ScreenUseGL != 0) || (Config::_3DRenderer != 0);
|
bool old_gl = (Config::ScreenUseGL != 0) || (Config::_3DRenderer != 0);
|
||||||
@ -154,6 +161,8 @@ void VideoSettingsDialog::on_cbGLDisplay_stateChanged(int state)
|
|||||||
|
|
||||||
Config::ScreenUseGL = (state != 0);
|
Config::ScreenUseGL = (state != 0);
|
||||||
|
|
||||||
|
setVsyncControlEnable(UsesGL());
|
||||||
|
|
||||||
emit updateVideoSettings(old_gl != UsesGL());
|
emit updateVideoSettings(old_gl != UsesGL());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,6 +194,8 @@ void VideoSettingsDialog::on_cbxGLResolution_currentIndexChanged(int idx)
|
|||||||
|
|
||||||
Config::GL_ScaleFactor = idx+1;
|
Config::GL_ScaleFactor = idx+1;
|
||||||
|
|
||||||
|
setVsyncControlEnable(UsesGL());
|
||||||
|
|
||||||
emit updateVideoSettings(false);
|
emit updateVideoSettings(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,8 +67,9 @@ private slots:
|
|||||||
void on_cbBetterPolygons_stateChanged(int state);
|
void on_cbBetterPolygons_stateChanged(int state);
|
||||||
|
|
||||||
void on_cbSoftwareThreaded_stateChanged(int state);
|
void on_cbSoftwareThreaded_stateChanged(int state);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void setVsyncControlEnable(bool hasOGL);
|
||||||
|
|
||||||
Ui::VideoSettingsDialog* ui;
|
Ui::VideoSettingsDialog* ui;
|
||||||
|
|
||||||
QButtonGroup* grp3DRenderer;
|
QButtonGroup* grp3DRenderer;
|
||||||
|
@ -569,7 +569,10 @@ void EmuThread::run()
|
|||||||
if (EmuRunning == 3) EmuRunning = 2;
|
if (EmuRunning == 3) EmuRunning = 2;
|
||||||
|
|
||||||
// update render settings if needed
|
// 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)
|
if (oglContext)
|
||||||
{
|
{
|
||||||
@ -674,6 +677,11 @@ void EmuThread::run()
|
|||||||
|
|
||||||
bool fastforward = Input::HotkeyDown(HK_FastForward);
|
bool fastforward = Input::HotkeyDown(HK_FastForward);
|
||||||
|
|
||||||
|
if (fastforward && oglContext && Config::ScreenVSync)
|
||||||
|
{
|
||||||
|
oglContext->SetSwapInterval(0);
|
||||||
|
}
|
||||||
|
|
||||||
if (Config::AudioSync && !fastforward && audioDevice)
|
if (Config::AudioSync && !fastforward && audioDevice)
|
||||||
{
|
{
|
||||||
SDL_LockMutex(audioSyncLock);
|
SDL_LockMutex(audioSyncLock);
|
||||||
|
Loading…
Reference in New Issue
Block a user