[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57372] trunk/blender/source/blender/ editors/space_view3d/drawobject.c: another case that should have been in r57371, also reduce type conversions in compassion.
Campbell Barton
ideasman42 at gmail.com
Tue Jun 11 07:56:03 CEST 2013
Revision: 57372
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57372
Author: campbellbarton
Date: 2013-06-11 05:56:02 +0000 (Tue, 11 Jun 2013)
Log Message:
-----------
another case that should have been in r57371, also reduce type conversions in compassion.
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57371
Modified Paths:
--------------
trunk/blender/source/blender/editors/space_view3d/drawobject.c
Modified: trunk/blender/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawobject.c 2013-06-11 05:21:36 UTC (rev 57371)
+++ trunk/blender/source/blender/editors/space_view3d/drawobject.c 2013-06-11 05:56:02 UTC (rev 57372)
@@ -105,8 +105,8 @@
typedef struct drawDMVerts_userData {
BMEditMesh *em;
- int sel;
BMVert *eve_act;
+ char sel;
/* cached theme values */
unsigned char th_editmesh_active[4];
@@ -2038,13 +2038,13 @@
static void draw_dm_face_centers__mapFunc(void *userData, int index, const float cent[3], const float UNUSED(no[3]))
{
BMFace *efa = EDBM_face_at_index(((void **)userData)[0], index);
- int sel = *(((int **)userData)[1]);
+ const char sel = *(((char **)userData)[1]);
if (efa && !BM_elem_flag_test(efa, BM_ELEM_HIDDEN) && BM_elem_flag_test(efa, BM_ELEM_SELECT) == sel) {
bglVertex3fv(cent);
}
}
-static void draw_dm_face_centers(BMEditMesh *em, DerivedMesh *dm, int sel)
+static void draw_dm_face_centers(BMEditMesh *em, DerivedMesh *dm, char sel)
{
void *ptrs[2] = {em, &sel};
@@ -2065,9 +2065,7 @@
copy_v3_v3(no, no_f);
}
else {
- no[0] = no_s[0] / 32767.0f;
- no[1] = no_s[1] / 32767.0f;
- no[2] = no_s[2] / 32767.0f;
+ normal_short_to_float_v3(no, no_s);
}
if (!data->uniform_scale) {
@@ -2147,7 +2145,7 @@
}
}
-static void draw_dm_verts(BMEditMesh *em, DerivedMesh *dm, int sel, BMVert *eve_act,
+static void draw_dm_verts(BMEditMesh *em, DerivedMesh *dm, const char sel, BMVert *eve_act,
RegionView3D *rv3d)
{
drawDMVerts_userData data;
@@ -5092,7 +5090,7 @@
/* place to add drawers */
-static void drawhandlesN(Nurb *nu, short sel, short hide_handles)
+static void drawhandlesN(Nurb *nu, const char sel, const bool hide_handles)
{
BezTriple *bezt;
float *fp;
@@ -5187,7 +5185,7 @@
glLineWidth(1);
}
-static void drawvertsN(Nurb *nu, short sel, short hide_handles, void *lastsel)
+static void drawvertsN(Nurb *nu, const char sel, const bool hide_handles, void *lastsel)
{
BezTriple *bezt;
BPoint *bp;
@@ -5450,7 +5448,7 @@
Curve *cu = ob->data;
Nurb *nu;
BevList *bl;
- short hide_handles = (cu->drawflag & CU_HIDE_HANDLES);
+ const bool hide_handles = (cu->drawflag & CU_HIDE_HANDLES) != 0;
int index;
unsigned char wire_col[3];
@@ -5526,13 +5524,13 @@
}
}
- if (v3d->zbuf) glDisable(GL_DEPTH_TEST);
+ if (v3d->zbuf) glDepthFunc(GL_ALWAYS);
for (nu = nurb; nu; nu = nu->next) {
drawvertsN(nu, 1, hide_handles, cu->lastsel);
}
- if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
+ if (v3d->zbuf) glDepthFunc(GL_LEQUAL);
}
/* draw a sphere for use as an empty drawtype */
More information about the Bf-blender-cvs
mailing list