aboutsummaryrefslogtreecommitdiffstats
path: root/src/ansi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ansi.c')
-rw-r--r--src/ansi.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/ansi.c b/src/ansi.c
index bdc3a56..3e925c5 100644
--- a/src/ansi.c
+++ b/src/ansi.c
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
/*
* $Log$
+ * Revision 1.6 2008/02/06 17:53:28 james
+ * *** empty log message ***
+ *
* Revision 1.5 2008/02/06 15:53:22 james
* *** empty log message ***
*
@@ -216,6 +219,7 @@ ansi_set_attr (ANSI * a, int attr)
}
else
{
+ ansi_write (a, "\033[21m", 5);
ansi_write (a, "\033[22m", 5);
}
}
@@ -267,8 +271,10 @@ ansi_draw (ANSI * a, CRT * c)
{
CRT_Pos p;
int o;
+ int hidden_cursor=0;
+
+
- ansi_showhide_cursor (a, 1);
for (p.y = 0; p.y < CRT_ROWS; ++p.y)
{
@@ -281,6 +287,7 @@ ansi_draw (ANSI * a, CRT * c)
continue;
if (crt_ca_cmp (a->crt.screen[o], c->screen[o]))
{
+ ansi_showhide_cursor (a, 1);
a->crt.screen[o] = c->screen[o];
ansi_move (a, p);
@@ -289,6 +296,27 @@ ansi_draw (ANSI * a, CRT * c)
}
}
+
+ if ((CRT_COLS>a->size.x) || (CRT_ROWS>a->size.y)) {
+ char msg[]="Window is too small";
+ p.x=0;
+ p.y=0;
+
+ ansi_showhide_cursor (a, 1);
+ ansi_set_attr (a, CRT_ATTR_REVERSE);
+ ansi_move(a,p);
+
+ ansi_write (a, msg, sizeof(msg));
+ a->pos.x = ANSI_INVAL;
+ }
+
+
+ if ((c->pos.x>=a->size.x)
+ || (c->pos.y>=a->size.y)) {
+ ansi_showhide_cursor (a, 1);
+ return;
+ }
+
a->crt.pos = c->pos;
ansi_move (a, a->crt.pos);