draw_lit_rle_sprite(3)
π 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 π
draw_rle_sprite(3)draw_trans_rle_sprite(3)draw_lit_sprite(3)color_map(3)set_trans_blender(3)bitmap_mask_color(3)
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
- 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