From 841c0a4b8fc7de6c99030da58528f92cb40815a0 Mon Sep 17 00:00:00 2001 From: nick black Date: Sun, 7 Jun 2020 19:46:03 -0400 Subject: [PATCH] quadblitter: respect transparency #686 --- src/demo/outro.c | 1 + src/lib/blit.c | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/demo/outro.c b/src/demo/outro.c index d4de1d96e..37e5d2ad0 100644 --- a/src/demo/outro.c +++ b/src/demo/outro.c @@ -58,6 +58,7 @@ videothread(void* vnc){ struct ncvisual_options ovopts = { .scaling = NCSCALE_STRETCH, .n = ncp, + .y = 1, }; int three = 3; if(ncvisual_render(nc, ncv, &ovopts) == NULL){ diff --git a/src/lib/blit.c b/src/lib/blit.c index 476e03620..bb4b39e10 100644 --- a/src/lib/blit.c +++ b/src/lib/blit.c @@ -307,8 +307,6 @@ quadrant_blit(ncplane* nc, int placey, int placex, int linesize, && ffmpeg_trans_p(bgr, rgbbase_bl[3]) && ffmpeg_trans_p(bgr, rgbbase_br[3])){ cell_set_bg_alpha(c, CELL_ALPHA_TRANSPARENT); cell_set_fg_alpha(c, CELL_ALPHA_TRANSPARENT); - egc = " "; - // FIXME else look for pairs of transparency! }else{ uint32_t tl = 0, tr = 0, bl = 0, br = 0; channel_set_rgb(&tl, rgbbase_tl[rpos], rgbbase_tl[1], rgbbase_tl[bpos]); @@ -317,16 +315,16 @@ quadrant_blit(ncplane* nc, int placey, int placex, int linesize, channel_set_rgb(&br, rgbbase_br[rpos], rgbbase_br[1], rgbbase_br[bpos]); uint32_t bg, fg; egc = quadrant_solver(tl, tr, bl, br, &fg, &bg); + assert(egc); cell_set_fchannel(c, fg); cell_set_bchannel(c, bg); if(blendcolors){ cell_set_bg_alpha(c, CELL_ALPHA_BLEND); cell_set_fg_alpha(c, CELL_ALPHA_BLEND); } - } - assert(egc); - if(cell_load(nc, c, egc) <= 0){ - return -1; + if(cell_load(nc, c, egc) <= 0){ + return -1; + } } ++total; }