diff --git a/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditor-imgui.cpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditor-imgui.cpp index fce0783c..4809aa19 100644 --- a/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditor-imgui.cpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditor-imgui.cpp @@ -36,21 +36,12 @@ OX_MODEL_BEGIN(TileSheetEditorConfig) OX_MODEL_END() static ox::Vector normalizePixelSizes( - ox::Vector const&inPixels, - int const bpp) noexcept { - uint_t const bytesPerTile = bpp == 8 ? PixelsPerTile : PixelsPerTile / 2; + ox::Vector const&inPixels) noexcept { ox::Vector outPixels; - if (bytesPerTile == 64) { // 8 BPP - outPixels.resize(inPixels.size()); - for (std::size_t i = 0; i < inPixels.size(); ++i) { - outPixels[i] = inPixels[i]; - } - } else { // 4 BPP - outPixels.resize(inPixels.size() * 2); - for (std::size_t i = 0; i < inPixels.size(); ++i) { - outPixels[i * 2 + 0] = inPixels[i] & 0xF; - outPixels[i * 2 + 1] = inPixels[i] >> 4; - } + outPixels.reserve(inPixels.size()); + outPixels.resize(inPixels.size()); + for (std::size_t i = 0; i < inPixels.size(); ++i) { + outPixels[i] = inPixels[i]; } return outPixels; } @@ -409,12 +400,11 @@ void TileSheetEditorImGui::showSubsheetEditor() noexcept { ox::Error TileSheetEditorImGui::exportSubhseetToPng(int const scale) const noexcept { OX_REQUIRE(path, studio::saveFile({{"PNG", "png"}})); // subsheet to png - auto const&img = m_model.img(); auto const&s = m_model.activeSubSheet(); auto const&pal = m_model.pal(); auto const width = s.columns * TileWidth; auto const height = s.rows * TileHeight; - auto pixels = normalizePixelSizes(s.pixels, img.bpp); + auto pixels = normalizePixelSizes(s.pixels); pixels = normalizePixelArrangement(pixels, s.columns, scale); auto const err = toPngFile( path,