diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-03-14 07:10:18 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-03-14 07:10:18 +0400 |
commit | 99f72dfbfcb004418ae3c701f3badfd36996e6e5 (patch) | |
tree | 15fb556342a58a1a947bd087c11d39f7afa4f95b /source/blender/blenkernel/intern/mesh.c | |
parent | f80fa544281afb22815ca083d0badd3a9979d17d (diff) |
Add 'level' field to struct MDisps, companion to 'totdisp'.
Gets initialized when loading old files and updated at the same places
totdisp is updated. Saves having to do log+sqrt to extract level from
totdisp.
Diffstat (limited to 'source/blender/blenkernel/intern/mesh.c')
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 054cbe0021b..6600099fff7 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -1877,6 +1877,7 @@ static void bm_corners_to_loops(Mesh *me, int findex, int loopstart, int numTex, for (i=0; i<tot; i++, disps += side*side, ld++) { ld->totdisp = side*side; + ld->level = (int)(logf(side - 1.0f) / M_LN2) + 1; if (ld->disps) MEM_freeN(ld->disps); |