diff --git a/CONFIG/MainDlg.cpp b/CONFIG/MainDlg.cpp index b8980a9d..c833b315 100644 --- a/CONFIG/MainDlg.cpp +++ b/CONFIG/MainDlg.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -100,6 +101,9 @@ CMainDialog::CMainDialog(QWidget* pParent) : QDialog(pParent) connect(m_ui->maxActorsSlider, &QSlider::valueChanged, this, &CMainDialog::MaxActorsChanged); connect(m_ui->maxActorsSlider, &QSlider::sliderMoved, this, &CMainDialog::MaxActorsChanged); + connect(m_ui->msaaSlider, &QSlider::valueChanged, this, &CMainDialog::MSAAChanged); + connect(m_ui->msaaSlider, &QSlider::sliderMoved, this, &CMainDialog::MSAAChanged); + connect(m_ui->aspectRatioComboBox, &QComboBox::currentIndexChanged, this, &CMainDialog::AspectRatioChanged); connect(m_ui->xResSpinBox, &QSpinBox::valueChanged, this, &CMainDialog::XResChanged); connect(m_ui->yResSpinBox, &QSpinBox::valueChanged, this, &CMainDialog::YResChanged); @@ -312,9 +316,9 @@ void CMainDialog::UpdateInterface() m_ui->transitionTypeComboBox->setCurrentIndex(currentConfigApp->m_transition_type); m_ui->dataPath->setText(QString::fromStdString(currentConfigApp->m_cd_path)); m_ui->savePath->setText(QString::fromStdString(currentConfigApp->m_save_path)); + m_ui->textureCheckBox->setChecked(currentConfigApp->m_texture_load); m_ui->texturePath->setText(QString::fromStdString(currentConfigApp->m_texture_path)); - m_ui->texturePath->setEnabled(currentConfigApp->m_texture_load); m_ui->texturePathOpen->setEnabled(currentConfigApp->m_texture_load); @@ -322,6 +326,13 @@ void CMainDialog::UpdateInterface() m_ui->xResSpinBox->setValue(currentConfigApp->m_x_res); m_ui->yResSpinBox->setValue(currentConfigApp->m_y_res); m_ui->framerateSpinBox->setValue(static_cast(std::round(1000.0f / currentConfigApp->m_frame_delta))); + + m_ui->maxLoDSlider->setValue((int) (currentConfigApp->m_max_lod * 10)); + m_ui->LoDNum->setNum(currentConfigApp->m_max_lod); + m_ui->maxActorsSlider->setValue(currentConfigApp->m_max_actors); + m_ui->maxActorsNum->setNum(currentConfigApp->m_max_actors); + m_ui->msaaSlider->setValue(log2(currentConfigApp->m_msaa)); + m_ui->msaaNum->setNum(currentConfigApp->m_msaa); } // FUNCTION: CONFIG 0x004045e0 @@ -532,15 +543,22 @@ void CMainDialog::SavePathEdited() void CMainDialog::MaxLoDChanged(int value) { currentConfigApp->m_max_lod = static_cast(value) / 10.0f; - m_ui->LoDNum->setNum(value); m_modified = true; + UpdateInterface(); } void CMainDialog::MaxActorsChanged(int value) { currentConfigApp->m_max_actors = value; - m_ui->maxActorsNum->setNum(value); m_modified = true; + UpdateInterface(); +} + +void CMainDialog::MSAAChanged(int value) +{ + currentConfigApp->m_msaa = exp2(value); + m_modified = true; + UpdateInterface(); } void CMainDialog::SelectTexturePathDialog() diff --git a/CONFIG/MainDlg.h b/CONFIG/MainDlg.h index 1d895b4a..afbfd08f 100644 --- a/CONFIG/MainDlg.h +++ b/CONFIG/MainDlg.h @@ -60,6 +60,7 @@ private slots: void SavePathEdited(); void MaxLoDChanged(int value); void MaxActorsChanged(int value); + void MSAAChanged(int value); void SelectTexturePathDialog(); void TexturePathEdited(); void XResChanged(int i); diff --git a/CONFIG/config.cpp b/CONFIG/config.cpp index cc527542..fa2b76d0 100644 --- a/CONFIG/config.cpp +++ b/CONFIG/config.cpp @@ -84,6 +84,7 @@ bool CConfigApp::InitInstance() m_3d_video_ram = FALSE; m_joystick_index = -1; m_display_bit_depth = 16; + m_msaa = 1; m_haptic = TRUE; m_touch_scheme = 2; m_texture_load = TRUE; @@ -182,6 +183,7 @@ bool CConfigApp::ReadRegisterSettings() m_joystick_index = iniparser_getint(dict, "isle:JoystickIndex", m_joystick_index); m_max_lod = iniparser_getdouble(dict, "isle:Max LOD", m_max_lod); m_max_actors = iniparser_getint(dict, "isle:Max Allowed Extras", m_max_actors); + m_msaa = iniparser_getint(dict, "isle:MSAA", m_msaa); m_texture_load = iniparser_getboolean(dict, "extensions:texture loader", m_texture_load); m_texture_path = iniparser_getstring(dict, "texture loader:texture path", m_texture_path.c_str()); m_aspect_ratio = iniparser_getint(dict, "isle:Aspect Ratio", m_aspect_ratio); @@ -267,6 +269,19 @@ bool CConfigApp::ValidateSettings() m_full_screen = TRUE; is_modified = TRUE; } + if (!(m_msaa & (m_msaa - 1))) { //Check if MSAA is power of 2 (1, 2, 4, 8, etc) + m_msaa = exp2(round(log2(m_msaa))); //Closest power of 2 + is_modified = TRUE; + } + if (m_msaa > 16) { + m_msaa = 16; + is_modified = TRUE; + } + else if (m_msaa < 1){ + m_msaa = 1; + is_modified = TRUE; + } + return is_modified; } @@ -344,6 +359,7 @@ void CConfigApp::WriteRegisterSettings() const iniparser_set(dict, "isle:savepath", m_save_path.c_str()); SetIniInt(dict, "isle:Display Bit Depth", m_display_bit_depth); + SetIniInt(dict, "isle:MSAA", m_msaa); SetIniBool(dict, "isle:Flip Surfaces", m_flip_surfaces); SetIniBool(dict, "isle:Full Screen", m_full_screen); SetIniBool(dict, "isle:Exclusive Full Screen", m_exclusive_full_screen); diff --git a/CONFIG/config.h b/CONFIG/config.h index 03b64891..964bad8c 100644 --- a/CONFIG/config.h +++ b/CONFIG/config.h @@ -70,6 +70,7 @@ class CConfigApp { MxDriver* m_driver; Direct3DDeviceInfo* m_device; int m_display_bit_depth; + int m_msaa; bool m_flip_surfaces; bool m_full_screen; bool m_exclusive_full_screen; diff --git a/CONFIG/res/maindialog.ui b/CONFIG/res/maindialog.ui index 4b2eedb7..08d87497 100644 --- a/CONFIG/res/maindialog.ui +++ b/CONFIG/res/maindialog.ui @@ -56,6 +56,9 @@ false + + fullscreenRadioContainer_2 + @@ -353,12 +356,18 @@ A higher setting will cause higher quality textures to be drawn regardless of di - 15 + 20 0 + + + 20 + 16777215 + + - 35 + 3.5 @@ -533,10 +542,16 @@ The game will gradually increase the number of actors until this maximum is reac - 15 + 20 0 + + + 20 + 16777215 + + 20 @@ -602,8 +617,59 @@ The game will gradually increase the number of actors until this maximum is reac General - - + + + + + + 0 + 0 + + + + <html><head/><body><p><span style=" font-weight:700;">Windowed:</span> Runs in a window, the initial resolution of which is dictated by Windowed Resolution. </p><p><span style=" font-weight:700;">Fullscreen:</span> Runs in a borderless window that consumes the entire screen. </p><p><span style=" font-weight:700;">Exclusive Fullscreen:</span> Grants the app full control of the display for better performance and lower input lag. May cause slower alt-tabbing.</p></body></html> + + + + 3 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Windowed + + + + + + + Fullscreen + + + + + + + Exclusive Fullscreen + + + + + + + <html><head/><body><p>Maximum framerate. Values above 100fps are untested.</p></body></html> @@ -622,31 +688,6 @@ The game will gradually increase the number of actors until this maximum is reac - - - - - - Windowed - - - - - - - Fullscreen - - - - - - - Exclusive Fullscreen - - - - - @@ -781,6 +822,53 @@ The game will gradually increase the number of actors until this maximum is reac + + + + MSAA + + + + + + 0 + + + 4 + + + 1 + + + Qt::Orientation::Horizontal + + + QSlider::TickPosition::TicksBothSides + + + 1 + + + + + + + + 16 + 0 + + + + 1 + + + Qt::AlignmentFlag::AlignCenter + + + + + + @@ -789,7 +877,7 @@ The game will gradually increase the number of actors until this maximum is reac 20 - 40 + 0 @@ -877,7 +965,7 @@ The game will gradually increase the number of actors until this maximum is reac Settings for Texture Loader extension. - Texture Loader Extension + Texture Loader