[Bf-blender-cvs] [1422f0d] gooseberry: Use line drawing as a fallback if only one child is assigned to a parent.
Lukas Tönne
noreply at git.blender.org
Thu Jan 22 19:51:23 CET 2015
Commit: 1422f0d6cfd4251a72528b177ea62dc7145cd65f
Author: Lukas Tönne
Date: Thu Jan 22 15:46:46 2015 +0100
Branches: gooseberry
https://developer.blender.org/rB1422f0d6cfd4251a72528b177ea62dc7145cd65f
Use line drawing as a fallback if only one child is assigned to a parent.
===================================================================
M source/blender/editors/space_view3d/drawobject.c
===================================================================
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 19cd42a..164fbea 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -4503,8 +4503,6 @@ static void draw_particle_hair_hull(Scene *UNUSED(scene), View3D *v3d, RegionVie
glDepthMask(true);
glGetIntegerv(GL_POLYGON_MODE, polygonmode);
-// glEnableClientState(GL_VERTEX_ARRAY);
-// glEnableClientState(GL_NORMAL_ARRAY);
glEnable(GL_LIGHTING);
glEnable(GL_COLOR_MATERIAL);
@@ -4578,16 +4576,21 @@ static void draw_particle_hair_hull(Scene *UNUSED(scene), View3D *v3d, RegionVie
}
}
else {
- /* fall back to line drawing */
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_NORMAL_ARRAY);
+
+ /* fall back to line drawing in case of only 1 child */
+ glVertexPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->co);
+ glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), path->vel);
+
+ glDrawArrays(GL_LINE_STRIP, 0, path->segments + 1);
+
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_NORMAL_ARRAY);
}
pstart = p+1;
}
-
-// glVertexPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->co);
-// glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), path->vel);
-
-// glDrawArrays(GL_LINE_STRIP, 0, path->segments + 1);
}
glEnd();
@@ -4596,8 +4599,6 @@ static void draw_particle_hair_hull(Scene *UNUSED(scene), View3D *v3d, RegionVie
glDisable(GL_COLOR_MATERIAL);
glDisable(GL_LIGHTING);
-// glDisableClientState(GL_VERTEX_ARRAY);
-// glDisableClientState(GL_NORMAL_ARRAY);
glPolygonMode(GL_FRONT, polygonmode[0]);
glPolygonMode(GL_BACK, polygonmode[1]);
More information about the Bf-blender-cvs
mailing list