Add ncplane_bound(3). This allows a new plane N to be created in the
*bound* state relative to another ncplane B. If B moves, N moves the
same amount. If N is moved, the coordinates are taken relative to B
as opposed to the standard plane. If B is destroyed, N is destroyed.
Each plane can have many planes bound to it, but can only be bound to
a single plane. Add ncplane_reparent(3). This allows a plane to be
detached from any plane to which it is bound, and optionally rebound
to a new plane. The standard plane cannot be reparented.
Documentation and unit tests have been added for both.
* tetris: use NES gravities
* tetris: use NES grav multiplier of 50ms
* tetris: implement move down #421
* README: mention notcurses-tetris #421
* tetris: use double box for boundary #421
* tetris: extract background.h
* tetris: break up into chunks suitable for book
* tetris: do the rotations
ncvisual_render() now returns the number of cells emitted
rather than just 0/-1. -1 is still returned on failure.
Rather than 0 for length meaning "all possible length", it
now means 0, and -1 means "all possible length". All demos,
tests, and PoCs have been updated. #422
If notcurses_init() fails due to a bad encoding, it's
probably because someone didn't call setlocale(3).
Make a suggestion in the error message. Resolves#414.
ncplane_mergedown() is similar to the "Merge down" operation
in the GIMP. It writes to the destination plane the result
of rendering the source and destination frames per se.
I noticed while running benchmarks against ranges of widths that
we failed on certain widths. I traced this down to a repeatable
failure when run with the -c flag at the 104x52 resolution. At this
geometry and PRNG seed, we NULLed out the first subwindow of fallin',
but didn't recompress the window array. On the next loop we thus used
it again, and segfaulted out. This fixes that up. We now pass 100% of
the benchmarks, whereas we were failing about 3% before #407.