mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-02-03 12:31:15 +00:00
Run clang-format, remove colour bit depth, bug fix
Ran clang-format to have the code formatted properly (so it'll pass checks), removed the colour bit depth option from the config tool (and set the default to 16bit), and fixed a bug where it was writing the bit depth (an int) as a bool to the ini file.
This commit is contained in:
parent
e550ce929f
commit
fdda4d4f54
@ -14,5 +14,5 @@ CAboutDialog::CAboutDialog() : QDialog()
|
||||
{
|
||||
m_ui = new Ui::AboutDialog;
|
||||
m_ui->setupUi(this);
|
||||
layout()->setSizeConstraint( QLayout::SetFixedSize );
|
||||
layout()->setSizeConstraint(QLayout::SetFixedSize);
|
||||
}
|
||||
|
||||
@ -30,25 +30,7 @@ CMainDialog::CMainDialog(QWidget* pParent) : QDialog(pParent)
|
||||
// Populate the dialog prior to connecting all signals
|
||||
OnInitDialog();
|
||||
|
||||
connect(
|
||||
m_ui->colorPalette16bitRadioButton,
|
||||
&QRadioButton::toggled,
|
||||
this,
|
||||
&CMainDialog::OnRadiobuttonPalette16bit
|
||||
);
|
||||
connect(
|
||||
m_ui->colorPalette256RadioButton,
|
||||
&QRadioButton::toggled,
|
||||
this,
|
||||
&CMainDialog::OnRadiobuttonPalette256
|
||||
);
|
||||
|
||||
connect(
|
||||
m_ui->modelQualityLowRadioButton,
|
||||
&QRadioButton::toggled,
|
||||
this,
|
||||
&CMainDialog::OnRadiobuttonModelLowQuality
|
||||
);
|
||||
connect(m_ui->modelQualityLowRadioButton, &QRadioButton::toggled, this, &CMainDialog::OnRadiobuttonModelLowQuality);
|
||||
connect(
|
||||
m_ui->modelQualityMediumRadioButton,
|
||||
&QRadioButton::toggled,
|
||||
@ -96,7 +78,7 @@ CMainDialog::CMainDialog(QWidget* pParent) : QDialog(pParent)
|
||||
connect(m_ui->maxLoDSlider, &QSlider::valueChanged, this, &CMainDialog::MaxLoDChanged);
|
||||
connect(m_ui->maxActorsSlider, &QSlider::valueChanged, this, &CMainDialog::MaxActorsChanged);
|
||||
|
||||
layout()->setSizeConstraint( QLayout::SetFixedSize );
|
||||
layout()->setSizeConstraint(QLayout::SetFixedSize);
|
||||
}
|
||||
// FUNCTION: CONFIG 0x00403e80
|
||||
bool CMainDialog::OnInitDialog()
|
||||
@ -131,7 +113,7 @@ bool CMainDialog::OnInitDialog()
|
||||
}
|
||||
m_ui->devicesList->setCurrentRow(selected);
|
||||
|
||||
m_ui->maxLoDSlider->setValue((int)currentConfigApp->m_max_lod * 10);
|
||||
m_ui->maxLoDSlider->setValue((int) currentConfigApp->m_max_lod * 10);
|
||||
m_ui->maxActorsSlider->setValue(currentConfigApp->m_max_actors);
|
||||
UpdateInterface();
|
||||
return true;
|
||||
@ -189,21 +171,9 @@ void CMainDialog::UpdateInterface()
|
||||
m_ui->videomemoryCheckBox->setChecked(currentConfigApp->m_3d_video_ram);
|
||||
bool full_screen = currentConfigApp->m_full_screen;
|
||||
currentConfigApp->AdjustDisplayBitDepthBasedOnRenderStatus();
|
||||
if (full_screen) {
|
||||
if (currentConfigApp->m_display_bit_depth == 8) {
|
||||
m_ui->colorPalette256RadioButton->setChecked(true);
|
||||
}
|
||||
else {
|
||||
m_ui->colorPalette16bitRadioButton->setChecked(true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
m_ui->colorPalette256RadioButton->setChecked(false);
|
||||
m_ui->colorPalette256RadioButton->setChecked(false);
|
||||
if (!full_screen) {
|
||||
currentConfigApp->m_display_bit_depth = 0;
|
||||
}
|
||||
m_ui->colorPalette256RadioButton->setEnabled(full_screen && currentConfigApp->GetConditionalDeviceRenderBitDepth());
|
||||
m_ui->colorPalette16bitRadioButton->setEnabled(full_screen && currentConfigApp->GetDeviceRenderBitStatus());
|
||||
m_ui->sound3DCheckBox->setChecked(currentConfigApp->m_3d_sound);
|
||||
switch (currentConfigApp->m_model_quality) {
|
||||
case 0:
|
||||
@ -246,26 +216,6 @@ void CMainDialog::OnCheckbox3DVideoMemory(bool checked)
|
||||
UpdateInterface();
|
||||
}
|
||||
|
||||
// FUNCTION: CONFIG 0x00404640
|
||||
void CMainDialog::OnRadiobuttonPalette16bit(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
currentConfigApp->m_display_bit_depth = 16;
|
||||
m_modified = true;
|
||||
UpdateInterface();
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: CONFIG 0x00404670
|
||||
void CMainDialog::OnRadiobuttonPalette256(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
currentConfigApp->m_display_bit_depth = 8;
|
||||
m_modified = true;
|
||||
UpdateInterface();
|
||||
}
|
||||
}
|
||||
|
||||
// FUNCTION: CONFIG 0x004046a0
|
||||
void CMainDialog::OnCheckboxFlipVideoMemPages(bool checked)
|
||||
{
|
||||
@ -348,14 +298,15 @@ void CMainDialog::OnCheckboxMusic(bool checked)
|
||||
UpdateInterface();
|
||||
}
|
||||
|
||||
|
||||
void CMainDialog::SelectDiskPathDialog()
|
||||
{
|
||||
QString disk_path = QString::fromStdString(currentConfigApp->m_base_path);
|
||||
disk_path = QFileDialog::getExistingDirectory(this, tr("Open Directory"),
|
||||
disk_path,
|
||||
QFileDialog::ShowDirsOnly
|
||||
| QFileDialog::DontResolveSymlinks);
|
||||
disk_path = QFileDialog::getExistingDirectory(
|
||||
this,
|
||||
tr("Open Directory"),
|
||||
disk_path,
|
||||
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks
|
||||
);
|
||||
|
||||
if (disk_path.toStdString() != "") {
|
||||
currentConfigApp->m_base_path = disk_path.toStdString();
|
||||
@ -367,10 +318,12 @@ void CMainDialog::SelectDiskPathDialog()
|
||||
void CMainDialog::SelectCDPathDialog()
|
||||
{
|
||||
QString cd_path = QString::fromStdString(currentConfigApp->m_cd_path);
|
||||
cd_path = QFileDialog::getExistingDirectory(this, tr("Open Directory"),
|
||||
cd_path,
|
||||
QFileDialog::ShowDirsOnly
|
||||
| QFileDialog::DontResolveSymlinks);
|
||||
cd_path = QFileDialog::getExistingDirectory(
|
||||
this,
|
||||
tr("Open Directory"),
|
||||
cd_path,
|
||||
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks
|
||||
);
|
||||
|
||||
if (cd_path.toStdString() != "") {
|
||||
currentConfigApp->m_cd_path = cd_path.toStdString();
|
||||
@ -382,10 +335,12 @@ void CMainDialog::SelectCDPathDialog()
|
||||
void CMainDialog::SelectMediaPathDialog()
|
||||
{
|
||||
QString media_path = QString::fromStdString(currentConfigApp->m_media_path);
|
||||
media_path = QFileDialog::getExistingDirectory(this, tr("Open Directory"),
|
||||
media_path,
|
||||
QFileDialog::ShowDirsOnly
|
||||
| QFileDialog::DontResolveSymlinks);
|
||||
media_path = QFileDialog::getExistingDirectory(
|
||||
this,
|
||||
tr("Open Directory"),
|
||||
media_path,
|
||||
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks
|
||||
);
|
||||
if (media_path.toStdString() != "") {
|
||||
currentConfigApp->m_media_path = media_path.toStdString();
|
||||
m_modified = true;
|
||||
@ -396,10 +351,12 @@ void CMainDialog::SelectMediaPathDialog()
|
||||
void CMainDialog::SelectSavePathDialog()
|
||||
{
|
||||
QString save_path = QString::fromStdString(currentConfigApp->m_save_path);
|
||||
save_path = QFileDialog::getExistingDirectory(this, tr("Open Directory"),
|
||||
save_path,
|
||||
QFileDialog::ShowDirsOnly
|
||||
| QFileDialog::DontResolveSymlinks);
|
||||
save_path = QFileDialog::getExistingDirectory(
|
||||
this,
|
||||
tr("Open Directory"),
|
||||
save_path,
|
||||
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks
|
||||
);
|
||||
|
||||
if (save_path.toStdString() != "") {
|
||||
currentConfigApp->m_save_path = save_path.toStdString();
|
||||
@ -408,36 +365,34 @@ void CMainDialog::SelectSavePathDialog()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CMainDialog::DiskPathEdited(const QString &text)
|
||||
void CMainDialog::DiskPathEdited(const QString& text)
|
||||
{
|
||||
currentConfigApp->m_base_path = text.toStdString();
|
||||
m_modified = true;
|
||||
UpdateInterface();
|
||||
}
|
||||
|
||||
void CMainDialog::CDPathEdited(const QString &text)
|
||||
void CMainDialog::CDPathEdited(const QString& text)
|
||||
{
|
||||
currentConfigApp->m_cd_path = text.toStdString();
|
||||
m_modified = true;
|
||||
UpdateInterface();
|
||||
}
|
||||
|
||||
void CMainDialog::MediaPathEdited(const QString &text)
|
||||
void CMainDialog::MediaPathEdited(const QString& text)
|
||||
{
|
||||
currentConfigApp->m_media_path = text.toStdString();
|
||||
m_modified = true;
|
||||
UpdateInterface();
|
||||
}
|
||||
|
||||
void CMainDialog::SavePathEdited(const QString &text)
|
||||
void CMainDialog::SavePathEdited(const QString& text)
|
||||
{
|
||||
currentConfigApp->m_save_path = text.toStdString();
|
||||
m_modified = true;
|
||||
UpdateInterface();
|
||||
}
|
||||
|
||||
|
||||
void CMainDialog::MaxLoDChanged(int value)
|
||||
{
|
||||
currentConfigApp->m_max_lod = static_cast<float>(value) / 10.0f;
|
||||
|
||||
@ -35,8 +35,6 @@ private slots:
|
||||
void OnList3DevicesSelectionChanged(int row);
|
||||
void OnCheckbox3DSound(bool checked);
|
||||
void OnCheckbox3DVideoMemory(bool checked);
|
||||
void OnRadiobuttonPalette16bit(bool checked);
|
||||
void OnRadiobuttonPalette256(bool checked);
|
||||
void OnCheckboxFlipVideoMemPages(bool checked);
|
||||
void OnRadiobuttonModelLowQuality(bool checked);
|
||||
void OnRadiobuttonModelMediumQuality(bool checked);
|
||||
@ -51,10 +49,10 @@ private slots:
|
||||
void SelectCDPathDialog();
|
||||
void SelectMediaPathDialog();
|
||||
void SelectSavePathDialog();
|
||||
void DiskPathEdited(const QString &text);
|
||||
void CDPathEdited(const QString &text);
|
||||
void MediaPathEdited(const QString &text);
|
||||
void SavePathEdited(const QString &text);
|
||||
void DiskPathEdited(const QString& text);
|
||||
void CDPathEdited(const QString& text);
|
||||
void MediaPathEdited(const QString& text);
|
||||
void SavePathEdited(const QString& text);
|
||||
void MaxLoDChanged(int value);
|
||||
void MaxActorsChanged(int value);
|
||||
};
|
||||
|
||||
@ -208,7 +208,7 @@ bool CConfigApp::ValidateSettings()
|
||||
}
|
||||
}
|
||||
if ((m_display_bit_depth != 8 && m_display_bit_depth != 16) && (m_display_bit_depth != 0 || m_full_screen)) {
|
||||
m_display_bit_depth = 8;
|
||||
m_display_bit_depth = 16;
|
||||
is_modified = TRUE;
|
||||
}
|
||||
if (m_model_quality < 0 || m_model_quality > 2) {
|
||||
@ -276,7 +276,7 @@ bool CConfigApp::AdjustDisplayBitDepthBasedOnRenderStatus()
|
||||
m_display_bit_depth = 16;
|
||||
return TRUE;
|
||||
}
|
||||
m_display_bit_depth = 8;
|
||||
m_display_bit_depth = 16;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -304,7 +304,7 @@ void CConfigApp::WriteRegisterSettings() const
|
||||
iniparser_set(dict, "isle:mediapath", m_media_path.c_str());
|
||||
iniparser_set(dict, "isle:savepath", m_save_path.c_str());
|
||||
|
||||
SetIniBool(dict, "isle:Display Bit Depth", m_display_bit_depth);
|
||||
SetIniInt(dict, "isle:Display Bit Depth", m_display_bit_depth);
|
||||
SetIniBool(dict, "isle:Flip Surfaces", m_flip_surfaces);
|
||||
SetIniBool(dict, "isle:Full Screen", m_full_screen);
|
||||
SetIniBool(dict, "isle:Wide View Angle", m_wide_view_angle);
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>575</width>
|
||||
<height>725</height>
|
||||
<height>666</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -421,41 +421,6 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="colorPaletteGroup">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Color Palette</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="colorPalette256RadioButton">
|
||||
<property name="text">
|
||||
<string>256 Color</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="colorPalette16bitRadioButton">
|
||||
<property name="text">
|
||||
<string>High Color (16 bit)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="musicJoystickWidget" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
@ -675,8 +640,6 @@
|
||||
<tabstop>modelQualityHighRadioButton</tabstop>
|
||||
<tabstop>maxLoDSlider</tabstop>
|
||||
<tabstop>maxActorsSlider</tabstop>
|
||||
<tabstop>colorPalette256RadioButton</tabstop>
|
||||
<tabstop>colorPalette16bitRadioButton</tabstop>
|
||||
<tabstop>sound3DCheckBox</tabstop>
|
||||
<tabstop>musicCheckBox</tabstop>
|
||||
<tabstop>joystickCheckBox</tabstop>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user