mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-02 09:03:37 +00:00
Add Adjust Aspect option to the GUI.
This commit is contained in:
parent
89a6186166
commit
c9d486222b
10
src/Config.h
10
src/Config.h
|
@ -45,6 +45,14 @@ struct Config
|
|||
u32 hacks;
|
||||
} generalEmulation;
|
||||
|
||||
enum Aspect {
|
||||
aStretch = 0,
|
||||
a43 = 1,
|
||||
a169 = 2,
|
||||
aAdjust = 3,
|
||||
aTotal = 4
|
||||
};
|
||||
|
||||
struct {
|
||||
u32 enable;
|
||||
u32 copyToRDRAM;
|
||||
|
@ -52,7 +60,7 @@ struct Config
|
|||
u32 copyFromRDRAM;
|
||||
u32 detectCFB;
|
||||
u32 N64DepthCompare;
|
||||
u32 aspect; // 0: stretch ; 1: 4/3 ; 2: 16/9
|
||||
u32 aspect; // 0: stretch ; 1: 4/3 ; 2: 16/9; 3: adjust
|
||||
u32 validityCheckMethod; // 0: checksum; 1: fill RDRAM
|
||||
} frameBufferEmulation;
|
||||
|
||||
|
|
|
@ -118,15 +118,18 @@ void ConfigDialog::_init()
|
|||
ui->CopyDepthCheckBox->setChecked(config.frameBufferEmulation.copyDepthToRDRAM != 0);
|
||||
ui->n64DepthCompareCheckBox->setChecked(config.frameBufferEmulation.N64DepthCompare != 0);
|
||||
switch (config.frameBufferEmulation.aspect) {
|
||||
case 0:
|
||||
case Config::aStretch:
|
||||
ui->aspectStretchRadioButton->setChecked(true);
|
||||
break;
|
||||
case 1:
|
||||
case Config::a43:
|
||||
ui->aspect43RadioButton->setChecked(true);
|
||||
break;
|
||||
case 2:
|
||||
case Config::a169:
|
||||
ui->aspect169RadioButton->setChecked(true);
|
||||
break;
|
||||
case Config::aAdjust:
|
||||
ui->aspectAdjustRadioButton->setChecked(true);
|
||||
break;
|
||||
}
|
||||
switch (config.frameBufferEmulation.validityCheckMethod) {
|
||||
case 0:
|
||||
|
@ -197,9 +200,9 @@ void ConfigDialog::_init()
|
|||
}
|
||||
|
||||
ConfigDialog::ConfigDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::ConfigDialog),
|
||||
m_accepted(false)
|
||||
QDialog(parent),
|
||||
ui(new Ui::ConfigDialog),
|
||||
m_accepted(false)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
_init();
|
||||
|
@ -248,11 +251,14 @@ void ConfigDialog::accept()
|
|||
config.frameBufferEmulation.copyDepthToRDRAM = ui->CopyDepthCheckBox->isChecked() ? 1 : 0;
|
||||
config.frameBufferEmulation.N64DepthCompare = ui->n64DepthCompareCheckBox->isChecked() ? 1 : 0;
|
||||
if (ui->aspectStretchRadioButton->isChecked())
|
||||
config.frameBufferEmulation.aspect = 0;
|
||||
config.frameBufferEmulation.aspect = Config::aStretch;
|
||||
else if (ui->aspect43RadioButton->isChecked())
|
||||
config.frameBufferEmulation.aspect = 1;
|
||||
config.frameBufferEmulation.aspect = Config::a43;
|
||||
else if (ui->aspect169RadioButton->isChecked())
|
||||
config.frameBufferEmulation.aspect = 2;
|
||||
config.frameBufferEmulation.aspect = Config::a169;
|
||||
else if (ui->aspectAdjustRadioButton->isChecked())
|
||||
config.frameBufferEmulation.aspect = Config::aAdjust;
|
||||
|
||||
if (ui->checksumRadioButton->isChecked())
|
||||
config.frameBufferEmulation.validityCheckMethod = 0;
|
||||
else if (ui->fillRdramRadioButton->isChecked())
|
||||
|
@ -347,7 +353,7 @@ void ConfigDialog::on_buttonBox_clicked(QAbstractButton *button)
|
|||
QMessageBox msgBox(QMessageBox::Question, "GLideN64",
|
||||
"Do you really want to reset all settings to defaults?",
|
||||
QMessageBox::RestoreDefaults | QMessageBox::Cancel, this
|
||||
);
|
||||
);
|
||||
msgBox.setDefaultButton(QMessageBox::Cancel);
|
||||
if (msgBox.exec() == QMessageBox::RestoreDefaults) {
|
||||
config.resetToDefaults();
|
||||
|
|
|
@ -157,6 +157,16 @@
|
|||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="aspectAdjustRadioButton">
|
||||
<property name="text">
|
||||
<string>Adjust</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">aspectButtonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
|
|
@ -195,11 +195,11 @@ void OGLVideo::_setBufferSize()
|
|||
{
|
||||
if (config.frameBufferEmulation.enable) {
|
||||
switch (config.frameBufferEmulation.aspect) {
|
||||
case 0: // stretch
|
||||
case Config::aStretch: // stretch
|
||||
m_width = m_screenWidth;
|
||||
m_height = m_screenHeight;
|
||||
break;
|
||||
case 1: // force 4/3
|
||||
case Config::a43: // force 4/3
|
||||
if (m_screenWidth * 3 / 4 > m_screenHeight) {
|
||||
m_height = m_screenHeight;
|
||||
m_width = m_screenHeight * 4 / 3;
|
||||
|
@ -211,7 +211,7 @@ void OGLVideo::_setBufferSize()
|
|||
m_height = m_screenHeight;
|
||||
}
|
||||
break;
|
||||
case 2: // force 16/9
|
||||
case Config::a169: // force 16/9
|
||||
if (m_screenWidth * 9 / 16 > m_screenHeight) {
|
||||
m_height = m_screenHeight;
|
||||
m_width = m_screenHeight * 16 / 9;
|
||||
|
|
|
@ -44,7 +44,7 @@ bool Config_SetDefault()
|
|||
|
||||
res = ConfigSetDefaultInt(g_configVideoGliden64, "MultiSampling", 0, "Enable/Disable MultiSampling (0=off, 2,4,8,16=quality)");
|
||||
assert(res == M64ERR_SUCCESS);
|
||||
res = ConfigSetDefaultInt(g_configVideoGliden64, "AspectRatio", 0, "Screen aspect ratio (0=stretch, 1=force 4:3, 2=force 16:9)");
|
||||
res = ConfigSetDefaultInt(g_configVideoGliden64, "AspectRatio", 0, "Screen aspect ratio (0=stretch, 1=force 4:3, 2=force 16:9, 3=adjust)");
|
||||
assert(res == M64ERR_SUCCESS);
|
||||
|
||||
//#Texture Settings
|
||||
|
|
Loading…
Reference in New Issue
Block a user