mirror of https://github.com/mgba-emu/mgba.git
Qt: Close game inspector windows when game ends
This commit is contained in:
parent
a01f9921f5
commit
a7ad78d46e
|
@ -21,6 +21,7 @@ using namespace QGBA;
|
||||||
|
|
||||||
MemoryModel::MemoryModel(QWidget* parent)
|
MemoryModel::MemoryModel(QWidget* parent)
|
||||||
: QAbstractScrollArea(parent)
|
: QAbstractScrollArea(parent)
|
||||||
|
, m_cpu(nullptr)
|
||||||
, m_top(0)
|
, m_top(0)
|
||||||
{
|
{
|
||||||
m_font.setFamily("Source Code Pro");
|
m_font.setFamily("Source Code Pro");
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
|
|
||||||
#include "MemoryView.h"
|
#include "MemoryView.h"
|
||||||
|
|
||||||
|
#include "GameController.h"
|
||||||
|
|
||||||
using namespace QGBA;
|
using namespace QGBA;
|
||||||
|
|
||||||
MemoryView::MemoryView(GameController* controller, QWidget* parent)
|
MemoryView::MemoryView(GameController* controller, QWidget* parent)
|
||||||
|
@ -15,4 +17,5 @@ MemoryView::MemoryView(GameController* controller, QWidget* parent)
|
||||||
m_ui.setupUi(this);
|
m_ui.setupUi(this);
|
||||||
|
|
||||||
m_ui.hexfield->setController(controller);
|
m_ui.hexfield->setController(controller);
|
||||||
|
connect(controller, SIGNAL(gameStopped(GBAThread*)), this, SLOT(close()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,9 +33,14 @@ PaletteView::PaletteView(GameController* controller, QWidget* parent)
|
||||||
|
|
||||||
connect(m_ui.bgGrid, SIGNAL(indexPressed(int)), this, SLOT(selectIndex(int)));
|
connect(m_ui.bgGrid, SIGNAL(indexPressed(int)), this, SLOT(selectIndex(int)));
|
||||||
connect(m_ui.objGrid, &Swatch::indexPressed, [this] (int index) { selectIndex(index + 256); });
|
connect(m_ui.objGrid, &Swatch::indexPressed, [this] (int index) { selectIndex(index + 256); });
|
||||||
|
|
||||||
|
connect(controller, SIGNAL(gameStopped(GBAThread*)), this, SLOT(close()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PaletteView::updatePalette() {
|
void PaletteView::updatePalette() {
|
||||||
|
if (!m_controller->thread() || !m_controller->thread()->gba) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const uint16_t* palette = m_controller->thread()->gba->video.palette;
|
const uint16_t* palette = m_controller->thread()->gba->video.palette;
|
||||||
for (int i = 0; i < 256; ++i) {
|
for (int i = 0; i < 256; ++i) {
|
||||||
m_ui.bgGrid->setColor(i, palette[i]);
|
m_ui.bgGrid->setColor(i, palette[i]);
|
||||||
|
|
Loading…
Reference in New Issue