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

Function curses_clear_unhighlight_message_window

win/curses/cursmesg.c:382–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

380/* Clear the message window if one line; otherwise unhighlight old messages */
381
382void
383curses_clear_unhighlight_message_window(void)
384{
385 int mh, mw, rx, ry,
386 brdroffset = curses_window_has_border(MESSAGE_WIN) ? 1 : 0;
387 WINDOW *win = curses_get_nhwin(MESSAGE_WIN);
388
389 turn_lines = 0;
390 curses_set_wid_colors(MESSAGE_WIN, NULL);
391 curses_get_window_size(MESSAGE_WIN, &mh, &mw);
392
393 if (mh == 1) {
394 curses_clear_nhwin(MESSAGE_WIN);
395 mx = my = brdroffset;
396 } else {
397 mx = mw + brdroffset; /* Force new line on new turn */
398
399 for (ry = brdroffset; ry < mh; ry++) {
400 for (rx = brdroffset; rx < mw; rx++) {
401 chtype cht = mvwinch(win, ry, rx);
402
403 mvwchgat(win, ry, rx, 1, A_NORMAL, PAIR_NUMBER(cht), NULL);
404 }
405 }
406
407 wnoutrefresh(win);
408 }
409 wmove(win, my, mx);
410}
411
412
413/* Reset message window cursor to starting position, and display most

Callers 4

curses_blockFunction · 0.85
curs_scroll_invtFunction · 0.85
curses_posthousekeepingFunction · 0.85

Calls 5

curses_window_has_borderFunction · 0.85
curses_get_nhwinFunction · 0.85
curses_set_wid_colorsFunction · 0.85
curses_get_window_sizeFunction · 0.85
curses_clear_nhwinFunction · 0.85

Tested by

no test coverage detected