src/ui-term.c
errr Term_clear(void)
{
	int x, y;

	int w = Term->wid;
	int h = Term->hgt;

	int na = Term->attr_blank;
	wchar_t nc = Term->char_blank;

	/* Cursor usable */
	Term->scr->cu = 0;

	/* Cursor to the top left */
	Term->scr->cx = Term->scr->cy = 0;

	/* Wipe each row */
	for (y = 0; y < h; y++) {
		int *scr_aa = Term->scr->a[y];
		wchar_t *scr_cc = Term->scr->c[y];
		int *scr_taa = Term->scr->ta[y];
		wchar_t *scr_tcc = Term->scr->tc[y];

		/* Wipe each column */
		for (x = 0; x < w; x++) {
			scr_aa[x] = na;
			scr_cc[x] = nc;

			scr_taa[x] = 0;
			scr_tcc[x] = 0;
		}

		/* This row has changed */
		Term->x1[y] = 0;
		Term->x2[y] = w - 1;
	}

	/* Every row has changed */
	Term->y1 = 0;
	Term->y2 = h - 1;

	/* Force "total erase" */
	Term->total_erase = TRUE;

	/* Success */
	return (0);
}
/**
 * Clear the entire window, and move to the top left corner
 *
 * Note the use of the special "total_erase" code
 */
Clear the entire window, and move to the top left corner
Note the use of the special "total_erase" code
Clear the entire window and move to the top left corner Note the use of the special " total_erase " code
errr Term_clear(void)
{
	int x, y;
	int w = Term->wid;
	int h = Term->hgt;
	int na = Term->attr_blank;
	wchar_t nc = Term->char_blank;
	Term->scr->cu = 0;
	Term->scr->cx = Term->scr->cy = 0;
	for (y = 0; y < h; y++) {
		int *scr_aa = Term->scr->a[y];
		wchar_t *scr_cc = Term->scr->c[y];
		int *scr_taa = Term->scr->ta[y];
		wchar_t *scr_tcc = Term->scr->tc[y];
		for (x = 0; x < w; x++) {
			scr_aa[x] = na;
			scr_cc[x] = nc;
			scr_taa[x] = 0;
			scr_tcc[x] = 0;
		}
		Term->x1[y] = 0;
		Term->x2[y] = w - 1;
	}
	Term->y1 = 0;
	Term->y2 = h - 1;
	Term->total_erase = TRUE;
	return (0);
}
errr Term_clear ( void ) { int x , y ; int w = Term -> wid ; int h = Term -> hgt ; int na = Term -> attr_blank ; wchar_t nc = Term -> char_blank ; Term -> scr -> cu = 0 ; Term -> scr -> cx = Term -> scr -> cy = 0 ; for ( y = 0 ; y < h ; y ++ ) { int * scr_aa = Term -> scr -> a [ y ] ; wchar_t * scr_cc = Term -> scr -> c [ y ] ; int * scr_taa = Term -> scr -> ta [ y ] ; wchar_t * scr_tcc = Term -> scr -> tc [ y ] ; for ( x = 0 ; x < w ; x ++ ) { scr_aa [ x ] = na ; scr_cc [ x ] = nc ; scr_taa [ x ] = 0 ; scr_tcc [ x ] = 0 ; } Term -> x1 [ y ] = 0 ; Term -> x2 [ y ] = w - 1 ; } Term -> y1 = 0 ; Term -> y2 = h - 1 ; Term -> total_erase = TRUE ; return ( 0 ) ; }
Clear the entire window, and move to the top left corner
 Note the use of the special "total_erase" code
Clear the entire window and move to the top left corner Note the use of the special " total_erase " code
/* Cursor usable */ /* Cursor to the top left */ /* Wipe each row */ /* Wipe each column */ /* This row has changed */ /* Every row has changed */ /* Force "total erase" */ /* Success */