draw_lit_rle_sprite(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

πŸ’… draw_lit_rle_sprite β€” Allegro manual, bestie edition πŸŽ€

okay so we're in the Allegro manual, section 3, and today's main character is draw_lit_rle_sprite. she tints things. she's an RLE girlie. let's get into it πŸ’–


✨ NAME ✨

draw_lit_rle_sprite β€” draws a tinted RLE sprite. literally that's the whole job. part of the Allegro game programming library, which is the vibe πŸ¦‹


🌸 SYNOPSIS 🌸

#include <allegro.h>

void draw_lit_rle_sprite(BITMAP *bmp, const RLE_SPRITE *sprite, int x,
y, color);

no cap, that's the whole signature. copy it exactly, bestie, don't get cute with it πŸ™ˆ


πŸ’œ DESCRIPTION πŸ’œ

so this is the tinted version of draw_rle_sprite(). if you wanna know how the tinting actually behaves, go read the description of draw_lit_sprite() β€” she's the blueprint, this one just does the RLE flavor of it. iykyk ✨

⚠️ REAL TALK, DO NOT SKIP THIS: you can only use this after you've set up your color mapping table (for 256-color modes) or your blender functions (for truecolor modes). no setup, no slay. it's giving undefined chaos. πŸ’€

here's the example, verbatim, because i would never do you dirty:

/* Some one time initialisation code. */
COLOR_MAP global_light_table;
create_light_table(&global_trans_table, my_palette,
                   10, 10, 60, NULL);
...
if (get_color_depth() == 8)
   color_map = &global_light_table;
else
   set_trans_blender(40, 40, 255, 255);

/* Lit the cape with a blueish light. */
draw_lit_rle_sprite(buffer, rle_colored_cape, x, y, 64);

notice how we're lighting the cape with a blueish light? that's character development. that's cinema. πŸ‘‘


πŸ‘‘ SEE ALSO πŸ‘‘

go read those too, they're all icons in their own right 🌈


mwah πŸ’‹ that's the whole page. this one's from Allegro, version 4.4.3 β€” yes, the manual name is draw_lit_rle_sprite and that's the section 3 energy we're serving today. stay tinted, stay RLE, and remember: set up your tables first, bestie πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from