From 84b72e1e6b28dfae11d14349acaac5e65f857a4c Mon Sep 17 00:00:00 2001 From: nick black Date: Sat, 28 Aug 2021 03:00:49 -0400 Subject: [PATCH] lookup_blitset: handle exclusive plotter blitters #2113 --- src/lib/blit.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/lib/blit.c b/src/lib/blit.c index cf53583d7..1e32b0060 100644 --- a/src/lib/blit.c +++ b/src/lib/blit.c @@ -917,7 +917,8 @@ void set_pixel_blitter(ncblitter blitfxn){ b->blit = blitfxn; } -const struct blitset* lookup_blitset(const tinfo* tcache, ncblitter_e setid, bool may_degrade) { +const struct blitset* lookup_blitset(const tinfo* tcache, ncblitter_e setid, + bool may_degrade){ if(setid == NCBLIT_DEFAULT){ // ought have resolved NCBLIT_DEFAULT before now return NULL; } @@ -939,6 +940,24 @@ const struct blitset* lookup_blitset(const tinfo* tcache, ncblitter_e setid, boo } setid = NCBLIT_3x2; } + // without eighths support, NCBLIT_8x1 decays to NCBLIT_4x1 + if(setid == NCBLIT_8x1){ // plotter only + if(tcache->caps.quadrants){ + return ¬curses_blitters[setid - 1]; + }else if(!may_degrade){ + return NULL; + } + setid = NCBLIT_4x1; + } + // without quarters support, NCBLIT_4x1 decays to NCBLIT_2x1 + if(setid == NCBLIT_4x1){ // plotter only + if(tcache->caps.quadrants){ + return ¬curses_blitters[setid - 1]; + }else if(!may_degrade){ + return NULL; + } + setid = NCBLIT_2x1; + } // without sextant support, NCBLIT_3x2 decays to NCBLIT_2x2 if(setid == NCBLIT_3x2){ if(tcache->caps.sextants){