Commit Graph

79 Commits

Author SHA1 Message Date
nick black
d467367ff5 nctetris: kill off bogus cast 2021-08-20 08:44:56 -05:00
nick black
89729e3315
use PRIu64 in place of %ju #2062 2021-08-15 22:56:04 -04:00
nick black
305e8fceea
move call to termname() into interrogate_terminfo() #2023 2021-08-05 00:56:58 -04:00
nick black
0d289958f9
death to sigset_t #1967 2021-07-25 00:38:33 -04:00
nick black
4f1de02710
replace random() with rand() for windows goodness 2021-07-24 15:18:02 -04:00
nick black
bc4f2a3626
CHANNELS_RGB_ -> NCCHANNELS_ 2021-07-10 17:54:06 -04:00
nick black
cadd4aefee s/CELL_ALPHA_/NCCELL_ALPHA_/g 2021-06-13 18:21:14 -04:00
nick black
3eb004b61d s/channels/ncchannels/g #1570 2021-04-29 01:32:08 -04:00
nick black
da1b8d1d53
install version.h #1054 2020-10-10 20:53:45 -04:00
nick black
b7a57eaab7 convert all channel rgb calls #985 2020-09-18 01:39:21 -04:00
nick black
5d9cc8a098 tetris: fix up staining #974 2020-08-30 16:50:31 -04:00
nick black
4dd1d6a4c8 Annihilate nc_err_e and all infrastructure #948 2020-08-24 17:20:29 -04:00
Nick Black
359ad1d36d
Generalized mergedown #779 (#932)
* Rename ncplane_mergedown -> ncplane_mergedown_simple()
* New ncplane_mergedown(), fully general projection of src to dst
2020-08-20 23:51:35 -04:00
nick black
a2c95814b7 Remove cell_simple_p()
Get notcurses-tetris working again, since its collision
detection relied on simple vs non-simple EGCs, which are
no longer an operative concept. Closes #899.
2020-08-16 15:57:32 -04:00
nick black
dab269f506
tetris: ensure continued color changes #825 2020-07-25 23:11:28 -04:00
nick black
6d2ba86acc
Clear screen if we want smcup but it's not available #817 2020-07-22 17:53:46 -04:00
nick black
a76ee9a5af
tetris: refresh on startup in place of erase() 2020-07-22 13:34:18 -04:00
nick black
7a459abd56
tetris: clear screen in case background isn't available 2020-07-21 22:37:49 -04:00
Nick Black
50ce76bad8
Add kernel unicode-to-font mappings dynamically for line-drawing characters (#794)
Part 1 of a two-part revolution in Linux console graphics. Map all the line-drawing Unicode characters to similar glyphs. This means all our nice corners freely translate into rigid corners etc in the console, rather than hateful default characters (usually black diamonds). The demo and all widgets now look correct when drawing lines and boxes. Next, we'll add the actual glyphs for the block-drawing characters, and we'll have the finest graphics ever seen on a text-mode Linux console. #201
2020-07-13 18:04:43 -04:00
nick black
992eaea8d0
tetris: swap colors on level change 2020-07-12 08:29:51 -04:00
nick black
894c6d15f6
tetris: start on level 1 2020-07-12 03:12:42 -04:00
Nick Black
ebcba82d4b
Fully general ncvisual layer (#647)
This represents an essentially complete rewrite of ncvisual and associated code. It had two major goals:

Improve the ncvisual API based off lessons learned, pursuant to the upcoming API freeze. In particular, I wanted to:

decouple ncvisuals from ncplanes. It should be possible to render a ncvisual to multiple planes, with different scaling each time. It should be possible to create an ncvisual without a plane, etc.
normalize the various ways of constructing an ncvisual -- file, memory, plane, etc.
Support multiple blitters, from 7-bit ASCII to Sixel. This required writing the blitters in several cases, and they're not yet in their final implementations (but the API is fine)
I have not yet unified Plots and Visuals, and might not, given that the Plot code works fine. We could at this point implement Plots in terms of Visuals, though -- the blitter backend range has been unified. Sixel is not yet implemented, though it is listed.

There is a new POC tool, blitter. It renders its arguments using all possible blitter+scaling combinations. Another new POC, resize, displays its argument, then resizes it to the screen size and displays that, explicitly making use of ncvisual_resize() rather than a scaling parameter to ncvisual_render().

This also eliminates some memory leaks and bugs we were seeing in trunk, and brings in Sixel scaffolding.

The C++ wrapper will also need patching back up; I cut most of it down while wrestling with this crap, urk.

Closes #638, #562, and #622.
2020-05-28 21:16:58 -04:00
nick black
8971bda0c2 ncpp: stop() resets _instance, add unit test #538 2020-05-24 03:34:46 -04:00
nick black
4ab0e67155
tetris: rely on c++ exceptions #621 2020-05-21 17:37:39 -04:00
nick black
e5b1c2cdea
view/demo/tetris: NCOPTION_INHIBIT_SETLOCALE 2020-05-19 08:52:36 -04:00
nick black
dd044c96c8
tetris: replace cuserid with getpwuid #577 2020-05-09 03:36:36 -04:00
nick black
e2a94817e7 tests: lots of NULL->nullptr 2020-05-08 21:42:04 -04:00
nick black
384bdf88b2 tetris: use C++ refresh() 2020-05-08 21:42:04 -04:00
nick black
88d14f2f9e
tetris: #include <array>, needed on freebsd #573 2020-05-07 17:28:25 -04:00
nick black
f63325db60 Lots of ncvisual work
Unify ffmpeg/oiio/null implementations, where possible. This effectively
required placing all three in the same file, which meant they're all now
C++. Update FFmpeg implemenation to be C++-usable. Implement
ncvisual_rotate_cw() and ncvisual_rotate_ccw() #515. Move most of tetris
over to Visual from Plane #558. Add bgra_to_rgba(), necessary for
creating ncvisual from BGRA memory. Implement ncvisual_from_rgba()
and ncvisual_from_bgra() #557. Add unit tests on ncvisual rotation.
2020-05-06 01:02:46 -04:00
nick black
803296fb80 tetris: curpiece is now a Visual, not a Plane #558 2020-05-06 01:02:46 -04:00
nick black
9f211c75f9
rename jpeg -> jpg 2020-04-25 19:13:37 -04:00
nick black
0b4ada19b1 Remove AVFrame from API #532 2020-04-24 04:17:56 -04:00
nick black
2037cdfacb move libav.c to nc_err_e #532 2020-04-24 04:17:56 -04:00
nick black
60e3e604a8
Handle fallout from reversion of Notcurses::render() semantic inversion (see #510) 2020-04-18 15:28:26 -04:00
Nick Black
c6a9997554
Normalize ncplane_at_* / ncplane_set_base() (#479)
* ncplane_at_* and ncplane_at_cursor_*

We had notcurses_at_yx() expanding into three distinct parts of
the cell structure, and ncplane_at_yx() / ncplane_at_cursor()
writing directly to a cell. It was annoying to remember which
was which. The latter two now have a signature matching
notcurses_at_yx(), while the old functionality has been moved
to ncplane_at_yx_cell() and ncplane_at_cursor_yx(). #476
2020-04-18 00:09:14 -04:00
nick black
ffdee735cb
Tetris: update to reflect ncpp render() return value inversion #484 2020-04-15 12:49:37 -04:00
nick black
33e4341a67 tetris: use background from installed path #466 2020-04-10 18:05:19 -04:00
nick black
78142bcddc Tetris: import version.h for USE_FFMPEG 2020-04-08 05:54:03 -04:00
Nick Black
c2a645e9af
Rust wrapper work (#454)
* packaging: s/libtinfo/Terminfo/g
* rust: add stddim_yx()
* rust: check for valid init in unit tests
* rust: serialize up tests
* constify notcurses_term_dim_yx()
* rust: add dim wrappers
* remove notcurses_resize() from public API #367
* call notcurses_resize() from notcurses_refresh() #367
2020-04-08 05:39:41 -04:00
Nick Black
d66549d362
Prep for Fedora packaging (#452)
* jungle demo should be available outside of DFSG builds
* libav: blitters don't need FFMpeg
* CMake: threads independent of ffmpeg
* CMake: add USE_TESTS option to disable tests #450
* tetris: work without ffmpeg
* fedora: flesh out specfile #328
* menu poc: don't use ffmpeg at all
* compile PoCs with binary/include
* multiselect PoC: work without ffmpeg
2020-04-08 02:12:46 -04:00
nick black
312d15d0f9
mathtext poc: enable scrolling 2020-04-07 16:20:08 -04:00
nick black
2852ff736c
tetris: factor out MoveLateral() 2020-04-07 16:00:32 -04:00
nick black
d30858e60d tetris: factor out MAX_LEVEL 2020-04-04 12:32:19 -04:00
nick black
d1724d6183
tetris: kill unnecessary return in MoveRight() 2020-04-02 12:40:38 -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
5bcd643a68
tetris: increase gravity with level #421 2020-03-27 00:17:16 -04:00