From fb932bb52a65c147689f5940aa0f347066ba0547 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 7 Nov 2018 08:42:15 +1100 Subject: Cleanup: use BKE_brush_tool_get/set macros Also add API call WM_toolsystem_ref_sync_from_context (was in rna_workspace_api.c) --- source/blender/blenkernel/BKE_brush.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender/blenkernel/BKE_brush.h') 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); -- cgit v1.2.3