diff --git a/src/nostalgia/core/gfx.cpp b/src/nostalgia/core/gfx.cpp index e54f26e5..bf32cc53 100644 --- a/src/nostalgia/core/gfx.cpp +++ b/src/nostalgia/core/gfx.cpp @@ -175,9 +175,8 @@ uint8_t blue32(Color16 c) noexcept { return blue16(c) * 8; } -static_assert(color16(0, 31, 0, 0) == 992); -static_assert(color16(16, 31, 0, 0) == 1008); -static_assert(color16(16, 31, 8, 0) == 9200); -static_assert(color16(16, 31, 8, 1) == 41968); +static_assert(color16(0, 31, 0) == 992); +static_assert(color16(16, 31, 0) == 1008); +static_assert(color16(16, 31, 8) == 9200); } diff --git a/src/nostalgia/core/gfx.hpp b/src/nostalgia/core/gfx.hpp index f35243f2..9d2a1801 100644 --- a/src/nostalgia/core/gfx.hpp +++ b/src/nostalgia/core/gfx.hpp @@ -107,8 +107,8 @@ ox::Error loadSpriteTileSheet(Context *ctx, } -[[nodiscard]] constexpr Color16 color16(uint8_t r, uint8_t g, uint8_t b, uint8_t a) { - return r | (g << 5) | (b << 10) | (a << 15); +[[nodiscard]] constexpr Color16 color16(uint8_t r, uint8_t g, uint8_t b) { + return r | (g << 5) | (b << 10); } [[nodiscard]] uint8_t red32(Color32 c) noexcept; diff --git a/src/nostalgia/core/studio/paletteeditor.cpp b/src/nostalgia/core/studio/paletteeditor.cpp index 1750c728..d877ed38 100644 --- a/src/nostalgia/core/studio/paletteeditor.cpp +++ b/src/nostalgia/core/studio/paletteeditor.cpp @@ -277,7 +277,7 @@ void PaletteEditor::addTableRow(int i, Color16 c) { m_table->setItem(i, 0, mkCell(red16(c))); m_table->setItem(i, 1, mkCell(green16(c))); m_table->setItem(i, 2, mkCell(blue16(c))); - m_table->setItem(i, 3, mkCell(toQColor(m_pal->colors[static_cast(i)]).name(QColor::HexArgb), false)); + m_table->setItem(i, 3, mkCell(toQColor(m_pal->colors[static_cast(i)]).name(QColor::HexRgb), false)); connect(m_table, &QTableWidget::cellChanged, this, &PaletteEditor::cellChanged); } @@ -292,7 +292,7 @@ void PaletteEditor::setTableRow(int idx, Color16 c) { m_table->item(idx, 0)->setText(QString::number(red16(c))); m_table->item(idx, 1)->setText(QString::number(green16(c))); m_table->item(idx, 2)->setText(QString::number(blue16(c))); - m_table->item(idx, 3)->setText(toQColor(m_pal->colors[static_cast(idx)]).name(QColor::HexArgb)); + m_table->item(idx, 3)->setText(toQColor(m_pal->colors[static_cast(idx)]).name(QColor::HexRgb)); connect(m_table, &QTableWidget::cellChanged, this, &PaletteEditor::cellChanged); } diff --git a/src/nostalgia/core/studio/tilesheeteditor.cpp b/src/nostalgia/core/studio/tilesheeteditor.cpp index 5db32374..fd3dada0 100644 --- a/src/nostalgia/core/studio/tilesheeteditor.cpp +++ b/src/nostalgia/core/studio/tilesheeteditor.cpp @@ -279,7 +279,7 @@ class UpdatePixelsCommand: public QUndoCommand { m_cmdIdx = cmdIdx; PixelUpdate pu; pu.item = pixelItem; - pu.oldColorId = m_palette.indexOf(pixelItem->property("color").value().name(QColor::HexArgb)); + pu.oldColorId = m_palette.indexOf(pixelItem->property("color").value().name(QColor::HexRgb)); m_pixelUpdates.insert(pu); setObsolete(pu.oldColorId == newColorId); } @@ -585,7 +585,7 @@ void SheetData::setPalette(const NostalgiaPalette *npal) { m_palette.clear(); for (std::size_t i = 0; i < npal->colors.size(); i++) { const auto c = toQColor(npal->colors[i]); - const auto color = c.name(QColor::HexArgb); + const auto color = c.name(QColor::HexRgb); m_palette.append(color); } emit paletteChanged();