Use the new frame() method.
This commit is contained in:
parent
965dafa240
commit
ef348fe1ca
1 changed files with 1 additions and 2 deletions
|
@ -119,7 +119,6 @@ namespace {
|
|||
std::vector<std::vector<char>> 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<uint8_t>& 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<std::vector<char>> 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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue