From a0ce240de94521b6caf55b0738b70f2dc2ad3353 Mon Sep 17 00:00:00 2001 From: Jason Wilkins Date: Fri, 4 May 2012 11:50:11 +0000 Subject: 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. --- source/blender/editors/include/BIF_glutil.h | 23 ++++++++++------------ source/blender/editors/interface/interface_draw.c | 12 +++++------ source/blender/editors/screen/glutil.c | 8 ++++---- source/blender/editors/space_view3d/drawarmature.c | 6 +++--- source/blender/editors/space_view3d/drawobject.c | 2 +- 5 files changed, 24 insertions(+), 27 deletions(-) (limited to 'source/blender/editors') 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}; -- cgit v1.2.3