From 9c5d434d9084fcff22c8128fdbe5e3f6281c3784 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Thu, 20 Oct 2016 22:17:23 -0700 Subject: [PATCH] Qt: Fix indices when swapping palette sets --- src/platform/qt/AssetTile.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platform/qt/AssetTile.cpp b/src/platform/qt/AssetTile.cpp index 77bc52eb5..9963f907b 100644 --- a/src/platform/qt/AssetTile.cpp +++ b/src/platform/qt/AssetTile.cpp @@ -65,6 +65,7 @@ void AssetTile::setPalette(int palette) { } 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::setPaletteSet(int palette, int boundary, int max) { 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;