populate the dialog.

also add setting for vsync interval.
This commit is contained in:
Arisotura
2020-05-28 13:21:25 +02:00
parent 695839bb0e
commit 5005a7c3f0
4 changed files with 30 additions and 3 deletions

View File

@ -45,6 +45,7 @@ int ScreenFilter;
int ScreenUseGL; int ScreenUseGL;
int ScreenVSync; int ScreenVSync;
int ScreenVSyncInterval;
int LimitFPS; int LimitFPS;
int AudioSync; int AudioSync;
@ -124,8 +125,9 @@ ConfigEntry PlatformConfigFile[] =
{"IntegerScaling", 0, &IntegerScaling, 0, NULL, 0}, {"IntegerScaling", 0, &IntegerScaling, 0, NULL, 0},
{"ScreenFilter", 0, &ScreenFilter, 1, NULL, 0}, {"ScreenFilter", 0, &ScreenFilter, 1, NULL, 0},
{"ScreenUseGL", 0, &ScreenUseGL, 1, NULL, 0}, {"ScreenUseGL", 0, &ScreenUseGL, 1, NULL, 0},
{"ScreenVSync", 0, &ScreenVSync, 0, NULL, 0}, {"ScreenVSync", 0, &ScreenVSync, 0, NULL, 0},
{"ScreenVSyncInterval", 0, &ScreenVSyncInterval, 1, NULL, 0},
{"LimitFPS", 0, &LimitFPS, 0, NULL, 0}, {"LimitFPS", 0, &LimitFPS, 0, NULL, 0},
{"AudioSync", 0, &AudioSync, 1, NULL, 0}, {"AudioSync", 0, &AudioSync, 1, NULL, 0},

View File

@ -58,6 +58,7 @@ extern int ScreenFilter;
extern int ScreenUseGL; extern int ScreenUseGL;
extern int ScreenVSync; extern int ScreenVSync;
extern int ScreenVSyncInterval;
extern int LimitFPS; extern int LimitFPS;
extern int AudioSync; extern int AudioSync;

View File

@ -36,12 +36,29 @@ VideoSettingsDialog::VideoSettingsDialog(QWidget* parent) : QDialog(parent), ui(
ui->setupUi(this); ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose); setAttribute(Qt::WA_DeleteOnClose);
// oldRenderer = Config::_3DRenderer;
oldGLDisplay = Config::ScreenUseGL;
oldVSync = Config::ScreenVSync;
oldVSyncInterval = Config::ScreenVSyncInterval;
oldSoftThreaded = Config::Threaded3D;
oldGLScale = Config::GL_ScaleFactor;
grp3DRenderer = new QButtonGroup(this); grp3DRenderer = new QButtonGroup(this);
grp3DRenderer->addButton(ui->rb3DSoftware, 0); grp3DRenderer->addButton(ui->rb3DSoftware, 0);
grp3DRenderer->addButton(ui->rb3DOpenGL, 1); grp3DRenderer->addButton(ui->rb3DOpenGL, 1);
//connect(grp3DRenderer, SIGNAL(buttonClicked(int)), this, SLOT(onChange3DRenderer(int))); //connect(grp3DRenderer, SIGNAL(buttonClicked(int)), this, SLOT(onChange3DRenderer(int)));
grp3DRenderer->button(Config::_3DRenderer)->setChecked(true);
ui->cbGLDisplay->setChecked(Config::ScreenUseGL != 0);
ui->cbVSync->setChecked(Config::ScreenVSync != 0);
ui->sbVSyncInterval->setValue(Config::ScreenVSyncInterval);
ui->cbSoftwareThreaded->setChecked(Config::Threaded3D != 0);
for (int i = 1; i <= 16; i++)
ui->cbxGLResolution->addItem(QString("%1x native (%2x%3)").arg(i).arg(256*i).arg(192*i), QVariant(i));
ui->cbxGLResolution->setCurrentIndex(Config::GL_ScaleFactor);
} }
VideoSettingsDialog::~VideoSettingsDialog() VideoSettingsDialog::~VideoSettingsDialog()

View File

@ -61,6 +61,13 @@ private:
Ui::VideoSettingsDialog* ui; Ui::VideoSettingsDialog* ui;
QButtonGroup* grp3DRenderer; QButtonGroup* grp3DRenderer;
int oldRenderer;
int oldGLDisplay;
int oldVSync;
int oldVSyncInterval;
int oldSoftThreaded;
int oldGLScale;
}; };
#endif // VIDEOSETTINGSDIALOG_H #endif // VIDEOSETTINGSDIALOG_H