Cleanup: #define -> enums.

This commit is contained in:
Bastien Montagne 2014-11-19 20:48:35 +01:00
parent 82d2718c8f
commit 0cb1c2cdee
4 changed files with 323 additions and 251 deletions

View File

@ -44,54 +44,65 @@ struct FileData;
struct ID; struct ID;
struct PackedFile; struct PackedFile;
struct GPUTexture; struct GPUTexture;
typedef struct IDPropertyData { typedef struct IDPropertyData {
void *pointer; void *pointer;
ListBase group; ListBase group;
int val, val2; /*note, we actually fit a double into these two ints*/ int val, val2; /* note, we actually fit a double into these two ints */
} IDPropertyData; } IDPropertyData;
typedef struct IDProperty { typedef struct IDProperty {
struct IDProperty *next, *prev; struct IDProperty *next, *prev;
char type, subtype; char type, subtype;
short flag; short flag;
char name[64]; /* MAX_IDPROP_NAME */ char name[64]; /* MAX_IDPROP_NAME */
int saved; /* saved is used to indicate if this struct has been saved yet.
* seemed like a good idea as a pad var was needed anyway :)*/ /* saved is used to indicate if this struct has been saved yet.
IDPropertyData data; /* note, alignment for 64 bits */ * seemed like a good idea as a pad var was needed anyway :) */
int len; /* array length, also (this is important!) string length + 1. int saved;
* the idea is to be able to reuse array realloc functions on strings.*/ IDPropertyData data; /* note, alignment for 64 bits */
/* array length, also (this is important!) string length + 1.
* the idea is to be able to reuse array realloc functions on strings.*/
int len;
/* Strings and arrays are both buffered, though the buffer isn't saved. */
/* totallen is total length of allocated array/string, including a buffer. /* totallen is total length of allocated array/string, including a buffer.
* Note that the buffering is mild; the code comes from python's list implementation.*/ * Note that the buffering is mild; the code comes from python's list implementation. */
int totallen; /*strings and arrays are both buffered, though the buffer isn't saved.*/ int totallen;
} IDProperty; } IDProperty;
#define MAX_IDPROP_NAME 64 #define MAX_IDPROP_NAME 64
#define DEFAULT_ALLOC_FOR_NULL_STRINGS 64 #define DEFAULT_ALLOC_FOR_NULL_STRINGS 64
/*->type*/ /*->type*/
#define IDP_STRING 0 enum {
#define IDP_INT 1 IDP_STRING = 0,
#define IDP_FLOAT 2 IDP_INT = 1,
#define IDP_ARRAY 5 IDP_FLOAT = 2,
#define IDP_GROUP 6 IDP_ARRAY = 5,
/* the ID link property type hasn't been implemented yet, this will require IDP_GROUP = 6,
* some cleanup of blenkernel, most likely.*/ /* the ID link property type hasn't been implemented yet, this will require
#define IDP_ID 7 * some cleanup of blenkernel, most likely. */
#define IDP_DOUBLE 8 IDP_ID = 7,
#define IDP_IDPARRAY 9 IDP_DOUBLE = 8,
#define IDP_NUMTYPES 10 IDP_IDPARRAY = 9,
IDP_NUMTYPES = 10,
};
/*->subtype */ /*->subtype */
/* IDP_STRING */ /* IDP_STRING */
#define IDP_STRING_SUB_UTF8 0 /* default */ enum {
#define IDP_STRING_SUB_BYTE 1 /* arbitrary byte array, _not_ null terminated */ IDP_STRING_SUB_UTF8 = 0, /* default */
/*->flag*/ IDP_STRING_SUB_BYTE = 1, /* arbitrary byte array, _not_ null terminated */
#define IDP_FLAG_GHOST (1<<7) /* this means the property is set but RNA will return };
* false when checking 'RNA_property_is_set',
* currently this is a runtime flag */
/*->flag*/
enum {
IDP_FLAG_GHOST = 1 << 7, /* this means the property is set but RNA will return false when checking
* 'RNA_property_is_set', currently this is a runtime flag */
};
/* add any future new id property types here.*/ /* add any future new id property types here.*/
@ -102,7 +113,7 @@ typedef struct IDProperty {
* */ * */
/* 2 characters for ID code and 64 for actual name */ /* 2 characters for ID code and 64 for actual name */
#define MAX_ID_NAME 66 #define MAX_ID_NAME 66
/* There's a nasty circular dependency here.... 'void *' to the rescue! I /* There's a nasty circular dependency here.... 'void *' to the rescue! I
* really wonder why this is needed. */ * really wonder why this is needed. */
@ -129,14 +140,14 @@ typedef struct Library {
ID id; ID id;
ID *idblock; ID *idblock;
struct FileData *filedata; struct FileData *filedata;
char name[1024]; /* path name used for reading, can be relative and edited in the outliner */ char name[1024]; /* path name used for reading, can be relative and edited in the outliner */
char filepath[1024]; /* absolute filepath, this is only for convenience,
* 'name' is the real path used on file read but in /* absolute filepath, this is only for convenience, 'name' is the real path used on file read but in
* some cases its useful to access the absolute one, * some cases its useful to access the absolute one.
* This is set on file read. * This is set on file read.
* Use BKE_library_filepath_set() rather than * Use BKE_library_filepath_set() rather than setting 'name' directly and it will be kept in sync - campbell */
* setting 'name' directly and it will be kept in char filepath[1024];
* sync - campbell */
struct Library *parent; /* set for indirectly linked libs, used in the outliner and while reading */ struct Library *parent; /* set for indirectly linked libs, used in the outliner and while reading */
struct PackedFile *packedfile; struct PackedFile *packedfile;
@ -239,26 +250,28 @@ typedef struct PreviewImage {
#define ID_NEW_US(a) if ( (a)->id.newid) { (a) = (void *)(a)->id.newid; (a)->id.us++; } #define ID_NEW_US(a) if ( (a)->id.newid) { (a) = (void *)(a)->id.newid; (a)->id.us++; }
#define ID_NEW_US2(a) if (((ID *)a)->newid) { (a) = ((ID *)a)->newid; ((ID *)a)->us++; } #define ID_NEW_US2(a) if (((ID *)a)->newid) { (a) = ((ID *)a)->newid; ((ID *)a)->us++; }
/* id->flag: set frist 8 bits always at zero while reading */ /* id->flag: set first 8 bits always at zero while reading */
#define LIB_LOCAL 0 enum {
#define LIB_EXTERN 1 LIB_LOCAL = 0,
#define LIB_INDIRECT 2 LIB_EXTERN = 1 << 0,
#define LIB_NEED_EXPAND 8 LIB_INDIRECT = 1 << 1,
#define LIB_TESTEXT (LIB_NEED_EXPAND | LIB_EXTERN) LIB_NEED_EXPAND = 1 << 3,
#define LIB_TESTIND (LIB_NEED_EXPAND | LIB_INDIRECT) LIB_TESTEXT = (LIB_NEED_EXPAND | LIB_EXTERN),
#define LIB_READ 16 LIB_TESTIND = (LIB_NEED_EXPAND | LIB_INDIRECT),
#define LIB_NEED_LINK 32 LIB_READ = 1 << 4,
LIB_NEED_LINK = 1 << 5,
#define LIB_NEW 256 LIB_NEW = 1 << 8,
#define LIB_FAKEUSER 512 LIB_FAKEUSER = 1 << 9,
/* free test flag */ /* free test flag */
#define LIB_DOIT 1024 LIB_DOIT = 1 << 10,
/* tag existing data before linking so we know what is new */ /* tag existing data before linking so we know what is new */
#define LIB_PRE_EXISTING 2048 LIB_PRE_EXISTING = 1 << 11,
/* runtime */ /* runtime */
#define LIB_ID_RECALC 4096 LIB_ID_RECALC = 1 << 12,
#define LIB_ID_RECALC_DATA 8192 LIB_ID_RECALC_DATA = 1 << 13,
#define LIB_ANIM_NO_RECALC 16384 LIB_ANIM_NO_RECALC = 1 << 14,
};
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -270,86 +270,101 @@ typedef struct Curve {
/* **************** CURVE ********************* */ /* **************** CURVE ********************* */
/* texflag */ /* Curve.texflag */
#define CU_AUTOSPACE 1
/* drawflag */
#define CU_HIDE_HANDLES (1 << 0)
#define CU_HIDE_NORMALS (1 << 1)
/* flag */
#define CU_3D 1
#define CU_FRONT 2
#define CU_BACK 4
#define CU_PATH 8
#define CU_FOLLOW 16
#define CU_UV_ORCO 32
#define CU_DEFORM_BOUNDS_OFF 64
#define CU_STRETCH 128
/* #define CU_OFFS_PATHDIST 256 */ /* DEPRECATED */
#define CU_FAST 512 /* Font: no filling inside editmode */
/* #define CU_RETOPO 1024 */ /* DEPRECATED */
#define CU_DS_EXPAND 2048
#define CU_PATH_RADIUS 4096 /* make use of the path radius if this is enabled (default for new curves) */
#define CU_DEFORM_FILL 8192 /* fill 2d curve after deformation */
#define CU_FILL_CAPS 16384 /* fill bevel caps */
#define CU_MAP_TAPER 32768 /* map taper object to beveled area */
/* twist mode */
#define CU_TWIST_Z_UP 0
// #define CU_TWIST_Y_UP 1 // not used yet
// #define CU_TWIST_X_UP 2
#define CU_TWIST_MINIMUM 3
#define CU_TWIST_TANGENT 4
/* bevel factor mapping */
enum { enum {
CU_BEVFAC_MAP_RESOLU = 0, CU_AUTOSPACE = 1,
CU_BEVFAC_MAP_SEGMENT = 1,
CU_BEVFAC_MAP_SPLINE = 2
}; };
/* spacemode */ /* Curve.drawflag */
#define CU_LEFT 0 enum {
#define CU_MIDDLE 1 CU_HIDE_HANDLES = 1 << 0,
#define CU_RIGHT 2 CU_HIDE_NORMALS = 1 << 1,
#define CU_JUSTIFY 3 };
#define CU_FLUSH 4
/* flag (nurb) */ /* Curve.flag */
#define CU_SMOOTH 1 enum {
#define CU_2D 8 /* moved from type since 2.4x */ CU_3D = 1 << 0,
CU_FRONT = 1 << 1,
CU_BACK = 1 << 2,
CU_PATH = 1 << 3,
CU_FOLLOW = 1 << 4,
CU_UV_ORCO = 1 << 5,
CU_DEFORM_BOUNDS_OFF = 1 << 6,
CU_STRETCH = 1 << 7,
/* CU_OFFS_PATHDIST = 1 << 8, */ /* DEPRECATED */
CU_FAST = 1 << 9, /* Font: no filling inside editmode */
/* CU_RETOPO = 1 << 10, */ /* DEPRECATED */
CU_DS_EXPAND = 1 << 11,
CU_PATH_RADIUS = 1 << 12, /* make use of the path radius if this is enabled (default for new curves) */
CU_DEFORM_FILL = 1 << 13, /* fill 2d curve after deformation */
CU_FILL_CAPS = 1 << 14, /* fill bevel caps */
CU_MAP_TAPER = 1 << 15, /* map taper object to beveled area */
};
/* type (nurb) */ /* Curve.twist_mode */
#define CU_POLY 0 enum {
#define CU_BEZIER 1 CU_TWIST_Z_UP = 0,
#define CU_BSPLINE 2 /* CU_TWIST_Y_UP = 1, */ /* not used yet */
#define CU_CARDINAL 3 /* CU_TWIST_X_UP = 2, */
#define CU_NURBS 4 CU_TWIST_MINIMUM = 3,
#define CU_TYPE (CU_POLY|CU_BEZIER|CU_BSPLINE|CU_CARDINAL|CU_NURBS) CU_TWIST_TANGENT = 4,
};
/* only for adding */ /* Curve.bevfac1_mapping, Curve.bevfac2_mapping, bevel factor mapping */
#define CU_PRIMITIVE 0xF00 enum {
CU_BEVFAC_MAP_RESOLU = 0,
CU_BEVFAC_MAP_SEGMENT = 1,
CU_BEVFAC_MAP_SPLINE = 2,
};
/* 2 or 4 points */ /* Curve.spacemode */
#define CU_PRIM_CURVE 0x100 enum {
/* 8 points circle */ CU_LEFT = 0,
#define CU_PRIM_CIRCLE 0x200 CU_MIDDLE = 1,
/* 4x4 patch Nurb */ CU_RIGHT = 2,
#define CU_PRIM_PATCH 0x300 CU_JUSTIFY = 3,
#define CU_PRIM_TUBE 0x400 CU_FLUSH = 4,
#define CU_PRIM_SPHERE 0x500 };
#define CU_PRIM_DONUT 0x600
/* 5 points, 5th order straight line (for anim path) */
#define CU_PRIM_PATH 0x700
/* Nurb.flag */
enum {
CU_SMOOTH = 1 << 0,
CU_2D = 1 << 3, /* moved from type since 2.4x */
};
/* flagu flagv (nurb) */ /* Nurb.type */
#define CU_NURB_CYCLIC 1 enum {
#define CU_NURB_ENDPOINT 2 CU_POLY = 0,
#define CU_NURB_BEZIER 4 CU_BEZIER = 1,
CU_BSPLINE = 2,
CU_CARDINAL = 3,
CU_NURBS = 4,
CU_TYPE = (CU_POLY | CU_BEZIER | CU_BSPLINE | CU_CARDINAL | CU_NURBS),
#define CU_ACT_NONE -1 /* only for adding */
CU_PRIMITIVE = 0xF00,
/* 2 or 4 points */
CU_PRIM_CURVE = 0x100,
/* 8 points circle */
CU_PRIM_CIRCLE = 0x200,
/* 4x4 patch Nurb */
CU_PRIM_PATCH = 0x300,
CU_PRIM_TUBE = 0x400,
CU_PRIM_SPHERE = 0x500,
CU_PRIM_DONUT = 0x600,
/* 5 points, 5th order straight line (for anim path) */
CU_PRIM_PATH = 0x700,
};
/* Nurb.flagu, Nurb.flagv */
enum {
CU_NURB_CYCLIC = 1 << 0,
CU_NURB_ENDPOINT = 1 << 1,
CU_NURB_BEZIER = 1 << 2,
};
#define CU_ACT_NONE -1
/* *************** BEZTRIPLE **************** */ /* *************** BEZTRIPLE **************** */
@ -366,9 +381,9 @@ typedef enum eBezTriple_Handle {
/* interpolation modes (used only for BezTriple->ipo) */ /* interpolation modes (used only for BezTriple->ipo) */
typedef enum eBezTriple_Interpolation { typedef enum eBezTriple_Interpolation {
/* traditional interpolation */ /* traditional interpolation */
BEZT_IPO_CONST = 0, /* constant interpolation */ BEZT_IPO_CONST = 0, /* constant interpolation */
BEZT_IPO_LIN = 1, /* linear interpolation */ BEZT_IPO_LIN = 1, /* linear interpolation */
BEZT_IPO_BEZ = 2, /* bezier interpolation */ BEZT_IPO_BEZ = 2, /* bezier interpolation */
/* easing equations */ /* easing equations */
BEZT_IPO_BACK = 3, BEZT_IPO_BACK = 3,
@ -380,7 +395,7 @@ typedef enum eBezTriple_Interpolation {
BEZT_IPO_QUAD = 9, BEZT_IPO_QUAD = 9,
BEZT_IPO_QUART = 10, BEZT_IPO_QUART = 10,
BEZT_IPO_QUINT = 11, BEZT_IPO_QUINT = 11,
BEZT_IPO_SINE = 12 BEZT_IPO_SINE = 12,
} eBezTriple_Interpolation; } eBezTriple_Interpolation;
/* easing modes (used only for Keyframes - BezTriple->easing) */ /* easing modes (used only for Keyframes - BezTriple->easing) */
@ -389,15 +404,15 @@ typedef enum eBezTriple_Easing {
BEZT_IPO_EASE_IN = 1, BEZT_IPO_EASE_IN = 1,
BEZT_IPO_EASE_OUT = 2, BEZT_IPO_EASE_OUT = 2,
BEZT_IPO_EASE_IN_OUT = 3 BEZT_IPO_EASE_IN_OUT = 3,
} eBezTriple_Easing; } eBezTriple_Easing;
/* types of keyframe (used only for BezTriple->hide when BezTriple is used in F-Curves) */ /* types of keyframe (used only for BezTriple->hide when BezTriple is used in F-Curves) */
typedef enum eBezTriple_KeyframeType { typedef enum eBezTriple_KeyframeType {
BEZT_KEYTYPE_KEYFRAME = 0, /* default - 'proper' Keyframe */ BEZT_KEYTYPE_KEYFRAME = 0, /* default - 'proper' Keyframe */
BEZT_KEYTYPE_EXTREME = 1, /* 'extreme' keyframe */ BEZT_KEYTYPE_EXTREME = 1, /* 'extreme' keyframe */
BEZT_KEYTYPE_BREAKDOWN = 2, /* 'breakdown' keyframe */ BEZT_KEYTYPE_BREAKDOWN = 2, /* 'breakdown' keyframe */
BEZT_KEYTYPE_JITTER = 3, /* 'jitter' keyframe (for adding 'filler' secondary motion) */ BEZT_KEYTYPE_JITTER = 3, /* 'jitter' keyframe (for adding 'filler' secondary motion) */
} eBezTriple_KeyframeType; } eBezTriple_KeyframeType;
/* checks if the given BezTriple is selected */ /* checks if the given BezTriple is selected */
@ -406,14 +421,16 @@ typedef enum eBezTriple_KeyframeType {
/* *************** CHARINFO **************** */ /* *************** CHARINFO **************** */
/* flag */ /* CharInfo.flag */
/* note: CU_CHINFO_WRAP and CU_CHINFO_SMALLCAPS_TEST are set dynamically */ enum {
#define CU_CHINFO_BOLD (1<<0) /* note: CU_CHINFO_WRAP and CU_CHINFO_SMALLCAPS_TEST are set dynamically */
#define CU_CHINFO_ITALIC (1<<1) CU_CHINFO_BOLD = 1 << 0,
#define CU_CHINFO_UNDERLINE (1<<2) CU_CHINFO_ITALIC = 1 << 1,
#define CU_CHINFO_WRAP (1<<3) /* wordwrap occurred here */ CU_CHINFO_UNDERLINE = 1 << 2,
#define CU_CHINFO_SMALLCAPS (1<<4) CU_CHINFO_WRAP = 1 << 3, /* wordwrap occurred here */
#define CU_CHINFO_SMALLCAPS_CHECK (1<<5) /* set at runtime, checks if case switching is needed */ CU_CHINFO_SMALLCAPS = 1 << 4,
CU_CHINFO_SMALLCAPS_CHECK = 1 << 5, /* set at runtime, checks if case switching is needed */
};
/* mixed with KEY_LINEAR but define here since only curve supports */ /* mixed with KEY_LINEAR but define here since only curve supports */
#define KEY_CU_EASE 3 #define KEY_CU_EASE 3

View File

@ -33,55 +33,71 @@ struct CurveMapping;
struct PaintSurfaceData; struct PaintSurfaceData;
/* surface format */ /* surface format */
#define MOD_DPAINT_SURFACE_F_PTEX 0 enum {
#define MOD_DPAINT_SURFACE_F_VERTEX 1 MOD_DPAINT_SURFACE_F_PTEX = 0,
#define MOD_DPAINT_SURFACE_F_IMAGESEQ 2 MOD_DPAINT_SURFACE_F_VERTEX = 1,
MOD_DPAINT_SURFACE_F_IMAGESEQ = 2,
};
/* surface type */ /* surface type */
#define MOD_DPAINT_SURFACE_T_PAINT 0 enum {
#define MOD_DPAINT_SURFACE_T_DISPLACE 1 MOD_DPAINT_SURFACE_T_PAINT = 0,
#define MOD_DPAINT_SURFACE_T_WEIGHT 2 MOD_DPAINT_SURFACE_T_DISPLACE = 1,
#define MOD_DPAINT_SURFACE_T_WAVE 3 MOD_DPAINT_SURFACE_T_WEIGHT = 2,
MOD_DPAINT_SURFACE_T_WAVE = 3,
};
/* surface flags */ /* surface flags */
#define MOD_DPAINT_ACTIVE (1<<0) /* Is surface enabled */ enum {
MOD_DPAINT_ACTIVE = 1 << 0, /* Is surface enabled */
#define MOD_DPAINT_ANTIALIAS (1<<1) /* do antialiasing */ MOD_DPAINT_ANTIALIAS = 1 << 1, /* do antialiasing */
#define MOD_DPAINT_DISSOLVE (1<<2) /* do dissolve */ MOD_DPAINT_DISSOLVE = 1 << 2, /* do dissolve */
#define MOD_DPAINT_MULALPHA (1<<3) /* Multiply color by alpha when saving image */ MOD_DPAINT_MULALPHA = 1 << 3, /* Multiply color by alpha when saving image */
#define MOD_DPAINT_DISSOLVE_LOG (1<<4) /* Use 1/x for surface dissolve */ MOD_DPAINT_DISSOLVE_LOG = 1 << 4, /* Use 1/x for surface dissolve */
#define MOD_DPAINT_DRY_LOG (1<<5) /* Use 1/x for drying paint */ MOD_DPAINT_DRY_LOG = 1 << 5, /* Use 1/x for drying paint */
#define MOD_DPAINT_PREVIEW (1<<6) /* preview this surface on viewport*/ MOD_DPAINT_PREVIEW = 1 << 6, /* preview this surface on viewport*/
#define MOD_DPAINT_WAVE_OPEN_BORDERS (1<<7) /* passes waves through mesh edges */ MOD_DPAINT_WAVE_OPEN_BORDERS = 1 << 7, /* passes waves through mesh edges */
#define MOD_DPAINT_DISP_INCREMENTAL (1<<8) /* builds displace on top of earlier values */ MOD_DPAINT_DISP_INCREMENTAL = 1 << 8, /* builds displace on top of earlier values */
#define MOD_DPAINT_USE_DRYING (1<<9) /* use drying */ MOD_DPAINT_USE_DRYING = 1 << 9, /* use drying */
#define MOD_DPAINT_OUT1 (1<<10) /* output primary surface */ MOD_DPAINT_OUT1 = 1 << 10, /* output primary surface */
#define MOD_DPAINT_OUT2 (1<<11) /* output secondary surface */ MOD_DPAINT_OUT2 = 1 << 11, /* output secondary surface */
};
/* image_fileformat */ /* image_fileformat */
#define MOD_DPAINT_IMGFORMAT_PNG 0 enum {
#define MOD_DPAINT_IMGFORMAT_OPENEXR 1 MOD_DPAINT_IMGFORMAT_PNG = 0,
MOD_DPAINT_IMGFORMAT_OPENEXR = 1,
};
/* disp_format */ /* disp_format */
#define MOD_DPAINT_DISP_DISPLACE 0 /* displacement output displace map */ enum {
#define MOD_DPAINT_DISP_DEPTH 1 /* displacement output depth data */ MOD_DPAINT_DISP_DISPLACE = 0, /* displacement output displace map */
MOD_DPAINT_DISP_DEPTH = 1, /* displacement output depth data */
};
/* effect */ /* effect */
#define MOD_DPAINT_EFFECT_DO_SPREAD (1<<0) /* do spread effect */ enum {
#define MOD_DPAINT_EFFECT_DO_DRIP (1<<1) /* do drip effect */ MOD_DPAINT_EFFECT_DO_SPREAD = 1 << 0, /* do spread effect */
#define MOD_DPAINT_EFFECT_DO_SHRINK (1<<2) /* do shrink effect */ MOD_DPAINT_EFFECT_DO_DRIP = 1 << 1, /* do drip effect */
MOD_DPAINT_EFFECT_DO_SHRINK = 1 << 2, /* do shrink effect */
};
/* preview_id */ /* preview_id */
#define MOD_DPAINT_SURFACE_PREV_PAINT 0 enum {
#define MOD_DPAINT_SURFACE_PREV_WETMAP 1 MOD_DPAINT_SURFACE_PREV_PAINT = 0,
MOD_DPAINT_SURFACE_PREV_WETMAP = 1,
};
/* init_color_type */ /* init_color_type */
#define MOD_DPAINT_INITIAL_NONE 0 enum {
#define MOD_DPAINT_INITIAL_COLOR 1 MOD_DPAINT_INITIAL_NONE = 0,
#define MOD_DPAINT_INITIAL_TEXTURE 2 MOD_DPAINT_INITIAL_COLOR = 1,
#define MOD_DPAINT_INITIAL_VERTEXCOLOR 3 MOD_DPAINT_INITIAL_TEXTURE = 2,
MOD_DPAINT_INITIAL_VERTEXCOLOR = 3,
};
typedef struct DynamicPaintSurface { typedef struct DynamicPaintSurface {
@ -136,11 +152,14 @@ typedef struct DynamicPaintSurface {
} DynamicPaintSurface; } DynamicPaintSurface;
/* canvas flags */ /* canvas flags */
#if 0 /* This should not be needed, having a valid WEIGHT_MCOL layer should be enough. enum {
* And if not, should be a general flag. But seems unnecessary for now... */ /* This should not be needed, having a valid WEIGHT_MCOL layer should be enough.
#define MOD_DPAINT_PREVIEW_READY (1<<0) /* if viewport preview is ready */ * And if not, should be a general flag. But seems unnecessary for now... */
#if 0
MOD_DPAINT_PREVIEW_READY = 1 << 0, /* if viewport preview is ready */
#endif #endif
#define MOD_DPAINT_BAKING (1<<1) /* surface is already baking, so it wont get updated (loop) */ MOD_DPAINT_BAKING = 1 << 1, /* surface is already baking, so it wont get updated (loop) */
};
/* Canvas settings */ /* Canvas settings */
typedef struct DynamicPaintCanvasSettings { typedef struct DynamicPaintCanvasSettings {
@ -157,47 +176,56 @@ typedef struct DynamicPaintCanvasSettings {
/* flags */ /* flags */
#define MOD_DPAINT_PART_RAD (1<<0) /* use particle radius */ enum {
#define MOD_DPAINT_USE_MATERIAL (1<<1) /* use object material */ MOD_DPAINT_PART_RAD = 1 << 0, /* use particle radius */
#define MOD_DPAINT_ABS_ALPHA (1<<2) /* don't increase alpha unless MOD_DPAINT_USE_MATERIAL = 1 << 1, /* use object material */
* paint alpha is higher than existing */ MOD_DPAINT_ABS_ALPHA = 1 << 2, /* don't increase alpha unless paint alpha is higher than existing */
#define MOD_DPAINT_ERASE (1<<3) /* removes paint */ MOD_DPAINT_ERASE = 1 << 3, /* removes paint */
#define MOD_DPAINT_RAMP_ALPHA (1<<4) /* only read falloff ramp alpha */ MOD_DPAINT_RAMP_ALPHA = 1 << 4, /* only read falloff ramp alpha */
#define MOD_DPAINT_PROX_PROJECT (1<<5) /* do proximity check only in defined dir */ MOD_DPAINT_PROX_PROJECT = 1 << 5, /* do proximity check only in defined dir */
#define MOD_DPAINT_INVERSE_PROX (1<<6) /* inverse proximity painting */ MOD_DPAINT_INVERSE_PROX = 1 << 6, /* inverse proximity painting */
#define MOD_DPAINT_NEGATE_VOLUME (1<<7) /* negates volume influence on "volume + prox" mode */ MOD_DPAINT_NEGATE_VOLUME = 1 << 7, /* negates volume influence on "volume + prox" mode */
#define MOD_DPAINT_DO_SMUDGE (1<<8) /* brush smudges existing paint */ MOD_DPAINT_DO_SMUDGE = 1 << 8, /* brush smudges existing paint */
#define MOD_DPAINT_VELOCITY_ALPHA (1<<9) /* multiply brush influence by velocity */ MOD_DPAINT_VELOCITY_ALPHA = 1 << 9, /* multiply brush influence by velocity */
#define MOD_DPAINT_VELOCITY_COLOR (1<<10) /* replace brush color by velocity color ramp */ MOD_DPAINT_VELOCITY_COLOR = 1 << 10, /* replace brush color by velocity color ramp */
#define MOD_DPAINT_VELOCITY_DEPTH (1<<11) /* multiply brush intersection depth by velocity */ MOD_DPAINT_VELOCITY_DEPTH = 1 << 11, /* multiply brush intersection depth by velocity */
#define MOD_DPAINT_USES_VELOCITY ((1<<8)|(1<<9)|(1<<10)|(1<<11)) MOD_DPAINT_USES_VELOCITY = (MOD_DPAINT_DO_SMUDGE | MOD_DPAINT_VELOCITY_ALPHA |
MOD_DPAINT_VELOCITY_COLOR | MOD_DPAINT_VELOCITY_DEPTH),
};
/* collision type */ /* collision type */
#define MOD_DPAINT_COL_VOLUME 0 /* paint with mesh volume */ enum {
#define MOD_DPAINT_COL_DIST 1 /* paint using distance to mesh surface */ MOD_DPAINT_COL_VOLUME = 0, /* paint with mesh volume */
#define MOD_DPAINT_COL_VOLDIST 2 /* use both volume and distance */ MOD_DPAINT_COL_DIST = 1, /* paint using distance to mesh surface */
#define MOD_DPAINT_COL_PSYS 3 /* use particle system */ MOD_DPAINT_COL_VOLDIST = 2, /* use both volume and distance */
#define MOD_DPAINT_COL_POINT 4 /* use distance to object center point */ MOD_DPAINT_COL_PSYS = 3, /* use particle system */
MOD_DPAINT_COL_POINT = 4, /* use distance to object center point */
};
/* proximity_falloff */ /* proximity_falloff */
#define MOD_DPAINT_PRFALL_CONSTANT 0 /* no-falloff */ enum {
#define MOD_DPAINT_PRFALL_SMOOTH 1 /* smooth, linear falloff */ MOD_DPAINT_PRFALL_CONSTANT = 0, /* no-falloff */
#define MOD_DPAINT_PRFALL_RAMP 2 /* use color ramp */ MOD_DPAINT_PRFALL_SMOOTH = 1, /* smooth, linear falloff */
MOD_DPAINT_PRFALL_RAMP = 2, /* use color ramp */
};
/* wave_brush_type */ /* wave_brush_type */
#define MOD_DPAINT_WAVEB_DEPTH 0 /* use intersection depth */ enum {
#define MOD_DPAINT_WAVEB_FORCE 1 /* act as a force on intersection area */ MOD_DPAINT_WAVEB_DEPTH = 0, /* use intersection depth */
#define MOD_DPAINT_WAVEB_REFLECT 2 /* obstacle that reflects waves */ MOD_DPAINT_WAVEB_FORCE = 1, /* act as a force on intersection area */
#define MOD_DPAINT_WAVEB_CHANGE 3 /* use change of intersection depth from previous frame */ MOD_DPAINT_WAVEB_REFLECT = 2, /* obstacle that reflects waves */
MOD_DPAINT_WAVEB_CHANGE = 3, /* use change of intersection depth from previous frame */
};
/* brush ray_dir */ /* brush ray_dir */
#define MOD_DPAINT_RAY_CANVAS 0 enum {
#define MOD_DPAINT_RAY_BRUSH_AVG 1 MOD_DPAINT_RAY_CANVAS = 0,
#define MOD_DPAINT_RAY_ZPLUS 2 MOD_DPAINT_RAY_BRUSH_AVG = 1,
MOD_DPAINT_RAY_ZPLUS = 2,
};
/* Brush settings */ /* Brush settings */
typedef struct DynamicPaintBrushSettings { typedef struct DynamicPaintBrushSettings {

View File

@ -44,60 +44,74 @@ struct Group;
struct Text; struct Text;
/* FreestyleConfig::flags */ /* FreestyleConfig::flags */
#define FREESTYLE_SUGGESTIVE_CONTOURS_FLAG (1 << 0) enum {
#define FREESTYLE_RIDGES_AND_VALLEYS_FLAG (1 << 1) FREESTYLE_SUGGESTIVE_CONTOURS_FLAG = 1 << 0,
#define FREESTYLE_MATERIAL_BOUNDARIES_FLAG (1 << 2) FREESTYLE_RIDGES_AND_VALLEYS_FLAG = 1 << 1,
#define FREESTYLE_FACE_SMOOTHNESS_FLAG (1 << 3) FREESTYLE_MATERIAL_BOUNDARIES_FLAG = 1 << 2,
#define FREESTYLE_ADVANCED_OPTIONS_FLAG (1 << 4) FREESTYLE_FACE_SMOOTHNESS_FLAG = 1 << 3,
#define FREESTYLE_CULLING (1 << 5) FREESTYLE_ADVANCED_OPTIONS_FLAG = 1 << 4,
#define FREESTYLE_VIEW_MAP_CACHE (1 << 6) FREESTYLE_CULLING = 1 << 5,
FREESTYLE_VIEW_MAP_CACHE = 1 << 6,
};
/* FreestyleConfig::mode */ /* FreestyleConfig::mode */
#define FREESTYLE_CONTROL_SCRIPT_MODE 1 enum {
#define FREESTYLE_CONTROL_EDITOR_MODE 2 FREESTYLE_CONTROL_SCRIPT_MODE = 1,
FREESTYLE_CONTROL_EDITOR_MODE = 2,
};
/* FreestyleLineSet::flags */ /* FreestyleLineSet::flags */
#define FREESTYLE_LINESET_CURRENT (1 << 0) enum {
#define FREESTYLE_LINESET_ENABLED (1 << 1) FREESTYLE_LINESET_CURRENT = 1 << 0,
#define FREESTYLE_LINESET_FE_NOT (1 << 2) FREESTYLE_LINESET_ENABLED = 1 << 1,
#define FREESTYLE_LINESET_FE_AND (1 << 3) FREESTYLE_LINESET_FE_NOT = 1 << 2,
#define FREESTYLE_LINESET_GR_NOT (1 << 4) FREESTYLE_LINESET_FE_AND = 1 << 3,
#define FREESTYLE_LINESET_FM_NOT (1 << 5) FREESTYLE_LINESET_GR_NOT = 1 << 4,
#define FREESTYLE_LINESET_FM_BOTH (1 << 6) FREESTYLE_LINESET_FM_NOT = 1 << 5,
FREESTYLE_LINESET_FM_BOTH = 1 << 6,
};
/* FreestyleLineSet::selection */ /* FreestyleLineSet::selection */
#define FREESTYLE_SEL_VISIBILITY (1 << 0) enum {
#define FREESTYLE_SEL_EDGE_TYPES (1 << 1) FREESTYLE_SEL_VISIBILITY = 1 << 0,
#define FREESTYLE_SEL_GROUP (1 << 2) FREESTYLE_SEL_EDGE_TYPES = 1 << 1,
#define FREESTYLE_SEL_IMAGE_BORDER (1 << 3) FREESTYLE_SEL_GROUP = 1 << 2,
#define FREESTYLE_SEL_FACE_MARK (1 << 4) FREESTYLE_SEL_IMAGE_BORDER = 1 << 3,
FREESTYLE_SEL_FACE_MARK = 1 << 4,
};
/* FreestyleLineSet::edge_types, exclude_edge_types */ /* FreestyleLineSet::edge_types, exclude_edge_types */
#define FREESTYLE_FE_SILHOUETTE (1 << 0) enum {
#define FREESTYLE_FE_BORDER (1 << 1) FREESTYLE_FE_SILHOUETTE = 1 << 0,
#define FREESTYLE_FE_CREASE (1 << 2) FREESTYLE_FE_BORDER = 1 << 1,
#define FREESTYLE_FE_RIDGE_VALLEY (1 << 3) FREESTYLE_FE_CREASE = 1 << 2,
/* Note: FREESTYLE_FE_VALLEY = (1 << 4) is no longer used */ FREESTYLE_FE_RIDGE_VALLEY = 1 << 3,
#define FREESTYLE_FE_SUGGESTIVE_CONTOUR (1 << 5) /* FREESTYLE_FE_VALLEY = 1 << 4, */ /* No longer used */
#define FREESTYLE_FE_MATERIAL_BOUNDARY (1 << 6) FREESTYLE_FE_SUGGESTIVE_CONTOUR = 1 << 5,
#define FREESTYLE_FE_CONTOUR (1 << 7) FREESTYLE_FE_MATERIAL_BOUNDARY = 1 << 6,
#define FREESTYLE_FE_EXTERNAL_CONTOUR (1 << 8) FREESTYLE_FE_CONTOUR = 1 << 7,
#define FREESTYLE_FE_EDGE_MARK (1 << 9) FREESTYLE_FE_EXTERNAL_CONTOUR = 1 << 8,
FREESTYLE_FE_EDGE_MARK = 1 << 9,
};
/* FreestyleLineSet::qi */ /* FreestyleLineSet::qi */
#define FREESTYLE_QI_VISIBLE 1 enum {
#define FREESTYLE_QI_HIDDEN 2 FREESTYLE_QI_VISIBLE = 1,
#define FREESTYLE_QI_RANGE 3 FREESTYLE_QI_HIDDEN = 2,
FREESTYLE_QI_RANGE = 3,
};
/* FreestyleConfig::raycasting_algorithm */ /* FreestyleConfig::raycasting_algorithm */
/* Defines should be replaced with ViewMapBuilder::visibility_algo */ /* Defines should be replaced with ViewMapBuilder::visibility_algo */
#define FREESTYLE_ALGO_REGULAR 1 enum {
#define FREESTYLE_ALGO_FAST 2 FREESTYLE_ALGO_REGULAR = 1,
#define FREESTYLE_ALGO_VERYFAST 3 FREESTYLE_ALGO_FAST = 2,
#define FREESTYLE_ALGO_CULLED_ADAPTIVE_TRADITIONAL 4 FREESTYLE_ALGO_VERYFAST = 3,
#define FREESTYLE_ALGO_ADAPTIVE_TRADITIONAL 5 FREESTYLE_ALGO_CULLED_ADAPTIVE_TRADITIONAL = 4,
#define FREESTYLE_ALGO_CULLED_ADAPTIVE_CUMULATIVE 6 FREESTYLE_ALGO_ADAPTIVE_TRADITIONAL = 5,
#define FREESTYLE_ALGO_ADAPTIVE_CUMULATIVE 7 FREESTYLE_ALGO_CULLED_ADAPTIVE_CUMULATIVE = 6,
FREESTYLE_ALGO_ADAPTIVE_CUMULATIVE = 7,
};
typedef struct FreestyleLineSet { typedef struct FreestyleLineSet {
struct FreestyleLineSet *next, *prev; struct FreestyleLineSet *next, *prev;