Thx


void degrade(int x0, int x1, int c0, int c1, int *scr)
{
int x_offset;
int r;
int g;
int b;
int r_offset;
int g_offset;
int b_offset;
if (!(x_offset = x1 - x0))
return;
r = c0 >> 16;
g = (c0 >> 8) & 0xff;
b = c0 & 0xff;
c1 = (c0 - c1) << 8;
r_offset = (c1 & 0xff0000) / x_offset;
g_offset = (c1 & 0xff00) / x_offset;
b_offset = (c1 & 0xff) / x_offset;
while (x0 != x1)
{
*(scr + x0) = (r | g | b) >> 8;
r += r_offset;
g += g_offset;
b += b_offset;
x0++;
}
}