mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-26 01:40:12 -05:00
sixel: add: increase data pointer instead of offset
Same ‘add’ instruction to increase the offset, but simpler ‘mov’ instruction when writing the pixel data.
This commit is contained in:
parent
777576b66b
commit
751ccf5316
1 changed files with 3 additions and 3 deletions
6
sixel.c
6
sixel.c
|
|
@ -1004,13 +1004,13 @@ sixel_add(struct terminal *term, uint32_t color, uint8_t sixel)
|
||||||
xassert(term->sixel.pos.row < term->sixel.image.height);
|
xassert(term->sixel.pos.row < term->sixel.image.height);
|
||||||
|
|
||||||
size_t ofs = term->sixel.row_byte_ofs + term->sixel.pos.col;
|
size_t ofs = term->sixel.row_byte_ofs + term->sixel.pos.col;
|
||||||
uint32_t *data = term->sixel.image.data;
|
uint32_t *data = &term->sixel.image.data[ofs];
|
||||||
|
|
||||||
int max_non_empty_row = 0;
|
int max_non_empty_row = 0;
|
||||||
for (int i = 0; i < 6; i++, sixel >>= 1, ofs += width) {
|
for (int i = 0; i < 6; i++, sixel >>= 1, data += width) {
|
||||||
if (sixel & 1) {
|
if (sixel & 1) {
|
||||||
data[ofs] = color;
|
|
||||||
max_non_empty_row = i;
|
max_non_empty_row = i;
|
||||||
|
*data = color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue