summaryrefslogtreecommitdiff
path: root/src/ui/paint.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-09-22 11:36:31 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-09-22 11:36:31 +0300
commitc6182b6b4158a3227546ae55895b72a326db19fb (patch)
tree8841cf408132a55959916384309b5daab844e11a /src/ui/paint.c
parentf55e327bdcdefc1c130febcc8f3a03062fba782e (diff)
Drawing with alpha blending
Diffstat (limited to 'src/ui/paint.c')
-rw-r--r--src/ui/paint.c5
1 files changed, 3 insertions, 2 deletions
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) {
31 31
32static void setColor_Paint_(const iPaint *d, int color) { 32static void setColor_Paint_(const iPaint *d, int color) {
33 const iColor clr = get_Color(color & mask_ColorId); 33 const iColor clr = get_Color(color & mask_ColorId);
34 SDL_SetRenderDrawColor(renderer_Paint_(d), clr.r, clr.g, clr.b, clr.a); 34 SDL_SetRenderDrawColor(renderer_Paint_(d), clr.r, clr.g, clr.b, clr.a * d->alpha / 255);
35} 35}
36 36
37void init_Paint(iPaint *d) { 37void init_Paint(iPaint *d) {
38 d->dst = get_Window(); 38 d->dst = get_Window();
39 d->setTarget = NULL; 39 d->setTarget = NULL;
40 d->oldTarget = NULL; 40 d->oldTarget = NULL;
41 d->alpha = 255;
41} 42}
42 43
43void beginTarget_Paint(iPaint *d, SDL_Texture *target) { 44void beginTarget_Paint(iPaint *d, SDL_Texture *target) {