Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wilkins <Jason.A.Wilkins@gmail.com>2012-05-04 15:50:11 +0400
committerJason Wilkins <Jason.A.Wilkins@gmail.com>2012-05-04 15:50:11 +0400
commita0ce240de94521b6caf55b0738b70f2dc2ad3353 (patch)
treea14430fbb928e7b25ec29ac1e33cf9c62a13159f /source/blender/editors
parentdf553582e96569e49a4d28c167c5dd334be5f216 (diff)
Renamed "fake" OpenGL identifiers.
Any identifier that looks like an OpenGL identifier, but isn't, causes a false alarm by the glreport.py tool. Most of these were in comments so I just rephrased the comments. There were a couple of static functions/macros that were easy enough to rename. Only the glTexco and glIndex fields of the DMVertexAttribs struct was public and had non-local uses.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/include/BIF_glutil.h23
-rw-r--r--source/blender/editors/interface/interface_draw.c12
-rw-r--r--source/blender/editors/screen/glutil.c8
-rw-r--r--source/blender/editors/space_view3d/drawarmature.c6
-rw-r--r--source/blender/editors/space_view3d/drawobject.c2
5 files changed, 24 insertions, 27 deletions
diff --git a/source/blender/editors/include/BIF_glutil.h b/source/blender/editors/include/BIF_glutil.h
index 44195988c40..2172aa82acf 100644
--- a/source/blender/editors/include/BIF_glutil.h
+++ b/source/blender/editors/include/BIF_glutil.h
@@ -49,7 +49,8 @@ void fdrawXORcirc(float xofs, float yofs, float rad);
void fdrawcheckerboard(float x1, float y1, float x2, float y2);
-/* glStipple defines */
+/* OpenGL stipple defines */
+/* OpenGL stipple defines */
extern unsigned char stipple_halftone[128];
extern unsigned char stipple_quarttone[128];
extern unsigned char stipple_diag_stripes_pos[128];
@@ -147,13 +148,14 @@ void glaDrawPixelsTexScaled(float x, float y, int img_w, int img_h, int format,
/* 2D Drawing Assistance */
/** Define a 2D area (viewport, scissor, matrices) for OpenGL rendering.
- * This routine sets up an OpenGL state appropriate for drawing using
- * both vertice (glVertex, etc) and raster (glRasterPos, glRect) commands.
- * All coordinates should be at integer positions. There is little to
- * no reason to use glVertex2f etc. functions during 2D rendering, and
+ *
+ * glwDefine2DArea and glaBegin2DDraw set up an OpenGL state appropriate
+ * for drawing using both vertice (Vertex, etc) and raster (RasterPos, Rect)
+ * commands. All coordinates should be at integer positions. There is little
+ * to no reason to use glVertex2f etc. functions during 2D rendering, and
* thus no reason to +-0.5 the coordinates or perform other silly
* tricks.
- *
+ *
* \param screen_rect The screen rectangle to be defined for 2D drawing.
*/
void glaDefine2DArea (struct rcti *screen_rect);
@@ -165,13 +167,8 @@ typedef struct gla2DDrawInfo gla2DDrawInfo;
* to free it and to return OpenGL to its previous state. The
* scissor rectangle is set to match the viewport.
*
- * This routine sets up an OpenGL state appropriate for drawing using
- * both vertice (glVertex, etc) and raster (glRasterPos, glRect) commands.
- * All coordinates should be at integer positions. There is little to
- * no reason to use glVertex2f etc. functions during 2D rendering, and
- * thus no reason to +-0.5 the coordinates or perform other silly
- * tricks.
- *
+ * See glaDefine2DArea for an explanation of why this function uses integers.
+ *
* \param screen_rect The screen rectangle to be used for 2D drawing.
* \param world_rect The world rectangle that the 2D area represented
* by \a screen_rect is supposed to represent. If NULL it is assumed the
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index d90d8286db9..8c5913e23fb 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -1196,7 +1196,7 @@ void ui_draw_but_NORMAL(uiBut *but, uiWidgetColors *wcol, rcti *rect)
ui_get_but_vectorf(but, dir);
- dir[3] = 0.0f; /* glLight needs 4 args, 0.0 is sun */
+ dir[3] = 0.0f; /* glLightfv needs 4 args, 0.0 is sun */
glLightfv(GL_LIGHT7, GL_POSITION, dir);
glLightfv(GL_LIGHT7, GL_DIFFUSE, diffn);
glLightfv(GL_LIGHT7, GL_SPECULAR, vec0);
@@ -1281,7 +1281,7 @@ static void ui_draw_but_curve_grid(rcti *rect, float zoomx, float zoomy, float o
}
-static void glColor3ubvShade(unsigned char *col, int shade)
+static void gl_shaded_color(unsigned char *col, int shade)
{
glColor3ub(col[0] - shade > 0 ? col[0] - shade : 0,
col[1] - shade > 0 ? col[1] - shade : 0,
@@ -1318,7 +1318,7 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect
/* backdrop */
if (cumap->flag & CUMA_DO_CLIP) {
- glColor3ubvShade((unsigned char *)wcol->inner, -20);
+ gl_shaded_color((unsigned char *)wcol->inner, -20);
glRectf(rect->xmin, rect->ymin, rect->xmax, rect->ymax);
glColor3ubv((unsigned char *)wcol->inner);
glRectf(rect->xmin + zoomx * (cumap->clipr.xmin - offsx),
@@ -1332,13 +1332,13 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *rect
}
/* grid, every .25 step */
- glColor3ubvShade((unsigned char *)wcol->inner, -16);
+ gl_shaded_color((unsigned char *)wcol->inner, -16);
ui_draw_but_curve_grid(rect, zoomx, zoomy, offsx, offsy, 0.25f);
/* grid, every 1.0 step */
- glColor3ubvShade((unsigned char *)wcol->inner, -24);
+ gl_shaded_color((unsigned char *)wcol->inner, -24);
ui_draw_but_curve_grid(rect, zoomx, zoomy, offsx, offsy, 1.0f);
/* axes */
- glColor3ubvShade((unsigned char *)wcol->inner, -50);
+ gl_shaded_color((unsigned char *)wcol->inner, -50);
glBegin(GL_LINES);
glVertex2f(rect->xmin, rect->ymin + zoomy * (-offsy));
glVertex2f(rect->xmax, rect->ymin + zoomy * (-offsy));
diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c
index 50430399f09..69db65fda1c 100644
--- a/source/blender/editors/screen/glutil.c
+++ b/source/blender/editors/screen/glutil.c
@@ -297,13 +297,13 @@ void setlinestyle(int nr)
/* Invert line handling */
-#define glToggle(mode, onoff) (((onoff)?glEnable:glDisable)(mode))
+#define gl_toggle(mode, onoff) (((onoff)?glEnable:glDisable)(mode))
void set_inverted_drawing(int enable)
{
glLogicOp(enable?GL_INVERT:GL_COPY);
- glToggle(GL_COLOR_LOGIC_OP, enable);
- glToggle(GL_DITHER, !enable);
+ gl_toggle(GL_COLOR_LOGIC_OP, enable);
+ gl_toggle(GL_DITHER, !enable);
}
void sdrawXORline(int x0, int y0, int x1, int y1)
@@ -781,7 +781,7 @@ void glaEnd2DDraw(gla2DDrawInfo *di)
}
#endif
-/* **************** glPoint hack ************************ */
+/* **************** GL_POINT hack ************************ */
static int curmode=0;
static int pointhack=0;
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c
index fec93b3b9aa..15e6994dfe4 100644
--- a/source/blender/editors/space_view3d/drawarmature.c
+++ b/source/blender/editors/space_view3d/drawarmature.c
@@ -1297,7 +1297,7 @@ static void draw_bone(int dt, int armflag, int boneflag, short constflag, unsign
{
/* Draw a 3d octahedral bone, we use normalized space based on length,
- * for glDisplayLists */
+ * for display-lists */
glScalef(length, length, length);
@@ -1996,7 +1996,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base,
/* finally names and axes */
if ((arm->flag & (ARM_DRAWNAMES | ARM_DRAWAXES)) && (is_outline == 0)) {
- /* patch for several 3d cards (IBM mostly) that crash on glSelect with text drawing */
+ /* patch for several 3d cards (IBM mostly) that crash on GL_SELECT with text drawing */
if ((G.f & G_PICKSEL) == 0) {
float vec[3];
@@ -2208,7 +2208,7 @@ static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, int dt)
/* finally names and axes */
if (arm->flag & (ARM_DRAWNAMES | ARM_DRAWAXES)) {
- // patch for several 3d cards (IBM mostly) that crash on glSelect with text drawing
+ // patch for several 3d cards (IBM mostly) that crash on GL_SELECT with text drawing
if ((G.f & G_PICKSEL) == 0) {
float vec[3];
unsigned char col[4];
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 585fc43e5c2..36b11b2c28b 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -6990,7 +6990,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag)
drawtexspace(ob);
}
if (dtx & OB_DRAWNAME) {
- /* patch for several 3d cards (IBM mostly) that crash on glSelect with text drawing */
+ /* patch for several 3d cards (IBM mostly) that crash on GL_SELECT with text drawing */
/* but, we also don't draw names for sets or duplicators */
if (flag == 0) {
float zero[3] = {0, 0, 0};