From 983c331dc47ecb1569e3a2eed672436775482a4c Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 3 Jun 2003 20:28:22 +0000 Subject: [PATCH] use RrPlanarHasAlpha to determine if parent should be copied --- render2/planar.c | 48 ++++++------------------------------------------ 1 file changed, 6 insertions(+), 42 deletions(-) diff --git a/render2/planar.c b/render2/planar.c index ba6ef899..2f9ce670 100644 --- a/render2/planar.c +++ b/render2/planar.c @@ -29,53 +29,17 @@ void RrPlanarSet(struct RrSurface *sur, int RrPlanarHasAlpha(struct RrSurface *sur) { - if (RrColorHasAlpha(RrPlanarPrimaryColor(sur))) return 1; - if (!(RrPlanarColorType(sur) == RR_PLANAR_NONE || - RrPlanarColorType(sur) == RR_PLANAR_SOLID)) - if (RrColorHasAlpha(RrPlanarSecondaryColor(sur))) return 1; + if (!(RrPlanarColorType(sur) == RR_PLANAR_NONE)) { + if (RrColorHasAlpha(RrPlanarPrimaryColor(sur))) return 1; + if (!RrPlanarColorType(sur) == RR_PLANAR_SOLID) + if (RrColorHasAlpha(RrPlanarSecondaryColor(sur))) return 1; + } return 0; } static void copy_parent(struct RrSurface *sur) { - int ncols; - int copy; - - switch (RrPlanarColorType(sur)) { - case RR_PLANAR_NONE: - return; - case RR_PLANAR_SOLID: - ncols = 1; - break; - case RR_PLANAR_HORIZONTAL: - ncols = 2; - break; - case RR_PLANAR_VERTICAL: - ncols = 2; - break; - case RR_PLANAR_DIAGONAL: - ncols = 2; - break; - case RR_PLANAR_CROSSDIAGONAL: - ncols = 2; - break; - case RR_PLANAR_PYRAMID: - ncols = 2; - break; - case RR_PLANAR_PIPECROSS: - ncols = 2; - break; - case RR_PLANAR_RECTANGLE: - ncols = 2; - break; - } - - copy = 0; - if (ncols >= 1 && RrColorHasAlpha(RrPlanarPrimaryColor(sur))) - copy = 1; - if (ncols >= 1 && RrColorHasAlpha(RrPlanarSecondaryColor(sur))) - copy = 1; - if (copy) { + if (RrPlanarHasAlpha(sur)) { /* struct RrSurface *parent = RrSurfaceParent(sur); -- 2.34.1