Skip to content

Commit

Permalink
Use u128 for data-transfer in gfxFlushBuffers() when width is aligned…
Browse files Browse the repository at this point in the history
… for this.
  • Loading branch information
yellows8 committed Feb 12, 2018
1 parent ea612e3 commit 83349f9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions nx/source/gfx/gfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,10 +550,15 @@ void gfxFlushBuffers(void) {
for (y=0; y<height; y++) {
for (x=0; x<width; x+=4) {
tmpoff = gfxGetFramebufferDisplayOffset(x, y);
for(j=0; j<4; j++) {
if (x+j >= width)
break;
actual_framebuf[tmpoff+j] = in_framebuf[y * width + x+j];
if(width & 3) {
for(j=0; j<4; j++) {
if (x+j >= width)
break;
actual_framebuf[tmpoff+j] = in_framebuf[y * width + x+j];
}
}
else {
*((u128*)&actual_framebuf[tmpoff]) = *((u128*)&in_framebuf[y * width + x]);
}
}
}
Expand Down

0 comments on commit 83349f9

Please sign in to comment.