Windows console limits
This commit is contained in:
@@ -1182,6 +1182,11 @@ really_move_cursor()
|
|||||||
void
|
void
|
||||||
cmov(int x, int y)
|
cmov(int x, int y)
|
||||||
{
|
{
|
||||||
|
if (x >= console.width)
|
||||||
|
x = console.width - 1;
|
||||||
|
if (y >= console.height)
|
||||||
|
y = console.height - 1;
|
||||||
|
|
||||||
ttyDisplay->cury = y;
|
ttyDisplay->cury = y;
|
||||||
ttyDisplay->curx = x;
|
ttyDisplay->curx = x;
|
||||||
|
|
||||||
@@ -1221,8 +1226,11 @@ xputs(const char* s)
|
|||||||
int
|
int
|
||||||
xputc(int ch)
|
xputc(int ch)
|
||||||
{
|
{
|
||||||
set_console_cursor(ttyDisplay->curx, ttyDisplay->cury);
|
int x = ttyDisplay->curx, y = ttyDisplay->cury;
|
||||||
xputc_core(ch);
|
if (x < console.width && y < console.height) {
|
||||||
|
set_console_cursor(ttyDisplay->curx, ttyDisplay->cury);
|
||||||
|
xputc_core(ch);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1432,10 +1440,14 @@ term_end_24bitcolor(void)
|
|||||||
void
|
void
|
||||||
cl_end(void)
|
cl_end(void)
|
||||||
{
|
{
|
||||||
set_console_cursor(ttyDisplay->curx, ttyDisplay->cury);
|
if (ttyDisplay->curx < console.width
|
||||||
buffer_clear_to_end_of_line(console.back_buffer, console.cursor.X,
|
&& ttyDisplay->cury < console.height) {
|
||||||
console.cursor.Y);
|
set_console_cursor(ttyDisplay->curx, ttyDisplay->cury);
|
||||||
tty_curs(BASE_WINDOW, (int) ttyDisplay->curx + 1, (int) ttyDisplay->cury);
|
buffer_clear_to_end_of_line(console.back_buffer, console.cursor.X,
|
||||||
|
console.cursor.Y);
|
||||||
|
tty_curs(BASE_WINDOW, (int) ttyDisplay->curx + 1,
|
||||||
|
(int) ttyDisplay->cury);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user