Allow to change monochrome color.
Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
parent
35765e23e4
commit
45721b3fc5
5 changed files with 32 additions and 1 deletions
|
@ -214,6 +214,7 @@ void getAppleWinPreferences(PreferenceData & data)
|
|||
data.scanLines = IsVideoStyle(VS_HALF_SCANLINES);
|
||||
data.verticalBlend = IsVideoStyle(VS_COLOR_VERTICAL_BLEND);
|
||||
data.hz50 = GetVideoRefreshRate() == VR_50HZ;
|
||||
data.monochromeColor.setRgb(g_nMonochromeRGB);
|
||||
}
|
||||
|
||||
void setAppleWinPreferences(const PreferenceData & currentData, const PreferenceData & newData)
|
||||
|
@ -273,7 +274,7 @@ void setAppleWinPreferences(const PreferenceData & currentData, const Preference
|
|||
}
|
||||
|
||||
if (currentData.videoType != newData.videoType || currentData.scanLines != newData.scanLines || currentData.verticalBlend != newData.verticalBlend
|
||||
|| currentData.hz50 != newData.hz50)
|
||||
|| currentData.hz50 != newData.hz50 || currentData.monochromeColor != newData.monochromeColor)
|
||||
{
|
||||
const VideoType_e videoType = VideoType_e(newData.videoType);
|
||||
SetVideoType(videoType);
|
||||
|
@ -288,6 +289,10 @@ void setAppleWinPreferences(const PreferenceData & currentData, const Preference
|
|||
const VideoRefreshRate_e videoRefreshRate = newData.hz50 ? VR_50HZ : VR_60HZ;
|
||||
SetVideoRefreshRate(videoRefreshRate);
|
||||
|
||||
QColor color = newData.monochromeColor;
|
||||
// be careful QRgb is opposite way round to COLORREF
|
||||
g_nMonochromeRGB = RGB(color.red(), color.green(), color.blue());
|
||||
|
||||
Config_Save_Video();
|
||||
VideoReinitialize();
|
||||
VideoRedrawScreen();
|
||||
|
|
|
@ -44,6 +44,8 @@ struct PreferenceData
|
|||
std::vector<QString> disks;
|
||||
std::vector<QString> hds;
|
||||
|
||||
QColor monochromeColor;
|
||||
|
||||
QString saveState;
|
||||
};
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "options.h"
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QColorDialog>
|
||||
#include <QGamepadManager>
|
||||
#include <QSettings>
|
||||
|
||||
|
@ -200,6 +201,8 @@ void Preferences::setData(const PreferenceData & data)
|
|||
ui->vertical_blend->setChecked(data.verticalBlend);
|
||||
|
||||
ui->hz_50->setChecked(data.hz50);
|
||||
|
||||
myMonochromeColor = data.monochromeColor;
|
||||
}
|
||||
|
||||
PreferenceData Preferences::getData() const
|
||||
|
@ -236,6 +239,7 @@ PreferenceData Preferences::getData() const
|
|||
data.scanLines = ui->scan_lines->isChecked();
|
||||
data.verticalBlend = ui->vertical_blend->isChecked();
|
||||
data.hz50 = ui->hz_50->isChecked();
|
||||
data.monochromeColor = myMonochromeColor;
|
||||
|
||||
return data;
|
||||
}
|
||||
|
@ -320,3 +324,12 @@ void Preferences::on_browse_ss_clicked()
|
|||
ui->save_state->setText(name);
|
||||
}
|
||||
}
|
||||
|
||||
void Preferences::on_colorButton_clicked()
|
||||
{
|
||||
QColorDialog dialog(myMonochromeColor);
|
||||
if (dialog.exec())
|
||||
{
|
||||
myMonochromeColor = dialog.currentColor();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,10 +39,14 @@ private slots:
|
|||
|
||||
void on_browse_ss_clicked();
|
||||
|
||||
void on_colorButton_clicked();
|
||||
|
||||
private:
|
||||
std::vector<QComboBox *> myDisks;
|
||||
std::vector<QComboBox *> myHDs;
|
||||
|
||||
QColor myMonochromeColor;
|
||||
|
||||
void setSettings(QSettings & settings);
|
||||
void setData(const PreferenceData & data);
|
||||
void populateJoysticks();
|
||||
|
|
|
@ -505,6 +505,13 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QPushButton" name="colorButton">
|
||||
<property name="text">
|
||||
<string>Monochrome color</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
Loading…
Add table
Reference in a new issue