From 09da7e9f5b4a3433a9dbb991528c97fa55f7464e Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Wed, 18 Jun 2003 01:16:50 +0000 Subject: [PATCH] PLANAR_NONE surfaces can now have borders use them in the theme. (they also no longer need a color to not crash) --- render2/planar.c | 5 ++++- render2/theme.c | 13 ++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/render2/planar.c b/render2/planar.c index e760fa79..29bab5d5 100644 --- a/render2/planar.c +++ b/render2/planar.c @@ -27,7 +27,8 @@ void RrPlanarSet(struct RrSurface *sur, { sur->data.planar.colortype = type; sur->data.planar.bevel = bevel; - sur->data.planar.primary = *primary; + if (!(type == RR_PLANAR_NONE)) + sur->data.planar.primary = *primary; if (!(type == RR_PLANAR_NONE || type == RR_PLANAR_SOLID)) sur->data.planar.secondary = *secondary; assert(borderwidth >= 0); @@ -134,6 +135,8 @@ void RrPlanarPaint(struct RrSurface *sur, int absx, int absy) switch (RrPlanarColorType(sur)) { case RR_PLANAR_NONE: + if (RrPlanarBorderWidth(sur)) + RrBorderPaint(sur); return; case RR_PLANAR_SOLID: glBegin(GL_TRIANGLES); diff --git a/render2/theme.c b/render2/theme.c index 144a7bcb..f76f2bec 100644 --- a/render2/theme.c +++ b/render2/theme.c @@ -123,8 +123,8 @@ struct RrTheme *RrThemeLoad(struct RrInstance *inst, const char *name) RrColorSet(&pri, 0.9, 0.91, 0.9, 1); RrColorSet(&bor, 0, 0, 0, 1); - RrPlanarSet(theme->frame, RR_PLANAR_SOLID, RR_BEVEL_NONE, - &pri, NULL, 1, &bor); + RrPlanarSet(theme->frame, RR_PLANAR_NONE, RR_BEVEL_NONE, + NULL, NULL, 1, &bor); theme->title = RrSurfaceNewProto(RR_SURFACE_PLANAR, 0); theme->title_f = RrSurfaceNewProto(RR_SURFACE_PLANAR, 0); @@ -139,11 +139,10 @@ struct RrTheme *RrThemeLoad(struct RrInstance *inst, const char *name) theme->plate = RrSurfaceNewProto(RR_SURFACE_PLANAR, 0); theme->plate_f = RrSurfaceNewProto(RR_SURFACE_PLANAR, 0); - RrColorSet(&pri, 0, 0, 0, 1); - RrPlanarSet(theme->plate, RR_PLANAR_SOLID, RR_BEVEL_NONE, - &pri, NULL, 0, NULL); - RrPlanarSet(theme->plate_f, RR_PLANAR_SOLID, RR_BEVEL_NONE, - &pri, NULL, 0, NULL); + RrPlanarSet(theme->plate, RR_PLANAR_NONE, RR_BEVEL_NONE, + NULL, NULL, 0, NULL); + RrPlanarSet(theme->plate_f, RR_PLANAR_NONE, RR_BEVEL_NONE, + NULL, NULL, 0, NULL); theme->label = RrSurfaceNewProto(RR_SURFACE_PLANAR, 1); theme->label_f = RrSurfaceNewProto(RR_SURFACE_PLANAR, 1); -- 2.39.2