mirror of https://github.com/mgba-emu/mgba.git
Qt: Use C++11 in-class initialization where applicable
This commit is contained in:
parent
686380b6c4
commit
f6f3cb5d3d
|
@ -21,10 +21,6 @@ using namespace QGBA;
|
|||
|
||||
AssetTile::AssetTile(QWidget* parent)
|
||||
: QGroupBox(parent)
|
||||
, m_tileCache(nullptr)
|
||||
, m_paletteId(0)
|
||||
, m_paletteSet(0)
|
||||
, m_index(0)
|
||||
{
|
||||
m_ui.setupUi(this);
|
||||
|
||||
|
|
|
@ -31,9 +31,9 @@ private:
|
|||
Ui::AssetTile m_ui;
|
||||
|
||||
std::shared_ptr<mTileCache> m_tileCache;
|
||||
int m_paletteId;
|
||||
int m_paletteSet;
|
||||
int m_index;
|
||||
int m_paletteId = 0;
|
||||
int m_paletteSet = 0;
|
||||
int m_index = 0;
|
||||
|
||||
int m_addressWidth;
|
||||
int m_addressBase;
|
||||
|
|
|
@ -44,8 +44,6 @@ AudioProcessor* AudioProcessor::create() {
|
|||
|
||||
AudioProcessor::AudioProcessor(QObject* parent)
|
||||
: QObject(parent)
|
||||
, m_context(nullptr)
|
||||
, m_samples(2048)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -47,8 +47,8 @@ protected:
|
|||
mCoreThread* input() { return m_context; }
|
||||
|
||||
private:
|
||||
mCoreThread* m_context;
|
||||
int m_samples;
|
||||
mCoreThread* m_context = nullptr;
|
||||
int m_samples = 2048;
|
||||
static Driver s_driver;
|
||||
};
|
||||
|
||||
|
|
|
@ -17,9 +17,6 @@ using namespace QGBA;
|
|||
|
||||
AudioProcessorQt::AudioProcessorQt(QObject* parent)
|
||||
: AudioProcessor(parent)
|
||||
, m_audioOutput(nullptr)
|
||||
, m_device(nullptr)
|
||||
, m_sampleRate(44100)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -32,9 +32,9 @@ public slots:
|
|||
virtual void requestSampleRate(unsigned) override;
|
||||
|
||||
private:
|
||||
QAudioOutput* m_audioOutput;
|
||||
AudioDevice* m_device;
|
||||
unsigned m_sampleRate;
|
||||
QAudioOutput* m_audioOutput = nullptr;
|
||||
AudioDevice* m_device = nullptr;
|
||||
unsigned m_sampleRate = 44100;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -13,7 +13,6 @@ using namespace QGBA;
|
|||
|
||||
AudioProcessorSDL::AudioProcessorSDL(QObject* parent)
|
||||
: AudioProcessor(parent)
|
||||
, m_audio{ 2048, 44100 }
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ public slots:
|
|||
virtual void requestSampleRate(unsigned) override;
|
||||
|
||||
private:
|
||||
mSDLAudio m_audio;
|
||||
mSDLAudio m_audio{2048, 44100};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -90,7 +90,6 @@ QString ConfigController::s_configDir;
|
|||
|
||||
ConfigController::ConfigController(QObject* parent)
|
||||
: QObject(parent)
|
||||
, m_opts{}
|
||||
{
|
||||
QString fileName = configDir();
|
||||
fileName.append(QDir::separator());
|
||||
|
|
|
@ -102,7 +102,7 @@ private:
|
|||
Configuration* defaults() { return &m_config.defaultsTable; }
|
||||
|
||||
mCoreConfig m_config;
|
||||
mCoreOptions m_opts;
|
||||
mCoreOptions m_opts{};
|
||||
|
||||
QMap<QString, ConfigOption*> m_optionSet;
|
||||
QSettings* m_settings;
|
||||
|
|
|
@ -53,9 +53,6 @@ Display* Display::create(QWidget* parent) {
|
|||
|
||||
Display::Display(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
, m_lockAspectRatio(false)
|
||||
, m_lockIntegerScaling(false)
|
||||
, m_filter(false)
|
||||
{
|
||||
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
||||
#ifdef M_CORE_GB
|
||||
|
|
|
@ -75,9 +75,9 @@ private:
|
|||
static const int MOUSE_DISAPPEAR_TIMER = 1000;
|
||||
|
||||
MessagePainter m_messagePainter;
|
||||
bool m_lockAspectRatio;
|
||||
bool m_lockIntegerScaling;
|
||||
bool m_filter;
|
||||
bool m_lockAspectRatio = false;
|
||||
bool m_lockIntegerScaling = false;
|
||||
bool m_filter = false;
|
||||
QTimer m_mouseTimer;
|
||||
};
|
||||
|
||||
|
|
|
@ -27,10 +27,7 @@ using namespace QGBA;
|
|||
|
||||
DisplayGL::DisplayGL(const QGLFormat& format, QWidget* parent)
|
||||
: Display(parent)
|
||||
, m_isDrawing(false)
|
||||
, m_gl(new EmptyGLWidget(format, this))
|
||||
, m_drawThread(nullptr)
|
||||
, m_context(nullptr)
|
||||
{
|
||||
m_painter = new PainterGL(format.majorVersion() < 2 ? 1 : m_gl->format().majorVersion(), m_gl);
|
||||
m_gl->setMouseTracking(true);
|
||||
|
|
|
@ -70,11 +70,11 @@ protected:
|
|||
private:
|
||||
void resizePainter();
|
||||
|
||||
bool m_isDrawing;
|
||||
bool m_isDrawing = false;
|
||||
QGLWidget* m_gl;
|
||||
PainterGL* m_painter;
|
||||
QThread* m_drawThread;
|
||||
mCoreThread* m_context;
|
||||
QThread* m_drawThread = nullptr;
|
||||
mCoreThread* m_context = nullptr;
|
||||
};
|
||||
|
||||
class PainterGL : public QObject {
|
||||
|
|
|
@ -14,8 +14,6 @@ using namespace QGBA;
|
|||
|
||||
DisplayQt::DisplayQt(QWidget* parent)
|
||||
: Display(parent)
|
||||
, m_isDrawing(false)
|
||||
, m_backing(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -40,10 +40,10 @@ protected:
|
|||
virtual void paintEvent(QPaintEvent*) override;
|
||||
|
||||
private:
|
||||
bool m_isDrawing;
|
||||
bool m_isDrawing = false;
|
||||
unsigned m_width;
|
||||
unsigned m_height;
|
||||
QImage m_backing;
|
||||
QImage m_backing{nullptr};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -33,7 +33,6 @@ mLOG_DEFINE_CATEGORY(QT, "Qt", "platform.qt");
|
|||
|
||||
GBAApp::GBAApp(int& argc, char* argv[])
|
||||
: QApplication(argc, argv)
|
||||
, m_db(nullptr)
|
||||
{
|
||||
g_app = this;
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ private:
|
|||
QList<Window*> m_windows;
|
||||
MultiplayerController m_multiplayer;
|
||||
|
||||
NoIntroDB* m_db;
|
||||
NoIntroDB* m_db = nullptr;
|
||||
#ifdef USE_SQLITE3
|
||||
QThread m_parseThread;
|
||||
#endif
|
||||
|
|
|
@ -28,8 +28,6 @@ const qreal GBAKeyEditor::DPAD_HEIGHT = 0.12;
|
|||
|
||||
GBAKeyEditor::GBAKeyEditor(InputController* controller, int type, const QString& profile, QWidget* parent)
|
||||
: QWidget(parent)
|
||||
, m_profileSelect(nullptr)
|
||||
, m_clear(nullptr)
|
||||
, m_type(type)
|
||||
, m_profile(profile)
|
||||
, m_controller(controller)
|
||||
|
|
|
@ -68,8 +68,8 @@ private:
|
|||
|
||||
KeyEditor* keyById(GBAKey);
|
||||
|
||||
QComboBox* m_profileSelect;
|
||||
QWidget* m_clear;
|
||||
QComboBox* m_profileSelect = nullptr;
|
||||
QWidget* m_clear = nullptr;
|
||||
QWidget* m_buttons;
|
||||
KeyEditor* m_keyDU;
|
||||
KeyEditor* m_keyDD;
|
||||
|
|
|
@ -11,7 +11,6 @@ using namespace QGBA;
|
|||
|
||||
GDBController::GDBController(GameController* controller, QObject* parent)
|
||||
: DebuggerController(controller, &m_gdbStub.d, parent)
|
||||
, m_port(2345)
|
||||
, m_bindAddress({ IPV4, 0 })
|
||||
{
|
||||
GDBStubCreate(&m_gdbStub);
|
||||
|
|
|
@ -40,7 +40,7 @@ private:
|
|||
|
||||
GDBStub m_gdbStub;
|
||||
|
||||
ushort m_port;
|
||||
ushort m_port = 2345;
|
||||
Address m_bindAddress;
|
||||
};
|
||||
|
||||
|
|
|
@ -39,41 +39,9 @@ using namespace std;
|
|||
|
||||
GameController::GameController(QObject* parent)
|
||||
: QObject(parent)
|
||||
, m_drawContext(nullptr)
|
||||
, m_frontBuffer(nullptr)
|
||||
, m_threadContext()
|
||||
, m_activeKeys(0)
|
||||
, m_inactiveKeys(0)
|
||||
, m_logLevels(0)
|
||||
, m_gameOpen(false)
|
||||
, m_vf(nullptr)
|
||||
, m_useBios(false)
|
||||
, m_override(nullptr)
|
||||
, m_audioProcessor(AudioProcessor::create())
|
||||
, m_pauseAfterFrame(false)
|
||||
, m_sync(true)
|
||||
, m_videoSync(VIDEO_SYNC)
|
||||
, m_audioSync(AUDIO_SYNC)
|
||||
, m_fpsTarget(-1)
|
||||
, m_turbo(false)
|
||||
, m_turboForced(false)
|
||||
, m_turboSpeed(-1)
|
||||
, m_wasPaused(false)
|
||||
, m_audioChannels()
|
||||
, m_videoLayers()
|
||||
, m_autofire{}
|
||||
, m_autofireStatus{}
|
||||
, m_stateSlot(1)
|
||||
, m_backupLoadState(nullptr)
|
||||
, m_backupSaveState(nullptr)
|
||||
, m_saveStateFlags(SAVESTATE_SCREENSHOT | SAVESTATE_SAVEDATA | SAVESTATE_CHEATS | SAVESTATE_RTC)
|
||||
, m_loadStateFlags(SAVESTATE_SCREENSHOT | SAVESTATE_RTC)
|
||||
, m_preload(false)
|
||||
, m_inputController(nullptr)
|
||||
, m_multiplayer(nullptr)
|
||||
, m_stream(nullptr)
|
||||
, m_vl(nullptr)
|
||||
, m_vlVf(nullptr)
|
||||
{
|
||||
#ifdef M_CORE_GBA
|
||||
m_lux.p = this;
|
||||
|
|
|
@ -191,63 +191,63 @@ private:
|
|||
void redoSamples(int samples);
|
||||
void enableTurbo();
|
||||
|
||||
uint32_t* m_drawContext;
|
||||
uint32_t* m_frontBuffer;
|
||||
mCoreThread m_threadContext;
|
||||
uint32_t* m_drawContext = nullptr;
|
||||
uint32_t* m_frontBuffer = nullptr;
|
||||
mCoreThread m_threadContext{};
|
||||
const mCoreConfig* m_config;
|
||||
mCheatDevice* m_cheatDevice;
|
||||
int m_activeKeys;
|
||||
int m_activeButtons;
|
||||
int m_inactiveKeys;
|
||||
int m_logLevels;
|
||||
int m_activeKeys = 0;
|
||||
int m_activeButtons = 0;
|
||||
int m_inactiveKeys = 0;
|
||||
int m_logLevels = 0;
|
||||
|
||||
bool m_gameOpen;
|
||||
bool m_gameOpen = false;
|
||||
|
||||
QString m_fname;
|
||||
QString m_fsub;
|
||||
VFile* m_vf;
|
||||
VFile* m_vf = nullptr;
|
||||
QString m_bios;
|
||||
bool m_useBios;
|
||||
bool m_useBios = false;
|
||||
QString m_patch;
|
||||
Override* m_override;
|
||||
Override* m_override = nullptr;
|
||||
|
||||
AudioProcessor* m_audioProcessor;
|
||||
|
||||
QAtomicInt m_pauseAfterFrame;
|
||||
QAtomicInt m_pauseAfterFrame{false};
|
||||
QList<std::function<void ()>> m_resetActions;
|
||||
|
||||
bool m_sync;
|
||||
bool m_videoSync;
|
||||
bool m_audioSync;
|
||||
float m_fpsTarget;
|
||||
bool m_turbo;
|
||||
bool m_turboForced;
|
||||
float m_turboSpeed;
|
||||
bool m_wasPaused;
|
||||
bool m_sync = true;
|
||||
bool m_videoSync = VIDEO_SYNC;
|
||||
bool m_audioSync = AUDIO_SYNC;
|
||||
float m_fpsTarget = -1;
|
||||
bool m_turbo = false;
|
||||
bool m_turboForced = false;
|
||||
float m_turboSpeed = -1;
|
||||
bool m_wasPaused = false;
|
||||
|
||||
std::shared_ptr<mTileCache> m_tileCache;
|
||||
|
||||
QList<bool> m_audioChannels;
|
||||
QList<bool> m_videoLayers;
|
||||
|
||||
bool m_autofire[GBA_KEY_MAX];
|
||||
int m_autofireStatus[GBA_KEY_MAX];
|
||||
bool m_autofire[GBA_KEY_MAX] = {};
|
||||
int m_autofireStatus[GBA_KEY_MAX] = {};
|
||||
|
||||
int m_stateSlot;
|
||||
struct VFile* m_backupLoadState;
|
||||
QByteArray m_backupSaveState;
|
||||
int m_stateSlot = 1;
|
||||
struct VFile* m_backupLoadState = nullptr;
|
||||
QByteArray m_backupSaveState{nullptr};
|
||||
int m_saveStateFlags;
|
||||
int m_loadStateFlags;
|
||||
|
||||
bool m_preload;
|
||||
bool m_preload = false;
|
||||
|
||||
InputController* m_inputController;
|
||||
MultiplayerController* m_multiplayer;
|
||||
InputController* m_inputController = nullptr;
|
||||
MultiplayerController* m_multiplayer = nullptr;
|
||||
|
||||
mAVStream* m_stream;
|
||||
mAVStream* m_stream = nullptr;
|
||||
|
||||
mVideoLogContext* m_vl;
|
||||
VFile* m_vlVf;
|
||||
mVideoLogContext* m_vl = nullptr;
|
||||
VFile* m_vlVf = nullptr;
|
||||
|
||||
struct GameControllerLux : GBALuminanceSource {
|
||||
GameController* p;
|
||||
|
|
|
@ -26,16 +26,9 @@ mSDLEvents InputController::s_sdlEvents;
|
|||
|
||||
InputController::InputController(int playerId, QWidget* topLevel, QObject* parent)
|
||||
: QObject(parent)
|
||||
, m_config(nullptr)
|
||||
, m_playerId(playerId)
|
||||
, m_allowOpposing(false)
|
||||
, m_topLevel(topLevel)
|
||||
, m_focusParent(topLevel)
|
||||
#ifdef BUILD_SDL
|
||||
, m_sdlPlayer{}
|
||||
, m_playerAttached(false)
|
||||
#endif
|
||||
, m_gamepadTimer(nullptr)
|
||||
{
|
||||
mInputMapInit(&m_inputMap, &GBAInputInfo);
|
||||
|
||||
|
|
|
@ -104,17 +104,17 @@ private:
|
|||
void sendGamepadEvent(QEvent*);
|
||||
|
||||
mInputMap m_inputMap;
|
||||
ConfigController* m_config;
|
||||
ConfigController* m_config = nullptr;
|
||||
int m_playerId;
|
||||
bool m_allowOpposing;
|
||||
bool m_allowOpposing = false;
|
||||
QWidget* m_topLevel;
|
||||
QWidget* m_focusParent;
|
||||
|
||||
#ifdef BUILD_SDL
|
||||
static int s_sdlInited;
|
||||
static mSDLEvents s_sdlEvents;
|
||||
mSDLPlayer m_sdlPlayer;
|
||||
bool m_playerAttached;
|
||||
mSDLPlayer m_sdlPlayer{};
|
||||
bool m_playerAttached = false;
|
||||
#endif
|
||||
|
||||
QVector<int> m_deadzones;
|
||||
|
@ -122,7 +122,7 @@ private:
|
|||
QSet<int> m_activeButtons;
|
||||
QSet<QPair<int, GamepadAxisEvent::Direction>> m_activeAxes;
|
||||
QSet<QPair<int, GamepadHatEvent::Direction>> m_activeHats;
|
||||
QTimer m_gamepadTimer;
|
||||
QTimer m_gamepadTimer{nullptr};
|
||||
|
||||
QSet<GBAKey> m_pendingEvents;
|
||||
};
|
||||
|
|
|
@ -16,10 +16,6 @@ using namespace QGBA;
|
|||
|
||||
KeyEditor::KeyEditor(QWidget* parent)
|
||||
: QLineEdit(parent)
|
||||
, m_key(-1)
|
||||
, m_axis(-1)
|
||||
, m_hat(-1)
|
||||
, m_button(false)
|
||||
, m_direction(GamepadAxisEvent::NEUTRAL)
|
||||
, m_hatDirection(GamepadHatEvent::CENTER)
|
||||
{
|
||||
|
|
|
@ -54,10 +54,10 @@ private:
|
|||
|
||||
void updateButtonText();
|
||||
|
||||
int m_key;
|
||||
int m_axis;
|
||||
int m_hat;
|
||||
bool m_button;
|
||||
int m_key = -1;
|
||||
int m_axis = -1;
|
||||
int m_hat = -1;
|
||||
bool m_button = false;
|
||||
GamepadAxisEvent::Direction m_direction;
|
||||
GamepadHatEvent::Direction m_hatDirection;
|
||||
QTimer m_lastKey;
|
||||
|
|
|
@ -14,8 +14,6 @@ using namespace QGBA;
|
|||
|
||||
LogView::LogView(LogController* log, QWidget* parent)
|
||||
: QWidget(parent)
|
||||
, m_lines(0)
|
||||
, m_lineLimit(DEFAULT_LINE_LIMIT)
|
||||
{
|
||||
m_ui.setupUi(this);
|
||||
connect(m_ui.levelDebug, &QAbstractButton::toggled, [this](bool set) {
|
||||
|
|
|
@ -40,8 +40,8 @@ private:
|
|||
static const int DEFAULT_LINE_LIMIT = 1000;
|
||||
|
||||
Ui::LogView m_ui;
|
||||
int m_lines;
|
||||
int m_lineLimit;
|
||||
int m_lines = 0;
|
||||
int m_lineLimit = DEFAULT_LINE_LIMIT;
|
||||
QQueue<QString> m_pendingLines;
|
||||
|
||||
void setLevel(int level, bool);
|
||||
|
|
|
@ -26,12 +26,6 @@ using namespace QGBA;
|
|||
|
||||
MemoryModel::MemoryModel(QWidget* parent)
|
||||
: QAbstractScrollArea(parent)
|
||||
, m_core(nullptr)
|
||||
, m_codec(nullptr)
|
||||
, m_top(0)
|
||||
, m_align(1)
|
||||
, m_selection(0, 0)
|
||||
, m_selectionAnchor(0)
|
||||
{
|
||||
m_font.setFamily("Source Code Pro");
|
||||
m_font.setStyleHint(QFont::Monospace);
|
||||
|
|
|
@ -76,22 +76,22 @@ private:
|
|||
void operator()(TextCodec*);
|
||||
};
|
||||
|
||||
mCore* m_core;
|
||||
mCore* m_core = nullptr;
|
||||
std::unique_ptr<TextCodec, TextCodecFree> m_codec;
|
||||
QFont m_font;
|
||||
int m_cellHeight;
|
||||
int m_letterWidth;
|
||||
uint32_t m_base;
|
||||
uint32_t m_size;
|
||||
int m_top;
|
||||
int m_align;
|
||||
int m_top = 0;
|
||||
int m_align = 1;
|
||||
QMargins m_margins;
|
||||
QVector<QStaticText> m_staticNumbers;
|
||||
QVector<QStaticText> m_staticLatin1;
|
||||
QStaticText m_regionName;
|
||||
QSizeF m_cellSize;
|
||||
QPair<uint32_t, uint32_t> m_selection;
|
||||
uint32_t m_selectionAnchor;
|
||||
QPair<uint32_t, uint32_t> m_selection{0, 0};
|
||||
uint32_t m_selectionAnchor = 0;
|
||||
uint32_t m_buffer;
|
||||
int m_bufferedNybbles;
|
||||
int m_currentBank;
|
||||
|
|
|
@ -15,8 +15,6 @@ using namespace QGBA;
|
|||
|
||||
MessagePainter::MessagePainter(QObject* parent)
|
||||
: QObject(parent)
|
||||
, m_messageTimer(this)
|
||||
, m_scaleFactor(1)
|
||||
{
|
||||
m_messageFont.setFamily("Source Code Pro");
|
||||
m_messageFont.setStyleHint(QFont::Monospace);
|
||||
|
|
|
@ -35,11 +35,11 @@ private:
|
|||
QStaticText m_message;
|
||||
QPixmap m_pixmap;
|
||||
QPixmap m_pixmapBuffer;
|
||||
QTimer m_messageTimer;
|
||||
QTimer m_messageTimer{this};
|
||||
QPoint m_local;
|
||||
QTransform m_world;
|
||||
QFont m_messageFont;
|
||||
qreal m_scaleFactor;
|
||||
qreal m_scaleFactor = 1;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -27,9 +27,6 @@ using namespace QGBA;
|
|||
ObjView::ObjView(GameController* controller, QWidget* parent)
|
||||
: AssetView(controller, parent)
|
||||
, m_controller(controller)
|
||||
, m_tileStatus{}
|
||||
, m_objId(0)
|
||||
, m_objInfo{}
|
||||
{
|
||||
m_ui.setupUi(this);
|
||||
m_ui.tile->setController(controller);
|
||||
|
|
|
@ -41,8 +41,8 @@ private:
|
|||
Ui::ObjView m_ui;
|
||||
|
||||
GameController* m_controller;
|
||||
mTileCacheEntry m_tileStatus[1024 * 32]; // TODO: Correct size
|
||||
int m_objId;
|
||||
mTileCacheEntry m_tileStatus[1024 * 32] = {}; // TODO: Correct size
|
||||
int m_objId = 0;
|
||||
struct ObjInfo {
|
||||
unsigned tile;
|
||||
unsigned width;
|
||||
|
@ -53,7 +53,7 @@ private:
|
|||
unsigned bits;
|
||||
|
||||
bool operator!=(const ObjInfo&);
|
||||
} m_objInfo;
|
||||
} m_objInfo = {};
|
||||
|
||||
int m_tileOffset;
|
||||
};
|
||||
|
|
|
@ -31,7 +31,6 @@ ShaderSelector::ShaderSelector(Display* display, ConfigController* config, QWidg
|
|||
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint)
|
||||
, m_display(display)
|
||||
, m_config(config)
|
||||
, m_shaderPath("")
|
||||
{
|
||||
m_ui.setupUi(this);
|
||||
|
||||
|
|
|
@ -17,9 +17,6 @@ using namespace QGBA;
|
|||
|
||||
ShortcutController::ShortcutController(QObject* parent)
|
||||
: QAbstractItemModel(parent)
|
||||
, m_rootMenu(nullptr)
|
||||
, m_config(nullptr)
|
||||
, m_profile(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -540,10 +537,7 @@ int ShortcutController::toModifierKey(int key) {
|
|||
ShortcutController::ShortcutItem::ShortcutItem(QAction* action, const QString& name, ShortcutItem* parent)
|
||||
: m_action(action)
|
||||
, m_shortcut(action->shortcut().isEmpty() ? 0 : action->shortcut()[0])
|
||||
, m_menu(nullptr)
|
||||
, m_name(name)
|
||||
, m_button(-1)
|
||||
, m_axis(-1)
|
||||
, m_direction(GamepadAxisEvent::NEUTRAL)
|
||||
, m_parent(parent)
|
||||
{
|
||||
|
@ -553,25 +547,17 @@ ShortcutController::ShortcutItem::ShortcutItem(QAction* action, const QString& n
|
|||
}
|
||||
|
||||
ShortcutController::ShortcutItem::ShortcutItem(ShortcutController::ShortcutItem::Functions functions, int shortcut, const QString& visibleName, const QString& name, ShortcutItem* parent)
|
||||
: m_action(nullptr)
|
||||
, m_shortcut(shortcut)
|
||||
, m_menu(nullptr)
|
||||
: m_shortcut(shortcut)
|
||||
, m_functions(functions)
|
||||
, m_name(name)
|
||||
, m_visibleName(visibleName)
|
||||
, m_button(-1)
|
||||
, m_axis(-1)
|
||||
, m_direction(GamepadAxisEvent::NEUTRAL)
|
||||
, m_parent(parent)
|
||||
{
|
||||
}
|
||||
|
||||
ShortcutController::ShortcutItem::ShortcutItem(QMenu* menu, ShortcutItem* parent)
|
||||
: m_action(nullptr)
|
||||
, m_shortcut(0)
|
||||
, m_menu(menu)
|
||||
, m_button(-1)
|
||||
, m_axis(-1)
|
||||
: m_menu(menu)
|
||||
, m_direction(GamepadAxisEvent::NEUTRAL)
|
||||
, m_parent(parent)
|
||||
{
|
||||
|
|
|
@ -69,14 +69,14 @@ private:
|
|||
}
|
||||
|
||||
private:
|
||||
QAction* m_action;
|
||||
int m_shortcut;
|
||||
QMenu* m_menu;
|
||||
QAction* m_action = nullptr;
|
||||
int m_shortcut = 0;
|
||||
QMenu* m_menu = nullptr;
|
||||
Functions m_functions;
|
||||
QString m_name;
|
||||
QString m_visibleName;
|
||||
int m_button;
|
||||
int m_axis;
|
||||
int m_button = -1;
|
||||
int m_axis = -1;
|
||||
GamepadAxisEvent::Direction m_direction;
|
||||
QList<ShortcutItem> m_items;
|
||||
ShortcutItem* m_parent;
|
||||
|
@ -133,14 +133,14 @@ private:
|
|||
void onSubitems(ShortcutItem*, std::function<void(ShortcutItem*)> func);
|
||||
void updateKey(ShortcutItem* item, int keySequence);
|
||||
|
||||
ShortcutItem m_rootMenu;
|
||||
ShortcutItem m_rootMenu{nullptr};
|
||||
QMap<QMenu*, ShortcutItem*> m_menuMap;
|
||||
QMap<int, ShortcutItem*> m_buttons;
|
||||
QMap<QPair<int, GamepadAxisEvent::Direction>, ShortcutItem*> m_axes;
|
||||
QMap<int, ShortcutItem*> m_heldKeys;
|
||||
ConfigController* m_config;
|
||||
ConfigController* m_config = nullptr;
|
||||
QString m_profileName;
|
||||
const InputProfile* m_profile;
|
||||
const InputProfile* m_profile = nullptr;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -15,8 +15,6 @@ using namespace QGBA;
|
|||
|
||||
ShortcutView::ShortcutView(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
, m_controller(nullptr)
|
||||
, m_input(nullptr)
|
||||
{
|
||||
m_ui.setupUi(this);
|
||||
m_ui.keyEdit->setValueKey(0);
|
||||
|
|
|
@ -40,8 +40,8 @@ private slots:
|
|||
private:
|
||||
Ui::ShortcutView m_ui;
|
||||
|
||||
ShortcutController* m_controller;
|
||||
InputController* m_input;
|
||||
ShortcutController* m_controller = nullptr;
|
||||
InputController* m_input = nullptr;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@ using namespace QGBA;
|
|||
Swatch::Swatch(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
m_size = 10;
|
||||
}
|
||||
|
||||
void Swatch::setSize(int size) {
|
||||
|
|
|
@ -32,7 +32,7 @@ protected:
|
|||
void mousePressEvent(QMouseEvent*) override;
|
||||
|
||||
private:
|
||||
int m_size;
|
||||
int m_size = 10;
|
||||
QVector<QColor> m_colors;
|
||||
QPixmap m_backing;
|
||||
QSize m_dims;
|
||||
|
|
|
@ -13,9 +13,7 @@ using namespace QGBA;
|
|||
|
||||
TilePainter::TilePainter(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
, m_size(8)
|
||||
{
|
||||
m_backing = QPixmap(256, 768);
|
||||
m_backing.fill(Qt::transparent);
|
||||
resize(256, 768);
|
||||
setTileCount(3072);
|
||||
|
|
|
@ -32,8 +32,8 @@ protected:
|
|||
void resizeEvent(QResizeEvent*) override;
|
||||
|
||||
private:
|
||||
QPixmap m_backing;
|
||||
int m_size;
|
||||
QPixmap m_backing{256, 768};
|
||||
int m_size = 8;
|
||||
int m_tileCount;
|
||||
};
|
||||
|
||||
|
|
|
@ -19,8 +19,6 @@ using namespace QGBA;
|
|||
TileView::TileView(GameController* controller, QWidget* parent)
|
||||
: AssetView(controller, parent)
|
||||
, m_controller(controller)
|
||||
, m_tileStatus{}
|
||||
, m_paletteId(0)
|
||||
{
|
||||
m_ui.setupUi(this);
|
||||
m_ui.tile->setController(controller);
|
||||
|
|
|
@ -35,8 +35,8 @@ private:
|
|||
Ui::TileView m_ui;
|
||||
|
||||
GameController* m_controller;
|
||||
mTileCacheEntry m_tileStatus[3072 * 32]; // TODO: Correct size
|
||||
int m_paletteId;
|
||||
mTileCacheEntry m_tileStatus[3072 * 32] = {}; // TODO: Correct size
|
||||
int m_paletteId = 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -45,13 +45,6 @@ bool VideoView::Preset::compatible(const Preset& other) const {
|
|||
|
||||
VideoView::VideoView(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
, m_audioCodecCstr(nullptr)
|
||||
, m_videoCodecCstr(nullptr)
|
||||
, m_containerCstr(nullptr)
|
||||
, m_nativeWidth(0)
|
||||
, m_nativeHeight(0)
|
||||
, m_width(1)
|
||||
, m_height(1)
|
||||
{
|
||||
m_ui.setupUi(this);
|
||||
|
||||
|
|
|
@ -86,18 +86,18 @@ private:
|
|||
QString m_audioCodec;
|
||||
QString m_videoCodec;
|
||||
QString m_container;
|
||||
char* m_audioCodecCstr;
|
||||
char* m_videoCodecCstr;
|
||||
char* m_containerCstr;
|
||||
char* m_audioCodecCstr = nullptr;
|
||||
char* m_videoCodecCstr = nullptr;
|
||||
char* m_containerCstr = nullptr;
|
||||
|
||||
int m_abr;
|
||||
int m_vbr;
|
||||
|
||||
int m_width;
|
||||
int m_height;
|
||||
int m_width = 1;
|
||||
int m_height = 1;
|
||||
|
||||
int m_nativeWidth;
|
||||
int m_nativeHeight;
|
||||
int m_nativeWidth = 0;
|
||||
int m_nativeHeight = 0;
|
||||
|
||||
QMap<QAbstractButton*, Preset> m_presets;
|
||||
|
||||
|
|
|
@ -63,30 +63,11 @@ using namespace QGBA;
|
|||
|
||||
Window::Window(ConfigController* config, int playerId, QWidget* parent)
|
||||
: QMainWindow(parent)
|
||||
, m_log(0)
|
||||
, m_logView(new LogView(&m_log))
|
||||
#ifdef USE_DEBUGGERS
|
||||
, m_console(nullptr)
|
||||
#endif
|
||||
, m_stateWindow(nullptr)
|
||||
, m_screenWidget(new WindowBackground())
|
||||
, m_logo(":/res/mgba-1024.png")
|
||||
, m_config(config)
|
||||
, m_inputController(playerId, this)
|
||||
, m_mruMenu(nullptr)
|
||||
, m_shortcutController(new ShortcutController(this))
|
||||
, m_fullscreenOnStart(false)
|
||||
, m_autoresume(false)
|
||||
, m_wasOpened(false)
|
||||
#ifdef USE_FFMPEG
|
||||
, m_videoView(nullptr)
|
||||
#endif
|
||||
#ifdef USE_MAGICK
|
||||
, m_gifView(nullptr)
|
||||
#endif
|
||||
#ifdef USE_GDB_STUB
|
||||
, m_gdbController(nullptr)
|
||||
#endif
|
||||
{
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
setAcceptDrops(true);
|
||||
|
|
|
@ -164,41 +164,41 @@ private:
|
|||
#endif
|
||||
QAction* m_multiWindow;
|
||||
QMap<int, QAction*> m_frameSizes;
|
||||
LogController m_log;
|
||||
LogController m_log{0};
|
||||
LogView* m_logView;
|
||||
#ifdef USE_DEBUGGERS
|
||||
DebuggerConsoleController* m_console;
|
||||
DebuggerConsoleController* m_console = nullptr;
|
||||
#endif
|
||||
LoadSaveState* m_stateWindow;
|
||||
LoadSaveState* m_stateWindow = nullptr;
|
||||
WindowBackground* m_screenWidget;
|
||||
QPixmap m_logo;
|
||||
QPixmap m_logo{":/res/mgba-1024.png"};
|
||||
ConfigController* m_config;
|
||||
InputController m_inputController;
|
||||
QList<QDateTime> m_frameList;
|
||||
QTimer m_fpsTimer;
|
||||
QList<QString> m_mruFiles;
|
||||
QMenu* m_mruMenu;
|
||||
QMenu* m_mruMenu = nullptr;
|
||||
QMenu* m_videoLayers;
|
||||
QMenu* m_audioChannels;
|
||||
ShortcutController* m_shortcutController;
|
||||
ShaderSelector* m_shaderView;
|
||||
bool m_fullscreenOnStart;
|
||||
bool m_fullscreenOnStart = false;
|
||||
QTimer m_focusCheck;
|
||||
bool m_autoresume;
|
||||
bool m_wasOpened;
|
||||
bool m_autoresume = false;
|
||||
bool m_wasOpened = false;
|
||||
|
||||
bool m_hitUnimplementedBiosCall;
|
||||
|
||||
#ifdef USE_FFMPEG
|
||||
VideoView* m_videoView;
|
||||
VideoView* m_videoView = nullptr;
|
||||
#endif
|
||||
|
||||
#ifdef USE_MAGICK
|
||||
GIFView* m_gifView;
|
||||
GIFView* m_gifView = nullptr;
|
||||
#endif
|
||||
|
||||
#ifdef USE_GDB_STUB
|
||||
GDBController* m_gdbController;
|
||||
GDBController* m_gdbController = nullptr;
|
||||
#endif
|
||||
|
||||
#ifdef USE_SQLITE3
|
||||
|
|
Loading…
Reference in New Issue