mirror of https://github.com/mgba-emu/mgba.git
Qt: Fix a load of uninitialized members
This commit is contained in:
parent
46d31796df
commit
b0e12c3392
|
@ -17,12 +17,13 @@ AudioDevice::AudioDevice(QObject* parent)
|
|||
: QIODevice(parent)
|
||||
, m_context(nullptr)
|
||||
, m_drift(0)
|
||||
, m_ratio(1.f)
|
||||
{
|
||||
setOpenMode(ReadOnly);
|
||||
}
|
||||
|
||||
void AudioDevice::setFormat(const QAudioFormat& format) {
|
||||
if (!GBAThreadIsActive(m_context)) {
|
||||
if (!m_context || !GBAThreadIsActive(m_context)) {
|
||||
return;
|
||||
}
|
||||
#if RESAMPLE_LIBRARY == RESAMPLE_NN
|
||||
|
|
|
@ -48,6 +48,8 @@ AudioProcessor* AudioProcessor::create() {
|
|||
|
||||
AudioProcessor::AudioProcessor(QObject* parent)
|
||||
: QObject(parent)
|
||||
, m_context(nullptr)
|
||||
, m_samples(GBA_AUDIO_SAMPLES)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -33,6 +33,10 @@ void AudioProcessorQt::setInput(GBAThread* input) {
|
|||
}
|
||||
|
||||
void AudioProcessorQt::start() {
|
||||
if (!input()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_device) {
|
||||
m_device = new AudioDevice(this);
|
||||
}
|
||||
|
|
|
@ -22,6 +22,10 @@ AudioProcessorSDL::~AudioProcessorSDL() {
|
|||
}
|
||||
|
||||
void AudioProcessorSDL::start() {
|
||||
if (!input()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_audio.thread) {
|
||||
GBASDLResumeAudio(&m_audio);
|
||||
} else {
|
||||
|
|
|
@ -32,6 +32,9 @@ Display::Display(QGLFormat format, QWidget* parent)
|
|||
: QGLWidget(format, parent)
|
||||
, m_painter(nullptr)
|
||||
, m_started(false)
|
||||
, m_lockAspectRatio(false)
|
||||
, m_filter(false)
|
||||
, m_context(nullptr)
|
||||
{
|
||||
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
||||
setMinimumSize(VIDEO_HORIZONTAL_PIXELS, VIDEO_VERTICAL_PIXELS);
|
||||
|
@ -145,6 +148,7 @@ Painter::Painter(Display* parent)
|
|||
: m_gl(parent)
|
||||
, m_lockAspectRatio(false)
|
||||
, m_filter(false)
|
||||
, m_context(nullptr)
|
||||
{
|
||||
m_size = parent->size();
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ using namespace QGBA;
|
|||
KeyEditor::KeyEditor(QWidget* parent)
|
||||
: QLineEdit(parent)
|
||||
, m_direction(GamepadAxisEvent::NEUTRAL)
|
||||
, m_button(false)
|
||||
{
|
||||
setAlignment(Qt::AlignCenter);
|
||||
}
|
||||
|
|
|
@ -47,7 +47,6 @@ private:
|
|||
|
||||
Ui::LoadSaveState m_ui;
|
||||
GameController* m_controller;
|
||||
InputController* m_inputController;
|
||||
SavestateButton* m_slots[NUM_SLOTS];
|
||||
LoadSave m_mode;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@ using namespace QGBA;
|
|||
|
||||
LogView::LogView(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
, m_logLevel(0)
|
||||
, m_lines(0)
|
||||
, m_lineLimit(DEFAULT_LINE_LIMIT)
|
||||
{
|
||||
m_ui.setupUi(this);
|
||||
connect(m_ui.levelDebug, SIGNAL(toggled(bool)), this, SLOT(setLevelDebug(bool)));
|
||||
|
@ -24,8 +27,6 @@ LogView::LogView(QWidget* parent)
|
|||
connect(m_ui.levelSWI, SIGNAL(toggled(bool)), this, SLOT(setLevelSWI(bool)));
|
||||
connect(m_ui.clear, SIGNAL(clicked()), this, SLOT(clear()));
|
||||
connect(m_ui.maxLines, SIGNAL(valueChanged(int)), this, SLOT(setMaxLines(int)));
|
||||
m_logLevel = 0;
|
||||
m_lines = 0;
|
||||
m_ui.maxLines->setValue(DEFAULT_LINE_LIMIT);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue