From 99f72dfbfcb004418ae3c701f3badfd36996e6e5 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Wed, 14 Mar 2012 03:10:18 +0000 Subject: 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. --- source/blender/blenkernel/intern/customdata.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/blenkernel/intern/customdata.c') diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 233d0202540..2520c9b666e 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -485,10 +485,12 @@ static void layerCopy_mdisps(const void *source, void *dest, int count) if(s[i].disps) { d[i].disps = MEM_dupallocN(s[i].disps); d[i].totdisp = s[i].totdisp; + d[i].level = s[i].level; } else { d[i].disps = NULL; d[i].totdisp = 0; + d[i].level = 0; } } @@ -504,6 +506,7 @@ static void layerFree_mdisps(void *data, int count, int UNUSED(size)) MEM_freeN(d[i].disps); d[i].disps = NULL; d[i].totdisp = 0; + d[i].level = 0; } } -- cgit v1.2.3