split the increment into a separate macro
This commit is contained in:
parent
2494762dbf
commit
08f1f213f1
1 changed files with 5 additions and 2 deletions
|
@ -304,6 +304,9 @@ static void gradient_solid(RrAppearance *l, int w, int h)
|
||||||
(color##x[1] << RrDefaultGreenOffset) + \
|
(color##x[1] << RrDefaultGreenOffset) + \
|
||||||
(color##x[2] << RrDefaultBlueOffset))
|
(color##x[2] << RrDefaultBlueOffset))
|
||||||
|
|
||||||
|
#define INCREMENT(x, i) \
|
||||||
|
(inc##x[i])
|
||||||
|
|
||||||
#define NEXT(x) \
|
#define NEXT(x) \
|
||||||
{ \
|
{ \
|
||||||
int i; \
|
int i; \
|
||||||
|
@ -314,13 +317,13 @@ static void gradient_solid(RrAppearance *l, int w, int h)
|
||||||
/* Y (color) is dependant on X */ \
|
/* Y (color) is dependant on X */ \
|
||||||
error##x[i] += cdelta##x[i]; \
|
error##x[i] += cdelta##x[i]; \
|
||||||
if ((error##x[i] << 1) >= len##x) { \
|
if ((error##x[i] << 1) >= len##x) { \
|
||||||
color##x[i] += inc##x[i]; \
|
color##x[i] += INCREMENT(x, i); \
|
||||||
error##x[i] -= len##x; \
|
error##x[i] -= len##x; \
|
||||||
} \
|
} \
|
||||||
} else { \
|
} else { \
|
||||||
/* X is dependant on Y (color) */ \
|
/* X is dependant on Y (color) */ \
|
||||||
while (1) { \
|
while (1) { \
|
||||||
color##x[i] += inc##x[i]; \
|
color##x[i] += INCREMENT(x, i); \
|
||||||
error##x[i] += len##x; \
|
error##x[i] += len##x; \
|
||||||
if ((error##x[i] << 1) >= cdelta##x[i]) { \
|
if ((error##x[i] << 1) >= cdelta##x[i]) { \
|
||||||
error##x[i] -= cdelta##x[i]; \
|
error##x[i] -= cdelta##x[i]; \
|
||||||
|
|
Loading…
Reference in a new issue