static void gradient_splitvertical(RrAppearance *a, gint w, gint h)
{
- gint x, y1, y2, y3, r, g, b;
+ gint x, y1, y2, y3;
RrSurface *sf = &a->surface;
RrPixel32 *data = sf->pixel_data;
RrPixel32 current;
- RrColor *primary_light, *secondary_light;
gint y1sz, y2sz, y3sz;
VARS(y1);
VARS(y2);
VARS(y3);
- r = sf->primary->r;
- r += r >> 2;
- g = sf->primary->g;
- g += g >> 2;
- b = sf->primary->b;
- b += b >> 2;
- if (r > 0xFF) r = 0xFF;
- if (g > 0xFF) g = 0xFF;
- if (b > 0xFF) b = 0xFF;
- primary_light = RrColorNew(a->inst, r, g, b);
-
- r = sf->secondary->r;
- r += r >> 4;
- g = sf->secondary->g;
- g += g >> 4;
- b = sf->secondary->b;
- b += b >> 4;
- if (r > 0xFF) r = 0xFF;
- if (g > 0xFF) g = 0xFF;
- if (b > 0xFF) b = 0xFF;
- secondary_light = RrColorNew(a->inst, r, g, b);
y1sz = MAX(h/2 - 1, 1);
/* setup to get the colors _in between_ these other 2 */
y2sz = (h < 3 ? 0 : (h % 2 ? 3 : 2));
y3sz = MAX(h/2 - 1, 0);
- SETUP(y1, primary_light, sf->primary, y1sz);
+ SETUP(y1, sf->split_primary, sf->primary, y1sz);
if (y2sz) {
SETUP(y2, sf->primary, sf->secondary, y2sz);
NEXT(y2); /* skip the first one, its the same as the last of y1 */
}
- SETUP(y3, sf->secondary, secondary_light, y3sz);
+ SETUP(y3, sf->secondary, sf->split_secondary, y3sz);
for (y1 = y1sz; y1 > 0; --y1) {
current = COLOR(y1);
NEXT(y3);
}
-
- RrColorFree(primary_light);
- RrColorFree(secondary_light);
}
static void gradient_horizontal(RrSurface *sf, gint w, gint h)
spo->bevel_light->b);
else spc->bevel_light = NULL;
+ if (spo->split_primary != NULL)
+ spc->split_primary = RrColorNew(copy->inst,
+ spo->split_primary->r,
+ spo->split_primary->g,
+ spo->split_primary->b);
+ else spc->split_primary = NULL;
+
+ if (spo->split_secondary != NULL)
+ spc->split_secondary = RrColorNew(copy->inst,
+ spo->split_secondary->r,
+ spo->split_secondary->g,
+ spo->split_secondary->b);
+ else spc->split_secondary = NULL;
+
spc->interlaced = spo->interlaced;
spc->bevel_light_adjust = spo->bevel_light_adjust;
spc->bevel_dark_adjust = spo->bevel_dark_adjust;
RrColorFree(p->interlace_color);
RrColorFree(p->bevel_dark);
RrColorFree(p->bevel_light);
+ RrColorFree(p->split_primary);
+ RrColorFree(p->split_secondary);
g_free(p->pixel_data);
p->pixel_data = NULL;
g_free(a);
RrPixel32 *pixel_data;
gint bevel_dark_adjust; /* 0-255, default is 64 */
gint bevel_light_adjust; /* 0-255, default is 128 */
+ RrColor *split_primary;
+ RrColor *split_secondary;
};
struct _RrTextureText {
value->surface.bevel_light_adjust = i;
if (read_int(db, sname, &i) && i >= 0 && i <= 256)
value->surface.bevel_dark_adjust = i;
+
+ if (value->surface.grad == RR_SURFACE_SPLIT_VERTICAL) {
+ gint r, g, b;
+
+ r = value->surface.primary->r;
+ r += r >> 2;
+ g = value->surface.primary->g;
+ g += g >> 2;
+ b = value->surface.primary->b;
+ b += b >> 2;
+ if (r > 0xFF) r = 0xFF;
+ if (g > 0xFF) g = 0xFF;
+ if (b > 0xFF) b = 0xFF;
+ value->surface.split_primary = RrColorNew(inst, r, g, b);
+
+ r = value->surface.secondary->r;
+ r += r >> 4;
+ g = value->surface.secondary->g;
+ g += g >> 4;
+ b = value->surface.secondary->b;
+ b += b >> 4;
+ if (r > 0xFF) r = 0xFF;
+ if (g > 0xFF) g = 0xFF;
+ if (b > 0xFF) b = 0xFF;
+ value->surface.split_secondary = RrColorNew(inst, r, g, b);
+ }
+
ret = TRUE;
}