fli_pal_dirty_from(3)
π fli_pal_dirty_from β bestie, it's the palette gossip tracker
okay so this is from the Allegro manual, section 3, and it's literally just two lil global ints that tell you which slice of your palette just changed. main character energy fr fr. π
β¨ NAME β¨
fli_pal_dirty_from, fli_pal_dirty_to β these two tell you which parts of the palette have changed. part of the Allegro game programming library, bestie π¦
πΈ SYNOPSIS πΈ
#include <allegro.h>
extern int fli_pal_dirty_from;
extern int fli_pal_dirty_to;
π DESCRIPTION π
so the way this works: next_fli_frame() sets these two variables for you, and they mark which part of fli_palette has changed since the last time somebody called reset_fli_variables(). it's giving "here's your update, queen." π
the rule is lowkey simple:
- if
fli_pal_dirty_fromis greater thanfli_pal_dirty_toβ the palette has NOT changed, nothing to see here, go home, no notes π - otherwise β colors
fli_pal_dirty_fromtofli_pal_dirty_to, inclusive, have altered β¨
and why do you care? because when you're updating the hardware palette you can use these to dodge unnecessary calls to set_palette(). it's called not wasting cycles, and it's iconic. π«Ά
example, verbatim, no cap:
if (fli_pal_dirty_from <= fli_pal_dirty_to)
set_palette_range(fli_palette, fli_pal_dirty_from,
fli_pal_dirty_to, 1);
likeβ¦ look at that. only touch the palette if the palette actually moved. periodt. π₯
π SEE ALSO π
ngl bestie, if you're out here calling set_palette() on a palette that hasn't changed, that's not the vibe. check the dirty range first. iykyk π
and that's the whole page, babes π β brought to you by the Allegro manual, version 4.4.3. mwah π β¨
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms