mirror of
https://github.com/sheumann/VNCviewGS.git
synced 2024-11-21 10:33:40 +00:00
Replace a few mod-by-power-of-2 operations with bit masking, since ORCA/C wasn't optimizing them
This commit is contained in:
parent
8ee57096d2
commit
8861cb4a3a
6
mouse.cc
6
mouse.cc
@ -234,7 +234,7 @@ void DoCursor (void) {
|
||||
*(imageLine + n) ^= 0xFF; /* Reverse color */
|
||||
*(imageLine + n) &= *(maskLine + n);
|
||||
}
|
||||
if (rectWidth % 2) {
|
||||
if (rectWidth & 0x01) {
|
||||
*(imageLine + n) = coltab320[*(dataPtr++)] & 0xF0;
|
||||
*(imageLine + n) ^= 0xFF; /* Reverse color */
|
||||
*(imageLine + n) &= *(maskLine + n);
|
||||
@ -270,9 +270,9 @@ void DoCursor (void) {
|
||||
*(imageLine + n) &= *(maskLine + n);
|
||||
}
|
||||
|
||||
if (rectWidth % 4) {
|
||||
if (rectWidth & 0x03) {
|
||||
*(imageLine + n) = 0;
|
||||
for (j = 0; j < rectWidth % 4; j++) {
|
||||
for (j = 0; j < (rectWidth & 0x03); j++) {
|
||||
*(imageLine + n) += coltab640[*(dataPtr++)] & (0xC0 >> j*2);
|
||||
}
|
||||
*(imageLine + n) ^= 0xFF; /* Reverse color */
|
||||
|
Loading…
Reference in New Issue
Block a user