From b7bc693ef7e99a85921b6548d5bb480615dd57b0 Mon Sep 17 00:00:00 2001 From: nick black Date: Sun, 19 Jan 2020 04:39:15 -0500 Subject: [PATCH] i'm WarMECH, bitch --- README.md | 6 +++--- data/warmech.bmp | Bin 0 -> 10138 bytes src/demo/luigi.c | 27 ++++++++++++++++++++++++++- 3 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 data/warmech.bmp diff --git a/README.md b/README.md index b49af83a9..b51354d8d 100644 --- a/README.md +++ b/README.md @@ -2561,9 +2561,9 @@ up someday **FIXME**. POSIX, eliminating the need for me to cons up something similar. * I one night read the entirety of Lexi Summer Hale's [essays](http://xn--rpa.cc/irl/index.html), and woke up intending to write notcurses. -* NES art was lifted from [The Spriters Resource](https://www.spriters-resource.com/nes/), - the kind of site that makes the Internet great. It probably violates any - number of copyrights. C'est la vie. +* NES art was lifted from [The Spriters Resource](https://www.spriters-resource.com/nes/) + and [NES Sprite](http://nes-sprite.resampled.ru/), the kind of sites that + make the Internet great. It probably violates any number of copyrights. C'est la vie. * Mark Ferrari, master of the pixel, for no good reason allowed me to reproduce his incredible and groundbreaking color-cycling artwork. Thanks Mark! * Finally, the [demoscene](https://en.wikipedia.org/wiki/Demoscene) and general diff --git a/data/warmech.bmp b/data/warmech.bmp new file mode 100644 index 0000000000000000000000000000000000000000..0872d3e7fccc0bd01dc5180056e21d00786614d5 GIT binary patch literal 10138 zcmeH{J93ms5QGQt366lbK1Yy)g@eg8c0F+dj=*I_Wvjp1?3(@`J%b>EphB&BXJvK& z(!;0k|6H1Ui{D@4eCX%Z<^APN*zY3$-`nRCZkMOa<@rbc)5FKl|B^YYU!N`f^XlT} zbbHgYx9wJs$M^bwcJAr%@$u@|Ud(fT&7SoU>;3fp3Z4AmfbLul^G_4`4SR4`yL{PA zn*F{!jtdYs4fgNQji>W9UM+XPe~WYOU-2gX7RG9P*hRcGOPU=fvz@2U%ecQO_V}XD zbG-RZyZzn6Tb!9I+YVz|Z0il_MROPIV0d7Id#}!W*UUP{V$8`s;i?{NY3}3~aEFt0 z;|^bGaeoXO7MZ}r_92S2}O_)8o2qd8g2H%PC&#SzA>`8Jzx!1*uiFz^Sf?$UR~O^4o_yY+c)+FbSA0*V808)I`tQvp?*JP9AIb0M%#3^o_TSk7+_U=h ze9dOQ^bLQDZ4dQiRx^ia@T743BV5c)nFthF; zJaQ*-RF*x?1#ZeKu359AJhjq>7v?ExJ=_Zz>=p>h?@7*t$C*6>F#C4wy}7g8fa&+u zXVjjde#XD|4Ry1adR?rh&OGC{H?Qw5zu=}%PFhDoOg+S18&*>H7=1k!YFQdTX6ik# zr2{QbjpK`$>hP;pt_rxkKm9!(>L$735GcuCwsVt@C|>immYRwwUwcTv=ry5kl7Vv| zT=Djp+s?uHil5h2TYf#(AE}#UmRMq#Nbu;@cpR?679b6rRgI^&2#4e{|7z3vPZtH zdbtbcxK2ODYvo+z`wrw3_daa$(#$!~kzSJI6J0rj`O=D4QOx%^dJpgSIqE|kGwfAq zFwr#Z;68Jti92t_*~$0ERvw{Wy6#YFqGU;uLv*!oLR!bU))>6069?IFN5hT0_ALR>!lrCq3}mK^coM|epZm*^PYM7|%*b|2e0DaHEXsB*S+!!Al-+4)mN!JsjjCs^idGbM#3|s1Lm&t*`V?WAF&@+<_SV(h}8B z=QW>Vz3WW%iWKC92HeYg0@zhma? q%9}j*iQjdosZ8;sQt_9THXFXKV{qm5(p>JvuYBFV7yEC2xq%-}W0Ru* literal 0 HcmV?d00001 diff --git a/src/demo/luigi.c b/src/demo/luigi.c index 900ad32c6..335b8f164 100644 --- a/src/demo/luigi.c +++ b/src/demo/luigi.c @@ -182,7 +182,29 @@ int luigi_demo(struct notcurses* nc){ } struct timespec stepdelay; ns_to_timespec(timespec_to_ns(&demodelay) / (cols - 16 - 1), &stepdelay); - for(i = 0 ; i < cols - 16 - 1 ; ++i){ + struct ncvisual* wmncv = NULL; + char* fname = find_data("warmech.bmp"); + if(fname == NULL){ + return -1; + } + wmncv = ncvisual_open_plane(nc, fname, &averr, 0, 0, NCSCALE_NONE); + free(fname); + if(wmncv == NULL){ + return -1; + } + if(ncvisual_decode(wmncv, &averr) == NULL){ + ncvisual_destroy(wmncv); + return -1; + } + cell b = CELL_TRIVIAL_INITIALIZER; + cell_set_fg_alpha(&b, CELL_ALPHA_TRANSPARENT); + cell_set_bg_alpha(&b, CELL_ALPHA_TRANSPARENT); + ncplane_set_base(ncvisual_plane(wmncv), &b); + if(ncvisual_render(wmncv, 0, 0, 0, 0)){ + ncvisual_destroy(wmncv); + return -1; + } + for(i = 0 ; i < cols - 16 - 1 + 50 ; ++i){ if(i + 16 >= cols - 16 - 1){ --yoff; }else{ @@ -191,6 +213,8 @@ int luigi_demo(struct notcurses* nc){ ncplane_move_top(lastseen); } ncplane_move_yx(lastseen, yoff, i); + int dimy = ncplane_dim_y(ncvisual_plane(wmncv)); + ncplane_move_yx(ncvisual_plane(wmncv), rows * 4 / 5 - dimy + 1 + (i % 2), i - 60); demo_render(nc); nanosleep(&stepdelay, NULL); } @@ -198,5 +222,6 @@ int luigi_demo(struct notcurses* nc){ ncplane_destroy(lns[i]); } ncvisual_destroy(nv); + ncvisual_destroy(wmncv); return 0; }