all repos — mgba @ a36315097a8757e2c5c7ca0d8b2e639880655767

mGBA Game Boy Advance Emulator

Qt: Fix tile and sprite views not always displaying at first
Vicki Pfau vi@endrift.com
Sat, 09 Feb 2019 02:09:10 -0800
commit

a36315097a8757e2c5c7ca0d8b2e639880655767

parent

0c9802e4da83f8f82bfba7576eaf644aa1b1f25f

M CHANGESCHANGES

@@ -6,6 +6,7 @@ - GBA: All IRQs have 7 cycle delay (fixes mgba.io/i/539, mgba.io/i/1208)

- GBA: Reset now reloads multiboot ROMs - GBA BIOS: Fix multiboot entry point (fixes Magic Floor) - Switch: Fix final cleanup (fixes mgba.io/i/1283) + - Qt: Fix tile and sprite views not always displaying at first Misc: - GBA Savedata: EEPROM performance fixes - GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash
M src/platform/qt/ObjView.cppsrc/platform/qt/ObjView.cpp

@@ -46,6 +46,9 @@ m_ui.transform->setFont(font);

m_ui.mode->setFont(font); connect(m_ui.tiles, &TilePainter::indexPressed, this, &ObjView::translateIndex); + connect(m_ui.tiles, &TilePainter::needsRedraw, this, [this]() { + updateTiles(true); + }); connect(m_ui.objId, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &ObjView::selectObj); connect(m_ui.magnification, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), [this]() { updateTiles(true);
M src/platform/qt/TilePainter.cppsrc/platform/qt/TilePainter.cpp

@@ -31,6 +31,7 @@ calculatedHeight -= calculatedHeight % m_size;

if (width() / m_size != m_backing.width() / m_size || m_backing.height() != calculatedHeight) { m_backing = QPixmap(width(), calculatedHeight); m_backing.fill(Qt::transparent); + emit needsRedraw(); } }
M src/platform/qt/TilePainter.hsrc/platform/qt/TilePainter.h

@@ -26,6 +26,7 @@ void setTileMagnification(int mag);

signals: void indexPressed(int index); + void needsRedraw(); protected: void paintEvent(QPaintEvent*) override;
M src/platform/qt/TileView.cppsrc/platform/qt/TileView.cpp

@@ -25,6 +25,9 @@ m_ui.setupUi(this);

m_ui.tile->setController(controller); connect(m_ui.tiles, &TilePainter::indexPressed, m_ui.tile, &AssetTile::selectIndex); + connect(m_ui.tiles, &TilePainter::needsRedraw, this, [this]() { + updateTiles(true); + }); connect(m_ui.paletteId, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &TileView::updatePalette); switch (m_controller->platform()) {