diff --git a/src/demo/normal.c b/src/demo/normal.c index 50855b1677..15af938e5f 100644 --- a/src/demo/normal.c +++ b/src/demo/normal.c @@ -23,13 +23,12 @@ mandelbrot(int y, int x, int dy, int dx){ static int mcell(uint32_t* c, int y, int x, int dy, int dx){ int iter = mandelbrot(y, x, dy, dx); - *c = ((128 - iter / 2) << 24u) + ((256 - iter) << 16u) + ((128 - iter / 2) << 8u); + *c = ((256 - iter) << 24u) + ((256 - iter) << 16u) + ((256 - iter) << 8u); return 0; } static uint32_t* offset(uint32_t* rgba, int y, int x, int dx){ -fprintf(stderr, "writing to %p\n", rgba + y * dx + x); return rgba + y * dx + x; } @@ -42,6 +41,7 @@ int normal_demo(struct notcurses* nc){ if(!rgba){ return -1; } + memset(rgba, 0, sizeof(*rgba) * dy * dx); int y; if(dy / VSCALE % 2){ y = dy / VSCALE + 1; @@ -60,12 +60,11 @@ int normal_demo(struct notcurses* nc){ return -1; } } - if(ncblit_rgba(n, y, 0, dx, rgba, dy / 2 - y, 0, y * 2, dx) < 0){ + if(ncblit_rgba(n, 0, 0, dx * sizeof(*rgba), rgba, 0, 0, dy, dx) < 0){ return -1; } DEMO_RENDER(nc); } - sleep(1); free(rgba); return 0; } diff --git a/src/lib/libav.c b/src/lib/libav.c index b6b1842e3a..cf9eb8ece5 100644 --- a/src/lib/libav.c +++ b/src/lib/libav.c @@ -385,7 +385,7 @@ tria_blit(ncplane* nc, int placey, int placex, int linesize, const void* data, for(x = placex ; visx < (begx + lenx) && x < dimx ; ++x, ++visx){ const unsigned char* rgbbase_up = dat + (linesize * visy) + (visx * bpp / CHAR_BIT); const unsigned char* rgbbase_down = dat + (linesize * (visy + 1)) + (visx * bpp / CHAR_BIT); -fprintf(stderr, "[%04d/%04d] bpp: %d lsize: %d %02x %02x %02x %02x\n", y, x, bpp, linesize, rgbbase_up[0], rgbbase_up[1], rgbbase_up[2], rgbbase_up[3]); +//fprintf(stderr, "[%04d/%04d] bpp: %d lsize: %d %02x %02x %02x %02x\n", y, x, bpp, linesize, rgbbase_up[0], rgbbase_up[1], rgbbase_up[2], rgbbase_up[3]); cell* c = ncplane_cell_ref_yx(nc, y, x); // use the default for the background, as that's the only way it's // effective in that case anyway