From ef348fe1ca5717cb7b4d50661c0b554c3146f7ed Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Fri, 20 Mar 2020 01:53:57 +0100 Subject: [PATCH] Use the new frame() method. --- subprojects/memcard/src/icon_fetch.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/subprojects/memcard/src/icon_fetch.cpp b/subprojects/memcard/src/icon_fetch.cpp index 84725fc..4101edc 100644 --- a/subprojects/memcard/src/icon_fetch.cpp +++ b/subprojects/memcard/src/icon_fetch.cpp @@ -119,7 +119,6 @@ namespace { std::vector> icon_fetch (const ConstBlock& block, int width, int height) { const constexpr int in_height = 16, in_width = 16; const bool scale = (in_width != width or in_height != height); - const auto slot_begin = block.cbegin(); const std::vector& palette = block.palette(); assert(palette.size() == 16 * 4); const int32_t palette_padded_size = (not scale) * (((palette.size() * CHAR_BIT + 31) bitand ~31) / CHAR_BIT); @@ -165,7 +164,7 @@ std::vector> icon_fetch (const ConstBlock& block, int width, i orig_rgb.resize(in_scan_sz * in_height); for (int y = 0; y < in_height; ++y) { for (int x = 0; x < in_width / 2; ++x) { - const uint8_t curr = *(slot_begin + 128 + (in_width / 2 * y) + 128 * icon_num + x); + const uint8_t curr = *(block.frame(1 + icon_num) + (in_width / 2 * y) + x); orig_rgb[y * in_scan_sz + x] = ((curr bitand 0xf0) >> 4) bitor ((curr bitand 0x0f) << 4); } }