Browse Source

Reset screen on exit as well as entry

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
82ec3fc5cc
1 changed files with 3 additions and 6 deletions
  1. 3
    6
      src/hci/mucurses/ansi_screen.c

+ 3
- 6
src/hci/mucurses/ansi_screen.c View File

4
 unsigned short _COLS = 80;
4
 unsigned short _COLS = 80;
5
 unsigned short _LINES = 24;
5
 unsigned short _LINES = 24;
6
 
6
 
7
-static void ansiscr_init ( struct _curses_screen *scr ) {
7
+static void ansiscr_reset ( struct _curses_screen *scr ) {
8
 	/* Reset terminal attributes and clear screen */
8
 	/* Reset terminal attributes and clear screen */
9
 	scr->attrs = 0;
9
 	scr->attrs = 0;
10
 	scr->curs_x = 0;
10
 	scr->curs_x = 0;
12
 	printf ( "\033[0m\033[2J\033[1;1H" );
12
 	printf ( "\033[0m\033[2J\033[1;1H" );
13
 }
13
 }
14
 
14
 
15
-static void ansiscr_exit ( struct _curses_screen *scr __unused ) {
16
-}
17
-
18
 static void ansiscr_movetoyx ( struct _curses_screen *scr,
15
 static void ansiscr_movetoyx ( struct _curses_screen *scr,
19
 			       unsigned int y, unsigned int x ) {
16
 			       unsigned int y, unsigned int x ) {
20
 	if ( ( x != scr->curs_x ) || ( y != scr->curs_y ) ) {
17
 	if ( ( x != scr->curs_x ) || ( y != scr->curs_y ) ) {
60
 }
57
 }
61
 
58
 
62
 SCREEN _ansi_screen = {
59
 SCREEN _ansi_screen = {
63
-	.init		= ansiscr_init,
64
-	.exit		= ansiscr_exit,
60
+	.init		= ansiscr_reset,
61
+	.exit		= ansiscr_reset,
65
 	.movetoyx	= ansiscr_movetoyx,
62
 	.movetoyx	= ansiscr_movetoyx,
66
 	.putc		= ansiscr_putc,
63
 	.putc		= ansiscr_putc,
67
 	.getc		= ansiscr_getc,
64
 	.getc		= ansiscr_getc,

Loading…
Cancel
Save