From c6182b6b4158a3227546ae55895b72a326db19fb Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Tue, 22 Sep 2020 11:36:31 +0300 Subject: Drawing with alpha blending --- src/ui/paint.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/ui/paint.c') diff --git a/src/ui/paint.c b/src/ui/paint.c index d0a4a579..9c6711f1 100644 --- a/src/ui/paint.c +++ b/src/ui/paint.c @@ -31,13 +31,14 @@ iLocalDef SDL_Renderer *renderer_Paint_(const iPaint *d) { static void setColor_Paint_(const iPaint *d, int color) { const iColor clr = get_Color(color & mask_ColorId); - SDL_SetRenderDrawColor(renderer_Paint_(d), clr.r, clr.g, clr.b, clr.a); + SDL_SetRenderDrawColor(renderer_Paint_(d), clr.r, clr.g, clr.b, clr.a * d->alpha / 255); } void init_Paint(iPaint *d) { - d->dst = get_Window(); + d->dst = get_Window(); d->setTarget = NULL; d->oldTarget = NULL; + d->alpha = 255; } void beginTarget_Paint(iPaint *d, SDL_Texture *target) { -- cgit v1.2.3