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

Function curses_init_options

win/curses/cursinit.c:744–801  ·  view source on GitHub ↗

Initialize and display options appropriately */

Source from the content-addressed store, hash-verified

742
743/* Initialize and display options appropriately */
744void
745curses_init_options(void)
746{
747 /* change these from set_gameview to set_in_game */
748 set_wc_option_mod_status(WC_ALIGN_MESSAGE | WC_ALIGN_STATUS, set_in_game);
749
750 /* Remove a few options that are irrelevant to this windowport */
751 set_option_mod_status("eight_bit_tty", set_in_config);
752
753 /* If we don't have a symset defined, load the curses symset by default */
754 if (!gs.symset[PRIMARYSET].explicitly)
755 load_symset("curses", PRIMARYSET);
756 if (!gs.symset[ROGUESET].explicitly)
757 load_symset("default", ROGUESET);
758
759#ifdef PDCURSES
760 /* PDCurses for SDL, win32 and OS/2 has the ability to set the
761 terminal size programmatically. If the user does not specify a
762 size in the config file, we will set it to a nice big 32x110 to
763 take advantage of some of the nice features of this windowport. */
764 if (iflags.wc2_term_cols == 0)
765 iflags.wc2_term_cols = 110;
766 if (iflags.wc2_term_rows == 0)
767 iflags.wc2_term_rows = 32;
768
769 resize_term(iflags.wc2_term_rows, iflags.wc2_term_cols);
770 getmaxyx(base_term, term_rows, term_cols);
771
772 /* This is needed for an odd bug with PDCurses-SDL */
773/* How to deal with this?
774 switch_graphics(ASCII_GRAPHICS);
775 if (iflags.IBMgraphics) {
776 switch_graphics(IBM_GRAPHICS);
777 } else if (iflags.cursesgraphics) {
778 switch_graphics(CURS_GRAPHICS);
779 } else {
780 switch_graphics(ASCII_GRAPHICS);
781 }
782*/
783#endif /* PDCURSES */
784
785 /* FIXME: this overrides explicit OPTIONS=!use_inverse */
786 iflags.wc_inverse = TRUE; /* aka iflags.use_inverse; default is False */
787
788 /* curses doesn't support 's' (single message at a time; successive
789 ^P's go back to earlier messages) and 'c' (combination; single
790 on first and second of consecutive ^P's, full on third) */
791 if (iflags.prevmsg_window != 'f')
792 iflags.prevmsg_window = 'r';
793
794#ifdef NCURSES_MOUSE_VERSION
795 if (iflags.wc_mouse_support) {
796 curses_mouse_support(iflags.wc_mouse_support);
797 }
798#else
799 iflags.wc_mouse_support = 0;
800#endif
801}

Callers 1

curses_init_nhwindowsFunction · 0.85

Calls 4

set_wc_option_mod_statusFunction · 0.85
set_option_mod_statusFunction · 0.85
load_symsetFunction · 0.85
curses_mouse_supportFunction · 0.85

Tested by

no test coverage detected