[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33458] trunk/blender/source/blender/ editors: remove shadowed definitions but keep them as zero this time.
Campbell Barton
ideasman42 at gmail.com
Sat Dec 4 00:55:10 CET 2010
Revision: 33458
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33458
Author: campbellbarton
Date: 2010-12-04 00:55:10 +0100 (Sat, 04 Dec 2010)
Log Message:
-----------
remove shadowed definitions but keep them as zero this time.
Modified Paths:
--------------
trunk/blender/source/blender/editors/include/ED_view3d.h
trunk/blender/source/blender/editors/space_view3d/drawobject.c
Modified: trunk/blender/source/blender/editors/include/ED_view3d.h
===================================================================
--- trunk/blender/source/blender/editors/include/ED_view3d.h 2010-12-03 23:17:49 UTC (rev 33457)
+++ trunk/blender/source/blender/editors/include/ED_view3d.h 2010-12-03 23:55:10 UTC (rev 33458)
@@ -121,7 +121,7 @@
void view3d_align_axis_to_vector(struct View3D *v3d, struct RegionView3D *rv3d, int axisidx, float vec[3]);
float view3d_pixel_size(struct RegionView3D *rv3d, const float co[3]);
-void drawcircball(int mode, float *cent, float rad, float tmat[][4]);
+void drawcircball(int mode, const float cent[3], float rad, float tmat[][4]);
/* backbuffer select and draw support */
void view3d_validate_backbuf(struct ViewContext *vc);
Modified: trunk/blender/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawobject.c 2010-12-03 23:17:49 UTC (rev 33457)
+++ trunk/blender/source/blender/editors/space_view3d/drawobject.c 2010-12-03 23:55:10 UTC (rev 33458)
@@ -316,7 +316,7 @@
1.00000000
};
-static void draw_xyz_wire(float *c, float size, int axis)
+static void draw_xyz_wire(const float c[3], float size, int axis)
{
float v1[3]= {0.f, 0.f, 0.f}, v2[3] = {0.f, 0.f, 0.f};
float dim = size * 0.1;
@@ -413,16 +413,16 @@
case OB_PLAINAXES:
for (axis=0; axis<3; axis++) {
- float v1[3]= {0.0, 0.0, 0.0};
- float v2[3]= {0.0, 0.0, 0.0};
-
glBegin(GL_LINES);
v1[axis]= size;
v2[axis]= -size;
glVertex3fv(v1);
glVertex3fv(v2);
-
+
+ /* reset v1 & v2 to zero */
+ v1[axis]= v2[axis]= 0.0f;
+
glEnd();
}
break;
@@ -478,10 +478,8 @@
case OB_ARROWS:
default:
for (axis=0; axis<3; axis++) {
- float v1[3]= {0.0, 0.0, 0.0};
- float v2[3]= {0.0, 0.0, 0.0};
- int arrow_axis= (axis==0)?1:0;
-
+ const int arrow_axis= (axis==0) ? 1:0;
+
glBegin(GL_LINES);
v2[axis]= size;
@@ -502,12 +500,16 @@
v2[axis]+= size*0.125;
draw_xyz_wire(v2, size, axis);
+
+
+ /* reset v1 & v2 to zero */
+ v1[arrow_axis]= v1[axis]= v2[axis]= 0.0f;
}
break;
}
}
-void drawcircball(int mode, float *cent, float rad, float tmat[][4])
+void drawcircball(int mode, const float cent[3], float rad, float tmat[][4])
{
float vec[3], vx[3], vy[3];
int a, tot=32;
@@ -526,7 +528,7 @@
}
/* circle for object centers, special_color is for library or ob users */
-static void drawcentercircle(View3D *v3d, RegionView3D *rv3d, float *co, int selstate, int special_color)
+static void drawcentercircle(View3D *v3d, RegionView3D *rv3d, const float co[3], int selstate, int special_color)
{
const float size= view3d_pixel_size(rv3d, co) * (float)U.obcenter_dia * 0.5f;
More information about the Bf-blender-cvs
mailing list