From: Dana Jansens Date: Tue, 3 Jun 2003 00:45:44 +0000 (+0000) Subject: moving some manny code around :> X-Git-Tag: gl2^0 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=ae1f50ba01a75c587060c31e8907fe5058df9b63;p=dana%2Fopenbox.git moving some manny code around :> --- diff --git a/render2/paint.c b/render2/paint.c index 965e95b2..ff783dc5 100644 --- a/render2/paint.c +++ b/render2/paint.c @@ -100,31 +100,6 @@ void RrPaint(struct RrSurface *sur) break; } - switch (RrPlanarBevelType(sur)) { - case RR_SUNKEN_OUTER: - RrBevel(RrSurfaceX(sur), RrSurfaceY(sur), - RrSurfaceWidth(sur), RrSurfaceHeight(sur), - 0, 0, 0); - break; - case RR_SUNKEN_INNER: - RrBevel(RrSurfaceX(sur), RrSurfaceY(sur), - RrSurfaceWidth(sur), RrSurfaceHeight(sur), - 0, 1, 0); - break; - case RR_RAISED_OUTER: - RrBevel(RrSurfaceX(sur), RrSurfaceY(sur), - RrSurfaceWidth(sur), RrSurfaceHeight(sur), - 0, 0, 1); - break; - case RR_RAISED_INNER: - RrBevel(RrSurfaceX(sur), RrSurfaceY(sur), - RrSurfaceWidth(sur), RrSurfaceHeight(sur), - 0, 1, 1); - break; - case RR_BEVEL_NONE: - break; - } - for (i = 0; i < sur->ntextures; ++i) RrTexturePaint(sur, &sur->texture[i]); diff --git a/render2/planar.c b/render2/planar.c index 05501457..81339430 100644 --- a/render2/planar.c +++ b/render2/planar.c @@ -75,6 +75,37 @@ static void copy_parent(struct RrSurface *sur) } } +static void RrBevelPaint(int x, int y, int w, int h, int bwidth, + int inset, int raise) +{ + int offset = bwidth + inset; + h--; w--; + + if (raise) + glColor4f(1.0, 1.0, 1.0, 0.25); + else + glColor4f(0.0, 0.0, 0.0, 0.25); + + glBegin(GL_LINES); + glVertex2i(x + offset, y + offset); + glVertex2i(x + offset, y + h - offset); + + glVertex2i(x + offset, y + h - offset); + glVertex2i(x + w - offset, y + h - offset); + + if (!raise) + glColor4f(1.0, 1.0, 1.0, 0.25); + else + glColor4f(0.0, 0.0, 0.0, 0.25); + + glVertex2i(x + w - offset, y + h - offset); + glVertex2i(x + w - offset, y + offset); + + glVertex2i(x + w - offset, y + offset); + glVertex2i(x + offset, y + offset); + glEnd(); +} + void RrPlanarPaint(struct RrSurface *sur, int absx, int absy) { struct RrColor *pri, *sec, avg; @@ -296,6 +327,31 @@ void RrPlanarPaint(struct RrSurface *sur, int absx, int absy) glEnd(); break; } + + switch (RrPlanarBevelType(sur)) { + case RR_SUNKEN_OUTER: + RrBevelPaint(RrSurfaceX(sur), RrSurfaceY(sur), + RrSurfaceWidth(sur), RrSurfaceHeight(sur), + 0, 0, 0); + break; + case RR_SUNKEN_INNER: + RrBevelPaint(RrSurfaceX(sur), RrSurfaceY(sur), + RrSurfaceWidth(sur), RrSurfaceHeight(sur), + 0, 1, 0); + break; + case RR_RAISED_OUTER: + RrBevelPaint(RrSurfaceX(sur), RrSurfaceY(sur), + RrSurfaceWidth(sur), RrSurfaceHeight(sur), + 0, 0, 1); + break; + case RR_RAISED_INNER: + RrBevelPaint(RrSurfaceX(sur), RrSurfaceY(sur), + RrSurfaceWidth(sur), RrSurfaceHeight(sur), + 0, 1, 1); + break; + case RR_BEVEL_NONE: + break; + } } void RrPlanarMinSize(struct RrSurface *sur, int *w, int *h) @@ -303,34 +359,3 @@ void RrPlanarMinSize(struct RrSurface *sur, int *w, int *h) *w = 0; *h = 0; } - -void RrBevel(int x, int y, int w, int h, int bwidth, int inset, int raise) -{ - int offset = bwidth + inset; - h--; w--; - - if (raise) - glColor4f(1.0, 1.0, 1.0, 0.25); - else - glColor4f(0.0, 0.0, 0.0, 0.25); - - glBegin(GL_LINES); - glVertex2i(x + offset, y + offset); - glVertex2i(x + offset, y + h - offset); - - glVertex2i(x + offset, y + h - offset); - glVertex2i(x + w - offset, y + h - offset); - - if (!raise) - glColor4f(1.0, 1.0, 1.0, 0.25); - else - glColor4f(0.0, 0.0, 0.0, 0.25); - - glVertex2i(x + w - offset, y + h - offset); - glVertex2i(x + w - offset, y + offset); - - glVertex2i(x + w - offset, y + offset); - glVertex2i(x + offset, y + offset); - glEnd(); -} - diff --git a/render2/planar.h b/render2/planar.h index 8a970707..755b1220 100644 --- a/render2/planar.h +++ b/render2/planar.h @@ -21,8 +21,6 @@ struct RrPlanarSurface { void RrPlanarPaint(struct RrSurface *sur, int absx, int absy); -void RrBevel(int x, int y, int w, int h, int bwidth, int inset, int raise); - void RrPlanarMinSize(struct RrSurface *sur, int *w, int *h); #endif