summaryrefslogtreecommitdiff
path: root/games/tetris/screen.c
diff options
context:
space:
mode:
authorDavid Coppa <dcoppa@cvs.openbsd.org>2011-04-03 10:26:00 +0000
committerDavid Coppa <dcoppa@cvs.openbsd.org>2011-04-03 10:26:00 +0000
commit4a3ee66337a7c22eb506f7eb14f9561f76c94082 (patch)
tree0b3e5e5ce19e87b0406151b8edb48b9fd94c033d /games/tetris/screen.c
parent955c4b2765c723b52e26247105e6d8aa82587c81 (diff)
Hide the cursor during game. From NetBSD.
OK nicm@
Diffstat (limited to 'games/tetris/screen.c')
-rw-r--r--games/tetris/screen.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/games/tetris/screen.c b/games/tetris/screen.c
index 7b954f0cad7..b04a9a7618c 100644
--- a/games/tetris/screen.c
+++ b/games/tetris/screen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: screen.c,v 1.13 2006/04/20 03:25:36 ray Exp $ */
+/* $OpenBSD: screen.c,v 1.14 2011/04/03 10:25:59 dcoppa Exp $ */
/* $NetBSD: screen.c,v 1.4 1995/04/29 01:11:36 mycroft Exp $ */
/*-
@@ -80,7 +80,9 @@ static char
*LLstr, /* last line, first column */
*pcstr, /* pad character */
*TEstr, /* end cursor motion mode */
- *TIstr; /* begin cursor motion mode */
+ *TIstr, /* begin cursor motion mode */
+ *VIstr, /* make cursor invisible */
+ *VEstr; /* make cursor appear normal */
char
*SEstr, /* end standout mode */
*SOstr; /* begin standout mode */
@@ -107,6 +109,8 @@ struct tcsinfo { /* termcap string info; some abbrevs above */
{"so", &SOstr},
{"te", &TEstr},
{"ti", &TIstr},
+ {"vi", &VIstr},
+ {"ve", &VEstr},
{"up", &UP}, /* cursor up */
{ {0}, NULL}
};
@@ -291,6 +295,8 @@ scr_set(void)
*/
if (TIstr)
putstr(TIstr); /* termcap(5) says this is not padded */
+ if (VIstr)
+ putstr(VIstr); /* termcap(5) says this is not padded */
if (tstp != SIG_IGN)
(void) signal(SIGTSTP, scr_stop);
if (ttou != SIG_IGN)
@@ -321,6 +327,8 @@ scr_end(void)
/* exit screen mode */
if (TEstr)
putstr(TEstr); /* termcap(5) says this is not padded */
+ if (VEstr)
+ putstr(VEstr); /* termcap(5) says this is not padded */
(void) fflush(stdout);
(void) tcsetattr(0, TCSADRAIN, &oldtt);
isset = 0;