combine the parent and child textures in fun ways when a parentrelative texture with a bevel is placed right overtop of another texture with a bevel
This commit is contained in:
parent
cea8656983
commit
4548d40c0d
1 changed files with 32 additions and 11 deletions
|
@ -205,6 +205,26 @@ static void gradient_parentrelative(RrAppearance *a, gint w, gint h)
|
|||
sw = a->surface.parent->w;
|
||||
sh = a->surface.parent->h;
|
||||
|
||||
/* This is a little hack. When a texture is parentrelative, and the same
|
||||
area as the parent, and has a bevel, it will draw its bevel on top
|
||||
of the parent's, amplifying it. So instead, rerender the child with
|
||||
the parent's settings, but the child's bevel and interlace */
|
||||
if (a->surface.relief != RR_RELIEF_FLAT &&
|
||||
!a->surface.parentx && !a->surface.parenty &&
|
||||
sw == w && sh == h)
|
||||
{
|
||||
RrSurface old = a->surface;
|
||||
a->surface = a->surface.parent->surface;
|
||||
a->surface.relief = old.relief;
|
||||
a->surface.bevel = old.bevel;
|
||||
a->surface.pixel_data = old.pixel_data;
|
||||
if (old.interlaced) {
|
||||
a->surface.interlaced = TRUE;
|
||||
a->surface.interlace_color = old.interlace_color;
|
||||
}
|
||||
RrRender(a, w, h);
|
||||
a->surface = old;
|
||||
} else {
|
||||
source = (a->surface.parent->surface.pixel_data +
|
||||
a->surface.parentx + sw * a->surface.parenty);
|
||||
dest = a->surface.pixel_data;
|
||||
|
@ -221,6 +241,7 @@ static void gradient_parentrelative(RrAppearance *a, gint w, gint h)
|
|||
memcpy(dest, source, partial_w * sizeof(RrPixel32));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void gradient_solid(RrAppearance *l, gint w, gint h)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue