diff options
Diffstat (limited to 'screen.c')
-rw-r--r-- | screen.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -196,11 +196,11 @@ void erase_screen(){ erase_line(i); } -void check_bound(){ - if (x<0) x=0; - else if (x>=WIDTH) x = WIDTH-1; - if (y<0) y=0; - else if (y>=HEIGHT) y = HEIGHT -1; +void check_bound(int *x, int *y){ + if (*x<0) *x=0; + else if (*x>=WIDTH) *x = WIDTH-1; + if (*y<0) *y=0; + else if (*y>=HEIGHT) *y = HEIGHT -1; } void reset_styles(){ @@ -242,7 +242,7 @@ void go_to(int where){ y = HEIGHT/2; break; } - check_bound(); + check_bound(&x, &y); show_cursor(); } @@ -279,7 +279,7 @@ void handle_goto(){ go_to(MIDDLE); break; } - check_bound(); + check_bound(&x, &y); show_cursor(); } |