summaryrefslogtreecommitdiff
path: root/src/w32console.c
diff options
context:
space:
mode:
authorGeoff Voelker <voelker@cs.washington.edu>1996-01-21 00:28:26 +0000
committerGeoff Voelker <voelker@cs.washington.edu>1996-01-21 00:28:26 +0000
commit6aac6d07ca3973e3f97d1599df52aaeb4c3be5ce (patch)
treec42b4a968ad2d1d77fd4acfce6fc6183534bcade /src/w32console.c
parent90ed8fe71fc11bd4a7b6868a908260ee50312d0a (diff)
downloademacs-6aac6d07ca3973e3f97d1599df52aaeb4c3be5ce.tar.gz
(clear_frame): Use FillConsoleOutput* calls instead of
ScrollConsoleScreenBuffer (which has a bug on Win95).
Diffstat (limited to 'src/w32console.c')
-rw-r--r--src/w32console.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/src/w32console.c b/src/w32console.c
index 102693d44e1..31ec9363569 100644
--- a/src/w32console.c
+++ b/src/w32console.c
@@ -123,25 +123,18 @@ clear_to_end (void)
void
clear_frame (void)
{
- SMALL_RECT scroll;
- COORD dest;
- CHAR_INFO fill;
FRAME_PTR f = PICK_FRAME ();
-
+ COORD dest;
+ int n, r;
+
hl_mode (0);
- scroll.Top = 0;
- scroll.Bottom = FRAME_HEIGHT (f) - 1;
- scroll.Left = 0;
- scroll.Right = FRAME_WIDTH (f) - 1;
-
- dest.Y = FRAME_HEIGHT (f);
- dest.X = 0;
-
- fill.Char.AsciiChar = 0x20;
- fill.Attributes = char_attr;
-
- ScrollConsoleScreenBuffer (cur_screen, &scroll, NULL, dest, &fill);
+ n = FRAME_HEIGHT (f) * FRAME_WIDTH (f);
+ dest.X = dest.Y = 0;
+
+ FillConsoleOutputAttribute (cur_screen, char_attr, n, dest, &r);
+ FillConsoleOutputCharacter (cur_screen, ' ', n, dest, &r);
+
move_cursor (0, 0);
}
@@ -347,6 +340,9 @@ write_glyphs (register GLYPH *string, register int len)
char *chars;
int i;
+ if (len <= 0)
+ return;
+
attrs = alloca (len * sizeof (*attrs));
chars = alloca (len * sizeof (*chars));
if (attrs == NULL || chars == NULL)