From: nethack.allison Date: Sat, 15 Jan 2005 14:04:03 +0000 (+0000) Subject: win32tty: prevent early messages from flashing by unseen X-Git-Tag: MOVE2GIT~1353 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7b83a76bffdcef9f07c46810e63e5359dbc7cd86;p=nethack win32tty: prevent early messages from flashing by unseen --- diff --git a/include/ntconf.h b/include/ntconf.h index 21eff4f6e..17c17fb1e 100644 --- a/include/ntconf.h +++ b/include/ntconf.h @@ -151,6 +151,7 @@ extern void FDECL(nttty_preference_update, (const char *)); extern void NDECL(toggle_mouse_support); extern void FDECL(map_subkeyvalue, (char *)); extern void NDECL(load_keyboard_handler); +extern void NDECL(raw_clear_screen); #endif #include diff --git a/sys/share/pcmain.c b/sys/share/pcmain.c index 18f24bd6a..eca498128 100644 --- a/sys/share/pcmain.c +++ b/sys/share/pcmain.c @@ -105,6 +105,7 @@ char *argv[]; register char *dir; #if defined(WIN32) char fnamebuf[BUFSZ], encodedfnamebuf[BUFSZ]; + boolean save_getreturn_status; #endif #ifdef NOCWD_ASSUMPTIONS char failbuf[BUFSZ]; @@ -172,6 +173,11 @@ char *argv[]; chdirx(HACKDIR, 1); # endif ami_wininit_data(); +#endif +#ifdef WIN32CON + save_getreturn_status = getreturn_enabled; + raw_clear_screen(); + getreturn_enabled = TRUE; #endif initoptions(); @@ -243,6 +249,9 @@ char *argv[]; } } +#ifdef WIN32 + getreturn_enabled = save_getreturn_status; +#endif /* * It seems you really want to play. */ diff --git a/sys/winnt/nttty.c b/sys/winnt/nttty.c index 5541bb844..e71622dbd 100644 --- a/sys/winnt/nttty.c +++ b/sys/winnt/nttty.c @@ -498,7 +498,7 @@ cl_end() void -clear_screen() +raw_clear_screen() { if (GetConsoleScreenBufferInfo(hConOut,&csbi)) { DWORD ccnt; @@ -514,6 +514,12 @@ clear_screen() csbi.dwSize.X * csbi.dwSize.Y, newcoord, &ccnt); } +} + +void +clear_screen() +{ + raw_clear_screen(); home(); }