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

Function tty_destroy_nhwindow

win/tty/wintty.c:2008–2032  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2006}
2007
2008void
2009tty_destroy_nhwindow(winid window)
2010{
2011 struct WinDesc *cw = 0;
2012
2013 if (window == WIN_ERR || (cw = wins[window]) == (struct WinDesc *) 0) {
2014 if (window == WIN_INVEN) /* Null wins[WIN_INVEN] is tolerated */
2015 return;
2016 ttywindowpanic();
2017 }
2018
2019 if (cw->active)
2020 tty_dismiss_nhwindow(window);
2021 if (cw->type == NHW_MESSAGE)
2022 iflags.window_inited = 0;
2023 if (cw->type == NHW_MAP)
2024 term_clear_screen();
2025#ifdef TTY_PERM_INVENT
2026 if (cw->type == NHW_MENU && cw->mbehavior == MENU_BEHAVE_PERMINV)
2027 ttyinv_remove_data(cw, TRUE);
2028#endif
2029 free_window_info(cw, TRUE);
2030 free((genericptr_t) cw);
2031 wins[window] = 0; /* available for re-use */
2032}
2033
2034/* when screen is cleared, reset stored data to spaces */
2035void

Callers 4

new_status_windowFunction · 0.85
tty_preference_updateFunction · 0.85
tty_display_fileFunction · 0.85
ttyinv_create_windowFunction · 0.85

Calls 4

tty_dismiss_nhwindowFunction · 0.85
ttyinv_remove_dataFunction · 0.85
free_window_infoFunction · 0.85
term_clear_screenFunction · 0.70

Tested by

no test coverage detected