MCPcopy Create free account
hub / github.com/NetHack/NetHack / curses_display_splash_window

Function curses_display_splash_window

win/curses/cursinit.c:804–835  ·  view source on GitHub ↗

Display an ASCII splash screen if the splash_screen option is set */

Source from the content-addressed store, hash-verified

802
803/* Display an ASCII splash screen if the splash_screen option is set */
804void
805curses_display_splash_window(void)
806{
807 int i, x_start, y_start;
808
809 curses_get_window_xy(MAP_WIN, &x_start, &y_start);
810
811 if ((term_cols < 70) || (term_rows < 20)) {
812 iflags.wc_splash_screen = FALSE; /* No room for s.s. */
813 }
814
815 if (iflags.wc_splash_screen) {
816 if (iflags.wc2_guicolor)
817 curses_toggle_color_attr(stdscr, CLR_WHITE, A_NORMAL, ON);
818 mvaddstr(y_start, x_start, NETHACK_SPLASH_A);
819 mvaddstr(y_start + 1, x_start, NETHACK_SPLASH_B);
820 mvaddstr(y_start + 2, x_start, NETHACK_SPLASH_C);
821 mvaddstr(y_start + 3, x_start, NETHACK_SPLASH_D);
822 mvaddstr(y_start + 4, x_start, NETHACK_SPLASH_E);
823 mvaddstr(y_start + 5, x_start, NETHACK_SPLASH_F);
824 y_start += 7;
825 }
826 if (iflags.wc2_guicolor)
827 curses_toggle_color_attr(stdscr, CLR_WHITE, A_NORMAL, OFF);
828
829 for (i = 1; i <= 4; ++i) {
830 mvaddstr(y_start, x_start, copyright_banner_line(i));
831 y_start++;
832 }
833
834 refresh();
835}
836
837/* Restore colors and cursor state before exiting */
838void

Callers 1

curses_init_nhwindowsFunction · 0.85

Calls 4

curses_get_window_xyFunction · 0.85
curses_toggle_color_attrFunction · 0.85
copyright_banner_lineFunction · 0.85
refreshFunction · 0.85

Tested by

no test coverage detected