mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-21 21:38:00 +01:00
Remove dead code from wrlib
This commit is contained in:
committed by
Carlos R. Mafra
parent
7d905787d2
commit
28cbda550a
108
wrlib/draw.c
108
wrlib/draw.c
@@ -372,114 +372,6 @@ static int genericLine(RImage * image, int x0, int y0, int x1, int y1, RColor *
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (mode == RALTER_PIXELS) {
|
||||
RColorOffset *cdelta = (RColorOffset *) cdata;
|
||||
register short r, g, b, a;
|
||||
|
||||
for (i = 0; i <= last; i++) {
|
||||
/* Change the pixel with offset */
|
||||
r = (short)*sr + cdelta->red;
|
||||
g = (short)*sg + cdelta->green;
|
||||
b = (short)*sb + cdelta->blue;
|
||||
if (r > 255)
|
||||
r = 255;
|
||||
else if (r < 0)
|
||||
r = 0;
|
||||
if (g > 255)
|
||||
g = 255;
|
||||
else if (g < 0)
|
||||
g = 0;
|
||||
if (b > 255)
|
||||
b = 255;
|
||||
else if (b < 0)
|
||||
b = 0;
|
||||
*sr = (unsigned char)r;
|
||||
*sg = (unsigned char)g;
|
||||
*sb = (unsigned char)b;
|
||||
if (image->data[3]) {
|
||||
a = (short)*sa + cdelta->alpha;
|
||||
if (a > 255)
|
||||
a = 255;
|
||||
else if (a < 0)
|
||||
a = 0;
|
||||
*sa = (unsigned char)a;
|
||||
}
|
||||
|
||||
/* Compute error for NeXT Step */
|
||||
err += dv2;
|
||||
if (err >= du) {
|
||||
sr += vofs;
|
||||
sg += vofs;
|
||||
sb += vofs;
|
||||
sa += vofs;
|
||||
err -= du2;
|
||||
}
|
||||
sr += uofs;
|
||||
sg += uofs;
|
||||
sb += uofs;
|
||||
sa += uofs;
|
||||
}
|
||||
} else {
|
||||
RColor *color = (RColor *) cdata;
|
||||
|
||||
if (color->alpha == 255) {
|
||||
for (i = 0; i <= last; i++) {
|
||||
/* Draw the pixel */
|
||||
*sr = color->red;
|
||||
*sg = color->green;
|
||||
*sb = color->blue;
|
||||
if (image->data[3])
|
||||
*sa = 255;
|
||||
|
||||
/* Compute error for NeXT Step */
|
||||
err += dv2;
|
||||
if (err >= du) {
|
||||
sr += vofs;
|
||||
sg += vofs;
|
||||
sb += vofs;
|
||||
sa += vofs;
|
||||
err -= du2;
|
||||
}
|
||||
sr += uofs;
|
||||
sg += uofs;
|
||||
sb += uofs;
|
||||
sa += uofs;
|
||||
}
|
||||
} else {
|
||||
register short alpha, nalpha, r, g, b;
|
||||
|
||||
alpha = color->alpha;
|
||||
nalpha = 255 - alpha;
|
||||
r = color->red;
|
||||
g = color->green;
|
||||
b = color->blue;
|
||||
|
||||
for (i = 0; i <= last; i++) {
|
||||
/* Draw the pixel */
|
||||
*sr = (((int)*sr * nalpha) + (r * alpha)) / 256;
|
||||
*sg = (((int)*sg * nalpha) + (g * alpha)) / 256;
|
||||
*sb = (((int)*sb * nalpha) + (b * alpha)) / 256;
|
||||
if (image->data[3])
|
||||
*sa = alpha + ((int)*sa * nalpha) / 256;
|
||||
|
||||
/* Compute error for NeXT Step */
|
||||
err += dv2;
|
||||
if (err >= du) {
|
||||
sr += vofs;
|
||||
sg += vofs;
|
||||
sb += vofs;
|
||||
sa += vofs;
|
||||
err -= du2;
|
||||
}
|
||||
sr += uofs;
|
||||
sg += uofs;
|
||||
sb += uofs;
|
||||
sa += uofs;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return True;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user