mirror of
https://git.sr.ht/~calebccff/pbsplash
synced 2026-01-12 20:48:40 -09:00
render static logo on exit
This commit is contained in:
parent
86b7c8f1c3
commit
5780f60199
1 changed files with 8 additions and 13 deletions
|
|
@ -253,7 +253,7 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
LOG("active tty: '%s'\n", active_tty);
|
LOG("active tty: '%s'\n", active_tty);
|
||||||
|
|
||||||
if ((rc = tfb_acquire_fb(/*TFB_FL_USE_DOUBLE_BUFFER*/ 0, "/dev/fb0",
|
if ((rc = tfb_acquire_fb(/*TFB_FL_NO_TTY_KD_GRAPHICS */0, "/dev/fb0",
|
||||||
active_tty)) != TFB_SUCCESS) {
|
active_tty)) != TFB_SUCCESS) {
|
||||||
fprintf(stderr, "tfb_acquire_fb() failed with error code: %d\n",
|
fprintf(stderr, "tfb_acquire_fb() failed with error code: %d\n",
|
||||||
rc);
|
rc);
|
||||||
|
|
@ -341,26 +341,21 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
tfb_flush_window();
|
tfb_flush_window();
|
||||||
tfb_flush_fb();
|
tfb_flush_fb();
|
||||||
#define ANIM_HEIGHT 600
|
|
||||||
int frame = 0;
|
int frame = 0;
|
||||||
int tty = open(active_tty, O_RDWR);
|
int tty = open(active_tty, O_RDWR);
|
||||||
int tty_mode = 0;
|
|
||||||
while (!terminate) {
|
while (!terminate) {
|
||||||
animate_frame(frame++, w, h, dpi);
|
animate_frame(frame++, w, h, dpi);
|
||||||
tfb_flush_fb();
|
tfb_flush_fb();
|
||||||
ioctl(tty, KDGETMODE, &tty_mode);
|
|
||||||
// Login started and has reset the TTY back to text mode
|
|
||||||
if (tty_mode == KD_TEXT) {
|
|
||||||
// tfb_flush_window();
|
|
||||||
draw_svg(image, x, y, image_w, image_h);
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
// usleep(1666);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// free(animation_buf);
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
// Before we exit print the logo so it will persist
|
||||||
|
if (image) {
|
||||||
|
ioctl(tty, KDSETMODE, KD_TEXT);
|
||||||
|
draw_svg(image, x, y, image_w, image_h);
|
||||||
|
}
|
||||||
|
|
||||||
nsvgDelete(font);
|
nsvgDelete(font);
|
||||||
nsvgDelete(image);
|
nsvgDelete(image);
|
||||||
// The TTY might end up in a weird state if this
|
// The TTY might end up in a weird state if this
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue