jungle/normal: improve behavior under ASCII mode #696

This commit is contained in:
nick black 2020-06-09 07:24:47 -04:00
parent a10ba4dac6
commit 2b89b0850c
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
2 changed files with 12 additions and 4 deletions

View File

@ -26590,6 +26590,11 @@ int jungle_demo(struct notcurses* nc){
if(!notcurses_canchangecolor(nc)){
return 0; // skip
}
// FIXME once we rewrite the garbage below using a modern ncvisual, we
// can rely on blitter degradation, and run this in ASCII mode.
if(!notcurses_canutf8(nc)){
return 0;
}
struct timespec start, now;
clock_gettime(CLOCK_MONOTONIC_RAW, &start);
size_t have = 0, out = 0;
@ -26623,6 +26628,7 @@ int jungle_demo(struct notcurses* nc){
}
int dimx, dimy;
struct ncplane* n = notcurses_stddim_yx(nc, &dimy, &dimx);
// FIXME rewrite all of this using modern ncvisual, sheesh
dimy *= 2; // use half blocks
const int xiter = ORIGWIDTH / dimx + !!(ORIGWIDTH % dimx);
const int yiter = ORIGHEIGHT / dimy + !!(ORIGHEIGHT % dimy);

View File

@ -196,10 +196,12 @@ int normal_demo(struct notcurses* nc){
if(n == NULL){
goto err;
}
ncplane_erase(nstd);
ncplane_cursor_move_yx(n, 0, 0);
if(rotate_plane(nc, n)){
goto err;
if(notcurses_canutf8(nc)){
ncplane_erase(nstd);
ncplane_cursor_move_yx(n, 0, 0);
if(rotate_plane(nc, n)){
goto err;
}
}
ncplane_cursor_move_yx(n, 0, 0);
uint64_t tl, tr, bl, br;