From 8ee57096d2c98db95d5398997645962c38254ae1 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Fri, 25 Sep 2015 23:47:09 -0500 Subject: [PATCH] Fix bug where the rightmost few pixels of a cursor could sometimes be corrupted --- mouse.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mouse.cc b/mouse.cc index aed6c4f..472d005 100644 --- a/mouse.cc +++ b/mouse.cc @@ -272,10 +272,8 @@ void DoCursor (void) { if (rectWidth % 4) { *(imageLine + n) = 0; - switch (rectWidth - n * 4) { - case 3: *(imageLine + n) += coltab640[*(dataPtr++)] & 0x0C; - case 2: *(imageLine + n) += coltab640[*(dataPtr++)] & 0x30; - case 1: *(imageLine + n) += coltab640[*(dataPtr++)] & 0xC0; + for (j = 0; j < rectWidth % 4; j++) { + *(imageLine + n) += coltab640[*(dataPtr++)] & (0xC0 >> j*2); } *(imageLine + n) ^= 0xFF; /* Reverse color */ *(imageLine + n) &= *(maskLine + n);