PNGdec: Don't add palette_offset twice.

patch-pngdec-palette-offset
Phil Howard 2024-03-28 15:30:32 +00:00
rodzic 27b913124c
commit d34e692f51
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -217,7 +217,7 @@ mp_event_handle_nowait();
|| current_graphics->pen_type == PicoGraphics::PEN_3BIT
|| current_graphics->pen_type == PicoGraphics::PEN_INKY7)) {
if(current_palette_offset > 0) {
i += ((int16_t)(i) + current_palette_offset) & 0xff;
i = ((int16_t)(i) + current_palette_offset) & 0xff;
}
current_graphics->set_pen(i);
} else {
@ -279,7 +279,7 @@ mp_event_handle_nowait();
// Copy raw palette indexes over
if(current_mode == MODE_COPY) {
if(current_palette_offset > 0) {
i += ((int16_t)(i) + current_palette_offset) & 0xff;
i = ((int16_t)(i) + current_palette_offset) & 0xff;
}
current_graphics->set_pen(i);
current_graphics->rectangle({current_position.x, current_position.y, scale.x, scale.y});