Small optimization for sprite drawing

This commit is contained in:
Jeffrey Pfau 2013-07-29 00:44:38 -07:00
parent 425056ca15
commit 15aa862d70
1 changed files with 6 additions and 1 deletions

View File

@ -1015,7 +1015,12 @@ static const int _objSizes[32] = {
#define SPRITE_NORMAL_LOOP(DEPTH, TYPE) \ #define SPRITE_NORMAL_LOOP(DEPTH, TYPE) \
SPRITE_YBASE_ ## DEPTH(inY); \ SPRITE_YBASE_ ## DEPTH(inY); \
for (int outX = x >= start ? x : start; outX < x + width && outX < end; ++outX) { \ int outX = x >= start ? x : start; \
int condition = x + width; \
if (end < condition) { \
condition = end; \
} \
for (; outX < condition; ++outX) { \
int inX = outX - x; \ int inX = outX - x; \
if (sprite->hflip) { \ if (sprite->hflip) { \
inX = width - inX - 1; \ inX = width - inX - 1; \