all repos — mgba @ 9c5d434d9084fcff22c8128fdbe5e3f6281c3784

mGBA Game Boy Advance Emulator

Qt: Fix indices when swapping palette sets
Jeffrey Pfau jeffrey@endrift.com
Thu, 20 Oct 2016 22:17:23 -0700
commit

9c5d434d9084fcff22c8128fdbe5e3f6281c3784

parent

2f0501d3c476e234859d2c6063636bb03a92bea3

1 files changed, 2 insertions(+), 1 deletions(-)

jump to
M src/platform/qt/AssetTile.cppsrc/platform/qt/AssetTile.cpp

@@ -65,6 +65,7 @@ selectIndex(m_index);

} void AssetTile::setPaletteSet(int palette, int boundary, int max) { + m_index = m_index * (1 + m_paletteSet) / (1 + palette); if (m_index >= max) { m_index = max - 1; }

@@ -76,7 +77,7 @@

void AssetTile::selectIndex(int index) { m_index = index; const uint16_t* data; - m_ui.tileId->setText(QString::number(index)); + m_ui.tileId->setText(QString::number(index * (1 + m_paletteSet))); mTileCacheSetPalette(m_tileCache.get(), m_paletteSet); unsigned bpp = 8 << m_tileCache->bpp;