moving some manny code around :> github/gl2 origin/gl2 gl2
authorDana Jansens <danakj@orodu.net>
Tue, 3 Jun 2003 00:45:44 +0000 (00:45 +0000)
committerDana Jansens <danakj@orodu.net>
Tue, 3 Jun 2003 00:45:44 +0000 (00:45 +0000)
render2/paint.c
render2/planar.c
render2/planar.h

index 965e95b218ef8c5809d18ec1d794c6987c712be2..ff783dc5e41211fbab173d916d62de83c05aa434 100644 (file)
@@ -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]);
 
index 0550145754a59a7630c4fc0982d01737579d6559..8133943031b9d4f72c323a9f76414edcbc20cdf1 100644 (file)
@@ -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();
-}
-
index 8a970707a077d927aebf17552422a94810489305..755b122043ba73b22647be78d2c26b0938b9af19 100644 (file)
@@ -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