Skip to content

Commit b611e88

Browse files
authored
Merge pull request #40 from TheNitek/master
Fix endianness without framebuffer
2 parents ed3ac34 + 1265daf commit b611e88

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/VNC.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,7 +1483,7 @@ bool arduinoVNC::_handle_hextile_encoded_message(rfbFramebufferUpdateRectHeader
14831483
fb.draw_rect(0, 0, tile_w, tile_h, bgColor);
14841484
#else
14851485
/* fill the background */
1486-
display->draw_rect(rect_xW, rect_yW, tile_w, tile_h, bgColor);
1486+
display->draw_rect(rect_xW, rect_yW, tile_w, tile_h, Swap16IfLE(bgColor));
14871487
#endif
14881488

14891489
if(subrect_encoding & rfbHextileAnySubrects) {
@@ -1510,7 +1510,7 @@ bool arduinoVNC::_handle_hextile_encoded_message(rfbFramebufferUpdateRectHeader
15101510
#ifdef VNC_FRAMEBUFFER
15111511
fb.draw_rect(bufPC->x, bufPC->y, bufPC->w + 1, bufPC->h + 1, bufPC->color);
15121512
#else
1513-
display->draw_rect(rect_xW + bufPC->x, rect_yW + bufPC->y, bufPC->w+1, bufPC->h+1, bufPC->color);
1513+
display->draw_rect(rect_xW + bufPC->x, rect_yW + bufPC->y, bufPC->w+1, bufPC->h+1, Swap16IfLE(bufPC->color));
15141514
#endif
15151515
bufPC++;
15161516
}
@@ -1526,11 +1526,11 @@ bool arduinoVNC::_handle_hextile_encoded_message(rfbFramebufferUpdateRectHeader
15261526
HextileSubrects_t * bufP = (HextileSubrects_t *) buf;
15271527
for(uint8_t n = 0; n < nr_subr; n++) {
15281528

1529-
// DEBUG_VNC_HEXTILE("[_handle_hextile_encoded_message] nr_subr: %d bufP: 0x%08X\n", n, bufP);
1529+
// DEBUG_VNC_HEXTILE("[_handle_hextile_encoded_message] nr_subr: %d bufP: 0x%08X\n", n, bufP);
15301530
#ifdef VNC_FRAMEBUFFER
15311531
fb.draw_rect(bufP->x, bufP->y, bufP->w + 1, bufP->h + 1, fgColor);
15321532
#else
1533-
display->draw_rect(rect_xW + bufP->x, rect_yW + bufP->y, bufP->w+1, bufP->h+1, fgColor);
1533+
display->draw_rect(rect_xW + bufP->x, rect_yW + bufP->y, bufP->w+1, bufP->h+1, Swap16IfLE(fgColor));
15341534
#endif
15351535
bufP++;
15361536
}

0 commit comments

Comments
 (0)