mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-07 03:13:49 +00:00
Add 'custom windowed resolution' option to GUI.
This commit is contained in:
parent
676e00f19b
commit
9814c72544
|
@ -11,14 +11,12 @@
|
|||
#include "ConfigDialog.h"
|
||||
#include "FullscreenResolutions.h"
|
||||
|
||||
static
|
||||
const unsigned int numWindowedModes = 13U;
|
||||
static
|
||||
struct
|
||||
{
|
||||
unsigned short width, height;
|
||||
const char *description;
|
||||
} WindowedModes[numWindowedModes] = {
|
||||
} WindowedModes[] = {
|
||||
{ 320, 240, "320 x 240" },
|
||||
{ 400, 300, "400 x 300" },
|
||||
{ 480, 360, "480 x 360" },
|
||||
|
@ -31,8 +29,11 @@ struct
|
|||
{ 1280, 1024, "1280 x 1024" },
|
||||
{ 1440, 1080, "1440 x 1080" },
|
||||
{ 1600, 1024, "1600 x 1024" },
|
||||
{ 1600, 1200, "1600 x 1200" }
|
||||
{ 1600, 1200, "1600 x 1200" },
|
||||
{ 640, 480, "custom" }
|
||||
};
|
||||
static
|
||||
const unsigned int numWindowedModes = sizeof(WindowedModes) / sizeof(WindowedModes[0]);
|
||||
|
||||
static const unsigned int numFilters = 7U;
|
||||
static const char * cmbTexFilter_choices[numFilters] = {
|
||||
|
@ -67,7 +68,7 @@ void ConfigDialog::_init()
|
|||
{
|
||||
// Video settings
|
||||
QStringList windowedModesList;
|
||||
int windowedModesCurrent = 0;
|
||||
int windowedModesCurrent = numWindowedModes - 1;
|
||||
for (int i = 0; i < numWindowedModes; ++i) {
|
||||
windowedModesList.append(WindowedModes[i].description);
|
||||
if (WindowedModes[i].width == config.video.windowedWidth && WindowedModes[i].height == config.video.windowedHeight)
|
||||
|
@ -267,9 +268,9 @@ ConfigDialog::~ConfigDialog()
|
|||
void ConfigDialog::accept()
|
||||
{
|
||||
m_accepted = true;
|
||||
const int currentWindowedResolution = ui->windowedResolutionComboBox->currentIndex();
|
||||
config.video.windowedWidth = WindowedModes[currentWindowedResolution].width;
|
||||
config.video.windowedHeight = WindowedModes[currentWindowedResolution].height;
|
||||
|
||||
config.video.windowedWidth = ui->windowWidthSpinBox->value();
|
||||
config.video.windowedHeight = ui->windowHeightSpinBox->value();
|
||||
|
||||
getFullscreenResolutions(ui->fullScreenResolutionComboBox->currentIndex(), config.video.fullscreenWidth, config.video.fullscreenHeight);
|
||||
getFullscreenRefreshRate(ui->fullScreenRefreshRateComboBox->currentIndex(), config.video.fullscreenRefresh);
|
||||
|
@ -457,3 +458,12 @@ void ConfigDialog::on_fbInfoDisableCheckBox_toggled(bool checked)
|
|||
ui->readColorChunkCheckBox->setEnabled(!checked);
|
||||
ui->readDepthChunkCheckBox->setEnabled(!checked);
|
||||
}
|
||||
|
||||
void ConfigDialog::on_windowedResolutionComboBox_currentIndexChanged(int index)
|
||||
{
|
||||
const bool bCustom = index == numWindowedModes - 1;
|
||||
ui->windowWidthSpinBox->setValue(bCustom ? config.video.windowedWidth : WindowedModes[index].width);
|
||||
ui->windowWidthSpinBox->setEnabled(bCustom);
|
||||
ui->windowHeightSpinBox->setValue(bCustom ? config.video.windowedHeight : WindowedModes[index].height);
|
||||
ui->windowHeightSpinBox->setEnabled(bCustom);
|
||||
}
|
||||
|
|
|
@ -35,6 +35,8 @@ private slots:
|
|||
|
||||
void on_fbInfoDisableCheckBox_toggled(bool checked);
|
||||
|
||||
void on_windowedResolutionComboBox_currentIndexChanged(int index);
|
||||
|
||||
private:
|
||||
void _init();
|
||||
void _getTranslations(QStringList & _translationFiles) const;
|
||||
|
|
|
@ -104,6 +104,44 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_21">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_32">
|
||||
<property name="text">
|
||||
<string>W:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="windowWidthSpinBox">
|
||||
<property name="minimum">
|
||||
<number>320</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>1920</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_30">
|
||||
<property name="text">
|
||||
<string>H:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="windowHeightSpinBox">
|
||||
<property name="minimum">
|
||||
<number>240</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>1080</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
|
Loading…
Reference in New Issue
Block a user