Use eObjectMode for function arguments

This commit is contained in:
Campbell Barton 2018-02-06 23:34:58 +11:00
parent 486e2547ee
commit f9f64ca4a3
5 changed files with 11 additions and 8 deletions

@ -36,6 +36,7 @@ struct Scene;
struct UnifiedPaintSettings;
// enum eCurveMappingPreset;
#include "DNA_object_enums.h"
/* globals for brush execution */
void BKE_brush_system_init(void);
@ -43,8 +44,8 @@ void BKE_brush_system_exit(void);
/* datablock functions */
void BKE_brush_init(struct Brush *brush);
struct Brush *BKE_brush_add(struct Main *bmain, const char *name, short ob_mode);
struct Brush *BKE_brush_first_search(struct Main *bmain, short ob_mode);
struct Brush *BKE_brush_add(struct Main *bmain, const char *name, const eObjectMode ob_mode);
struct Brush *BKE_brush_first_search(struct Main *bmain, const eObjectMode ob_mode);
void BKE_brush_copy_data(struct Main *bmain, struct Brush *brush_dst, const struct Brush *brush_src, const int flag);
struct Brush *BKE_brush_copy(struct Main *bmain, const struct Brush *brush);
void BKE_brush_make_local(struct Main *bmain, struct Brush *brush, const bool lib_local);

@ -60,6 +60,8 @@ struct UnifiedPaintSettings;
enum eOverlayFlags;
#include "DNA_object_enums.h"
extern const char PAINT_CURSOR_SCULPT[3];
extern const char PAINT_CURSOR_VERTEX_PAINT[3];
extern const char PAINT_CURSOR_WEIGHT_PAINT[3];
@ -122,7 +124,7 @@ void BKE_paint_copy(struct Paint *src, struct Paint *tar, const int flag);
void BKE_paint_cavity_curve_preset(struct Paint *p, int preset);
short BKE_paint_object_mode_from_paint_mode(ePaintMode mode);
eObjectMode BKE_paint_object_mode_from_paint_mode(ePaintMode mode);
struct Paint *BKE_paint_get_active_from_paintmode(struct Scene *sce, ePaintMode mode);
struct Paint *BKE_paint_get_active(struct Scene *sce);
struct Paint *BKE_paint_get_active_from_context(const struct bContext *C);

@ -151,7 +151,7 @@ void BKE_brush_init(Brush *brush)
/**
* \note Resulting brush will have two users: one as a fake user, another is assumed to be used by the caller.
*/
Brush *BKE_brush_add(Main *bmain, const char *name, short ob_mode)
Brush *BKE_brush_add(Main *bmain, const char *name, const eObjectMode ob_mode)
{
Brush *brush;
@ -164,7 +164,7 @@ Brush *BKE_brush_add(Main *bmain, const char *name, short ob_mode)
return brush;
}
struct Brush *BKE_brush_first_search(struct Main *bmain, short ob_mode)
struct Brush *BKE_brush_first_search(struct Main *bmain, const eObjectMode ob_mode)
{
Brush *brush;

@ -496,7 +496,7 @@ void BKE_paint_cavity_curve_preset(Paint *p, int preset)
curvemapping_changed(p->cavity_curve, false);
}
short BKE_paint_object_mode_from_paint_mode(ePaintMode mode)
eObjectMode BKE_paint_object_mode_from_paint_mode(ePaintMode mode)
{
switch (mode) {
case ePaintSculpt:
@ -526,7 +526,7 @@ void BKE_paint_init(Scene *sce, ePaintMode mode, const char col[3])
/* If there's no brush, create one */
brush = BKE_paint_brush(paint);
if (brush == NULL) {
short ob_mode = BKE_paint_object_mode_from_paint_mode(mode);
eObjectMode ob_mode = BKE_paint_object_mode_from_paint_mode(mode);
brush = BKE_brush_first_search(G.main, ob_mode);
if (!brush) {

@ -72,7 +72,7 @@ typedef struct Brush {
float rake_factor; /* rake actual data (not texture), used for sculpt */
short blend; /* blend mode */
short ob_mode; /* & with ob->mode to see if the brush is compatible, use for display only. */
short ob_mode; /* eObjectMode: to see if the brush is compatible, use for display only. */
float weight; /* brush weight */
int size; /* brush diameter */
int flag; /* general purpose flag */