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:
authorCampbell Barton <ideasman42@gmail.com>2017-04-19 19:51:03 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-04-19 20:01:13 +0300
commit43a273616b1965dd6a6e1466f28cfb999b2744e3 (patch)
treeddf7c33ca6dae32ff8e39b3ca105d4f176a728dc /source/blender/editors/space_view3d/drawobject.c
parente28a92bacb94aaa011cd99f6709c63037f2d008f (diff)
No need for while-loop counting curve-normals
Diffstat (limited to 'source/blender/editors/space_view3d/drawobject.c')
-rw-r--r--source/blender/editors/space_view3d/drawobject.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 2c02de222d2..b80167ce676 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -7345,14 +7345,20 @@ static void draw_editnurb(
glLineWidth(1.0f);
int count = 0;
+ int count_used = 0;
for (bl = ob->curve_cache->bev.first, nu = nurb; nu && bl; bl = bl->next, nu = nu->next) {
int nr = bl->nr;
int skip = nu->resolu / 16;
-
+
+#if 0
while (nr-- > 0) { /* accounts for empty bevel lists */
count += 4;
nr -= skip;
}
+#else
+ /* Same as loop above */
+ count += 4 * max_ii((nr + max_ii(skip - 1, 0)) / (skip + 1), 0);
+#endif
}
if (count > 2) {
@@ -7361,7 +7367,7 @@ static void draw_editnurb(
BevPoint *bevp = bl->bevpoints;
int nr = bl->nr;
int skip = nu->resolu / 16;
-
+
while (nr-- > 0) { /* accounts for empty bevel lists */
const float fac = bevp->radius * ts->normalsize;
float vec_a[3]; /* Offset perpendicular to the curve */
@@ -7390,8 +7396,12 @@ static void draw_editnurb(
bevp += skip + 1;
nr -= skip;
+ count_used += 4;
}
}
+ BLI_assert(count == count_used);
+ UNUSED_VARS_NDEBUG(count_used);
+
immEnd();
}
immUnbindProgram();