diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-07 00:42:15 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-07 00:43:56 +0300 |
commit | fb932bb52a65c147689f5940aa0f347066ba0547 (patch) | |
tree | 700b721559370d073ca83324400bc2415f91b797 /source/blender/blenkernel/BKE_brush.h | |
parent | 150864dfb95c7b39dfd491805156599609ab3e2a (diff) |
Cleanup: use BKE_brush_tool_get/set macros
Also add API call WM_toolsystem_ref_sync_from_context
(was in rna_workspace_api.c)
Diffstat (limited to 'source/blender/blenkernel/BKE_brush.h')
-rw-r--r-- | source/blender/blenkernel/BKE_brush.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_brush.h b/source/blender/blenkernel/BKE_brush.h index aca734ae709..1a341d0208b 100644 --- a/source/blender/blenkernel/BKE_brush.h +++ b/source/blender/blenkernel/BKE_brush.h @@ -126,6 +126,14 @@ void BKE_brush_scale_size( float new_unprojected_radius, float old_unprojected_radius); +/* Accessors */ +#define BKE_brush_tool_get(brush, p) \ + (CHECK_TYPE_ANY(brush, struct Brush *, const struct Brush *), \ + *(const char *)POINTER_OFFSET(brush, (p)->runtime.tool_offset)) +#define BKE_brush_tool_set(brush, p, tool) { \ + CHECK_TYPE_ANY(brush, struct Brush *); \ + *(char *)POINTER_OFFSET(brush, (p)->runtime.tool_offset) = tool; } ((void)0) + /* debugging only */ void BKE_brush_debug_print_state(struct Brush *br); |