[qwaq] Ensure background color clearing works

Even with 0 for the character, colors should get into the buffer.
This commit is contained in:
Bill Currie 2020-03-19 20:39:23 +09:00
parent 3a28d84c3f
commit f329ca83b6

View file

@ -91,6 +91,9 @@
int *dst = buffer; int *dst = buffer;
int *end = buffer + size.width * size.height; int *end = buffer + size.width * size.height;
if (ch && !(ch & 0xff)) {
ch |= ' ';
}
while (dst < end) { while (dst < end) {
*dst++ = ch; *dst++ = ch;
} }
@ -129,10 +132,7 @@
cursor.y++; cursor.y++;
} else if (ch == '\r') { } else if (ch == '\r') {
cursor.x = 0; cursor.x = 0;
} else if (ch & 0xff) { } else {
if ((ch & 0xff) < 32) {
ch = (ch & ~0xff) | 32;
}
if (!(ch & ~0xff)) { if (!(ch & ~0xff)) {
ch |= background & ~0xff; ch |= background & ~0xff;
} }