diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-05-01 07:58:58 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-05-01 08:05:25 +0300 |
commit | ff1174e52c92ba5580a309ff9f6636fe179c4051 (patch) | |
tree | 2f0c40b26902dda7a34514eaebc6cb8c42f058cf /source/blender/blenkernel | |
parent | a6fbd4c9c8f46e479abb3be906362c8a71e5cee1 (diff) |
Cleanup: improve readability for color assignment
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/brush.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index c734205e84c..052f16b36a3 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -2055,7 +2055,7 @@ unsigned int *BKE_brush_gen_texture_cache(Brush *br, int half_side, bool use_sec unsigned int *texcache = NULL; MTex *mtex = (use_secondary) ? &br->mask_mtex : &br->mtex; float intensity; - float rgba[4]; + float rgba_dummy[4]; int ix, iy; int side = half_side * 2; @@ -2073,11 +2073,8 @@ unsigned int *BKE_brush_gen_texture_cache(Brush *br, int half_side, bool use_sec /* This is copied from displace modifier code */ /* TODO(sergey): brush are always caching with CM enabled for now. */ - RE_texture_evaluate(mtex, co, 0, NULL, false, false, &intensity, rgba); - - ((char *)texcache)[(iy * side + ix) * 4] = ((char *)texcache)[(iy * side + ix) * 4 + 1] = - ((char *)texcache)[(iy * side + ix) * 4 + 2] = (( - char *)texcache)[(iy * side + ix) * 4 + 3] = (char)(intensity * 255.0f); + RE_texture_evaluate(mtex, co, 0, NULL, false, false, &intensity, rgba_dummy); + copy_v4_uchar((uchar *)&texcache[iy * side + ix], (char)(intensity * 255.0f)); } } } |