diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-10-14 22:54:29 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-10-17 01:22:48 +0400 |
commit | c6c7b9e0f7331ce004e517ea02c6a3baf4378a54 (patch) | |
tree | 8a6d44a6a0ffcfe21090fe7a88fe72830bf79c38 /source/blender/blenkernel/intern | |
parent | b28aa182f3483ca467105505834eabf2eaa5a51a (diff) |
Cleanup: use SQUARED macro
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/multires.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index b470b9c7c65..9f5e049fe24 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -126,7 +126,7 @@ static BLI_bitmap *multires_mdisps_upsample_hidden(BLI_bitmap *lo_hidden, if (lo_level == hi_level) return MEM_dupallocN(lo_hidden); - subd = BLI_BITMAP_NEW(hi_gridsize * hi_gridsize, "MDisps.hidden upsample"); + subd = BLI_BITMAP_NEW(SQUARE(hi_gridsize), "MDisps.hidden upsample"); factor = BKE_ccg_factor(lo_level, hi_level); offset = 1 << (hi_level - lo_level - 1); @@ -182,9 +182,7 @@ static BLI_bitmap *multires_mdisps_downsample_hidden(BLI_bitmap *old_hidden, BLI_assert(new_level <= old_level); factor = BKE_ccg_factor(new_level, old_level); - new_hidden = BLI_BITMAP_NEW(new_gridsize * new_gridsize, - "downsample hidden"); - + new_hidden = BLI_BITMAP_NEW(SQUARE(new_gridsize), "downsample hidden"); for (y = 0; y < new_gridsize; y++) { @@ -250,15 +248,15 @@ static MDisps *multires_mdisps_initialize_hidden(Mesh *me, int level) MDisps *mdisps = CustomData_add_layer(&me->ldata, CD_MDISPS, CD_CALLOC, NULL, me->totloop); int gridsize = BKE_ccg_gridsize(level); - int gridarea = gridsize * gridsize; + int gridarea = SQUARE(gridsize); int i, j; for (i = 0; i < me->totpoly; i++) { - int hide = 0; + bool hide = false; for (j = 0; j < me->mpoly[i].totloop; j++) { if (me->mvert[me->mloop[me->mpoly[i].loopstart + j].v].flag & ME_HIDE) { - hide = 1; + hide = true; break; } } @@ -599,7 +597,7 @@ static void multires_grid_paint_mask_downsample(GridPaintMask *gpm, int level) { if (level < gpm->level) { int gridsize = BKE_ccg_gridsize(level); - float *data = MEM_callocN(sizeof(float) * gridsize * gridsize, + float *data = MEM_callocN(sizeof(float) * SQUARE(gridsize), "multires_grid_paint_mask_downsample"); int x, y; |