masked_stretch_blit(3alleg4)
π masked_stretch_blit β the glow-up blit
okay bestie, so this one lives in the Allegro game programming library (that's the manual name, and yes we're citing it up top because that's how we do), and it's the one you call when you need to scale a rectangular area while skipping every pixel that matches the mask color. no cap. it's giving "stretch, but make it masked" β¨
β¨ SYNOPSIS β¨
#include <allegro.h>
void masked_stretch_blit(BITMAP *source, BITMAP *dest, int source_x,
source_y, source_w, source_h, int dest_x, dest_y, dest_w, dest_h);
πΈ DESCRIPTION πΈ
So here's the tea π: this is exactly like masked_blit(), except it can scale images β which means the source rectangle and the destination rectangle literally do not have to be the same size. glow up, resize, whatever, she's flexible πβοΈ
but now the serious part, and I need you to actually listen bestie π«Ά: this routine doesn't do as much safety checking as the regular masked_blit(). specifically:
- you have to be careful not to copy from areas outside the source bitmap. she will not stop you. she will not warn you. she trusts you way too much π
- also the source must be a memory bitmap. that's not a suggestion, that's the vibe check, and it's mandatory π
example time, here's the whole thing verbatim:
BITMAP *hud_overlay;
...
/* Stretch hud overlay over the screen. */
masked_stretch_blit(hud_overlay, screen, 0, 0,
hud_overlay->w, hud_overlay->h,
0, 0, SCREEN_W, SCREEN_H);
see how she took hud_overlay's own ->w and ->h and stretched the whole thing across SCREEN_W and SCREEN_H? main character energy π
π SEE ALSO π
and that's the whole page, babe π this was brought to you by Allegro, version 4.4.3 β that's the source and the version, fr fr, no date on this one so we're just shouting out the release π go stretch something, carefully, love you π¦
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms