nick black
dfd54f540a
keyplot: ticker thead so we needn't provide input
2020-04-04 12:32:19 -04:00
nick black
d30858e60d
tetris: factor out MAX_LEVEL
2020-04-04 12:32:19 -04:00
nick black
8214665b7e
keyplot: only show yaxis labels on one plot #438
2020-04-04 12:32:19 -04:00
nick black
c022800295
plot: fix up slotcount vis-a-vis rangex #438
2020-04-04 12:32:19 -04:00
nick black
c6cfafc2fc
hrmmm
2020-04-04 12:32:19 -04:00
nick black
2a7ccffec6
ncplot: add labelaxisd, use it in keyplot #438
2020-04-04 12:32:19 -04:00
nick black
c0f8d9b444
eliminate detectdomain, infer it from maxy==miny #439
2020-04-04 08:56:31 -04:00
nick black
d2365b9f18
notcurses-keyplot: use full length of plane #436
2020-04-04 08:30:49 -04:00
nick black
119795dc0e
colloquy: use proper ident name in rust
2020-04-04 04:36:44 -04:00
nick black
5994eee711
colloquy: block on input before exiting #320
2020-04-04 04:35:34 -04:00
David Cantrell
299a39def6
demo.c needs errno.h
2020-04-03 23:51:29 -04:00
nick black
1c75ac5bd3
plot: implement minchannel with ncplane_stain() #136
2020-04-03 08:27:08 -04:00
nick black
8f65958a53
plot: use at least maxchannel #136
2020-04-03 08:27:08 -04:00
nick black
68b4ba1706
plots: implement remaining vertical grid types #136
2020-04-03 08:27:08 -04:00
nick black
5f3eb3dc24
keyplot: add third plot, this one with half blocks #433
2020-04-03 08:27:08 -04:00
nick black
42eb18893e
plots: multiple rows #136
2020-04-03 08:27:08 -04:00
nick black
6b74ea7718
plot: fix off-by-one on wide window shift, asdd unit test
2020-04-03 08:27:08 -04:00
nick black
8a23124c4a
plots: implement basic redraw_plot() #136
2020-04-03 05:51:02 -04:00
nick black
f1f94deda8
keyplot: input loop #430
2020-04-03 05:51:02 -04:00
nick black
a3f7dd486b
plot: AugmentSample5 test case
2020-04-03 05:51:02 -04:00
nick black
e8a4badf8b
plots: implement update_sample()
2020-04-03 05:51:02 -04:00
nick black
5bccf6b446
ncplot: implement x windowing #430
2020-04-03 05:51:02 -04:00
nick black
b3cda0d09f
notcurses-keyplot: throw a perimeter around base plane
2020-04-03 05:51:02 -04:00
nick black
d2fe768c30
plot unit tests #430
2020-04-03 05:51:02 -04:00
nick black
359303ed83
notcurses-keyplot: read input
2020-04-03 05:51:02 -04:00
nick black
4926186b5a
ncplot: check input parameters for validity #430
2020-04-03 05:51:02 -04:00
nick black
a2170a4291
ncplot: add_sample(), set_sample() #430
2020-04-03 05:51:02 -04:00
nick black
b3e874a179
ncplot: fold minx, maxx into rangex
2020-04-03 05:51:02 -04:00
nick black
09d8912d4e
notcurses-keyplot #430
2020-04-03 05:51:02 -04:00
nick black
5239900ac8
notcurses-input: upgrade shared_ptr to unique_ptr
2020-04-03 05:51:02 -04:00
nick black
5e27499194
add notcurses-keyplot #430
2020-04-03 05:51:02 -04:00
nick black
5aedb3491d
ncplot_plane(), ncplot_destroy()
2020-04-03 05:51:02 -04:00
nick black
d1724d6183
tetris: kill unnecessary return in MoveRight()
2020-04-02 12:40:38 -04:00
nick black
ac31bf3a12
awww fuck me in the ass #429
2020-03-29 06:52:13 -04:00
nick black
a45d888601
All fill-type functions return cells changed
...
Fill-type functions used to return 0 for success, and -1
on failure. They now return the number of cells written
on success, similarly to ncvisual_render(). Resolves #427 .
2020-03-29 05:26:56 -04:00
nick black
a3323fb22c
Enforce UTF8 where necessary in unit tests #428
...
Certain unit tests required UTF8 encoding on the output
terminal to work (#428 ). This includes anything which does
any kind of fill. Add enforce_utf8() checks to all such
tests that were missing them. Unit tests once again pass in
a pure ASCII environment.
2020-03-29 04:46:30 -04:00
nick black
bd7bf65c62
colloquy: spin up a rust notcurses instance
2020-03-28 00:11:00 -04:00
nick black
8651486ad7
Don't say DirectColor when TrueColor is meant
2020-03-27 12:58:30 -04:00
nick black
6c81cb3b45
rust: use libnotcurses-sys, add test
2020-03-27 06:27:26 -04:00
nick black
ddf206462b
colloquy: branch on widget type
2020-03-27 05:51:52 -04:00
nick black
a64119931a
colloquy: flesh out options parser
2020-03-27 05:27:59 -04:00
nick black
a77774f4dc
notcurses_at_yx(): value-result u32+u64, not cell
...
Resolves #410 . notcurses_at_yx() accepted a cell*, but the
gcluster of this cell was always set to 0. The EGC is instead
a heap-allocated copy, returned as the primary return value.
This is due to the absence of an egcpool to bind against.
Existing callers can be converted thus:
* instead of passing cell 'c', pass &(c)->attrword, &(c)->channels
* either initialize 'c' with CELL_TRIVIAL_INITIALIZER, or set its
gcluster field to 0 following the call
I've updated all calls from tests/demos, updated the docs, and
updated the C++ and Python wrappers.
2020-03-27 03:49:13 -04:00
nick black
73b61f6a69
Add bound planes ( #71 ) plus docs/tests
...
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.
2020-03-27 03:13:30 -04:00
nick black
5bcd643a68
tetris: increase gravity with level #421
2020-03-27 00:17:16 -04:00
nick black
4a02d7ed80
tetris: rewrite moveleft()/moveright() with invalidmove() #421
2020-03-27 00:04:12 -04:00
nick black
cb85e120e0
tetris: replace PieceStuck() with InvalidMove() #421
2020-03-26 23:59:13 -04:00
nick black
1665bbad8b
tetris: InvalidMove() for detecting bad rotations #421
2020-03-26 23:52:56 -04:00
nick black
5955125921
Tetris: remove dead code #421
2020-03-26 20:40:03 -04:00
nick black
925e416b8d
tetris: different colors for different levels
2020-03-26 20:19:57 -04:00
nick black
5b7e2f574c
tetris: fix up PieceStuck() #421
2020-03-26 20:10:25 -04:00
nick black
91f907a184
gradient_sized (C++): fix parameter name
2020-03-26 18:19:01 -04:00
nick black
ae792bbd5c
tetris: ctrl+L for refresh
2020-03-26 15:39:58 -04:00
nick black
752c29e648
Tetris: fix line clearing of final column #421
2020-03-26 15:33:14 -04:00
nick black
e500d0f8f4
tetris: print user name above score #421
2020-03-26 00:49:32 -04:00
nick black
4f6275b738
tetris: tighten LockPiece() still further
2020-03-26 00:41:54 -04:00
nick black
e84b896835
tetris: tighten up LockPiece()
2020-03-26 00:38:41 -04:00
nick black
34e4a5dbb9
tetris: display score and level #421
2020-03-26 00:34:19 -04:00
nick black
4afa02a44f
Tetris: clear out lines #421
2020-03-26 00:10:22 -04:00
nick black
1cd9ec2b31
tetris: clear out lines #421
2020-03-25 23:23:02 -04:00
nick black
ee754ed241
Tetris: simplify MoveDown(), don't be stupid
2020-03-25 23:10:31 -04:00
nick black
fff9118e17
tetris: factor out LockPiece()
2020-03-25 23:03:56 -04:00
nick black
d120e74580
Tetris: end game at the correct failpoint #421
2020-03-25 22:28:36 -04:00
nick black
d491d532bb
Tetris: gradient stain on fixed pieces #421
2020-03-25 22:27:23 -04:00
nick black
5864b37d0a
Tetris: place new pieces on mults of 2 #421
2020-03-25 22:12:46 -04:00
nick black
b7c9746cf0
Tetris: always move in chunks of two columns #421
2020-03-25 22:09:56 -04:00
nick black
642741f2c9
Tetris: take upper halves into account for PieceStuck()
2020-03-25 22:05:29 -04:00
nick black
d5e0b24f01
Tetris: PieceStuck() learns of lower halves
2020-03-25 21:52:23 -04:00
nick black
25dd65a172
Tetris: render after creating a new piece
2020-03-25 21:44:53 -04:00
Nick Black
f9c54761f5
Basic mandelbrot for n
ormal demo #145 ( #424 )
...
normal: working mandelbrot, very basic #145
2020-03-25 07:19:56 -04:00
Nick Black
de9158bd7b
More tetris work for book #421 ( #423 )
...
* 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
2020-03-25 04:06:38 -04:00
nick black
ae1421db15
ncvisual_render() API change/documentation #422
...
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
2020-03-24 18:43:10 -04:00
nick black
4e7d918732
Merge branch 'master' of github.com:dankamongmen/notcurses
2020-03-24 01:17:28 -04:00
nick black
0432a8a444
poc/zalgo: center output
2020-03-24 01:17:15 -04:00
nick black
84ef40143e
tetris: eliminate compiler warning
2020-03-23 01:13:25 -04:00
Nick Black
2b7b384e91
Most of notcurses-tetris, mergedown fixes ( #420 )
...
* ncplane_mergedown() fix for small planes #417
* tetris game needed for the book
2020-03-23 01:12:09 -04:00
nick black
c3feca6ded
ncplane_polyfill: reject null glyph + test #418
2020-03-22 23:10:13 -04:00
Nick Black
52bdbc6724
ncplane_translate() accept NULL dest as standard plane #408 ( #411 )
...
* tetris man page
* tetris basic skeleton
* tetris: Ticker()
* README: fix up some obsolete terminology
* tetris: draw the game board
* tetris: add NewPiece()
* tetris: draw tetriminos
* tetris: check for stuck piece, move it down
* Accept NULL dst in ncplane_translate() #408
2020-03-22 17:33:08 -04:00
nick black
fbd222b04a
notcurses_init(): mention setlocale in error
...
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 .
2020-03-21 20:28:50 -04:00
nick black
7e71ad8e11
implement ncplane_mergedown() #361
2020-03-21 05:09:31 -04:00
nick black
38f4255dc0
Define ncplane_mergedown() #361
...
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.
2020-03-21 05:09:31 -04:00
nick black
bb2c469168
Merge branch 'master' of github.com:dankamongmen/notcurses
2020-03-19 08:27:22 -04:00
nick black
12b601e02b
fallin': always push back NULLed out subwindows
...
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 .
2020-03-19 08:25:08 -04:00
nick black
bc3473da8a
demo: print unnecessary comma in JSON
2020-03-15 23:33:20 -04:00
Marek Habersack
3e78dd7d1f
[C++] API sync
...
New classes:
* MultiSelector (`ncmultiselector_*`)
Added:
* Direct: cursor_{enable,disable}
* Plane: high_gradient (`ncplane_highgradient`)
* Plane: high_gradient_sized (`ncplane_highgradient_sized`)
* Plane: rotate_cw (`ncplane_rotate_cw`)
* Plane: rotate_ccw (`ncplane_rotate_ccw`)
Updated:
* NotCurses: added all the margin initializers to the default options
2020-03-14 21:49:32 -04:00
nick black
ba90c70a47
ncplane_cursor_yx() takes const first argument
2020-03-14 21:15:37 -04:00
nick black
1b4333861a
add ncdirect_{en,dis}able_cursor() #402
2020-03-13 09:52:00 -04:00
nick black
d5d827f38e
adjust ncplane_yx() for margins
2020-03-13 06:53:52 -04:00
Nick Black
c056a0a026
Subregion renders #293 ( #404 )
...
Add four new fields to notcurses_options: margin_{tblr}, which requests margins to the top, right, bottom, and left. Render only within those margins, leaving the screen otherwise untouched (well, cleared if using the alternate screen). #293
2020-03-13 05:07:33 -04:00
nick black
982d729c69
switch to CLOCK_MONOTONIC from _RAW
2020-03-11 06:32:06 -04:00
nick black
d77aa78a0e
s/CLOCK_MONOTONIC_RAW/CLOCK_MONOTONIC/g
2020-03-11 05:46:33 -04:00
nick black
be089747a7
ncmultiselector_selected() #322
2020-03-09 15:31:16 -04:00
nick black
638be8feb7
multiselector options/items #322
2020-03-09 15:31:16 -04:00
nick black
a46393b035
ncmultiselect: get space rigged up #322
2020-03-09 15:31:16 -04:00
nick black
4abe078eae
ncmultiselector #322
2020-03-09 15:31:16 -04:00
nick black
667ac14549
ncmultiselector: draw properly
2020-03-09 15:31:16 -04:00
nick black
a9c64a8c8b
yummy covid-19
2020-03-09 15:31:16 -04:00
nick black
078feca8e6
ncmultiselector links up
2020-03-09 15:31:16 -04:00
nick black
635d6e5751
ncmultiselect demo
2020-03-09 15:31:16 -04:00
nick black
583906368c
add internal safe home_cursor()
2020-03-08 23:32:51 -04:00
nick black
eead4c1414
notcurses_highgradient() added #398
2020-03-08 04:05:55 -04:00