PLANAR_NONE surfaces can now have borders
authorDerek Foreman <manmower@gmail.com>
Wed, 18 Jun 2003 01:16:50 +0000 (01:16 +0000)
committerDerek Foreman <manmower@gmail.com>
Wed, 18 Jun 2003 01:16:50 +0000 (01:16 +0000)
use them in the theme.

(they also no longer need a color to not crash)

render2/planar.c
render2/theme.c

index e760fa79044da5fc83c6f2936d74d2e1f7f8e0eb..29bab5d517d3da75663628a76ac3f2c319a3a4d7 100644 (file)
@@ -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);
index 144a7bcbd754570de5293b14cdfb0cf7b836c999..f76f2bec496ff71ef0230f2068d089fcf4a8108f 100644 (file)
@@ -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);