Skip to content

Commit

Permalink
-Change: Simplification / optimization of GUI_DrawSprite()
Browse files Browse the repository at this point in the history
  • Loading branch information
miniupnp committed Apr 19, 2018
1 parent 5eafedd commit 3c4eecd
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/gui/gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,7 @@ void GUI_DrawSprite(Screen screenID, const uint8 *sprite, int16 posX, int16 posY
uint8 *buf = NULL;
uint8 *b = NULL;
int16 count;
int16 buf_incr;

if (sprite == NULL) return;

Expand Down Expand Up @@ -1153,6 +1154,9 @@ void GUI_DrawSprite(Screen screenID, const uint8 *sprite, int16 posX, int16 posY
pixelSkipStart = pixelSkipEnd;
pixelSkipEnd = tmp;
buf += pixelCountPerRow - 1;
buf_incr = -1;
} else {
buf_incr = 1;
}

b = buf;
Expand Down Expand Up @@ -1312,13 +1316,7 @@ void GUI_DrawSprite(Screen screenID, const uint8 *sprite, int16 posX, int16 posY
break;
}

#if 0
if ((flags & 0xFD) == 0) buf++;
else buf--;
#else
if ((flags & DRAWSPRITE_FLAG_RTL) != 0) buf--;
else buf++;
#endif
buf += buf_incr;
count--;
}
}
Expand Down

0 comments on commit 3c4eecd

Please sign in to comment.