diff options
138 files changed, 2766 insertions, 2851 deletions
diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h index 595a1e884d7..c7ddab47952 100644 --- a/source/blender/blenkernel/BKE_DerivedMesh.h +++ b/source/blender/blenkernel/BKE_DerivedMesh.h @@ -191,11 +191,11 @@ struct DerivedMesh { * and freed on the next ->release(). consider using getVert/Edge/Face if * you are only interested in a few verts/edges/faces. */ - struct MVert *(*getVertArray)(DerivedMesh *dm); - struct MEdge *(*getEdgeArray)(DerivedMesh *dm); - struct MFace *(*getTessFaceArray)(DerivedMesh *dm); - struct MLoop *(*getLoopArray)(DerivedMesh *dm); - struct MPoly *(*getPolyArray)(DerivedMesh *dm); + struct MVert *(*getVertArray)(DerivedMesh * dm); + struct MEdge *(*getEdgeArray)(DerivedMesh * dm); + struct MFace *(*getTessFaceArray)(DerivedMesh * dm); + struct MLoop *(*getLoopArray)(DerivedMesh * dm); + struct MPoly *(*getPolyArray)(DerivedMesh * dm); /* copy all verts/edges/faces from the derived mesh into * *{vert/edge/face}_r (must point to a buffer large enough) @@ -209,35 +209,35 @@ struct DerivedMesh { /* return a copy of all verts/edges/faces from the derived mesh * it is the caller's responsibility to free the returned pointer */ - struct MVert *(*dupVertArray)(DerivedMesh *dm); - struct MEdge *(*dupEdgeArray)(DerivedMesh *dm); - struct MFace *(*dupTessFaceArray)(DerivedMesh *dm); - struct MLoop *(*dupLoopArray)(DerivedMesh *dm); - struct MPoly *(*dupPolyArray)(DerivedMesh *dm); + struct MVert *(*dupVertArray)(DerivedMesh * dm); + struct MEdge *(*dupEdgeArray)(DerivedMesh * dm); + struct MFace *(*dupTessFaceArray)(DerivedMesh * dm); + struct MLoop *(*dupLoopArray)(DerivedMesh * dm); + struct MPoly *(*dupPolyArray)(DerivedMesh * dm); /* return a pointer to a single element of vert/edge/face custom data * from the derived mesh (this gives a pointer to the actual data, not * a copy) */ - void *(*getVertData)(DerivedMesh *dm, int index, int type); - void *(*getEdgeData)(DerivedMesh *dm, int index, int type); - void *(*getTessFaceData)(DerivedMesh *dm, int index, int type); + void *(*getVertData)(DerivedMesh * dm, int index, int type); + void *(*getEdgeData)(DerivedMesh * dm, int index, int type); + void *(*getTessFaceData)(DerivedMesh * dm, int index, int type); /* return a pointer to the entire array of vert/edge/face custom data * from the derived mesh (this gives a pointer to the actual data, not * a copy) */ - void *(*getVertDataArray)(DerivedMesh *dm, int type); - void *(*getEdgeDataArray)(DerivedMesh *dm, int type); - void *(*getTessFaceDataArray)(DerivedMesh *dm, int type); + void *(*getVertDataArray)(DerivedMesh * dm, int type); + void *(*getEdgeDataArray)(DerivedMesh * dm, int type); + void *(*getTessFaceDataArray)(DerivedMesh * dm, int type); /* retrieves the base CustomData structures for * verts/edges/tessfaces/loops/facdes*/ - CustomData *(*getVertDataLayout)(DerivedMesh *dm); - CustomData *(*getEdgeDataLayout)(DerivedMesh *dm); - CustomData *(*getTessFaceDataLayout)(DerivedMesh *dm); - CustomData *(*getLoopDataLayout)(DerivedMesh *dm); - CustomData *(*getPolyDataLayout)(DerivedMesh *dm); + CustomData *(*getVertDataLayout)(DerivedMesh * dm); + CustomData *(*getEdgeDataLayout)(DerivedMesh * dm); + CustomData *(*getTessFaceDataLayout)(DerivedMesh * dm); + CustomData *(*getLoopDataLayout)(DerivedMesh * dm); + CustomData *(*getPolyDataLayout)(DerivedMesh * dm); /*copies all customdata for an element source into dst at index dest*/ void (*copyFromVertCData)(DerivedMesh *dm, int source, CustomData *dst, int dest); @@ -247,12 +247,12 @@ struct DerivedMesh { /* optional grid access for subsurf */ int (*getNumGrids)(DerivedMesh *dm); int (*getGridSize)(DerivedMesh *dm); - struct CCGElem **(*getGridData)(DerivedMesh *dm); - DMGridAdjacency *(*getGridAdjacency)(DerivedMesh *dm); - int *(*getGridOffset)(DerivedMesh *dm); + struct CCGElem **(*getGridData)(DerivedMesh * dm); + DMGridAdjacency *(*getGridAdjacency)(DerivedMesh * dm); + int *(*getGridOffset)(DerivedMesh * dm); void (*getGridKey)(DerivedMesh *dm, struct CCGKey *key); - DMFlagMat *(*getGridFlagMats)(DerivedMesh *dm); - unsigned int **(*getGridHidden)(DerivedMesh *dm); + DMFlagMat *(*getGridFlagMats)(DerivedMesh * dm); + unsigned int **(*getGridHidden)(DerivedMesh * dm); /* Iterate over each mapped vertex in the derived mesh, calling the @@ -335,15 +335,15 @@ struct DerivedMesh { * Also called for *final* editmode DerivedMeshes */ void (*drawFacesSolid)(DerivedMesh *dm, float (*partial_redraw_planes)[4], - int fast, DMSetMaterial setMaterial); + int fast, DMSetMaterial setMaterial); /* Draw all faces using MTFace * o Drawing options too complicated to enumerate, look at code. */ void (*drawFacesTex)(DerivedMesh *dm, DMSetDrawOptionsTex setDrawOptions, - DMCompareDrawOptions compareDrawOptions, - void *userData); + DMCompareDrawOptions compareDrawOptions, + void *userData); /* Draw all faces with GLSL materials * o setMaterial is called for every different material nr @@ -365,19 +365,19 @@ struct DerivedMesh { * smooth shaded. */ void (*drawMappedFaces)(DerivedMesh *dm, - DMSetDrawOptions setDrawOptions, - DMSetMaterial setMaterial, - DMCompareDrawOptions compareDrawOptions, - void *userData, - DMDrawFlag flag); + DMSetDrawOptions setDrawOptions, + DMSetMaterial setMaterial, + DMCompareDrawOptions compareDrawOptions, + void *userData, + DMDrawFlag flag); /* Draw mapped faces using MTFace * o Drawing options too complicated to enumerate, look at code. */ void (*drawMappedFacesTex)(DerivedMesh *dm, - DMSetDrawOptions setDrawOptions, - DMCompareDrawOptions compareDrawOptions, - void *userData); + DMSetDrawOptions setDrawOptions, + DMCompareDrawOptions compareDrawOptions, + void *userData); /* Draw mapped faces with GLSL materials * o setMaterial is called for every different material nr @@ -385,17 +385,17 @@ struct DerivedMesh { * o Only if setMaterial and setDrawOptions return true */ void (*drawMappedFacesGLSL)(DerivedMesh *dm, - DMSetMaterial setMaterial, - DMSetDrawOptions setDrawOptions, - void *userData); + DMSetMaterial setMaterial, + DMSetDrawOptions setDrawOptions, + void *userData); /* Draw mapped edges as lines * o Only if !setDrawOptions or setDrawOptions(userData, mapped-edge) * returns true */ void (*drawMappedEdges)(DerivedMesh *dm, - DMSetDrawOptions setDrawOptions, - void *userData); + DMSetDrawOptions setDrawOptions, + void *userData); /* Draw mapped edges as lines with interpolation values * o Only if !setDrawOptions or @@ -405,17 +405,17 @@ struct DerivedMesh { * NOTE: This routine is optional! */ void (*drawMappedEdgesInterp)(DerivedMesh *dm, - DMSetDrawOptions setDrawOptions, - DMSetDrawInterpOptions setDrawInterpOptions, - void *userData); + DMSetDrawOptions setDrawOptions, + DMSetDrawInterpOptions setDrawInterpOptions, + void *userData); /* Draw all faces with materials * o setMaterial is called for every different material nr * o setFace is called to verify if a face must be hidden */ void (*drawMappedFacesMat)(DerivedMesh *dm, - void (*setMaterial)(void *userData, int, void *attribs), - int (*setFace)(void *userData, int index), void *userData); + void (*setMaterial)(void *userData, int, void *attribs), + int (*setFace)(void *userData, int index), void *userData); /* Release reference to the DerivedMesh. This function decides internally * if the DerivedMesh will be freed, or cached for later use. */ @@ -438,9 +438,9 @@ void DM_init(DerivedMesh *dm, DerivedMeshType type, int numVerts, int numEdges, * of vertices, edges and faces, with a layer setup copied from source */ void DM_from_template(DerivedMesh *dm, DerivedMesh *source, - DerivedMeshType type, - int numVerts, int numEdges, int numFaces, - int numLoops, int numPolys); + DerivedMeshType type, + int numVerts, int numEdges, int numFaces, + int numLoops, int numPolys); /* utility function to release a DerivedMesh's layers * returns 1 if DerivedMesh has to be released by the backend, 0 otherwise @@ -518,15 +518,15 @@ void DM_set_tessface_data(struct DerivedMesh *dm, int index, int type, void *dat * these copy all layers for which the CD_FLAG_NOCOPY flag is not set */ void DM_copy_vert_data(struct DerivedMesh *source, struct DerivedMesh *dest, - int source_index, int dest_index, int count); + int source_index, int dest_index, int count); void DM_copy_edge_data(struct DerivedMesh *source, struct DerivedMesh *dest, - int source_index, int dest_index, int count); -void DM_copy_tessface_data(struct DerivedMesh *source, struct DerivedMesh *dest, int source_index, int dest_index, int count); +void DM_copy_tessface_data(struct DerivedMesh *source, struct DerivedMesh *dest, + int source_index, int dest_index, int count); void DM_copy_loop_data(struct DerivedMesh *source, struct DerivedMesh *dest, int source_index, int dest_index, int count); void DM_copy_poly_data(struct DerivedMesh *source, struct DerivedMesh *dest, - int source_index, int dest_index, int count); + int source_index, int dest_index, int count); /* custom data free functions * free count elements, starting at index @@ -550,8 +550,8 @@ void DM_update_tessface_data(DerivedMesh *dm); * indexed by dest_index in the dest mesh */ void DM_interp_vert_data(struct DerivedMesh *source, struct DerivedMesh *dest, - int *src_indices, float *weights, - int count, int dest_index); + int *src_indices, float *weights, + int count, int dest_index); /* interpolates edge data from the edges indexed by src_indices in the * source mesh using the given weights and stores the result in the edge indexed @@ -562,9 +562,9 @@ void DM_interp_vert_data(struct DerivedMesh *source, struct DerivedMesh *dest, */ typedef float EdgeVertWeight[SUB_ELEMS_EDGE][SUB_ELEMS_EDGE]; void DM_interp_edge_data(struct DerivedMesh *source, struct DerivedMesh *dest, - int *src_indices, - float *weights, EdgeVertWeight *vert_weights, - int count, int dest_index); + int *src_indices, + float *weights, EdgeVertWeight *vert_weights, + int count, int dest_index); /* interpolates face data from the faces indexed by src_indices in the * source mesh using the given weights and stores the result in the face indexed @@ -575,9 +575,9 @@ void DM_interp_edge_data(struct DerivedMesh *source, struct DerivedMesh *dest, */ typedef float FaceVertWeight[SUB_ELEMS_FACE][SUB_ELEMS_FACE]; void DM_interp_tessface_data(struct DerivedMesh *source, struct DerivedMesh *dest, - int *src_indices, - float *weights, FaceVertWeight *vert_weights, - int count, int dest_index); + int *src_indices, + float *weights, FaceVertWeight *vert_weights, + int count, int dest_index); void DM_swap_tessface_data(struct DerivedMesh *dm, int index, const int *corner_indices); @@ -597,54 +597,54 @@ void vDM_ColorBand_store(struct ColorBand *coba); * In use now by vertex/weight paint and particles */ float *mesh_get_mapped_verts_nors(struct Scene *scene, struct Object *ob); - /* */ +/* */ DerivedMesh *mesh_get_derived_final(struct Scene *scene, struct Object *ob, - CustomDataMask dataMask); + CustomDataMask dataMask); DerivedMesh *mesh_get_derived_deform(struct Scene *scene, struct Object *ob, - CustomDataMask dataMask); + CustomDataMask dataMask); DerivedMesh *mesh_create_derived_for_modifier(struct Scene *scene, struct Object *ob, - struct ModifierData *md, int build_shapekey_layers); + struct ModifierData *md, int build_shapekey_layers); DerivedMesh *mesh_create_derived_render(struct Scene *scene, struct Object *ob, - CustomDataMask dataMask); + CustomDataMask dataMask); DerivedMesh *getEditDerivedBMesh(struct BMEditMesh *em, struct Object *ob, - float (*vertexCos)[3]); + float (*vertexCos)[3]); DerivedMesh *mesh_create_derived_index_render(struct Scene *scene, struct Object *ob, CustomDataMask dataMask, int index); - /* same as above but wont use render settings */ +/* same as above but wont use render settings */ DerivedMesh *mesh_create_derived(struct Mesh *me, struct Object *ob, float (*vertCos)[3]); DerivedMesh *mesh_create_derived_view(struct Scene *scene, struct Object *ob, - CustomDataMask dataMask); + CustomDataMask dataMask); DerivedMesh *mesh_create_derived_no_deform(struct Scene *scene, struct Object *ob, - float (*vertCos)[3], - CustomDataMask dataMask); + float (*vertCos)[3], + CustomDataMask dataMask); DerivedMesh *mesh_create_derived_no_deform_render(struct Scene *scene, struct Object *ob, - float (*vertCos)[3], - CustomDataMask dataMask); + float (*vertCos)[3], + CustomDataMask dataMask); /* for gameengine */ DerivedMesh *mesh_create_derived_no_virtual(struct Scene *scene, struct Object *ob, float (*vertCos)[3], - CustomDataMask dataMask); + CustomDataMask dataMask); DerivedMesh *mesh_create_derived_physics(struct Scene *scene, struct Object *ob, float (*vertCos)[3], - CustomDataMask dataMask); + CustomDataMask dataMask); DerivedMesh *editbmesh_get_derived_base(struct Object *, struct BMEditMesh *em); DerivedMesh *editbmesh_get_derived_cage(struct Scene *scene, struct Object *, - struct BMEditMesh *em, CustomDataMask dataMask); + struct BMEditMesh *em, CustomDataMask dataMask); DerivedMesh *editbmesh_get_derived_cage_and_final(struct Scene *scene, struct Object *, - struct BMEditMesh *em, DerivedMesh **final_r, - CustomDataMask dataMask); + struct BMEditMesh *em, DerivedMesh **final_r, + CustomDataMask dataMask); float (*editbmesh_get_vertex_cos(struct BMEditMesh *em, int *numVerts_r))[3]; int editbmesh_modifier_is_enabled(struct Scene *scene, struct ModifierData *md, DerivedMesh *dm); void makeDerivedMesh(struct Scene *scene, struct Object *ob, struct BMEditMesh *em, - CustomDataMask dataMask, int build_shapekey_layers); + CustomDataMask dataMask, int build_shapekey_layers); /* returns an array of deform matrices for crazyspace correction, and the * number of modifiers left */ int editbmesh_get_first_deform_matrices(struct Scene *, struct Object *, struct BMEditMesh *em, - float (**deformmats)[3][3], float (**deformcos)[3]); + float (**deformmats)[3][3], float (**deformcos)[3]); void weight_to_rgb(float r_rgb[3], const float weight); /* Update the weight MCOL preview layer. @@ -684,7 +684,7 @@ typedef struct DMVertexAttribs { } DMVertexAttribs; void DM_vertex_attributes_from_gpu(DerivedMesh *dm, - struct GPUVertexAttribs *gattribs, DMVertexAttribs *attribs); + struct GPUVertexAttribs *gattribs, DMVertexAttribs *attribs); void DM_add_tangent_layer(DerivedMesh *dm); void DM_calc_auto_bump_scale(DerivedMesh *dm); diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h index a326b514f9a..c1361788379 100644 --- a/source/blender/blenkernel/BKE_action.h +++ b/source/blender/blenkernel/BKE_action.h @@ -71,24 +71,24 @@ void BKE_action_make_local(struct bAction *act); /* Action API ----------------- */ /* types of transforms applied to the given item - * - these are the return falgs for action_get_item_transforms() + * - these are the return falgs for action_get_item_transforms() */ typedef enum eAction_TransformFlags { - /* location */ - ACT_TRANS_LOC = (1<<0), - /* rotation */ - ACT_TRANS_ROT = (1<<1), - /* scaling */ - ACT_TRANS_SCALE = (1<<2), - - /* strictly not a transform, but custom properties are also - * quite often used in modern rigs - */ - ACT_TRANS_PROP = (1<<3), - - /* all flags */ - ACT_TRANS_ONLY = (ACT_TRANS_LOC|ACT_TRANS_ROT|ACT_TRANS_SCALE), - ACT_TRANS_ALL = (ACT_TRANS_ONLY|ACT_TRANS_PROP) + /* location */ + ACT_TRANS_LOC = (1 << 0), + /* rotation */ + ACT_TRANS_ROT = (1 << 1), + /* scaling */ + ACT_TRANS_SCALE = (1 << 2), + + /* strictly not a transform, but custom properties are also + * quite often used in modern rigs + */ + ACT_TRANS_PROP = (1 << 3), + + /* all flags */ + ACT_TRANS_ONLY = (ACT_TRANS_LOC | ACT_TRANS_ROT | ACT_TRANS_SCALE), + ACT_TRANS_ALL = (ACT_TRANS_ONLY | ACT_TRANS_PROP) } eAction_TransformFlags; /* Return flags indicating which transforms the given object/posechannel has @@ -182,7 +182,7 @@ struct bPoseChannel *BKE_pose_channel_active(struct Object *ob); * already exists in this pose - if not a new one is * allocated and initialized. */ -struct bPoseChannel *BKE_pose_channel_verify(struct bPose* pose, const char* name); +struct bPoseChannel *BKE_pose_channel_verify(struct bPose *pose, const char *name); /* Copy the data from the action-pose (src) into the pose */ void extract_pose_from_pose(struct bPose *pose, const struct bPose *src); diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h index b8c2c42f8d5..44e47e779e7 100644 --- a/source/blender/blenkernel/BKE_armature.h +++ b/source/blender/blenkernel/BKE_armature.h @@ -46,28 +46,26 @@ struct Mesh; struct PoseTree; struct ListBase; -typedef struct PoseTarget -{ +typedef struct PoseTarget { struct PoseTarget *next, *prev; - struct bConstraint *con; /* the constrait of this target */ - int tip; /* index of tip pchan in PoseTree */ + struct bConstraint *con; /* the constrait of this target */ + int tip; /* index of tip pchan in PoseTree */ } PoseTarget; -typedef struct PoseTree -{ +typedef struct PoseTree { struct PoseTree *next, *prev; - int type; /* type of IK that this serves (CONSTRAINT_TYPE_KINEMATIC or ..._SPLINEIK) */ - int totchannel; /* number of pose channels */ + int type; /* type of IK that this serves (CONSTRAINT_TYPE_KINEMATIC or ..._SPLINEIK) */ + int totchannel; /* number of pose channels */ - struct ListBase targets; /* list of targets of the tree */ - struct bPoseChannel **pchan; /* array of pose channels */ - int *parent; /* and their parents */ - - float (*basis_change)[3][3]; /* basis change result from solver */ - int iterations; /* iterations from the constraint */ - int stretch; /* disable stretching */ + struct ListBase targets; /* list of targets of the tree */ + struct bPoseChannel **pchan; /* array of pose channels */ + int *parent; /* and their parents */ + + float (*basis_change)[3][3]; /* basis change result from solver */ + int iterations; /* iterations from the constraint */ + int stretch; /* disable stretching */ } PoseTree; /* Core armature functionality */ @@ -77,7 +75,7 @@ extern "C" { struct bArmature *BKE_armature_add(const char *name); struct bArmature *BKE_armature_from_object(struct Object *ob); -void BKE_armature_bonelist_free (struct ListBase *lb); +void BKE_armature_bonelist_free(struct ListBase *lb); void BKE_armature_free(struct bArmature *arm); void BKE_armature_make_local(struct bArmature *arm); struct bArmature *BKE_armature_copy(struct bArmature *arm); @@ -85,9 +83,9 @@ struct bArmature *BKE_armature_copy(struct bArmature *arm); /* Bounding box. */ struct BoundBox *BKE_armature_boundbox_get(struct Object *ob); -int bone_autoside_name (char name[64], int strip_number, short axis, float head, float tail); +int bone_autoside_name(char name[64], int strip_number, short axis, float head, float tail); -struct Bone *BKE_armature_find_bone_name (struct bArmature *arm, const char *name); +struct Bone *BKE_armature_find_bone_name(struct bArmature *arm, const char *name); float distfactor_to_bone(const float vec[3], const float b1[3], const float b2[3], float r1, float r2, float rdist); @@ -99,7 +97,7 @@ void BKE_pose_where_is_bone(struct Scene *scene, struct Object *ob, struct bPose void BKE_pose_where_is_bone_tail(struct bPoseChannel *pchan); /* get_objectspace_bone_matrix has to be removed still */ -void get_objectspace_bone_matrix (struct Bone* bone, float M_accumulatedMatrix[][4], int root, int posed); +void get_objectspace_bone_matrix(struct Bone *bone, float M_accumulatedMatrix[][4], int root, int posed); void vec_roll_to_mat3(const float vec[3], const float roll, float mat[][3]); void mat3_to_vec_roll(float mat[][3], float *vec, float *roll); diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 29e02562be3..7cc5d16dcc1 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -41,17 +41,17 @@ extern "C" { /* these lines are grep'd, watch out for our not-so-awesome regex * and keep comment above the defines. * Use STRINGIFY() rather than defining with quotes */ -#define BLENDER_VERSION 263 -#define BLENDER_SUBVERSION 5 +#define BLENDER_VERSION 263 +#define BLENDER_SUBVERSION 5 -#define BLENDER_MINVERSION 250 -#define BLENDER_MINSUBVERSION 0 +#define BLENDER_MINVERSION 250 +#define BLENDER_MINSUBVERSION 0 /* used by packaging tools */ - /* can be left blank, otherwise a,b,c... etc with no quotes */ +/* can be left blank, otherwise a,b,c... etc with no quotes */ #define BLENDER_VERSION_CHAR - /* alpha/beta/rc/release, docs use this */ -#define BLENDER_VERSION_CYCLE alpha +/* alpha/beta/rc/release, docs use this */ +#define BLENDER_VERSION_CYCLE alpha extern char versionstr[]; /* from blender.c */ @@ -64,11 +64,11 @@ struct Main; int BKE_read_file(struct bContext *C, const char *filepath, struct ReportList *reports); -#define BKE_READ_FILE_FAIL 0 /* no load */ -#define BKE_READ_FILE_OK 1 /* OK */ -#define BKE_READ_FILE_OK_USERPREFS 2 /* OK, and with new user settings */ +#define BKE_READ_FILE_FAIL 0 /* no load */ +#define BKE_READ_FILE_OK 1 /* OK */ +#define BKE_READ_FILE_OK_USERPREFS 2 /* OK, and with new user settings */ -int BKE_read_file_from_memory(struct bContext *C, char* filebuf, int filelength, struct ReportList *reports); +int BKE_read_file_from_memory(struct bContext *C, char *filebuf, int filelength, struct ReportList *reports); int BKE_read_file_from_memfile(struct bContext *C, struct MemFile *memfile, struct ReportList *reports); void free_blender(void); diff --git a/source/blender/blenkernel/BKE_bmesh.h b/source/blender/blenkernel/BKE_bmesh.h index bcb50a9c903..67b21eb764c 100644 --- a/source/blender/blenkernel/BKE_bmesh.h +++ b/source/blender/blenkernel/BKE_bmesh.h @@ -42,28 +42,28 @@ /* bevel tool defines */ /* element flags */ -#define BME_BEVEL_ORIG 1 -#define BME_BEVEL_BEVEL (1<<1) -#define BME_BEVEL_NONMAN (1<<2) -#define BME_BEVEL_WIRE (1<<3) +#define BME_BEVEL_ORIG 1 +#define BME_BEVEL_BEVEL (1 << 1) +#define BME_BEVEL_NONMAN (1 << 2) +#define BME_BEVEL_WIRE (1 << 3) /* tool options */ -#define BME_BEVEL_SELECT 1 -#define BME_BEVEL_VERT (1<<1) -#define BME_BEVEL_RADIUS (1<<2) -#define BME_BEVEL_ANGLE (1<<3) -#define BME_BEVEL_WEIGHT (1<<4) +#define BME_BEVEL_SELECT 1 +#define BME_BEVEL_VERT (1 << 1) +#define BME_BEVEL_RADIUS (1 << 2) +#define BME_BEVEL_ANGLE (1 << 3) +#define BME_BEVEL_WEIGHT (1 << 4) //~ #define BME_BEVEL_EWEIGHT (1<<4) //~ #define BME_BEVEL_VWEIGHT (1<<5) -#define BME_BEVEL_PERCENT (1<<6) -#define BME_BEVEL_EMIN (1<<7) -#define BME_BEVEL_EMAX (1<<8) -#define BME_BEVEL_RUNNING (1<<9) -#define BME_BEVEL_RES (1<<10) +#define BME_BEVEL_PERCENT (1 << 6) +#define BME_BEVEL_EMIN (1 << 7) +#define BME_BEVEL_EMAX (1 << 8) +#define BME_BEVEL_RUNNING (1 << 9) +#define BME_BEVEL_RES (1 << 10) -#define BME_BEVEL_EVEN (1<<11) /* this is a new setting not related to old (trunk bmesh bevel code) but adding - * here because they are mixed - campbell */ -#define BME_BEVEL_DIST (1<<12) /* same as above */ +#define BME_BEVEL_EVEN (1 << 11) /* this is a new setting not related to old (trunk bmesh bevel code) but adding + * here because they are mixed - campbell */ +#define BME_BEVEL_DIST (1 << 12) /* same as above */ typedef struct BME_TransData { struct BMesh *bm; /* the bmesh the vert belongs to */ @@ -74,11 +74,11 @@ typedef struct BME_TransData { void *loc; /* a pointer to the data to transform (likely the vert's cos) */ float factor; /* primary scaling factor; also accumulates number of weighted edges for beveling tool */ float weight; /* another scaling factor; used primarily for propogating vertex weights to transforms; */ - /* weight is also used across recursive bevels to help with the math */ + /* weight is also used across recursive bevels to help with the math */ float maxfactor; /* the unscaled, original factor (used only by "edge verts" in recursive beveling) */ float *max; /* the maximum distance this vert can be transformed; negative is infinite - * it points to the "parent" maxfactor (where maxfactor makes little sense) - * where the max limit is stored (limits are stored per-corner) */ + * it points to the "parent" maxfactor (where maxfactor makes little sense) + * where the max limit is stored (limits are stored per-corner) */ } BME_TransData; typedef struct BME_TransData_Head { diff --git a/source/blender/blenkernel/BKE_bmfont.h b/source/blender/blenkernel/BKE_bmfont.h index 6c0cbe3a51b..64daa311b9a 100644 --- a/source/blender/blenkernel/BKE_bmfont.h +++ b/source/blender/blenkernel/BKE_bmfont.h @@ -41,14 +41,14 @@ struct bmGlyph; struct ImBuf; struct bmFont; -void printfGlyph(struct bmGlyph * glyph); -void calcAlpha(struct ImBuf * ibuf); -void readBitmapFontVersion0(struct ImBuf * ibuf, - unsigned char * rect, +void printfGlyph(struct bmGlyph *glyph); +void calcAlpha(struct ImBuf *ibuf); +void readBitmapFontVersion0(struct ImBuf *ibuf, + unsigned char *rect, int step); void detectBitmapFont(struct ImBuf *ibuf); int locateGlyph(struct bmFont *bmfont, unsigned short unicode); -void matrixGlyph(struct ImBuf * ibuf, unsigned short unicode, +void matrixGlyph(struct ImBuf *ibuf, unsigned short unicode, float *centerx, float *centery, float *sizex, float *sizey, float *transx, float *transy, diff --git a/source/blender/blenkernel/BKE_booleanops_mesh.h b/source/blender/blenkernel/BKE_booleanops_mesh.h index 2e48b664449..e8ffefe74ce 100644 --- a/source/blender/blenkernel/BKE_booleanops_mesh.h +++ b/source/blender/blenkernel/BKE_booleanops_mesh.h @@ -53,12 +53,9 @@ typedef struct CSG_MeshDescriptor { } CSG_MeshDescriptor; -extern - int -CSG_LoadBlenderMesh( - struct Object * obj, - CSG_MeshDescriptor *output -); +extern int +CSG_LoadBlenderMesh(struct Object *obj, + CSG_MeshDescriptor *output); /** * Destroy the contents of a mesh descriptor. @@ -67,11 +64,8 @@ CSG_LoadBlenderMesh( * internal memory in the desriptor. */ -extern - void -CSG_DestroyMeshDescriptor( - CSG_MeshDescriptor *mesh -); +extern void +CSG_DestroyMeshDescriptor(CSG_MeshDescriptor *mesh); /** * Perform a boolean operation between 2 meshes and return the @@ -82,14 +76,11 @@ CSG_DestroyMeshDescriptor( * 3 = difference. */ -extern - int -CSG_PerformOp( - CSG_MeshDescriptor *mesh1, - CSG_MeshDescriptor *mesh2, - int op_type, - CSG_MeshDescriptor *output -); +extern int +CSG_PerformOp(CSG_MeshDescriptor *mesh1, + CSG_MeshDescriptor *mesh2, + int op_type, + CSG_MeshDescriptor *output); @@ -97,23 +88,17 @@ CSG_PerformOp( * Add a mesh to blender as a new object. */ -extern - int -CSG_AddMeshToBlender( - CSG_MeshDescriptor *mesh -); +extern int +CSG_AddMeshToBlender(CSG_MeshDescriptor *mesh); /** * Test functionality. */ -extern - int -NewBooleanMeshTest( - struct Base * base, - struct Base * base_select, - int op_type -); +extern int +NewBooleanMeshTest(struct Base *base, + struct Base *base_select, + int op_type); #endif diff --git a/source/blender/blenkernel/BKE_brush.h b/source/blender/blenkernel/BKE_brush.h index b5edc8f3e50..cbffb6c0cea 100644 --- a/source/blender/blenkernel/BKE_brush.h +++ b/source/blender/blenkernel/BKE_brush.h @@ -59,17 +59,17 @@ int BKE_brush_clone_image_delete(struct Brush *brush); /* jitter */ void BKE_brush_jitter_pos(const struct Scene *scene, struct Brush *brush, - const float pos[2], float jitterpos[2]); + const float pos[2], float jitterpos[2]); /* brush curve */ -void BKE_brush_curve_preset(struct Brush *b, /*enum CurveMappingPreset*/int preset); +void BKE_brush_curve_preset(struct Brush *b, /*enum CurveMappingPreset*/ int preset); float BKE_brush_curve_strength_clamp(struct Brush *br, float p, const float len); float BKE_brush_curve_strength(struct Brush *br, float p, const float len); /* used for sculpt */ /* sampling */ void BKE_brush_sample_tex(const struct Scene *scene, struct Brush *brush, const float xy[2], float rgba[4], const int thread); void BKE_brush_imbuf_new(const struct Scene *scene, struct Brush *brush, short flt, short texfalloff, int size, - struct ImBuf **imbuf, int use_color_correction); + struct ImBuf **imbuf, int use_color_correction); /* painting */ struct BrushPainter; @@ -78,9 +78,9 @@ typedef int (*BrushFunc)(void *user, struct ImBuf *ibuf, const float lastpos[2], BrushPainter *BKE_brush_painter_new(struct Scene *scene, struct Brush *brush); void BKE_brush_painter_require_imbuf(BrushPainter *painter, short flt, - short texonly, int size); + short texonly, int size); int BKE_brush_painter_paint(BrushPainter *painter, BrushFunc func, const float pos[2], - double time, float pressure, void *user, int use_color_correction); + double time, float pressure, void *user, int use_color_correction); void BKE_brush_painter_break_stroke(BrushPainter *painter); void BKE_brush_painter_free(BrushPainter *painter); @@ -108,13 +108,13 @@ int BKE_brush_use_size_pressure(const struct Scene *scene, struct Brush *brush) /* scale unprojected radius to reflect a change in the brush's 2D size */ void BKE_brush_scale_unprojected_radius(float *unprojected_radius, - int new_brush_size, - int old_brush_size); + int new_brush_size, + int old_brush_size); /* scale brush size to reflect a change in the brush's unprojected radius */ void BKE_brush_scale_size(int *BKE_brush_size_get, - float new_unprojected_radius, - float old_unprojected_radius); + float new_unprojected_radius, + float old_unprojected_radius); /* debugging only */ void BKE_brush_debug_print_state(struct Brush *br); diff --git a/source/blender/blenkernel/BKE_bullet.h b/source/blender/blenkernel/BKE_bullet.h index 2103eea1041..dc522d1b22c 100644 --- a/source/blender/blenkernel/BKE_bullet.h +++ b/source/blender/blenkernel/BKE_bullet.h @@ -38,7 +38,7 @@ struct BulletSoftBody; extern struct BulletSoftBody *bsbNew(void); /* frees internal data and softbody itself */ -extern void bsbFree(struct BulletSoftBody *sb); +extern void bsbFree(struct BulletSoftBody *sb); #endif diff --git a/source/blender/blenkernel/BKE_bvhutils.h b/source/blender/blenkernel/BKE_bvhutils.h index ab3d751cc8e..eff5019a49c 100644 --- a/source/blender/blenkernel/BKE_bvhutils.h +++ b/source/blender/blenkernel/BKE_bvhutils.h @@ -44,20 +44,19 @@ struct MFace; /* * struct that kepts basic information about a BVHTree build from a mesh */ -typedef struct BVHTreeFromMesh -{ +typedef struct BVHTreeFromMesh { struct BVHTree *tree; /* default callbacks to bvh nearest and raycast */ BVHTree_NearestPointCallback nearest_callback; - BVHTree_RayCastCallback raycast_callback; + BVHTree_RayCastCallback raycast_callback; /* Mesh represented on this BVHTree */ struct DerivedMesh *mesh; /* Vertex array, so that callbacks have instante access to data */ struct MVert *vert; - struct MEdge *edge; /* only used for BVHTreeFromMeshEdges */ + struct MEdge *edge; /* only used for BVHTreeFromMeshEdges */ struct MFace *face; /* radius for raycast */ @@ -65,7 +64,7 @@ typedef struct BVHTreeFromMesh /* Private data */ int cached; - void *em_evil; /* var only for snapping */ + void *em_evil; /* var only for snapping */ } BVHTreeFromMesh; @@ -80,7 +79,7 @@ typedef struct BVHTreeFromMesh * * free_bvhtree_from_mesh should be called when the tree is no longer needed. */ -BVHTree* bvhtree_from_mesh_verts(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis); +BVHTree *bvhtree_from_mesh_verts(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis); /* * Builds a bvh tree where nodes are the faces of the given mesh. @@ -96,9 +95,9 @@ BVHTree* bvhtree_from_mesh_verts(struct BVHTreeFromMesh *data, struct DerivedMes * * free_bvhtree_from_mesh should be called when the tree is no longer needed. */ -BVHTree* bvhtree_from_mesh_faces(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis); +BVHTree *bvhtree_from_mesh_faces(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis); -BVHTree* bvhtree_from_mesh_edges(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis); +BVHTree *bvhtree_from_mesh_edges(struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis); /* * Frees data allocated by a call to bvhtree_from_mesh_*. @@ -116,11 +115,11 @@ float nearest_point_in_tri_surface(const float v0[3], const float v1[3], const f */ //Using local coordinates -#define BVHTREE_FROM_FACES 0 -#define BVHTREE_FROM_VERTICES 1 -#define BVHTREE_FROM_EDGES 2 +#define BVHTREE_FROM_FACES 0 +#define BVHTREE_FROM_VERTICES 1 +#define BVHTREE_FROM_EDGES 2 -typedef struct LinkNode* BVHCache; +typedef struct LinkNode *BVHCache; /* diff --git a/source/blender/blenkernel/BKE_camera.h b/source/blender/blenkernel/BKE_camera.h index 8f68d7abcac..2a27934c038 100644 --- a/source/blender/blenkernel/BKE_camera.h +++ b/source/blender/blenkernel/BKE_camera.h @@ -112,13 +112,12 @@ void BKE_camera_params_compute_matrix(CameraParams *params); /* Camera View Frame */ void BKE_camera_view_frame_ex(struct Scene *scene, struct Camera *camera, float drawsize, const short do_clip, const float scale[3], - float r_asp[2], float r_shift[2], float *r_drawsize, float r_vec[4][3]); + float r_asp[2], float r_shift[2], float *r_drawsize, float r_vec[4][3]); void BKE_camera_view_frame(struct Scene *scene, struct Camera *camera, float r_vec[4][3]); -int BKE_camera_view_frame_fit_to_scene( - struct Scene *scene, struct View3D *v3d, struct Object *camera_ob, - float r_co[3]); +int BKE_camera_view_frame_fit_to_scene(struct Scene *scene, struct View3D *v3d, struct Object *camera_ob, + float r_co[3]); #ifdef __cplusplus } diff --git a/source/blender/blenkernel/BKE_ccg.h b/source/blender/blenkernel/BKE_ccg.h index 079994450d5..597d6498d99 100644 --- a/source/blender/blenkernel/BKE_ccg.h +++ b/source/blender/blenkernel/BKE_ccg.h @@ -43,7 +43,7 @@ struct CCGSubSurf; this reason, CCGElem is presented as an opaque pointer, and elements should always be accompanied by a CCGKey, which provides the necessary offsets to access components of a CCGElem. -*/ + */ typedef struct CCGElem CCGElem; typedef struct CCGKey { @@ -104,24 +104,24 @@ BLI_INLINE CCGElem *CCG_elem_next(const CCGKey *key, CCGElem *elem); BLI_INLINE float *CCG_elem_co(const CCGKey *UNUSED(key), CCGElem *elem) { - return (float*)elem; + return (float *)elem; } BLI_INLINE float *CCG_elem_no(const CCGKey *key, CCGElem *elem) { BLI_assert(key->has_normals); - return (float*)((char*)elem + key->normal_offset); + return (float *)((char *)elem + key->normal_offset); } BLI_INLINE float *CCG_elem_mask(const CCGKey *key, CCGElem *elem) { BLI_assert(key->has_mask); - return (float*)((char*)elem + (key->mask_offset)); + return (float *)((char *)elem + (key->mask_offset)); } BLI_INLINE CCGElem *CCG_elem_offset(const CCGKey *key, CCGElem *elem, int offset) { - return (CCGElem*)(((char*)elem) + key->elem_size * offset); + return (CCGElem *)(((char *)elem) + key->elem_size * offset); } BLI_INLINE CCGElem *CCG_grid_elem(const CCGKey *key, CCGElem *elem, int x, int y) diff --git a/source/blender/blenkernel/BKE_cdderivedmesh.h b/source/blender/blenkernel/BKE_cdderivedmesh.h index bdfe7366f9e..37763003099 100644 --- a/source/blender/blenkernel/BKE_cdderivedmesh.h +++ b/source/blender/blenkernel/BKE_cdderivedmesh.h @@ -79,11 +79,11 @@ struct DerivedMesh *CDDM_copy_from_tessface(struct DerivedMesh *dm); * elements are initialized to all zeros */ struct DerivedMesh *CDDM_from_template(struct DerivedMesh *source, - int numVerts, int numEdges, int numFaces, - int numLoops, int numPolys); + int numVerts, int numEdges, int numFaces, + int numLoops, int numPolys); -/*converts mfaces to mpolys. note things may break if there are not valid - *medges surrounding each mface. +/* converts mfaces to mpolys. note things may break if there are not valid + * medges surrounding each mface. */ void CDDM_tessfaces_to_faces(struct DerivedMesh *dm); diff --git a/source/blender/blenkernel/BKE_collision.h b/source/blender/blenkernel/BKE_collision.h index 24bce63ea3b..191056571c0 100644 --- a/source/blender/blenkernel/BKE_collision.h +++ b/source/blender/blenkernel/BKE_collision.h @@ -61,10 +61,10 @@ struct LinkNode; /* COLLISION FLAGS */ typedef enum { - COLLISION_IN_FUTURE = (1 << 1), + COLLISION_IN_FUTURE = (1 << 1), #ifdef WITH_ELTOPO - COLLISION_USE_COLLFACE = (1 << 2), - COLLISION_IS_EDGES = (1 << 3), + COLLISION_USE_COLLFACE = (1 << 2), + COLLISION_IS_EDGES = (1 << 3), #endif } COLLISION_FLAGS; @@ -73,8 +73,7 @@ typedef enum // used for collisions in collision.c //////////////////////////////////////// /* used for collisions in collision.c */ -typedef struct CollPair -{ +typedef struct CollPair { unsigned int face1; // cloth face unsigned int face2; // object face double distance; // magnitude of vector @@ -95,8 +94,7 @@ typedef struct CollPair CollPair; /* used for collisions in collision.c */ -typedef struct EdgeCollPair -{ +typedef struct EdgeCollPair { unsigned int p11, p12, p21, p22; float normal[3]; float vector[3]; @@ -107,8 +105,7 @@ typedef struct EdgeCollPair EdgeCollPair; /* used for collisions in collision.c */ -typedef struct FaceCollPair -{ +typedef struct FaceCollPair { unsigned int p11, p12, p13, p21; float normal[3]; float vector[3]; @@ -130,8 +127,8 @@ FaceCollPair; // used in modifier.c from collision.c ///////////////////////////////////////////////// -BVHTree *bvhtree_build_from_mvert(struct MFace *mfaces, unsigned int numfaces, struct MVert *x, unsigned int numverts, float epsilon ); -void bvhtree_update_from_mvert(BVHTree * bvhtree, struct MFace *faces, int numfaces, struct MVert *x, struct MVert *xnew, int numverts, int moving ); +BVHTree *bvhtree_build_from_mvert(struct MFace *mfaces, unsigned int numfaces, struct MVert *x, unsigned int numverts, float epsilon); +void bvhtree_update_from_mvert(BVHTree *bvhtree, struct MFace *faces, int numfaces, struct MVert *x, struct MVert *xnew, int numverts, int moving); ///////////////////////////////////////////////// diff --git a/source/blender/blenkernel/BKE_colortools.h b/source/blender/blenkernel/BKE_colortools.h index 1da0caf97c2..b85f0efe7e3 100644 --- a/source/blender/blenkernel/BKE_colortools.h +++ b/source/blender/blenkernel/BKE_colortools.h @@ -39,42 +39,42 @@ struct rctf; #if defined _WIN32 # define DO_INLINE __inline -#elif defined (__sun) || defined (__sun__) +#elif defined(__sun) || defined(__sun__) # define DO_INLINE #else # define DO_INLINE static inline #endif -struct CurveMapping *curvemapping_add(int tot, float minx, float miny, float maxx, float maxy); -void curvemapping_free(struct CurveMapping *cumap); -struct CurveMapping *curvemapping_copy(struct CurveMapping *cumap); -void curvemapping_set_black_white(struct CurveMapping *cumap, const float black[3], const float white[3]); +struct CurveMapping *curvemapping_add(int tot, float minx, float miny, float maxx, float maxy); +void curvemapping_free(struct CurveMapping *cumap); +struct CurveMapping *curvemapping_copy(struct CurveMapping *cumap); +void curvemapping_set_black_white(struct CurveMapping *cumap, const float black[3], const float white[3]); -#define CURVEMAP_SLOPE_NEGATIVE 0 -#define CURVEMAP_SLOPE_POSITIVE 1 -void curvemap_reset(struct CurveMap *cuma, struct rctf *clipr, int preset, int slope); -void curvemap_remove(struct CurveMap *cuma, int flag); -void curvemap_insert(struct CurveMap *cuma, float x, float y); -void curvemap_sethandle(struct CurveMap *cuma, int type); +#define CURVEMAP_SLOPE_NEGATIVE 0 +#define CURVEMAP_SLOPE_POSITIVE 1 +void curvemap_reset(struct CurveMap *cuma, struct rctf *clipr, int preset, int slope); +void curvemap_remove(struct CurveMap *cuma, int flag); +void curvemap_insert(struct CurveMap *cuma, float x, float y); +void curvemap_sethandle(struct CurveMap *cuma, int type); -void curvemapping_changed(struct CurveMapping *cumap, int rem_doubles); - - /* single curve, no table check */ -float curvemap_evaluateF(struct CurveMap *cuma, float value); - /* single curve, with table check */ -float curvemapping_evaluateF(struct CurveMapping *cumap, int cur, float value); -void curvemapping_evaluate3F(struct CurveMapping *cumap, float vecout[3], const float vecin[3]); -void curvemapping_evaluateRGBF(struct CurveMapping *cumap, float vecout[3], const float vecin[3]); -void curvemapping_evaluate_premulRGBF(struct CurveMapping *cumap, float vecout[3], const float vecin[3]); -void curvemapping_do_ibuf(struct CurveMapping *cumap, struct ImBuf *ibuf); -void curvemapping_premultiply(struct CurveMapping *cumap, int restore); -int curvemapping_RGBA_does_something(struct CurveMapping *cumap); -void curvemapping_initialize(struct CurveMapping *cumap); -void curvemapping_table_RGBA(struct CurveMapping *cumap, float **array, int *size); +void curvemapping_changed(struct CurveMapping *cumap, int rem_doubles); -void scopes_update(struct Scopes *scopes, struct ImBuf *ibuf, int use_color_management); -void scopes_free(struct Scopes *scopes); -void scopes_new(struct Scopes *scopes); +/* single curve, no table check */ +float curvemap_evaluateF(struct CurveMap *cuma, float value); +/* single curve, with table check */ +float curvemapping_evaluateF(struct CurveMapping *cumap, int cur, float value); +void curvemapping_evaluate3F(struct CurveMapping *cumap, float vecout[3], const float vecin[3]); +void curvemapping_evaluateRGBF(struct CurveMapping *cumap, float vecout[3], const float vecin[3]); +void curvemapping_evaluate_premulRGBF(struct CurveMapping *cumap, float vecout[3], const float vecin[3]); +void curvemapping_do_ibuf(struct CurveMapping *cumap, struct ImBuf *ibuf); +void curvemapping_premultiply(struct CurveMapping *cumap, int restore); +int curvemapping_RGBA_does_something(struct CurveMapping *cumap); +void curvemapping_initialize(struct CurveMapping *cumap); +void curvemapping_table_RGBA(struct CurveMapping *cumap, float **array, int *size); + +void scopes_update(struct Scopes *scopes, struct ImBuf *ibuf, int use_color_management); +void scopes_free(struct Scopes *scopes); +void scopes_new(struct Scopes *scopes); #endif diff --git a/source/blender/blenkernel/BKE_constraint.h b/source/blender/blenkernel/BKE_constraint.h index 35d07e7a7a7..686a60ab2c9 100644 --- a/source/blender/blenkernel/BKE_constraint.h +++ b/source/blender/blenkernel/BKE_constraint.h @@ -48,15 +48,15 @@ extern "C" { /* special struct for use in constraint evaluation */ typedef struct bConstraintOb { - struct Scene *scene; /* for system time, part of deglobalization, code nicer later with local time (ton) */ - struct Object *ob; /* if pchan, then armature that it comes from, otherwise constraint owner */ - struct bPoseChannel *pchan; /* pose channel that owns the constraints being evaluated */ + struct Scene *scene; /* for system time, part of deglobalization, code nicer later with local time (ton) */ + struct Object *ob; /* if pchan, then armature that it comes from, otherwise constraint owner */ + struct bPoseChannel *pchan; /* pose channel that owns the constraints being evaluated */ - float matrix[4][4]; /* matrix where constraints are accumulated + solved */ - float startmat[4][4]; /* original matrix (before constraint solving) */ + float matrix[4][4]; /* matrix where constraints are accumulated + solved */ + float startmat[4][4]; /* original matrix (before constraint solving) */ - short type; /* type of owner */ - short rotOrder; /* rotation order for constraint owner (as defined in eEulerRotationOrders in BLI_math.h) */ + short type; /* type of owner */ + short rotOrder; /* rotation order for constraint owner (as defined in eEulerRotationOrders in BLI_math.h) */ } bConstraintOb; /* ---------------------------------------------------------------------------- */ @@ -79,31 +79,31 @@ typedef void (*ConstraintIDFunc)(struct bConstraint *con, struct ID **idpoin, sh */ typedef struct bConstraintTypeInfo { /* admin/ident */ - short type; /* CONSTRAINT_TYPE_### */ - short size; /* size in bytes of the struct */ - char name[32]; /* name of constraint in interface */ - char structName[32]; /* name of struct for SDNA */ + short type; /* CONSTRAINT_TYPE_### */ + short size; /* size in bytes of the struct */ + char name[32]; /* name of constraint in interface */ + char structName[32]; /* name of struct for SDNA */ /* data management function pointers - special handling */ - /* free any data that is allocated separately (optional) */ + /* free any data that is allocated separately (optional) */ void (*free_data)(struct bConstraint *con); - /* run the provided callback function on all the ID-blocks linked to the constraint */ + /* run the provided callback function on all the ID-blocks linked to the constraint */ void (*id_looper)(struct bConstraint *con, ConstraintIDFunc func, void *userdata); - /* copy any special data that is allocated separately (optional) */ + /* copy any special data that is allocated separately (optional) */ void (*copy_data)(struct bConstraint *con, struct bConstraint *src); - /* set settings for data that will be used for bConstraint.data (memory already allocated using MEM_callocN) */ + /* set settings for data that will be used for bConstraint.data (memory already allocated using MEM_callocN) */ void (*new_data)(void *cdata); /* target handling function pointers */ - /* for multi-target constraints: return that list; otherwise make a temporary list (returns number of targets) */ + /* for multi-target constraints: return that list; otherwise make a temporary list (returns number of targets) */ int (*get_constraint_targets)(struct bConstraint *con, struct ListBase *list); - /* for single-target constraints only: flush data back to source data, and the free memory used */ + /* for single-target constraints only: flush data back to source data, and the free memory used */ void (*flush_constraint_targets)(struct bConstraint *con, struct ListBase *list, short nocopy); /* evaluation */ - /* set the ct->matrix for the given constraint target (at the given ctime) */ + /* set the ct->matrix for the given constraint target (at the given ctime) */ void (*get_target_matrix)(struct bConstraint *con, struct bConstraintOb *cob, struct bConstraintTarget *ct, float ctime); - /* evaluate the constraint for the given time */ + /* evaluate the constraint for the given time */ void (*evaluate_constraint)(struct bConstraint *con, struct bConstraintOb *cob, struct ListBase *targets); } bConstraintTypeInfo; diff --git a/source/blender/blenkernel/BKE_context.h b/source/blender/blenkernel/BKE_context.h index b2bd840a09a..23df246b430 100644 --- a/source/blender/blenkernel/BKE_context.h +++ b/source/blender/blenkernel/BKE_context.h @@ -72,7 +72,7 @@ struct bContextDataResult; typedef struct bContextDataResult bContextDataResult; typedef int (*bContextDataCallback)(const bContext *C, - const char *member, bContextDataResult *result); + const char *member, bContextDataResult *result); typedef struct bContextStoreEntry { struct bContextStoreEntry *next, *prev; @@ -223,7 +223,7 @@ void CTX_data_list_add(bContextDataResult *result, void *data); BLI_freelistN(&ctx_data_list); \ } -int ctx_data_list_count(const bContext *C, int (*func)(const bContext*, ListBase*)); +int ctx_data_list_count(const bContext *C, int (*func)(const bContext *, ListBase *)); #define CTX_DATA_COUNT(C, member) \ ctx_data_list_count(C, CTX_data_##member) diff --git a/source/blender/blenkernel/BKE_curve.h b/source/blender/blenkernel/BKE_curve.h index 6267104022c..a845ac10c9d 100644 --- a/source/blender/blenkernel/BKE_curve.h +++ b/source/blender/blenkernel/BKE_curve.h @@ -43,15 +43,15 @@ struct Nurb; struct Object; struct Scene; -#define KNOTSU(nu) ( (nu)->orderu+ (nu)->pntsu+ (((nu)->flagu & CU_NURB_CYCLIC) ? ((nu)->orderu-1) : 0) ) -#define KNOTSV(nu) ( (nu)->orderv+ (nu)->pntsv+ (((nu)->flagv & CU_NURB_CYCLIC) ? ((nu)->orderv-1) : 0) ) +#define KNOTSU(nu) ( (nu)->orderu + (nu)->pntsu + (((nu)->flagu & CU_NURB_CYCLIC) ? ((nu)->orderu - 1) : 0) ) +#define KNOTSV(nu) ( (nu)->orderv + (nu)->pntsv + (((nu)->flagv & CU_NURB_CYCLIC) ? ((nu)->orderv - 1) : 0) ) /* Non cyclic nurbs have 1 less segment */ -#define SEGMENTSU(nu) ( ((nu)->flagu & CU_NURB_CYCLIC) ? (nu)->pntsu : (nu)->pntsu-1 ) -#define SEGMENTSV(nu) ( ((nu)->flagv & CU_NURB_CYCLIC) ? (nu)->pntsv : (nu)->pntsv-1 ) +#define SEGMENTSU(nu) ( ((nu)->flagu & CU_NURB_CYCLIC) ? (nu)->pntsu : (nu)->pntsu - 1) +#define SEGMENTSV(nu) ( ((nu)->flagv & CU_NURB_CYCLIC) ? (nu)->pntsv : (nu)->pntsv - 1) -#define CU_DO_TILT(cu, nu) (((nu->flag & CU_2D) && (cu->flag & CU_3D)==0) ? 0 : 1) -#define CU_DO_RADIUS(cu, nu) ((CU_DO_TILT(cu, nu) || ((cu)->flag & CU_PATH_RADIUS) || (cu)->bevobj || (cu)->ext1!=0.0f || (cu)->ext2!=0.0f) ? 1:0) +#define CU_DO_TILT(cu, nu) (((nu->flag & CU_2D) && (cu->flag & CU_3D) == 0) ? 0 : 1) +#define CU_DO_RADIUS(cu, nu) ((CU_DO_TILT(cu, nu) || ((cu)->flag & CU_PATH_RADIUS) || (cu)->bevobj || (cu)->ext1 != 0.0f || (cu)->ext2 != 0.0f) ? 1 : 0) /* ** Curve ** */ void BKE_curve_unlink(struct Curve *cu); diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h index 4b52189d8b7..b39ea7cca02 100644 --- a/source/blender/blenkernel/BKE_customdata.h +++ b/source/blender/blenkernel/BKE_customdata.h @@ -47,7 +47,7 @@ struct CustomDataLayer; typedef uint64_t CustomDataMask; /*a data type large enough to hold 1 element from any customdata layer type*/ -typedef struct {unsigned char data[64];} CDBlockBytes; +typedef struct {unsigned char data[64]; } CDBlockBytes; extern const CustomDataMask CD_MASK_BAREMESH; extern const CustomDataMask CD_MASK_MESH; @@ -97,7 +97,7 @@ void CustomData_data_add(int type, void *data1, void *data2); * mask is a bitfield where (mask & (1 << (layer type))) indicates * if a layer should be copied or not. alloctype must be one of the above. */ void CustomData_copy(const struct CustomData *source, struct CustomData *dest, - CustomDataMask mask, int alloctype, int totelem); + CustomDataMask mask, int alloctype, int totelem); /* BMESH_TODO, not really a public function but readfile.c needs it */ void CustomData_update_typemap(struct CustomData *data); @@ -105,7 +105,7 @@ void CustomData_update_typemap(struct CustomData *data); /* same as the above, except that this will preserve existing layers, and only * add the layers that were not there yet */ void CustomData_merge(const struct CustomData *source, struct CustomData *dest, - CustomDataMask mask, int alloctype, int totelem); + CustomDataMask mask, int alloctype, int totelem); /* bmesh version of CustomData_merge; merges the layouts of source and dest, * then goes through the mesh and makes sure all the customdata blocks are @@ -128,10 +128,10 @@ void CustomData_free_temporary(struct CustomData *data, int totelem); * in editmode, use EDBM_data_layer_add instead of this function */ void *CustomData_add_layer(struct CustomData *data, int type, int alloctype, - void *layer, int totelem); + void *layer, int totelem); /*same as above but accepts a name */ void *CustomData_add_layer_named(struct CustomData *data, int type, int alloctype, - void *layer, int totelem, const char *name); + void *layer, int totelem, const char *name); /* frees the active or first data layer with the give type. * returns 1 on succes, 0 if no layer with the given type is found @@ -160,7 +160,7 @@ int CustomData_number_of_layers(const struct CustomData *data, int type); * returns the layer data */ void *CustomData_duplicate_referenced_layer(struct CustomData *data, const int type, const int totelem); void *CustomData_duplicate_referenced_layer_named(struct CustomData *data, - const int type, const char *name, const int totelem); + const int type, const char *name, const int totelem); int CustomData_is_referenced_layer(struct CustomData *data, int type); /* set the CD_FLAG_NOCOPY flag in custom data layers where the mask is @@ -168,7 +168,7 @@ int CustomData_is_referenced_layer(struct CustomData *data, int type); * will be copied */ void CustomData_set_only_copy(const struct CustomData *data, - CustomDataMask mask); + CustomDataMask mask); /* copies data from one CustomData object to another * objects need not be compatible, each source layer is copied to the @@ -176,8 +176,8 @@ void CustomData_set_only_copy(const struct CustomData *data, * return 1 on success, 0 on failure */ void CustomData_copy_data(const struct CustomData *source, - struct CustomData *dest, int source_index, - int dest_index, int count); + struct CustomData *dest, int source_index, + int dest_index, int count); void CustomData_copy_elements(int type, void *source, void *dest, int count); void CustomData_bmesh_copy_data(const struct CustomData *source, struct CustomData *dest, void *src_block, @@ -203,11 +203,11 @@ void CustomData_free_elem(struct CustomData *data, int index, int count); * returns 1 on success, 0 on failure */ void CustomData_interp(const struct CustomData *source, struct CustomData *dest, - int *src_indices, float *weights, float *sub_weights, - int count, int dest_index); + int *src_indices, float *weights, float *sub_weights, + int count, int dest_index); void CustomData_bmesh_interp(struct CustomData *data, void **src_blocks, - float *weights, float *sub_weights, int count, - void *dest_block); + float *weights, float *sub_weights, int count, + void *dest_block); /* swaps the data in the element corners, to new corners with indices as @@ -235,7 +235,7 @@ int CustomData_set_layer_name(const struct CustomData *data, int type, int n, co void *CustomData_get_layer(const struct CustomData *data, int type); void *CustomData_get_layer_n(const struct CustomData *data, int type, int n); void *CustomData_get_layer_named(const struct CustomData *data, int type, - const char *name); + const char *name); int CustomData_get_layer_index(const struct CustomData *data, int type); int CustomData_get_layer_index_n(const struct CustomData *data, int type, int n); @@ -254,18 +254,18 @@ int CustomData_get_stencil_layer(const struct CustomData *data, int type); * no effect if there is no layer of type */ void CustomData_set(const struct CustomData *data, int index, int type, - void *source); + void *source); void CustomData_bmesh_set(const struct CustomData *data, void *block, int type, - void *source); + void *source); void CustomData_bmesh_set_n(struct CustomData *data, void *block, int type, int n, - void *source); + void *source); /*sets the data of the block at physical layer n. no real type checking - *is performed. + *is performed. */ void CustomData_bmesh_set_layer_n(struct CustomData *data, void *block, int n, - void *source); + void *source); /* set the pointer of to the first layer of type. the old data is not freed. * returns the value of ptr if the layer is found, NULL otherwise @@ -294,9 +294,9 @@ void CustomData_bmesh_free_block(struct CustomData *data, void **block); /* copy custom data to/from layers as in mesh/derivedmesh, to editmesh * blocks of data. the CustomData's must not be compatible */ void CustomData_to_bmesh_block(const struct CustomData *source, - struct CustomData *dest, int src_index, void **dest_block); + struct CustomData *dest, int src_index, void **dest_block); void CustomData_from_bmesh_block(const struct CustomData *source, - struct CustomData *dest, void *src_block, int dest_index); + struct CustomData *dest, void *src_block, int dest_index); /* query info over types */ @@ -326,17 +326,17 @@ void CustomData_bmesh_init_pool(struct CustomData *data, int totelem, const char /* External file storage */ void CustomData_external_add(struct CustomData *data, - struct ID *id, int type, int totelem, const char *filename); + struct ID *id, int type, int totelem, const char *filename); void CustomData_external_remove(struct CustomData *data, - struct ID *id, int type, int totelem); + struct ID *id, int type, int totelem); int CustomData_external_test(struct CustomData *data, int type); void CustomData_external_write(struct CustomData *data, - struct ID *id, CustomDataMask mask, int totelem, int free); + struct ID *id, CustomDataMask mask, int totelem, int free); void CustomData_external_read(struct CustomData *data, - struct ID *id, CustomDataMask mask, int totelem); + struct ID *id, CustomDataMask mask, int totelem); void CustomData_external_reload(struct CustomData *data, - struct ID *id, CustomDataMask mask, int totelem); + struct ID *id, CustomDataMask mask, int totelem); #ifdef __cplusplus } diff --git a/source/blender/blenkernel/BKE_customdata_file.h b/source/blender/blenkernel/BKE_customdata_file.h index c4c41c20d80..978db8a6c1a 100644 --- a/source/blender/blenkernel/BKE_customdata_file.h +++ b/source/blender/blenkernel/BKE_customdata_file.h @@ -25,10 +25,10 @@ * \ingroup bke */ -#define CDF_TYPE_IMAGE 0 -#define CDF_TYPE_MESH 1 +#define CDF_TYPE_IMAGE 0 +#define CDF_TYPE_MESH 1 -#define CDF_LAYER_NAME_MAX 64 +#define CDF_LAYER_NAME_MAX 64 typedef struct CDataFile CDataFile; typedef struct CDataFileLayer CDataFileLayer; diff --git a/source/blender/blenkernel/BKE_deform.h b/source/blender/blenkernel/BKE_deform.h index 559dd4571f5..25677165fc2 100644 --- a/source/blender/blenkernel/BKE_deform.h +++ b/source/blender/blenkernel/BKE_deform.h @@ -40,17 +40,17 @@ struct ListBase; struct bDeformGroup; struct MDeformVert; -void defgroup_copy_list(struct ListBase *lb1, struct ListBase *lb2); +void defgroup_copy_list(struct ListBase *lb1, struct ListBase *lb2); struct bDeformGroup *defgroup_duplicate(struct bDeformGroup *ingroup); struct bDeformGroup *defgroup_find_name(struct Object *ob, const char *name); -int *defgroup_flip_map(struct Object *ob, int *flip_map_len, int use_default); -int *defgroup_flip_map_single(struct Object *ob, int *flip_map_len, int use_default, int defgroup); -int defgroup_flip_index(struct Object *ob, int index, int use_default); -int defgroup_name_index(struct Object *ob, const char *name); -void defgroup_unique_name(struct bDeformGroup *dg, struct Object *ob); +int *defgroup_flip_map(struct Object *ob, int *flip_map_len, int use_default); +int *defgroup_flip_map_single(struct Object *ob, int *flip_map_len, int use_default, int defgroup); +int defgroup_flip_index(struct Object *ob, int index, int use_default); +int defgroup_name_index(struct Object *ob, const char *name); +void defgroup_unique_name(struct bDeformGroup *dg, struct Object *ob); -struct MDeformWeight *defvert_find_index(const struct MDeformVert *dv, const int defgroup); -struct MDeformWeight *defvert_verify_index(struct MDeformVert *dv, const int defgroup); +struct MDeformWeight *defvert_find_index(const struct MDeformVert *dv, const int defgroup); +struct MDeformWeight *defvert_verify_index(struct MDeformVert *dv, const int defgroup); void defvert_add_index_notest(struct MDeformVert *dv, int defgroup, const float weight); void defvert_remove_group(struct MDeformVert *dvert, struct MDeformWeight *dw); void defvert_clear(struct MDeformVert *dvert); @@ -63,7 +63,7 @@ void defvert_copy_index(struct MDeformVert *dvert_dst, const struct MDeformVert void defvert_sync(struct MDeformVert *dvert_dst, const struct MDeformVert *dvert_src, int use_verify); void defvert_sync_mapped(struct MDeformVert *dvert_dst, const struct MDeformVert *dvert_src, const int *flip_map, const int flip_map_len, const int use_verify); -void defvert_remap (struct MDeformVert *dvert, int *map, const int map_len); +void defvert_remap(struct MDeformVert *dvert, int *map, const int map_len); void defvert_flip(struct MDeformVert *dvert, const int *flip_map, const int flip_map_len); void defvert_flip_merged(struct MDeformVert *dvert, const int *flip_map, const int flip_map_len); void defvert_normalize(struct MDeformVert *dvert); diff --git a/source/blender/blenkernel/BKE_depsgraph.h b/source/blender/blenkernel/BKE_depsgraph.h index b7edf04724d..cf7e4b24288 100644 --- a/source/blender/blenkernel/BKE_depsgraph.h +++ b/source/blender/blenkernel/BKE_depsgraph.h @@ -46,37 +46,37 @@ struct GHash; /* **** DAG relation types *** */ - /* scene link to object */ -#define DAG_RL_SCENE (1<<0) - /* object link to data */ -#define DAG_RL_DATA (1<<1) +/* scene link to object */ +#define DAG_RL_SCENE (1 << 0) +/* object link to data */ +#define DAG_RL_DATA (1 << 1) - /* object changes object (parent, track, constraints) */ -#define DAG_RL_OB_OB (1<<2) - /* object changes obdata (hooks, constraints) */ -#define DAG_RL_OB_DATA (1<<3) - /* data changes object (vertex parent) */ -#define DAG_RL_DATA_OB (1<<4) - /* data changes data (deformers) */ -#define DAG_RL_DATA_DATA (1<<5) +/* object changes object (parent, track, constraints) */ +#define DAG_RL_OB_OB (1 << 2) +/* object changes obdata (hooks, constraints) */ +#define DAG_RL_OB_DATA (1 << 3) +/* data changes object (vertex parent) */ +#define DAG_RL_DATA_OB (1 << 4) +/* data changes data (deformers) */ +#define DAG_RL_DATA_DATA (1 << 5) -#define DAG_NO_RELATION (1<<6) +#define DAG_NO_RELATION (1 << 6) -#define DAG_RL_ALL_BUT_DATA (DAG_RL_SCENE|DAG_RL_OB_OB|DAG_RL_OB_DATA|DAG_RL_DATA_OB|DAG_RL_DATA_DATA) -#define DAG_RL_ALL (DAG_RL_ALL_BUT_DATA|DAG_RL_DATA) +#define DAG_RL_ALL_BUT_DATA (DAG_RL_SCENE | DAG_RL_OB_OB | DAG_RL_OB_DATA | DAG_RL_DATA_OB | DAG_RL_DATA_DATA) +#define DAG_RL_ALL (DAG_RL_ALL_BUT_DATA | DAG_RL_DATA) -typedef void (*graph_action_func)(void * ob, void **data); +typedef void (*graph_action_func)(void *ob, void **data); // queues are returned by all BFS & DFS queries // opaque type -void *pop_ob_queue(struct DagNodeQueue *queue); -int queue_count(struct DagNodeQueue *queue); -void queue_delete(struct DagNodeQueue *queue); +void *pop_ob_queue(struct DagNodeQueue *queue); +int queue_count(struct DagNodeQueue *queue); +void queue_delete(struct DagNodeQueue *queue); // queries -struct DagForest *build_dag(struct Main *bmain, struct Scene *sce, short mask); -void free_forest(struct DagForest *Dag); +struct DagForest *build_dag(struct Main *bmain, struct Scene *sce, short mask); +void free_forest(struct DagForest *Dag); // note : // the meanings of the 2 returning values is a bit different : @@ -88,49 +88,49 @@ int pre_and_post_DFS(struct DagForest *dag, short mask, graph_action_func pre_fu int pre_and_post_source_BFS(struct DagForest *dag, short mask, struct DagNode *source, graph_action_func pre_func, graph_action_func post_func, void **data); int pre_and_post_source_DFS(struct DagForest *dag, short mask, struct DagNode *source, graph_action_func pre_func, graph_action_func post_func, void **data); -struct DagNodeQueue *get_obparents(struct DagForest *dag, void *ob); -struct DagNodeQueue *get_first_ancestors(struct DagForest *dag, void *ob); -struct DagNodeQueue *get_all_childs(struct DagForest *dag, void *ob); // -short are_obs_related(struct DagForest *dag, void *ob1, void *ob2); -int is_acyclic(struct DagForest *dag); // +struct DagNodeQueue *get_obparents(struct DagForest *dag, void *ob); +struct DagNodeQueue *get_first_ancestors(struct DagForest *dag, void *ob); +struct DagNodeQueue *get_all_childs(struct DagForest *dag, void *ob); +short are_obs_related(struct DagForest *dag, void *ob1, void *ob2); +int is_acyclic(struct DagForest *dag); //int get_cycles(struct DagForest *dag, struct DagNodeQueue **queues, int *count); // /* ********** API *************** */ /* Note that the DAG never executes changes in Objects, only sets flags in Objects */ - /* (re)-create dependency graph for scene */ -void DAG_scene_sort(struct Main *bmain, struct Scene *sce); - - /* flag all objects that need recalc because they're animated */ -void DAG_scene_update_flags(struct Main *bmain, struct Scene *sce, unsigned int lay, const short do_time); - /* flushes all recalc flags in objects down the dependency tree */ -void DAG_scene_flush_update(struct Main *bmain, struct Scene *sce, unsigned int lay, const short do_time); - /* tag objects for update on file load */ -void DAG_on_visible_update(struct Main *bmain, const short do_time); - - /* when setting manual RECALC flags, call this afterwards */ -void DAG_ids_flush_update(struct Main *bmain, int time); - - /* tag datablock to get updated for the next redraw */ -void DAG_id_tag_update(struct ID *id, short flag); - /* flush all tagged updates */ -void DAG_ids_flush_tagged(struct Main *bmain); - /* check and clear ID recalc flags */ -void DAG_ids_check_recalc(struct Main *bmain, struct Scene *scene, int time); -void DAG_ids_clear_recalc(struct Main *bmain); - /* test if any of this id type is tagged for update */ -void DAG_id_type_tag(struct Main *bmain, short idtype); -int DAG_id_type_tagged(struct Main *bmain, short idtype); - - /* (re)-create dependency graph for armature pose */ -void DAG_pose_sort(struct Object *ob); - - /* callback for editors module to do updates */ -void DAG_editors_update_cb(void (*id_func)(struct Main *bmain, struct ID *id), +/* (re)-create dependency graph for scene */ +void DAG_scene_sort(struct Main *bmain, struct Scene *sce); + +/* flag all objects that need recalc because they're animated */ +void DAG_scene_update_flags(struct Main *bmain, struct Scene *sce, unsigned int lay, const short do_time); +/* flushes all recalc flags in objects down the dependency tree */ +void DAG_scene_flush_update(struct Main *bmain, struct Scene *sce, unsigned int lay, const short do_time); +/* tag objects for update on file load */ +void DAG_on_visible_update(struct Main *bmain, const short do_time); + +/* when setting manual RECALC flags, call this afterwards */ +void DAG_ids_flush_update(struct Main *bmain, int time); + +/* tag datablock to get updated for the next redraw */ +void DAG_id_tag_update(struct ID *id, short flag); +/* flush all tagged updates */ +void DAG_ids_flush_tagged(struct Main *bmain); +/* check and clear ID recalc flags */ +void DAG_ids_check_recalc(struct Main *bmain, struct Scene *scene, int time); +void DAG_ids_clear_recalc(struct Main *bmain); +/* test if any of this id type is tagged for update */ +void DAG_id_type_tag(struct Main *bmain, short idtype); +int DAG_id_type_tagged(struct Main *bmain, short idtype); + +/* (re)-create dependency graph for armature pose */ +void DAG_pose_sort(struct Object *ob); + +/* callback for editors module to do updates */ +void DAG_editors_update_cb(void (*id_func)(struct Main *bmain, struct ID *id), void (*scene_func)(struct Main *bmain, struct Scene *scene, int updated)); - /* debugging */ -void DAG_print_dependencies(struct Main *bmain, struct Scene *scene, struct Object *ob); +/* debugging */ +void DAG_print_dependencies(struct Main *bmain, struct Scene *scene, struct Object *ob); #ifdef __cplusplus } diff --git a/source/blender/blenkernel/BKE_displist.h b/source/blender/blenkernel/BKE_displist.h index cb8ddbf0b00..758a2a8a2e8 100644 --- a/source/blender/blenkernel/BKE_displist.h +++ b/source/blender/blenkernel/BKE_displist.h @@ -42,13 +42,13 @@ #define DL_INDEX3 4 #define DL_INDEX4 5 #define DL_VERTCOL 6 -#define DL_VERTS 7 +#define DL_VERTS 7 /* dl->flag */ -#define DL_CYCL_U 1 -#define DL_CYCL_V 2 -#define DL_FRONT_CURVE 4 -#define DL_BACK_CURVE 8 +#define DL_CYCL_U 1 +#define DL_CYCL_V 2 +#define DL_FRONT_CURVE 4 +#define DL_BACK_CURVE 8 /* prototypes */ @@ -73,7 +73,7 @@ typedef struct DispList { int *index; unsigned int *col1, *col2; int charidx; - int totindex; /* indexed array drawing surfaces */ + int totindex; /* indexed array drawing surfaces */ unsigned int *bevelSplitFlag; } DispList; diff --git a/source/blender/blenkernel/BKE_dynamicpaint.h b/source/blender/blenkernel/BKE_dynamicpaint.h index 59f8864bb21..ffce16f39ff 100644 --- a/source/blender/blenkernel/BKE_dynamicpaint.h +++ b/source/blender/blenkernel/BKE_dynamicpaint.h @@ -64,7 +64,7 @@ typedef struct PaintWavePoint { } PaintWavePoint; struct DerivedMesh *dynamicPaint_Modifier_do(struct DynamicPaintModifierData *pmd, struct Scene *scene, struct Object *ob, struct DerivedMesh *dm); -void dynamicPaint_Modifier_free (struct DynamicPaintModifierData *pmd); +void dynamicPaint_Modifier_free(struct DynamicPaintModifierData *pmd); void dynamicPaint_Modifier_copy(struct DynamicPaintModifierData *pmd, struct DynamicPaintModifierData *tsmd); int dynamicPaint_createType(struct DynamicPaintModifierData *pmd, int type, struct Scene *scene); @@ -87,7 +87,7 @@ struct DynamicPaintSurface *get_activeSurface(struct DynamicPaintCanvasSettings /* image sequence baking */ int dynamicPaint_createUVSurface(struct DynamicPaintSurface *surface); int dynamicPaint_calculateFrame(struct DynamicPaintSurface *surface, struct Scene *scene, struct Object *cObject, int frame); -void dynamicPaint_outputSurfaceImage(struct DynamicPaintSurface *surface, char* filename, short output_layer); +void dynamicPaint_outputSurfaceImage(struct DynamicPaintSurface *surface, char *filename, short output_layer); /* PaintPoint state */ #define DPAINT_PAINT_NONE -1 diff --git a/source/blender/blenkernel/BKE_effect.h b/source/blender/blenkernel/BKE_effect.h index bb17c891020..e9d37fb4407 100644 --- a/source/blender/blenkernel/BKE_effect.h +++ b/source/blender/blenkernel/BKE_effect.h @@ -52,7 +52,7 @@ struct PartDeflect *object_add_collision_fields(int type); typedef struct EffectedPoint { float *loc; float *vel; - float *ave; /* angular velocity for particles with dynamic rotation */ + float *ave; /* angular velocity for particles with dynamic rotation */ float *rot; /* rotation quaternion for particles with dynamic rotation */ float vel_to_frame; float vel_to_sec; @@ -63,7 +63,7 @@ typedef struct EffectedPoint { unsigned int flag; int index; - struct ParticleSystem *psys; /* particle system the point belongs to */ + struct ParticleSystem *psys; /* particle system the point belongs to */ } EffectedPoint; typedef struct GuideEffectorData { @@ -86,7 +86,7 @@ typedef struct EffectorData { /* only for vortex effector with surface falloff */ float nor2[3], vec_to_point2[3]; - int *index; /* point index */ + int *index; /* point index */ } EffectorData; /* used for calculating the effector force */ @@ -109,10 +109,10 @@ typedef struct EffectorCache { int flag; } EffectorCache; -void free_partdeflect(struct PartDeflect *pd); +void free_partdeflect(struct PartDeflect *pd); struct ListBase *pdInitEffectors(struct Scene *scene, struct Object *ob_src, struct ParticleSystem *psys_src, struct EffectorWeights *weights); -void pdEndEffectors(struct ListBase **effectors); -void pdDoEffectors(struct ListBase *effectors, struct ListBase *colliders, struct EffectorWeights *weights, struct EffectedPoint *point, float *force, float *impulse); +void pdEndEffectors(struct ListBase **effectors); +void pdDoEffectors(struct ListBase *effectors, struct ListBase *colliders, struct EffectorWeights *weights, struct EffectedPoint *point, float *force, float *impulse); void pd_point_from_particle(struct ParticleSimulationData *sim, struct ParticleData *pa, struct ParticleKey *state, struct EffectedPoint *point); void pd_point_from_loc(struct Scene *scene, float *loc, float *vel, int index, struct EffectedPoint *point); @@ -120,7 +120,7 @@ void pd_point_from_soft(struct Scene *scene, float *loc, float *vel, int index, /* needed for boids */ float effector_falloff(struct EffectorCache *eff, struct EffectorData *efd, struct EffectedPoint *point, struct EffectorWeights *weights); -int closest_point_on_surface(SurfaceModifierData *surmd, const float co[3], float surface_co[3], float surface_nor[3], float surface_vel[3]); +int closest_point_on_surface(SurfaceModifierData * surmd, const float co[3], float surface_co[3], float surface_nor[3], float surface_vel[3]); int get_effector_data(struct EffectorCache *eff, struct EffectorData *efd, struct EffectedPoint *point, int real_velocity); /* required for particle_system.c */ @@ -128,12 +128,12 @@ int get_effector_data(struct EffectorCache *eff, struct EffectorData *efd, struc //float effector_falloff(struct EffectorData *eff, struct EffectorPoint *point, struct EffectorWeights *weights); /* EffectedPoint->flag */ -#define PE_WIND_AS_SPEED 1 -#define PE_DYNAMIC_ROTATION 2 -#define PE_USE_NORMAL_DATA 4 +#define PE_WIND_AS_SPEED 1 +#define PE_DYNAMIC_ROTATION 2 +#define PE_USE_NORMAL_DATA 4 /* EffectorData->flag */ -#define PE_VELOCITY_TO_IMPULSE 1 +#define PE_VELOCITY_TO_IMPULSE 1 #endif diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h index b615ac60c3e..9dae38d0a65 100644 --- a/source/blender/blenkernel/BKE_fcurve.h +++ b/source/blender/blenkernel/BKE_fcurve.h @@ -70,15 +70,15 @@ void bezt_add_to_cfra_elem(ListBase *lb, struct BezTriple *bezt); /* convenience looper over ALL driver targets for a given variable (even the unused ones) */ #define DRIVER_TARGETS_LOOPER(dvar) \ { \ - DriverTarget *dtar= &dvar->targets[0]; \ - int tarIndex= 0; \ + DriverTarget *dtar = &dvar->targets[0]; \ + int tarIndex = 0; \ for (; tarIndex < MAX_DRIVER_TARGETS; tarIndex++, dtar++) /* convenience looper over USED driver targets only */ #define DRIVER_TARGETS_USED_LOOPER(dvar) \ { \ - DriverTarget *dtar= &dvar->targets[0]; \ - int tarIndex= 0; \ + DriverTarget *dtar = &dvar->targets[0]; \ + int tarIndex = 0; \ for (; tarIndex < dvar->num_targets; tarIndex++, dtar++) /* tidy up for driver targets loopers */ @@ -94,7 +94,7 @@ void driver_free_variable(struct ChannelDriver *driver, struct DriverVar *dvar); void driver_change_variable_type(struct DriverVar *dvar, int type); struct DriverVar *driver_add_new_variable(struct ChannelDriver *driver); -float driver_get_variable_value (struct ChannelDriver *driver, struct DriverVar *dvar); +float driver_get_variable_value(struct ChannelDriver *driver, struct DriverVar *dvar); /* ************** F-Curve Modifiers *************** */ @@ -111,52 +111,52 @@ float driver_get_variable_value (struct ChannelDriver *driver, struct DriverVar */ typedef struct FModifierTypeInfo { /* admin/ident */ - short type; /* FMODIFIER_TYPE_### */ - short size; /* size in bytes of the struct */ - short acttype; /* eFMI_Action_Types */ - short requires; /* eFMI_Requirement_Flags */ - char name[64]; /* name of modifier in interface */ - char structName[64]; /* name of struct for SDNA */ + short type; /* FMODIFIER_TYPE_### */ + short size; /* size in bytes of the struct */ + short acttype; /* eFMI_Action_Types */ + short requires; /* eFMI_Requirement_Flags */ + char name[64]; /* name of modifier in interface */ + char structName[64]; /* name of struct for SDNA */ /* data management function pointers - special handling */ - /* free any data that is allocated separately (optional) */ + /* free any data that is allocated separately (optional) */ void (*free_data)(struct FModifier *fcm); - /* copy any special data that is allocated separately (optional) */ + /* copy any special data that is allocated separately (optional) */ void (*copy_data)(struct FModifier *fcm, struct FModifier *src); - /* set settings for data that will be used for FCuModifier.data (memory already allocated using MEM_callocN) */ + /* set settings for data that will be used for FCuModifier.data (memory already allocated using MEM_callocN) */ void (*new_data)(void *mdata); - /* verifies that the modifier settings are valid */ + /* verifies that the modifier settings are valid */ void (*verify_data)(struct FModifier *fcm); /* evaluation */ - /* evaluate time that the modifier requires the F-Curve to be evaluated at */ + /* evaluate time that the modifier requires the F-Curve to be evaluated at */ float (*evaluate_modifier_time)(struct FCurve *fcu, struct FModifier *fcm, float cvalue, float evaltime); - /* evaluate the modifier for the given time and 'accumulated' value */ + /* evaluate the modifier for the given time and 'accumulated' value */ void (*evaluate_modifier)(struct FCurve *fcu, struct FModifier *fcm, float *cvalue, float evaltime); } FModifierTypeInfo; /* Values which describe the behavior of a FModifier Type */ typedef enum eFMI_Action_Types { - /* modifier only modifies values outside of data range */ + /* modifier only modifies values outside of data range */ FMI_TYPE_EXTRAPOLATION = 0, - /* modifier leaves data-points alone, but adjusts the interpolation between and around them */ + /* modifier leaves data-points alone, but adjusts the interpolation between and around them */ FMI_TYPE_INTERPOLATION, - /* modifier only modifies the values of points (but times stay the same) */ + /* modifier only modifies the values of points (but times stay the same) */ FMI_TYPE_REPLACE_VALUES, - /* modifier generates a curve regardless of what came before */ + /* modifier generates a curve regardless of what came before */ FMI_TYPE_GENERATE_CURVE } eFMI_Action_Types; /* Flags for the requirements of a FModifier Type */ typedef enum eFMI_Requirement_Flags { - /* modifier requires original data-points (kindof beats the purpose of a modifier stack?) */ - FMI_REQUIRES_ORIGINAL_DATA = (1<<0), - /* modifier doesn't require on any preceding data (i.e. it will generate a curve). - * Use in conjunction with FMI_TYPE_GENRATE_CURVE - */ - FMI_REQUIRES_NOTHING = (1<<1), - /* refer to modifier instance */ - FMI_REQUIRES_RUNTIME_CHECK = (1<<2) + /* modifier requires original data-points (kindof beats the purpose of a modifier stack?) */ + FMI_REQUIRES_ORIGINAL_DATA = (1 << 0), + /* modifier doesn't require on any preceding data (i.e. it will generate a curve). + * Use in conjunction with FMI_TYPE_GENRATE_CURVE + */ + FMI_REQUIRES_NOTHING = (1 << 1), + /* refer to modifier instance */ + FMI_REQUIRES_RUNTIME_CHECK = (1 << 2) } eFMI_Requirement_Flags; /* Function Prototypes for FModifierTypeInfo's */ @@ -194,7 +194,7 @@ void copy_fcurves(ListBase *dst, ListBase *src); /* find matching F-Curve in the given list of F-Curves */ struct FCurve *list_find_fcurve(ListBase *list, const char rna_path[], const int array_index); -struct FCurve *iter_step_fcurve (struct FCurve *fcu_iter, const char rna_path[]); +struct FCurve *iter_step_fcurve(struct FCurve *fcu_iter, const char rna_path[]); /* high level function to get an fcurve from C without having the rna */ struct FCurve *id_data_find_fcurve(ID *id, void *data, struct StructRNA *type, const char *prop_name, int index, char *driven); diff --git a/source/blender/blenkernel/BKE_fluidsim.h b/source/blender/blenkernel/BKE_fluidsim.h index c2b1b1d6cad..c3fa6621c98 100644 --- a/source/blender/blenkernel/BKE_fluidsim.h +++ b/source/blender/blenkernel/BKE_fluidsim.h @@ -42,9 +42,9 @@ struct MVert; /* old interface */ void initElbeemMesh(struct Scene *scene, struct Object *ob, - int *numVertices, float **vertices, - int *numTriangles, int **triangles, - int useGlobalCoords, int modifierIndex); + int *numVertices, float **vertices, + int *numTriangles, int **triangles, + int useGlobalCoords, int modifierIndex); /* bounding box & memory estimate */ void fluid_get_bb(struct MVert *mvert, int totvert, float obmat[][4], diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h index 950c3c20b9b..593b4afb85c 100644 --- a/source/blender/blenkernel/BKE_global.h +++ b/source/blender/blenkernel/BKE_global.h @@ -64,8 +64,8 @@ typedef struct Global { short afbreek, moving, file_loaded; char background; char factory_startup; - short winpos, displaymode; /* used to be in Render */ - short rendering; /* to indicate render is busy, prevent renderwindow events etc */ + short winpos, displaymode; /* used to be in Render */ + short rendering; /* to indicate render is busy, prevent renderwindow events etc */ short rt; int f; @@ -75,7 +75,7 @@ typedef struct Global { struct BME_Glob *editBMesh; /* Frank's variables */ - int save_over; + int save_over; /* Rob's variables (keep here for WM recode) */ int have_quicktime; @@ -96,12 +96,12 @@ typedef struct Global { /* **************** GLOBAL ********************* */ /* G.f */ -#define G_RENDER_OGL (1 << 0) -#define G_SWAP_EXCHANGE (1 << 1) +#define G_RENDER_OGL (1 << 0) +#define G_SWAP_EXCHANGE (1 << 1) /* also uses G_FILE_AUTOPLAY */ /* #define G_RENDER_SHADOW (1 << 3) */ /* temp flag, removed */ -#define G_BACKBUFSEL (1 << 4) -#define G_PICKSEL (1 << 5) +#define G_BACKBUFSEL (1 << 4) +#define G_PICKSEL (1 << 5) /* #define G_FACESELECT (1 << 8) use (mesh->editflag & ME_EDIT_PAINT_MASK) */ @@ -109,7 +109,7 @@ typedef struct Global { #define G_SCRIPT_OVERRIDE_PREF (1 << 14) /* when this flag is set ignore the userprefs */ /* #define G_NOFROZEN (1 << 17) also removed */ -/* #define G_GREASEPENCIL (1 << 17) also removed */ +/* #define G_GREASEPENCIL (1 << 17) also removed */ /* #define G_AUTOMATKEYS (1 << 30) also removed */ @@ -130,39 +130,39 @@ enum { #define G_AUTOPACK (1 << 0) #define G_FILE_COMPRESS (1 << 1) #define G_FILE_AUTOPLAY (1 << 2) -#define G_FILE_ENABLE_ALL_FRAMES (1 << 3) /* deprecated */ -#define G_FILE_SHOW_DEBUG_PROPS (1 << 4) /* deprecated */ -#define G_FILE_SHOW_FRAMERATE (1 << 5) /* deprecated */ +#define G_FILE_ENABLE_ALL_FRAMES (1 << 3) /* deprecated */ +#define G_FILE_SHOW_DEBUG_PROPS (1 << 4) /* deprecated */ +#define G_FILE_SHOW_FRAMERATE (1 << 5) /* deprecated */ /* #define G_FILE_SHOW_PROFILE (1 << 6) */ /* deprecated */ #define G_FILE_LOCK (1 << 7) #define G_FILE_SIGN (1 << 8) /* #define G_FILE_PUBLISH (1 << 9) */ /* deprecated */ -#define G_FILE_NO_UI (1 << 10) +#define G_FILE_NO_UI (1 << 10) /* #define G_FILE_GAME_TO_IPO (1 << 11) */ /* deprecated */ -#define G_FILE_GAME_MAT (1 << 12) /* deprecated */ +#define G_FILE_GAME_MAT (1 << 12) /* deprecated */ /* #define G_FILE_DISPLAY_LISTS (1 << 13) */ /* deprecated */ -#define G_FILE_SHOW_PHYSICS (1 << 14) /* deprecated */ -#define G_FILE_GAME_MAT_GLSL (1 << 15) /* deprecated */ +#define G_FILE_SHOW_PHYSICS (1 << 14) /* deprecated */ +#define G_FILE_GAME_MAT_GLSL (1 << 15) /* deprecated */ /* #define G_FILE_GLSL_NO_LIGHTS (1 << 16) */ /* deprecated */ -#define G_FILE_GLSL_NO_SHADERS (1 << 17) /* deprecated */ -#define G_FILE_GLSL_NO_SHADOWS (1 << 18) /* deprecated */ -#define G_FILE_GLSL_NO_RAMPS (1 << 19) /* deprecated */ -#define G_FILE_GLSL_NO_NODES (1 << 20) /* deprecated */ -#define G_FILE_GLSL_NO_EXTRA_TEX (1 << 21) /* deprecated */ -#define G_FILE_IGNORE_DEPRECATION_WARNINGS (1 << 22) /* deprecated */ -#define G_FILE_RECOVER (1 << 23) -#define G_FILE_RELATIVE_REMAP (1 << 24) -#define G_FILE_HISTORY (1 << 25) -#define G_FILE_MESH_COMPAT (1 << 26) /* BMesh option to save as older mesh format */ +#define G_FILE_GLSL_NO_SHADERS (1 << 17) /* deprecated */ +#define G_FILE_GLSL_NO_SHADOWS (1 << 18) /* deprecated */ +#define G_FILE_GLSL_NO_RAMPS (1 << 19) /* deprecated */ +#define G_FILE_GLSL_NO_NODES (1 << 20) /* deprecated */ +#define G_FILE_GLSL_NO_EXTRA_TEX (1 << 21) /* deprecated */ +#define G_FILE_IGNORE_DEPRECATION_WARNINGS (1 << 22) /* deprecated */ +#define G_FILE_RECOVER (1 << 23) +#define G_FILE_RELATIVE_REMAP (1 << 24) +#define G_FILE_HISTORY (1 << 25) +#define G_FILE_MESH_COMPAT (1 << 26) /* BMesh option to save as older mesh format */ /* G.windowstate */ -#define G_WINDOWSTATE_USERDEF 0 -#define G_WINDOWSTATE_BORDER 1 -#define G_WINDOWSTATE_FULLSCREEN 2 +#define G_WINDOWSTATE_USERDEF 0 +#define G_WINDOWSTATE_BORDER 1 +#define G_WINDOWSTATE_FULLSCREEN 2 /* ENDIAN_ORDER: indicates what endianness the platform where the file was * written had. */ -#if !defined( __BIG_ENDIAN__ ) && !defined( __LITTLE_ENDIAN__ ) +#if !defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) # error Either __BIG_ENDIAN__ or __LITTLE_ENDIAN__ must be defined. #endif @@ -171,8 +171,8 @@ enum { # error "Mingw requires GCC 4.6 minimum" #endif -#define L_ENDIAN 1 -#define B_ENDIAN 0 +#define L_ENDIAN 1 +#define B_ENDIAN 0 #ifdef __BIG_ENDIAN__ # define ENDIAN_ORDER B_ENDIAN @@ -181,10 +181,10 @@ enum { #endif /* G.moving, signals drawing in (3d) window to denote transform */ -#define G_TRANSFORM_OBJ 1 -#define G_TRANSFORM_EDIT 2 -#define G_TRANSFORM_MANIP 4 -#define G_TRANSFORM_PARTICLE 8 +#define G_TRANSFORM_OBJ 1 +#define G_TRANSFORM_EDIT 2 +#define G_TRANSFORM_MANIP 4 +#define G_TRANSFORM_PARTICLE 8 /* G.special1 */ diff --git a/source/blender/blenkernel/BKE_group.h b/source/blender/blenkernel/BKE_group.h index ccf9e0cef5b..67cdee9fa07 100644 --- a/source/blender/blenkernel/BKE_group.h +++ b/source/blender/blenkernel/BKE_group.h @@ -40,21 +40,21 @@ struct Object; struct bAction; struct Scene; -void BKE_group_free(struct Group *group); -void BKE_group_unlink(struct Group *group); +void BKE_group_free(struct Group *group); +void BKE_group_unlink(struct Group *group); struct Group *add_group(const char *name); struct Group *BKE_group_copy(struct Group *group); -int add_to_group(struct Group *group, struct Object *ob, struct Scene *scene, struct Base *base); -int rem_from_group(struct Group *group, struct Object *ob, struct Scene *scene, struct Base *base); +int add_to_group(struct Group *group, struct Object *ob, struct Scene *scene, struct Base *base); +int rem_from_group(struct Group *group, struct Object *ob, struct Scene *scene, struct Base *base); struct Group *find_group(struct Object *ob, struct Group *group); -int object_in_group(struct Object *ob, struct Group *group); -int group_is_animated(struct Object *parent, struct Group *group); +int object_in_group(struct Object *ob, struct Group *group); +int group_is_animated(struct Object *parent, struct Group *group); -void group_tag_recalc(struct Group *group); -void group_handle_recalc_and_update(struct Scene *scene, struct Object *parent, struct Group *group); +void group_tag_recalc(struct Group *group); +void group_handle_recalc_and_update(struct Scene *scene, struct Object *parent, struct Group *group); #if 0 /* UNUSED */ struct Object *group_get_member_with_action(struct Group *group, struct bAction *act); -void group_relink_nla_objects(struct Object *ob); +void group_relink_nla_objects(struct Object *ob); #endif #endif diff --git a/source/blender/blenkernel/BKE_icons.h b/source/blender/blenkernel/BKE_icons.h index e1f8df941cb..ebfbe94802a 100644 --- a/source/blender/blenkernel/BKE_icons.h +++ b/source/blender/blenkernel/BKE_icons.h @@ -36,10 +36,9 @@ * Resizable Icons for Blender */ -typedef void (*DrawInfoFreeFP) (void *drawinfo); +typedef void (*DrawInfoFreeFP)(void *drawinfo); -struct Icon -{ +struct Icon { void *drawinfo; void *obj; short type; @@ -54,17 +53,17 @@ struct ID; void BKE_icons_init(int first_dyn_id); /* return icon id for library object or create new icon if not found */ -int BKE_icon_getid(struct ID* id); +int BKE_icon_getid(struct ID *id); /* retrieve icon for id */ -struct Icon* BKE_icon_get(int icon_id); +struct Icon *BKE_icon_get(int icon_id); /* set icon for id if not already defined */ /* used for inserting the internal icons */ -void BKE_icon_set(int icon_id, struct Icon* icon); +void BKE_icon_set(int icon_id, struct Icon *icon); /* remove icon and free date if library object becomes invalid */ -void BKE_icon_delete(struct ID* id); +void BKE_icon_delete(struct ID *id); /* report changes - icon needs to be recalculated */ void BKE_icon_changed(int icon_id); @@ -82,12 +81,12 @@ void BKE_previewimg_free(struct PreviewImage **prv); void BKE_previewimg_free_id(struct ID *id); /* create a new preview image */ -struct PreviewImage* BKE_previewimg_create(void); +struct PreviewImage *BKE_previewimg_create(void); /* create a copy of the preview image */ -struct PreviewImage* BKE_previewimg_copy(struct PreviewImage *prv); +struct PreviewImage *BKE_previewimg_copy(struct PreviewImage *prv); /* retrieve existing or create new preview image */ -struct PreviewImage* BKE_previewimg_get(struct ID *id); +struct PreviewImage *BKE_previewimg_get(struct ID *id); #endif /* __BKE_ICONS_H__ */ diff --git a/source/blender/blenkernel/BKE_idprop.h b/source/blender/blenkernel/BKE_idprop.h index 173adcc295b..2436ada9eaf 100644 --- a/source/blender/blenkernel/BKE_idprop.h +++ b/source/blender/blenkernel/BKE_idprop.h @@ -77,8 +77,8 @@ void IDP_ResizeArray(struct IDProperty *prop, int newlen); void IDP_FreeArray(struct IDProperty *prop); /* ---------- String Type ------------ */ -IDProperty *IDP_NewString(const char *st, const char *name, int maxlen);/* maxlen excludes '\0' */ -void IDP_AssignString(struct IDProperty *prop, const char *st, int maxlen); /* maxlen excludes '\0' */ +IDProperty *IDP_NewString(const char *st, const char *name, int maxlen); /* maxlen excludes '\0' */ +void IDP_AssignString(struct IDProperty *prop, const char *st, int maxlen); /* maxlen excludes '\0' */ void IDP_ConcatStringC(struct IDProperty *prop, const char *st); void IDP_ConcatString(struct IDProperty *str1, struct IDProperty *append); void IDP_FreeString(struct IDProperty *prop); @@ -122,7 +122,7 @@ int IDP_AddToGroup(struct IDProperty *group, struct IDProperty *prop); /** this is the same as IDP_AddToGroup, only you pass an item * in the group list to be inserted after. */ int IDP_InsertToGroup(struct IDProperty *group, struct IDProperty *previous, - struct IDProperty *pnew); + struct IDProperty *pnew); /** \note this does not free the property!! * @@ -201,10 +201,10 @@ void IDP_FreeProperty(struct IDProperty *prop); void IDP_UnlinkProperty(struct IDProperty *prop); #define IDP_Int(prop) ((prop)->data.val) -#define IDP_Float(prop) (*(float*)&(prop)->data.val) -#define IDP_String(prop) ((char*)(prop)->data.pointer) +#define IDP_Float(prop) (*(float *)&(prop)->data.val) +#define IDP_String(prop) ((char *)(prop)->data.pointer) #define IDP_Array(prop) ((prop)->data.pointer) -#define IDP_IDPArray(prop) ((IDProperty*)(prop)->data.pointer) -#define IDP_Double(prop) (*(double*)&(prop)->data.val) +#define IDP_IDPArray(prop) ((IDProperty *)(prop)->data.pointer) +#define IDP_Double(prop) (*(double *)&(prop)->data.val) #endif /* __BKE_IDPROP_H__ */ diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h index 563f066bda6..97b724c09e4 100644 --- a/source/blender/blenkernel/BKE_image.h +++ b/source/blender/blenkernel/BKE_image.h @@ -46,25 +46,25 @@ struct Object; struct ImageFormatData; /* call from library */ -void BKE_image_free(struct Image *me); +void BKE_image_free(struct Image *me); -void BKE_imbuf_stamp_info(struct Scene *scene, struct Object *camera, struct ImBuf *ibuf); -void BKE_stamp_buf(struct Scene *scene, struct Object *camera, unsigned char *rect, float *rectf, int width, int height, int channels); -int BKE_imbuf_alpha_test(struct ImBuf *ibuf); -int BKE_imbuf_write_stamp(struct Scene *scene, struct Object *camera, struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf); -int BKE_imbuf_write(struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf); +void BKE_imbuf_stamp_info(struct Scene *scene, struct Object *camera, struct ImBuf *ibuf); +void BKE_stamp_buf(struct Scene *scene, struct Object *camera, unsigned char *rect, float *rectf, int width, int height, int channels); +int BKE_imbuf_alpha_test(struct ImBuf *ibuf); +int BKE_imbuf_write_stamp(struct Scene *scene, struct Object *camera, struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf); +int BKE_imbuf_write(struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf); int BKE_imbuf_write_as(struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf, const short is_copy); -void BKE_makepicstring(char *string, const char *base, const char *relbase, int frame, const char imtype, const short use_ext, const short use_frames); -int BKE_add_image_extension(char *string, const char imtype); -char BKE_ftype_to_imtype(const int ftype); -int BKE_imtype_to_ftype(const char imtype); - -int BKE_imtype_is_movie(const char imtype); -int BKE_imtype_supports_zbuf(const char imtype); -int BKE_imtype_supports_compress(const char imtype); -int BKE_imtype_supports_quality(const char imtype); +void BKE_makepicstring(char *string, const char *base, const char *relbase, int frame, const char imtype, const short use_ext, const short use_frames); +int BKE_add_image_extension(char *string, const char imtype); +char BKE_ftype_to_imtype(const int ftype); +int BKE_imtype_to_ftype(const char imtype); + +int BKE_imtype_is_movie(const char imtype); +int BKE_imtype_supports_zbuf(const char imtype); +int BKE_imtype_supports_compress(const char imtype); +int BKE_imtype_supports_quality(const char imtype); char BKE_imtype_valid_channels(const char imtype); -char BKE_imtype_valid_depths(const char imtype); +char BKE_imtype_valid_depths(const char imtype); char BKE_imtype_from_arg(const char *arg); @@ -72,12 +72,12 @@ void BKE_imformat_defaults(struct ImageFormatData *im_format); struct anim *openanim(const char *name, int flags, int streamindex); -void BKE_image_de_interlace(struct Image *ima, int odd); +void BKE_image_de_interlace(struct Image *ima, int odd); -void BKE_image_make_local(struct Image *ima); +void BKE_image_make_local(struct Image *ima); -void BKE_image_tag_time(struct Image *ima); -void free_old_images(void); +void BKE_image_tag_time(struct Image *ima); +void free_old_images(void); /* ********************************** NEW IMAGE API *********************** */ @@ -88,34 +88,34 @@ struct RenderPass; struct RenderResult; /* ima->source; where image comes from */ -#define IMA_SRC_CHECK 0 -#define IMA_SRC_FILE 1 -#define IMA_SRC_SEQUENCE 2 -#define IMA_SRC_MOVIE 3 -#define IMA_SRC_GENERATED 4 -#define IMA_SRC_VIEWER 5 +#define IMA_SRC_CHECK 0 +#define IMA_SRC_FILE 1 +#define IMA_SRC_SEQUENCE 2 +#define IMA_SRC_MOVIE 3 +#define IMA_SRC_GENERATED 4 +#define IMA_SRC_VIEWER 5 /* ima->type, how to handle/generate it */ -#define IMA_TYPE_IMAGE 0 -#define IMA_TYPE_MULTILAYER 1 - /* generated */ -#define IMA_TYPE_UV_TEST 2 - /* viewers */ +#define IMA_TYPE_IMAGE 0 +#define IMA_TYPE_MULTILAYER 1 +/* generated */ +#define IMA_TYPE_UV_TEST 2 +/* viewers */ #define IMA_TYPE_R_RESULT 4 -#define IMA_TYPE_COMPOSITE 5 +#define IMA_TYPE_COMPOSITE 5 /* ima->ok */ -#define IMA_OK 1 -#define IMA_OK_LOADED 2 +#define IMA_OK 1 +#define IMA_OK_LOADED 2 /* signals */ - /* reload only frees, doesn't read until image_get_ibuf() called */ -#define IMA_SIGNAL_RELOAD 0 -#define IMA_SIGNAL_FREE 1 - /* source changes, from image to sequence or movie, etc */ -#define IMA_SIGNAL_SRC_CHANGE 5 - /* image-user gets a new image, check settings */ -#define IMA_SIGNAL_USER_NEW_IMAGE 6 +/* reload only frees, doesn't read until image_get_ibuf() called */ +#define IMA_SIGNAL_RELOAD 0 +#define IMA_SIGNAL_FREE 1 +/* source changes, from image to sequence or movie, etc */ +#define IMA_SIGNAL_SRC_CHANGE 5 +/* image-user gets a new image, check settings */ +#define IMA_SIGNAL_USER_NEW_IMAGE 6 #define IMA_CHAN_FLAG_BW 1 #define IMA_CHAN_FLAG_RGB 2 @@ -164,10 +164,10 @@ void BKE_image_release_renderresult(struct Scene *scene, struct Image *ima); void BKE_image_backup_render(struct Scene *scene, struct Image *ima); /* goes over all textures that use images */ -void BKE_image_free_all_textures(void); +void BKE_image_free_all_textures(void); /* does one image! */ -void BKE_image_free_anim_ibufs(struct Image *ima, int except_frame); +void BKE_image_free_anim_ibufs(struct Image *ima, int except_frame); /* does all images with type MOVIE or SEQUENCE */ void BKE_image_all_free_anim_ibufs(int except_frame); diff --git a/source/blender/blenkernel/BKE_key.h b/source/blender/blenkernel/BKE_key.h index 757952515e5..4240ef16100 100644 --- a/source/blender/blenkernel/BKE_key.h +++ b/source/blender/blenkernel/BKE_key.h @@ -63,7 +63,7 @@ float *do_ob_key(struct Scene *scene, struct Object *ob); struct Key *ob_get_key(struct Object *ob); struct KeyBlock *add_keyblock(struct Key *key, const char *name); -struct KeyBlock *add_keyblock_ctime(struct Key *key, const char * name, const short do_force); +struct KeyBlock *add_keyblock_ctime(struct Key *key, const char *name, const short do_force); struct KeyBlock *ob_get_keyblock(struct Object *ob); struct KeyBlock *ob_get_reference_keyblock(struct Object *ob); struct KeyBlock *key_get_keyblock(struct Key *key, int index); diff --git a/source/blender/blenkernel/BKE_lattice.h b/source/blender/blenkernel/BKE_lattice.h index 9a952fc6b1e..31626ef4a58 100644 --- a/source/blender/blenkernel/BKE_lattice.h +++ b/source/blender/blenkernel/BKE_lattice.h @@ -73,7 +73,7 @@ float (*BKE_lattice_vertexcos_get(struct Object *ob, int *numVerts_r))[3]; void BKE_lattice_vertexcos_apply(struct Object *ob, float (*vertexCos)[3]); void BKE_lattice_modifiers_calc(struct Scene *scene, struct Object *ob); -struct MDeformVert* BKE_lattice_deform_verts_get(struct Object *lattice); +struct MDeformVert *BKE_lattice_deform_verts_get(struct Object *lattice); #endif diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h index 2804eb407db..3a19d6c9007 100644 --- a/source/blender/blenkernel/BKE_library.h +++ b/source/blender/blenkernel/BKE_library.h @@ -66,7 +66,7 @@ void id_clear_lib_data(struct Main *bmain, struct ID *id); struct ListBase *which_libbase(struct Main *mainlib, short type); -#define MAX_LIBARRAY 40 +#define MAX_LIBARRAY 40 int set_listbasepointers(struct Main *main, struct ListBase **lb); void BKE_libblock_free(struct ListBase *lb, void *idv); @@ -86,7 +86,7 @@ struct ID *BKE_libblock_find_name(const short type, const char *name); void clear_id_newpoins(void); void IDnames_to_pupstring(const char **str, const char *title, const char *extraops, - struct ListBase *lb, struct ID* link, short *nr); + struct ListBase *lb, struct ID *link, short *nr); void IMAnames_to_pupstring(const char **str, const char *title, const char *extraops, struct ListBase *lb, struct ID *link, short *nr); diff --git a/source/blender/blenkernel/BKE_main.h b/source/blender/blenkernel/BKE_main.h index ffcbb6e40bc..09c91a59ac5 100644 --- a/source/blender/blenkernel/BKE_main.h +++ b/source/blender/blenkernel/BKE_main.h @@ -53,7 +53,7 @@ typedef struct Main { char name[1024]; /* 1024 = FILE_MAX */ short versionfile, subversionfile; short minversionfile, minsubversionfile; - int revision; /* svn revision of binary that saved file */ + int revision; /* svn revision of binary that saved file */ struct Library *curlib; ListBase scene; @@ -68,7 +68,7 @@ typedef struct Main { ListBase latt; ListBase lamp; ListBase camera; - ListBase ipo; // XXX depreceated + ListBase ipo; // XXX depreceated ListBase key; ListBase world; ListBase screen; diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h index 801724d1d4f..8aa25a235a8 100644 --- a/source/blender/blenkernel/BKE_material.h +++ b/source/blender/blenkernel/BKE_material.h @@ -90,7 +90,7 @@ void end_render_materials(struct Main *); int material_in_material(struct Material *parmat, struct Material *mat); -void ramp_blend(int type, float r_col[3], const float fac, const float col[3]); +void ramp_blend(int type, float r_col[3], const float fac, const float col[3]); /* copy/paste */ void clear_matcopybuf(void); @@ -106,4 +106,3 @@ int do_version_tface(struct Main *main, int fileload); #endif #endif - diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index bdadce2c7c7..62ba85ae937 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -164,14 +164,14 @@ void BKE_mesh_strip_loose_faces(struct Mesh *me); /* Needed for compatibility (s void BKE_mesh_strip_loose_polysloops(struct Mesh *me); void BKE_mesh_strip_loose_edges(struct Mesh *me); - /* Calculate vertex and face normals, face normals are returned in *faceNors_r if non-NULL - * and vertex normals are stored in actual mverts. - */ +/* Calculate vertex and face normals, face normals are returned in *faceNors_r if non-NULL + * and vertex normals are stored in actual mverts. + */ void BKE_mesh_calc_normals_mapping( struct MVert *mverts, int numVerts, struct MLoop *mloop, struct MPoly *mpolys, int numLoops, int numPolys, float (*polyNors_r)[3], struct MFace *mfaces, int numFaces, int *origIndexFace, float (*faceNors_r)[3]); - /* extended version of 'BKE_mesh_calc_normals' with option not to calc vertex normals */ +/* extended version of 'BKE_mesh_calc_normals' with option not to calc vertex normals */ void BKE_mesh_calc_normals_mapping_ex( struct MVert *mverts, int numVerts, struct MLoop *mloop, struct MPoly *mpolys, int numLoops, int numPolys, float (*polyNors_r)[3], @@ -183,15 +183,15 @@ void BKE_mesh_calc_normals( struct MLoop *mloop, struct MPoly *mpolys, int numLoops, int numPolys, float (*polyNors_r)[3]); - /* Return a newly MEM_malloc'd array of all the mesh vertex locations - * (_numVerts_r_ may be NULL) */ +/* Return a newly MEM_malloc'd array of all the mesh vertex locations + * (_numVerts_r_ may be NULL) */ float (*mesh_getVertexCos(struct Mesh *me, int *numVerts_r))[3]; /* map from uv vertex to face (for select linked, stitch, uv suburf) */ /* UvVertMap */ -#define STD_UV_CONNECT_LIMIT 0.0001f +#define STD_UV_CONNECT_LIMIT 0.0001f typedef struct UvVertMap { struct UvMapVert **vert; @@ -271,9 +271,9 @@ void create_vert_edge_map(struct ListBase **map, IndexNode **mem, const struct M /* vertex level transformations & checks (no derived mesh) */ -int BKE_mesh_minmax(struct Mesh *me, float r_min[3], float r_max[3]); -int BKE_mesh_center_median(struct Mesh *me, float cent[3]); -int BKE_mesh_center_bounds(struct Mesh *me, float cent[3]); +int BKE_mesh_minmax(struct Mesh *me, float r_min[3], float r_max[3]); +int BKE_mesh_center_median(struct Mesh *me, float cent[3]); +int BKE_mesh_center_bounds(struct Mesh *me, float cent[3]); void BKE_mesh_translate(struct Mesh *me, float offset[3], int do_keys); /* mesh_validate.c */ diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h index db57d411f31..551a31509a3 100644 --- a/source/blender/blenkernel/BKE_modifier.h +++ b/source/blender/blenkernel/BKE_modifier.h @@ -31,7 +31,7 @@ * \ingroup bke */ -#include "DNA_modifier_types.h" /* needed for all enum typdefs */ +#include "DNA_modifier_types.h" /* needed for all enum typdefs */ #include "BKE_customdata.h" struct ID; @@ -73,10 +73,10 @@ typedef enum { } ModifierTypeType; typedef enum { - eModifierTypeFlag_AcceptsMesh = (1<<0), - eModifierTypeFlag_AcceptsCVs = (1<<1), - eModifierTypeFlag_SupportsMapping = (1<<2), - eModifierTypeFlag_SupportsEditmode = (1<<3), + eModifierTypeFlag_AcceptsMesh = (1 << 0), + eModifierTypeFlag_AcceptsCVs = (1 << 1), + eModifierTypeFlag_SupportsMapping = (1 << 2), + eModifierTypeFlag_SupportsEditmode = (1 << 3), /* For modifiers that support editmode this determines if the * modifier should be enabled by default in editmode. This should @@ -84,25 +84,25 @@ typedef enum { * also generally used in editmode, otherwise let the user enable * it by hand. */ - eModifierTypeFlag_EnableInEditmode = (1<<4), + eModifierTypeFlag_EnableInEditmode = (1 << 4), /* For modifiers that require original data and so cannot * be placed after any non-deformative modifier. */ - eModifierTypeFlag_RequiresOriginalData = (1<<5), + eModifierTypeFlag_RequiresOriginalData = (1 << 5), /* For modifiers that support pointcache, so we can check to see if it has files we need to deal with */ - eModifierTypeFlag_UsesPointCache = (1<<6), + eModifierTypeFlag_UsesPointCache = (1 << 6), /* For physics modifiers, max one per type */ - eModifierTypeFlag_Single = (1<<7), + eModifierTypeFlag_Single = (1 << 7), /* Some modifier can't be added manually by user */ - eModifierTypeFlag_NoUserAdd = (1<<8), + eModifierTypeFlag_NoUserAdd = (1 << 8), /* For modifiers that use CD_PREVIEW_MCOL for preview. */ - eModifierTypeFlag_UsesPreview = (1<<9) + eModifierTypeFlag_UsesPreview = (1 << 9) } ModifierTypeFlag; typedef void (*ObjectWalkFunc)(void *userData, struct Object *ob, struct Object **obpoin); @@ -146,28 +146,25 @@ typedef struct ModifierTypeInfo { * and otherwise the ob argument. */ void (*deformVerts)(struct ModifierData *md, struct Object *ob, - struct DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, - ModifierApplyFlag flag); + struct DerivedMesh *derivedData, + float (*vertexCos)[3], int numVerts, + ModifierApplyFlag flag); /* Like deformMatricesEM but called from object mode (for supporting modifiers in sculpt mode) */ - void (*deformMatrices)( - struct ModifierData *md, struct Object *ob, - struct DerivedMesh *derivedData, - float (*vertexCos)[3], float (*defMats)[3][3], int numVerts); + void (*deformMatrices)(struct ModifierData *md, struct Object *ob, + struct DerivedMesh *derivedData, + float (*vertexCos)[3], float (*defMats)[3][3], int numVerts); /* Like deformVerts but called during editmode (for supporting modifiers) */ - void (*deformVertsEM)( - struct ModifierData *md, struct Object *ob, - struct BMEditMesh *editData, struct DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts); + void (*deformVertsEM)(struct ModifierData *md, struct Object *ob, + struct BMEditMesh *editData, struct DerivedMesh *derivedData, + float (*vertexCos)[3], int numVerts); /* Set deform matrix per vertex for crazyspace correction */ - void (*deformMatricesEM)( - struct ModifierData *md, struct Object *ob, - struct BMEditMesh *editData, struct DerivedMesh *derivedData, - float (*vertexCos)[3], float (*defMats)[3][3], int numVerts); + void (*deformMatricesEM)(struct ModifierData *md, struct Object *ob, + struct BMEditMesh *editData, struct DerivedMesh *derivedData, + float (*vertexCos)[3], float (*defMats)[3][3], int numVerts); /********************* Non-deform modifier functions *********************/ @@ -190,10 +187,9 @@ typedef struct ModifierTypeInfo { * The modifier may reuse the derivedData argument (i.e. return it in * modified form), but must not release it. */ - struct DerivedMesh *(*applyModifier)( - struct ModifierData *md, struct Object *ob, - struct DerivedMesh *derivedData, - ModifierApplyFlag flag); + struct DerivedMesh *(*applyModifier)(struct ModifierData *md, struct Object *ob, + struct DerivedMesh *derivedData, + ModifierApplyFlag flag); /* Like applyModifier but called during editmode (for supporting * modifiers). @@ -202,10 +198,9 @@ typedef struct ModifierTypeInfo { * are expected from editmode objects. The same qualifications regarding * derivedData apply as for applyModifier. */ - struct DerivedMesh *(*applyModifierEM)( - struct ModifierData *md, struct Object *ob, - struct BMEditMesh *editData, - struct DerivedMesh *derivedData); + struct DerivedMesh *(*applyModifierEM)(struct ModifierData *md, struct Object *ob, + struct BMEditMesh *editData, + struct DerivedMesh *derivedData); /********************* Optional functions *********************/ @@ -258,7 +253,7 @@ typedef struct ModifierTypeInfo { * This function is optional. */ void (*updateDepgraph)(struct ModifierData *md, struct DagForest *forest, struct Scene *scene, - struct Object *ob, struct DagNode *obNode); + struct Object *ob, struct DagNode *obNode); /* Should return true if the modifier needs to be recalculated on time * changes. @@ -285,7 +280,7 @@ typedef struct ModifierTypeInfo { * This function is optional. */ void (*foreachObjectLink)(struct ModifierData *md, struct Object *ob, - ObjectWalkFunc walk, void *userData); + ObjectWalkFunc walk, void *userData); /* Should call the given walk function with a pointer to each ID * pointer (i.e. each datablock pointer) that the modifier data @@ -296,7 +291,7 @@ typedef struct ModifierTypeInfo { * will be used. */ void (*foreachIDLink)(struct ModifierData *md, struct Object *ob, - IDWalkFunc walk, void *userData); + IDWalkFunc walk, void *userData); /* Should call the given walk function for each texture that the * modifier data stores. This is used for finding all textures in @@ -306,10 +301,10 @@ typedef struct ModifierTypeInfo { * assumed the modifier has no textures. */ void (*foreachTexLink)(struct ModifierData *md, struct Object *ob, - TexWalkFunc walk, void *userData); + TexWalkFunc walk, void *userData); } ModifierTypeInfo; -ModifierTypeInfo *modifierType_getInfo (ModifierType type); +ModifierTypeInfo *modifierType_getInfo(ModifierType type); /* Modifier utility calls, do call through type pointer and return * default values if pointer is optional. @@ -317,38 +312,38 @@ ModifierTypeInfo *modifierType_getInfo (ModifierType type); struct ModifierData *modifier_new(int type); void modifier_free(struct ModifierData *md); -void modifier_unique_name(struct ListBase *modifiers, struct ModifierData *md); +void modifier_unique_name(struct ListBase *modifiers, struct ModifierData *md); void modifier_copyData(struct ModifierData *md, struct ModifierData *target); int modifier_dependsOnTime(struct ModifierData *md); int modifier_supportsMapping(struct ModifierData *md); int modifier_couldBeCage(struct Scene *scene, struct ModifierData *md); int modifier_isCorrectableDeformed(struct ModifierData *md); -int modifier_sameTopology(ModifierData *md); +int modifier_sameTopology(ModifierData *md); int modifier_nonGeometrical(ModifierData *md); int modifier_isEnabled(struct Scene *scene, struct ModifierData *md, int required_mode); void modifier_setError(struct ModifierData *md, const char *format, ...) #ifdef __GNUC__ -__attribute__ ((format (printf, 2, 3))) +__attribute__ ((format(printf, 2, 3))) #endif ; int modifier_isPreview(struct ModifierData *md); void modifiers_foreachObjectLink(struct Object *ob, - ObjectWalkFunc walk, - void *userData); + ObjectWalkFunc walk, + void *userData); void modifiers_foreachIDLink(struct Object *ob, - IDWalkFunc walk, - void *userData); + IDWalkFunc walk, + void *userData); void modifiers_foreachTexLink(struct Object *ob, - TexWalkFunc walk, - void *userData); + TexWalkFunc walk, + void *userData); struct ModifierData *modifiers_findByType(struct Object *ob, ModifierType type); struct ModifierData *modifiers_findByName(struct Object *ob, const char *name); void modifiers_clearErrors(struct Object *ob); int modifiers_getCageIndex(struct Scene *scene, struct Object *ob, - int *lastPossibleCageIndex_r, int virtual_); + int *lastPossibleCageIndex_r, int virtual_); int modifiers_isSoftbodyEnabled(struct Object *ob); int modifiers_isClothEnabled(struct Object *ob); @@ -374,10 +369,10 @@ typedef struct CDMaskLink { * end of the stack. */ struct CDMaskLink *modifiers_calcDataMasks(struct Scene *scene, - struct Object *ob, - struct ModifierData *md, - CustomDataMask dataMask, - int required_mode); + struct Object *ob, + struct ModifierData *md, + CustomDataMask dataMask, + int required_mode); struct ModifierData *modifiers_getLastPreview(struct Scene *scene, struct ModifierData *md, int required_mode); diff --git a/source/blender/blenkernel/BKE_movieclip.h b/source/blender/blenkernel/BKE_movieclip.h index 29924542494..15b3cb91b90 100644 --- a/source/blender/blenkernel/BKE_movieclip.h +++ b/source/blender/blenkernel/BKE_movieclip.h @@ -15,7 +15,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * The Original Code is Copyright (C) 2011 Blender Foundation. + * The Original Code is Copyright (C) 2011 Blender Foundation. * All rights reserved. * * Contributor(s): Blender Foundation, @@ -64,12 +64,12 @@ void BKE_movieclip_build_proxy_frame(struct MovieClip *clip, int clip_flag, stru int cfra, int *build_sizes, int build_count, int undistorted); /* cacheing flags */ -#define MOVIECLIP_CACHE_SKIP (1<<0) +#define MOVIECLIP_CACHE_SKIP (1 << 0) /* postprocessing flags */ -#define MOVIECLIP_DISABLE_RED (1<<0) -#define MOVIECLIP_DISABLE_GREEN (1<<1) -#define MOVIECLIP_DISABLE_BLUE (1<<2) -#define MOVIECLIP_PREVIEW_GRAYSCALE (1<<3) +#define MOVIECLIP_DISABLE_RED (1 << 0) +#define MOVIECLIP_DISABLE_GREEN (1 << 1) +#define MOVIECLIP_DISABLE_BLUE (1 << 2) +#define MOVIECLIP_PREVIEW_GRAYSCALE (1 << 3) #endif diff --git a/source/blender/blenkernel/BKE_navmesh_conversion.h b/source/blender/blenkernel/BKE_navmesh_conversion.h index 8de53ed8b8e..aab359b307a 100644 --- a/source/blender/blenkernel/BKE_navmesh_conversion.h +++ b/source/blender/blenkernel/BKE_navmesh_conversion.h @@ -32,32 +32,32 @@ struct DerivedMesh; /* navmesh_conversion.c */ int buildNavMeshDataByDerivedMesh(struct DerivedMesh *dm, int *vertsPerPoly, - int *nverts, float **verts, - int *ndtris, unsigned short **dtris, - int *npolys, unsigned short **dmeshes, - unsigned short **polys, int **dtrisToPolysMap, - int **dtrisToTrisMap, int **trisToFacesMap); - -int buildRawVertIndicesData(struct DerivedMesh* dm, int *nverts, float **verts, - int *ntris, unsigned short **tris, int **trisToFacesMap, - int **recastData); - -int buildNavMeshData(const int nverts, const float* verts, - const int ntris, const unsigned short *tris, - const int* recastData, const int* trisToFacesMap, - int *ndtris, unsigned short **dtris, - int *npolys, unsigned short **dmeshes, unsigned short **polys, - int *vertsPerPoly, int **dtrisToPolysMap, int **dtrisToTrisMap); + int *nverts, float **verts, + int *ndtris, unsigned short **dtris, + int *npolys, unsigned short **dmeshes, + unsigned short **polys, int **dtrisToPolysMap, + int **dtrisToTrisMap, int **trisToFacesMap); + +int buildRawVertIndicesData(struct DerivedMesh *dm, int *nverts, float **verts, + int *ntris, unsigned short **tris, int **trisToFacesMap, + int **recastData); + +int buildNavMeshData(const int nverts, const float *verts, + const int ntris, const unsigned short *tris, + const int *recastData, const int *trisToFacesMap, + int *ndtris, unsigned short **dtris, + int *npolys, unsigned short **dmeshes, unsigned short **polys, + int *vertsPerPoly, int **dtrisToPolysMap, int **dtrisToTrisMap); int buildPolygonsByDetailedMeshes(const int vertsPerPoly, const int npolys, - unsigned short* polys, const unsigned short* dmeshes, - const float* verts, const unsigned short* dtris, - const int* dtrisToPolysMap); - -int polyNumVerts(const unsigned short* p, const int vertsPerPoly); -int polyIsConvex(const unsigned short* p, const int vertsPerPoly, const float* verts); -int polyFindVertex(const unsigned short* p, const int vertsPerPoly, unsigned short vertexIdx); -float distPointToSegmentSq(const float* point, const float* a, const float* b); + unsigned short *polys, const unsigned short *dmeshes, + const float *verts, const unsigned short *dtris, + const int *dtrisToPolysMap); + +int polyNumVerts(const unsigned short *p, const int vertsPerPoly); +int polyIsConvex(const unsigned short *p, const int vertsPerPoly, const float *verts); +int polyFindVertex(const unsigned short *p, const int vertsPerPoly, unsigned short vertexIdx); +float distPointToSegmentSq(const float *point, const float *a, const float *b); #endif //NAVMESH_CONVERSION_H diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h index 921972c9fa8..9e08f3a8c83 100644 --- a/source/blender/blenkernel/BKE_nla.h +++ b/source/blender/blenkernel/BKE_nla.h @@ -115,13 +115,13 @@ void BKE_nla_tweakmode_exit(struct AnimData *adt); /* time mapping conversion modes */ enum { - /* convert from global time to strip time - for evaluation */ + /* convert from global time to strip time - for evaluation */ NLATIME_CONVERT_EVAL = 0, - /* convert from global time to strip time - for editing corrections */ - // XXX old 0 invert + /* convert from global time to strip time - for editing corrections */ + // XXX old 0 invert NLATIME_CONVERT_UNMAP, - /* convert from strip time to global time */ - // xxx old 1 invert + /* convert from strip time to global time */ + // xxx old 1 invert NLATIME_CONVERT_MAP, } eNlaTime_ConvertModes; diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h index 92a447f9351..b0ee81f577a 100644 --- a/source/blender/blenkernel/BKE_object.h +++ b/source/blender/blenkernel/BKE_object.h @@ -101,25 +101,23 @@ void BKE_object_where_is_calc_mat4(struct Scene *scene, struct Object *ob, float /* possibly belong in own moduke? */ struct BoundBox *BKE_boundbox_alloc_unit(void); -void BKE_boundbox_init_from_minmax(struct BoundBox *bb, float min[3], float max[3]); -int BKE_boundbox_ray_hit_check(struct BoundBox *bb, float ray_start[3], float ray_normal[3]); +void BKE_boundbox_init_from_minmax(struct BoundBox *bb, float min[3], float max[3]); +int BKE_boundbox_ray_hit_check(struct BoundBox *bb, float ray_start[3], float ray_normal[3]); struct BoundBox *BKE_object_boundbox_get(struct Object *ob); void BKE_object_dimensions_get(struct Object *ob, float vec[3]); void BKE_object_dimensions_set(struct Object *ob, const float *value); void BKE_object_boundbox_flag(struct Object *ob, int flag, int set); void BKE_object_minmax(struct Object *ob, float r_min[3], float r_max[3]); -int BKE_object_minmax_dupli(struct Scene *scene, struct Object *ob, float r_min[3], float r_max[3]); +int BKE_object_minmax_dupli(struct Scene *scene, struct Object *ob, float r_min[3], float r_max[3]); /* sometimes min-max isn't enough, we need to loop over each point */ -void BKE_object_foreach_display_point( - struct Object *ob, float obmat[4][4], - void (*func_cb)(const float[3], void *), void *user_data); -void BKE_scene_foreach_display_point( - struct Scene *scene, - struct View3D *v3d, - const short flag, - void (*func_cb)(const float[3], void *), void *user_data); +void BKE_object_foreach_display_point(struct Object *ob, float obmat[4][4], + void (*func_cb)(const float[3], void *), void *user_data); +void BKE_scene_foreach_display_point(struct Scene *scene, + struct View3D *v3d, + const short flag, + void (*func_cb)(const float[3], void *), void *user_data); int BKE_object_parent_loop_check(const struct Object *parent, const struct Object *ob); @@ -136,11 +134,11 @@ typedef struct ObjectTfmProtectedChannels { } ObjectTfmProtectedChannels; void BKE_object_tfm_protected_backup(const struct Object *ob, - ObjectTfmProtectedChannels *obtfm); + ObjectTfmProtectedChannels *obtfm); void BKE_object_tfm_protected_restore(struct Object *ob, - const ObjectTfmProtectedChannels *obtfm, - const short protectflag); + const ObjectTfmProtectedChannels *obtfm, + const short protectflag); void BKE_object_handle_update(struct Scene *scene, struct Object *ob); void BKE_object_sculpt_modifiers_changed(struct Object *ob); diff --git a/source/blender/blenkernel/BKE_ocean.h b/source/blender/blenkernel/BKE_ocean.h index 1c659b61d7d..de12afb02bd 100644 --- a/source/blender/blenkernel/BKE_ocean.h +++ b/source/blender/blenkernel/BKE_ocean.h @@ -69,25 +69,25 @@ typedef struct OceanCache { } OceanCache; -#define OCEAN_NOT_CACHED 0 -#define OCEAN_CACHING 1 -#define OCEAN_CACHED 2 +#define OCEAN_NOT_CACHED 0 +#define OCEAN_CACHING 1 +#define OCEAN_CACHED 2 struct Ocean *BKE_add_ocean(void); void BKE_free_ocean_data(struct Ocean *oc); void BKE_free_ocean(struct Ocean *oc); -void BKE_init_ocean(struct Ocean* o, int M, int N, float Lx, float Lz, float V, float l, float A, float w, float damp, +void BKE_init_ocean(struct Ocean *o, int M, int N, float Lx, float Lz, float V, float l, float A, float w, float damp, float alignment, float depth, float time, short do_height_field, short do_chop, short do_normals, short do_jacobian, int seed); void BKE_simulate_ocean(struct Ocean *o, float t, float scale, float chop_amount); /* sampling the ocean surface */ float BKE_ocean_jminus_to_foam(float jminus, float coverage); -void BKE_ocean_eval_uv(struct Ocean * oc, struct OceanResult *ocr, float u, float v); -void BKE_ocean_eval_uv_catrom(struct Ocean * oc, struct OceanResult *ocr, float u, float v); -void BKE_ocean_eval_xz(struct Ocean * oc, struct OceanResult *ocr, float x, float z); -void BKE_ocean_eval_xz_catrom(struct Ocean * oc, struct OceanResult *ocr, float x, float z); -void BKE_ocean_eval_ij(struct Ocean * oc, struct OceanResult *ocr, int i, int j); +void BKE_ocean_eval_uv(struct Ocean *oc, struct OceanResult *ocr, float u, float v); +void BKE_ocean_eval_uv_catrom(struct Ocean *oc, struct OceanResult *ocr, float u, float v); +void BKE_ocean_eval_xz(struct Ocean *oc, struct OceanResult *ocr, float x, float z); +void BKE_ocean_eval_xz_catrom(struct Ocean *oc, struct OceanResult *ocr, float x, float z); +void BKE_ocean_eval_ij(struct Ocean *oc, struct OceanResult *ocr, int i, int j); /* ocean cache handling */ diff --git a/source/blender/blenkernel/BKE_packedFile.h b/source/blender/blenkernel/BKE_packedFile.h index 1eff20cbd57..1891840f497 100644 --- a/source/blender/blenkernel/BKE_packedFile.h +++ b/source/blender/blenkernel/BKE_packedFile.h @@ -32,8 +32,8 @@ * \since March 2001 * \author nzc */ -#define RET_OK 0 -#define RET_ERROR 1 +#define RET_OK 0 +#define RET_ERROR 1 struct bSound; struct Image; diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h index f776295b912..b3e650b2aa5 100644 --- a/source/blender/blenkernel/BKE_particle.h +++ b/source/blender/blenkernel/BKE_particle.h @@ -59,18 +59,18 @@ struct SurfaceModifierData; struct BVHTreeRay; struct BVHTreeRayHit; -#define PARTICLE_P ParticleData *pa; int p -#define LOOP_PARTICLES for(p=0, pa=psys->particles; p<psys->totpart; p++, pa++) -#define LOOP_EXISTING_PARTICLES for(p=0, pa=psys->particles; p<psys->totpart; p++, pa++) if(!(pa->flag & PARS_UNEXIST)) -#define LOOP_SHOWN_PARTICLES for(p=0, pa=psys->particles; p<psys->totpart; p++, pa++) if(!(pa->flag & (PARS_UNEXIST|PARS_NO_DISP))) +#define PARTICLE_P ParticleData * pa; int p +#define LOOP_PARTICLES for (p = 0, pa = psys->particles; p < psys->totpart; p++, pa++) +#define LOOP_EXISTING_PARTICLES for (p = 0, pa = psys->particles; p < psys->totpart; p++, pa++) if (!(pa->flag & PARS_UNEXIST)) +#define LOOP_SHOWN_PARTICLES for (p = 0, pa = psys->particles; p < psys->totpart; p++, pa++) if (!(pa->flag & (PARS_UNEXIST | PARS_NO_DISP))) /* OpenMP: Can only advance one variable within loop definition. */ -#define LOOP_DYNAMIC_PARTICLES for(p=0; p<psys->totpart; p++ ) if((pa=psys->particles+p)->state.time > 0.0f) +#define LOOP_DYNAMIC_PARTICLES for (p = 0; p < psys->totpart; p++) if ((pa = psys->particles + p)->state.time > 0.0f) -#define PSYS_FRAND_COUNT 1024 -#define PSYS_FRAND(seed) psys->frand[(seed) % PSYS_FRAND_COUNT] +#define PSYS_FRAND_COUNT 1024 +#define PSYS_FRAND(seed) psys->frand[(seed) % PSYS_FRAND_COUNT] /* fast but sure way to get the modifier*/ -#define PARTICLE_PSMD ParticleSystemModifierData *psmd = sim->psmd ? sim->psmd : psys_get_modifier(sim->ob, sim->psys) +#define PARTICLE_PSMD ParticleSystemModifierData * psmd = sim->psmd ? sim->psmd : psys_get_modifier(sim->ob, sim->psys) /* common stuff that many particle functions need */ typedef struct ParticleSimulationData { @@ -86,11 +86,11 @@ typedef struct ParticleSimulationData { } ParticleSimulationData; typedef struct ParticleTexture { - float ivel; /* used in reset */ - float time, life, exist, size; /* used in init */ - float damp, gravity, field; /* used in physics */ - float length, clump, kink, effector;/* used in path caching */ - float rough1, rough2, roughe; /* used in path caching */ + float ivel; /* used in reset */ + float time, life, exist, size; /* used in init */ + float damp, gravity, field; /* used in physics */ + float length, clump, kink, effector; /* used in path caching */ + float rough1, rough2, roughe; /* used in path caching */ } ParticleTexture; typedef struct ParticleSeam { @@ -145,8 +145,7 @@ typedef struct ParticleThread { int num, tot; } ParticleThread; -typedef struct ParticleBillboardData -{ +typedef struct ParticleBillboardData { struct Object *ob; float vec[3], vel[3]; float offset[2]; @@ -159,8 +158,7 @@ typedef struct ParticleBillboardData short align, uv_split, anim, split_offset; } ParticleBillboardData; -typedef struct ParticleCollisionElement -{ +typedef struct ParticleCollisionElement { /* pointers to original data */ float *x[4], *v[4]; @@ -181,8 +179,7 @@ typedef struct ParticleCollisionElement } ParticleCollisionElement; /* container for moving data between deflet_particle and particle_intersect_face */ -typedef struct ParticleCollision -{ +typedef struct ParticleCollision { struct Object *current; struct Object *hit; struct Object *prev; @@ -191,7 +188,7 @@ typedef struct ParticleCollision struct CollisionModifierData *md; // collision modifier for current object; - float f; // time factor of previous collision, needed for substracting face velocity + float f; // time factor of previous collision, needed for substracting face velocity float fac1, fac2; float cfra, old_cfra; @@ -214,10 +211,10 @@ typedef struct ParticleCollision } ParticleCollision; typedef struct ParticleDrawData { - float *vdata, *vd; /* vertice data */ - float *ndata, *nd; /* normal data */ - float *cdata, *cd; /* color data */ - float *vedata, *ved; /* velocity data */ + float *vdata, *vd; /* vertice data */ + float *ndata, *nd; /* normal data */ + float *cdata, *cd; /* color data */ + float *vedata, *ved; /* velocity data */ float *ma_col; int tot_vec_size, flag; int totpoint, totve; @@ -248,7 +245,7 @@ int psys_uses_gravity(struct ParticleSimulationData *sim); /* free */ void BKE_particlesettings_free(struct ParticleSettings *part); void psys_free_path_cache(struct ParticleSystem *psys, struct PTCacheEdit *edit); -void psys_free(struct Object * ob, struct ParticleSystem * psys); +void psys_free(struct Object *ob, struct ParticleSystem *psys); void psys_render_set(struct Object *ob, struct ParticleSystem *psys, float viewmat[][4], float winmat[][4], int winx, int winy, int timeoffset); void psys_render_restore(struct Object *ob, struct ParticleSystem *psys); @@ -291,7 +288,7 @@ void psys_get_dupli_path_transform(struct ParticleSimulationData *sim, struct Pa ParticleThread *psys_threads_create(struct ParticleSimulationData *sim); void psys_threads_free(ParticleThread *threads); -void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3], float zvec[3], float center[3]); +void psys_make_billboard(ParticleBillboardData * bb, float xvec[3], float yvec[3], float zvec[3], float center[3]); void psys_apply_hair_lattice(struct Scene *scene, struct Object *ob, struct ParticleSystem *psys); /* particle_system.c */ @@ -346,13 +343,13 @@ int psys_particle_dm_face_lookup(struct Object *ob, struct DerivedMesh *dm, int void reset_particle(struct ParticleSimulationData *sim, struct ParticleData *pa, float dtime, float cfra); /* psys_reset */ -#define PSYS_RESET_ALL 1 -#define PSYS_RESET_DEPSGRAPH 2 -/* #define PSYS_RESET_CHILDREN 3 */ /*UNUSED*/ -#define PSYS_RESET_CACHE_MISS 4 +#define PSYS_RESET_ALL 1 +#define PSYS_RESET_DEPSGRAPH 2 +/* #define PSYS_RESET_CHILDREN 3 */ /*UNUSED*/ +#define PSYS_RESET_CACHE_MISS 4 /* index_dmcache */ -#define DMCACHE_NOTFOUND -1 -#define DMCACHE_ISCHILD -2 +#define DMCACHE_NOTFOUND -1 +#define DMCACHE_ISCHILD -2 #endif diff --git a/source/blender/blenkernel/BKE_plugin_types.h b/source/blender/blenkernel/BKE_plugin_types.h index 8f9706f9833..f3c5db02427 100644 --- a/source/blender/blenkernel/BKE_plugin_types.h +++ b/source/blender/blenkernel/BKE_plugin_types.h @@ -34,11 +34,11 @@ struct ImBuf; -typedef int (*TexDoitold)(int stype, void *cast, float *texvec, float *dxt, float *dyt); -typedef int (*TexDoit)(int stype, void *cast, float *texvec, float *dxt, float *dyt, float *result ); -typedef void (*SeqDoit)(void*, float, float, int, int, - struct ImBuf*, struct ImBuf*, - struct ImBuf*, struct ImBuf*); +typedef int (*TexDoitold)(int stype, void *cast, float *texvec, float *dxt, float *dyt); +typedef int (*TexDoit)(int stype, void *cast, float *texvec, float *dxt, float *dyt, float *result); +typedef void (*SeqDoit)(void *, float, float, int, int, + struct ImBuf *, struct ImBuf *, + struct ImBuf *, struct ImBuf *); typedef struct VarStruct { int type; diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h index d7d7324dd56..d6ab9a35697 100644 --- a/source/blender/blenkernel/BKE_pointcache.h +++ b/source/blender/blenkernel/BKE_pointcache.h @@ -40,15 +40,15 @@ /* Point cache clearing option, for BKE_ptcache_id_clear, before * and after are non inclusive (they wont remove the cfra) */ -#define PTCACHE_CLEAR_ALL 0 -#define PTCACHE_CLEAR_FRAME 1 -#define PTCACHE_CLEAR_BEFORE 2 -#define PTCACHE_CLEAR_AFTER 3 +#define PTCACHE_CLEAR_ALL 0 +#define PTCACHE_CLEAR_FRAME 1 +#define PTCACHE_CLEAR_BEFORE 2 +#define PTCACHE_CLEAR_AFTER 3 /* Point cache reset options */ -#define PTCACHE_RESET_DEPSGRAPH 0 -#define PTCACHE_RESET_BAKED 1 -#define PTCACHE_RESET_OUTDATED 2 +#define PTCACHE_RESET_DEPSGRAPH 0 +#define PTCACHE_RESET_BAKED 1 +#define PTCACHE_RESET_OUTDATED 2 /* #define PTCACHE_RESET_FREE 3 */ /*UNUSED*/ /* Add the blendfile name after blendcache_ */ @@ -56,29 +56,29 @@ #define PTCACHE_PATH "blendcache_" /* File open options, for BKE_ptcache_file_open */ -#define PTCACHE_FILE_READ 0 -#define PTCACHE_FILE_WRITE 1 -#define PTCACHE_FILE_UPDATE 2 +#define PTCACHE_FILE_READ 0 +#define PTCACHE_FILE_WRITE 1 +#define PTCACHE_FILE_UPDATE 2 /* PTCacheID types */ -#define PTCACHE_TYPE_SOFTBODY 0 -#define PTCACHE_TYPE_PARTICLES 1 -#define PTCACHE_TYPE_CLOTH 2 -#define PTCACHE_TYPE_SMOKE_DOMAIN 3 -#define PTCACHE_TYPE_SMOKE_HIGHRES 4 -#define PTCACHE_TYPE_DYNAMICPAINT 5 +#define PTCACHE_TYPE_SOFTBODY 0 +#define PTCACHE_TYPE_PARTICLES 1 +#define PTCACHE_TYPE_CLOTH 2 +#define PTCACHE_TYPE_SMOKE_DOMAIN 3 +#define PTCACHE_TYPE_SMOKE_HIGHRES 4 +#define PTCACHE_TYPE_DYNAMICPAINT 5 /* high bits reserved for flags that need to be stored in file */ -#define PTCACHE_TYPEFLAG_COMPRESS (1<<16) -#define PTCACHE_TYPEFLAG_EXTRADATA (1<<17) +#define PTCACHE_TYPEFLAG_COMPRESS (1 << 16) +#define PTCACHE_TYPEFLAG_EXTRADATA (1 << 17) -#define PTCACHE_TYPEFLAG_TYPEMASK 0x0000FFFF -#define PTCACHE_TYPEFLAG_FLAGMASK 0xFFFF0000 +#define PTCACHE_TYPEFLAG_TYPEMASK 0x0000FFFF +#define PTCACHE_TYPEFLAG_FLAGMASK 0xFFFF0000 /* PTCache read return code */ -#define PTCACHE_READ_EXACT 1 -#define PTCACHE_READ_INTERPOLATED 2 -#define PTCACHE_READ_OLD 3 +#define PTCACHE_READ_EXACT 1 +#define PTCACHE_READ_INTERPOLATED 2 +#define PTCACHE_READ_OLD 3 /* Structs */ struct ClothModifierData; @@ -115,7 +115,7 @@ typedef struct PTCacheFile { void *cur[BPHYS_TOT_DATA]; } PTCacheFile; -#define PTCACHE_VEL_PER_SEC 1 +#define PTCACHE_VEL_PER_SEC 1 typedef struct PTCacheID { struct PTCacheID *next, *prev; @@ -182,10 +182,10 @@ typedef struct PTCacheBaker { } PTCacheBaker; /* PTCacheEditKey->flag */ -#define PEK_SELECT 1 -#define PEK_TAG 2 -#define PEK_HIDE 4 -#define PEK_USE_WCO 8 +#define PEK_SELECT 1 +#define PEK_TAG 2 +#define PEK_HIDE 4 +#define PEK_USE_WCO 8 typedef struct PTCacheEditKey { float *co; @@ -200,10 +200,10 @@ typedef struct PTCacheEditKey { } PTCacheEditKey; /* PTCacheEditPoint->flag */ -#define PEP_TAG 1 -#define PEP_EDIT_RECALC 2 -#define PEP_TRANSFORM 4 -#define PEP_HIDE 8 +#define PEP_TAG 1 +#define PEP_EDIT_RECALC 2 +#define PEP_TRANSFORM 4 +#define PEP_HIDE 8 typedef struct PTCacheEditPoint { struct PTCacheEditKey *keys; @@ -242,7 +242,7 @@ typedef struct PTCacheEdit { float *emitter_cosnos; /* localspace face centers and normals (average of its verts), from the derived mesh */ int *mirror_cache; - struct ParticleCacheKey **pathcache; /* path cache (runtime) */ + struct ParticleCacheKey **pathcache; /* path cache (runtime) */ ListBase pathcachebufs; int totpoint, totframes, totcached, edited; @@ -267,18 +267,18 @@ void BKE_ptcache_ids_from_object(struct ListBase *lb, struct Object *ob, struct void BKE_ptcache_remove(void); /************ ID specific functions ************************/ -void BKE_ptcache_id_clear(PTCacheID *id, int mode, unsigned int cfra); -int BKE_ptcache_id_exist(PTCacheID *id, int cfra); -int BKE_ptcache_id_reset(struct Scene *scene, PTCacheID *id, int mode); -void BKE_ptcache_id_time(PTCacheID *pid, struct Scene *scene, float cfra, int *startframe, int *endframe, float *timescale); -int BKE_ptcache_object_reset(struct Scene *scene, struct Object *ob, int mode); +void BKE_ptcache_id_clear(PTCacheID *id, int mode, unsigned int cfra); +int BKE_ptcache_id_exist(PTCacheID *id, int cfra); +int BKE_ptcache_id_reset(struct Scene *scene, PTCacheID *id, int mode); +void BKE_ptcache_id_time(PTCacheID *pid, struct Scene *scene, float cfra, int *startframe, int *endframe, float *timescale); +int BKE_ptcache_object_reset(struct Scene *scene, struct Object *ob, int mode); void BKE_ptcache_update_info(PTCacheID *pid); /*********** General cache reading/writing ******************/ /* Size of cache data type. */ -int BKE_ptcache_data_size(int data_type); +int BKE_ptcache_data_size(int data_type); /* Is point with indes in memory cache */ int BKE_ptcache_mem_index_find(struct PTCacheMem *pm, unsigned int index); @@ -289,10 +289,10 @@ void BKE_ptcache_mem_pointers_incr(struct PTCacheMem *pm); int BKE_ptcache_mem_pointers_seek(int point_index, struct PTCacheMem *pm); /* Main cache reading call. */ -int BKE_ptcache_read(PTCacheID *pid, float cfra); +int BKE_ptcache_read(PTCacheID *pid, float cfra); /* Main cache writing call. */ -int BKE_ptcache_write(PTCacheID *pid, unsigned int cfra); +int BKE_ptcache_write(PTCacheID *pid, unsigned int cfra); /****************** Continue physics ***************/ void BKE_ptcache_set_continue_physics(struct Main *bmain, struct Scene *scene, int enable); @@ -311,7 +311,7 @@ struct PointCache *BKE_ptcache_copy_list(struct ListBase *ptcaches_new, struct L void BKE_ptcache_quick_cache_all(struct Main *bmain, struct Scene *scene); /* Bake cache or simulate to current frame with settings defined in the baker. */ -void BKE_ptcache_bake(struct PTCacheBaker* baker); +void BKE_ptcache_bake(struct PTCacheBaker *baker); /* Convert disk cache to memory cache. */ void BKE_ptcache_disk_to_mem(struct PTCacheID *pid); diff --git a/source/blender/blenkernel/BKE_report.h b/source/blender/blenkernel/BKE_report.h index aa625fab3b2..4d69a013101 100644 --- a/source/blender/blenkernel/BKE_report.h +++ b/source/blender/blenkernel/BKE_report.h @@ -49,14 +49,14 @@ void BKE_reports_clear(ReportList *reports); void BKE_report(ReportList *reports, ReportType type, const char *message); void BKE_reportf(ReportList *reports, ReportType type, const char *format, ...) #ifdef __GNUC__ -__attribute__ ((format (printf, 3, 4))) +__attribute__ ((format(printf, 3, 4))) #endif ; void BKE_reports_prepend(ReportList *reports, const char *prepend); void BKE_reports_prependf(ReportList *reports, const char *prepend, ...) #ifdef __GNUC__ -__attribute__ ((format (printf, 2, 3))) +__attribute__ ((format(printf, 2, 3))) #endif ; diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h index 3a93562707d..bce4243190a 100644 --- a/source/blender/blenkernel/BKE_scene.h +++ b/source/blender/blenkernel/BKE_scene.h @@ -49,13 +49,13 @@ struct Scene; struct Text; struct Text; -#define SCE_COPY_NEW 0 -#define SCE_COPY_EMPTY 1 -#define SCE_COPY_LINK_OB 2 -#define SCE_COPY_LINK_DATA 3 -#define SCE_COPY_FULL 4 +#define SCE_COPY_NEW 0 +#define SCE_COPY_EMPTY 1 +#define SCE_COPY_LINK_OB 2 +#define SCE_COPY_LINK_DATA 3 +#define SCE_COPY_FULL 4 -#define SETLOOPER(_sce_basis, _sce_iter, _base) _sce_iter= _sce_basis, _base= _setlooper_base_step(&_sce_iter, NULL); _base; _base= _setlooper_base_step(&_sce_iter, _base) +#define SETLOOPER(_sce_basis, _sce_iter, _base) _sce_iter = _sce_basis, _base = _setlooper_base_step(&_sce_iter, NULL); _base; _base = _setlooper_base_step(&_sce_iter, _base) struct Base *_setlooper_base_step(struct Scene **sce_iter, struct Base *base); void free_avicodecdata(struct AviCodecData *acd); diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h index af6e793cf2f..7223008afad 100644 --- a/source/blender/blenkernel/BKE_screen.h +++ b/source/blender/blenkernel/BKE_screen.h @@ -58,43 +58,43 @@ struct wmWindowManager; * ED_spacetypes_init() in editors/area/spacetypes.c */ /* an editor in Blender is a combined ScrArea + SpaceType + SpaceData */ -#define BKE_ST_MAXNAME 64 +#define BKE_ST_MAXNAME 64 typedef struct SpaceType { struct SpaceType *next, *prev; - char name[BKE_ST_MAXNAME]; /* for menus */ - int spaceid; /* unique space identifier */ - int iconid; /* icon lookup for menus */ + char name[BKE_ST_MAXNAME]; /* for menus */ + int spaceid; /* unique space identifier */ + int iconid; /* icon lookup for menus */ /* initial allocation, after this WM will call init() too */ - struct SpaceLink *(*new)(const struct bContext *C); + struct SpaceLink *(*new)(const struct bContext *C); /* not free spacelink itself */ - void (*free)(struct SpaceLink *); + void (*free)(struct SpaceLink *); /* init is to cope with file load, screen (size) changes, check handlers */ - void (*init)(struct wmWindowManager *, struct ScrArea *); + void (*init)(struct wmWindowManager *, struct ScrArea *); /* Listeners can react to bContext changes */ - void (*listener)(struct ScrArea *, struct wmNotifier *); + void (*listener)(struct ScrArea *, struct wmNotifier *); /* refresh context, called after filereads, ED_area_tag_refresh() */ - void (*refresh)(const struct bContext *, struct ScrArea *); + void (*refresh)(const struct bContext *, struct ScrArea *); /* after a spacedata copy, an init should result in exact same situation */ - struct SpaceLink *(*duplicate)(struct SpaceLink *); + struct SpaceLink *(*duplicate)(struct SpaceLink *); /* register operator types on startup */ - void (*operatortypes)(void); + void (*operatortypes)(void); /* add default items to WM keymap */ - void (*keymap)(struct wmKeyConfig *); + void (*keymap)(struct wmKeyConfig *); /* on startup, define dropboxes for spacetype+regions */ - void (*dropboxes)(void); + void (*dropboxes)(void); /* return context data */ - int (*context)(const struct bContext *, const char*, struct bContextDataResult *); + int (*context)(const struct bContext *, const char *, struct bContextDataResult *); /* region type definitions */ - ListBase regiontypes; + ListBase regiontypes; /* tool shelf definitions */ ListBase toolshelf; @@ -102,7 +102,7 @@ typedef struct SpaceType { /* read and write... */ /* default keymaps to add */ - int keymapflag; + int keymapflag; } SpaceType; @@ -111,33 +111,33 @@ typedef struct SpaceType { typedef struct ARegionType { struct ARegionType *next, *prev; - int regionid; /* unique identifier within this space, defines RGN_TYPE_xxxx */ + int regionid; /* unique identifier within this space, defines RGN_TYPE_xxxx */ /* add handlers, stuff you only do once or on area/region type/size changes */ - void (*init)(struct wmWindowManager *, struct ARegion *); + void (*init)(struct wmWindowManager *, struct ARegion *); /* draw entirely, view changes should be handled here */ - void (*draw)(const struct bContext *, struct ARegion *); + void (*draw)(const struct bContext *, struct ARegion *); /* contextual changes should be handled here */ - void (*listener)(struct ARegion *, struct wmNotifier *); + void (*listener)(struct ARegion *, struct wmNotifier *); - void (*free)(struct ARegion *); + void (*free)(struct ARegion *); /* split region, copy data optionally */ - void *(*duplicate)(void *); + void *(*duplicate)(void *); /* register operator types on startup */ - void (*operatortypes)(void); + void (*operatortypes)(void); /* add own items to keymap */ - void (*keymap)(struct wmKeyConfig *); + void (*keymap)(struct wmKeyConfig *); /* allows default cursor per region */ - void (*cursor)(struct wmWindow *, struct ScrArea *, struct ARegion *ar); + void (*cursor)(struct wmWindow *, struct ScrArea *, struct ARegion *ar); /* return context data */ - int (*context)(const struct bContext *, const char *, struct bContextDataResult *); + int (*context)(const struct bContext *, const char *, struct bContextDataResult *); /* custom drawing callbacks */ - ListBase drawcalls; + ListBase drawcalls; /* panels type definitions */ ListBase paneltypes; @@ -146,13 +146,13 @@ typedef struct ARegionType { ListBase headertypes; /* hardcoded constraints, smaller than these values region is not visible */ - int minsizex, minsizey; + int minsizex, minsizey; /* when new region opens (region prefsizex/y are zero then */ - int prefsizex, prefsizey; + int prefsizex, prefsizey; /* default keymaps to add */ - int keymapflag; + int keymapflag; /* return without drawing. lock is set by region definition, and copied to do_lock by render. can become flag */ - short do_lock, lock; + short do_lock, lock; } ARegionType; /* panel types */ @@ -160,20 +160,20 @@ typedef struct ARegionType { typedef struct PanelType { struct PanelType *next, *prev; - char idname[BKE_ST_MAXNAME]; /* unique name */ - char label[BKE_ST_MAXNAME]; /* for panel header */ - char context[BKE_ST_MAXNAME]; /* for buttons window */ - int space_type; - int region_type; + char idname[BKE_ST_MAXNAME]; /* unique name */ + char label[BKE_ST_MAXNAME]; /* for panel header */ + char context[BKE_ST_MAXNAME]; /* for buttons window */ + int space_type; + int region_type; - int flag; + int flag; /* verify if the panel should draw or not */ - int (*poll)(const struct bContext *, struct PanelType *); + int (*poll)(const struct bContext *, struct PanelType *); /* draw header (optional) */ - void (*draw_header)(const struct bContext *, struct Panel *); + void (*draw_header)(const struct bContext *, struct Panel *); /* draw entirely, view changes should be handled here */ - void (*draw)(const struct bContext *, struct Panel *); + void (*draw)(const struct bContext *, struct Panel *); /* RNA integration */ ExtensionRNA ext; @@ -184,19 +184,19 @@ typedef struct PanelType { typedef struct HeaderType { struct HeaderType *next, *prev; - char idname[BKE_ST_MAXNAME]; /* unique name */ - int space_type; + char idname[BKE_ST_MAXNAME]; /* unique name */ + int space_type; /* draw entirely, view changes should be handled here */ - void (*draw)(const struct bContext *, struct Header *); + void (*draw)(const struct bContext *, struct Header *); /* RNA integration */ ExtensionRNA ext; } HeaderType; typedef struct Header { - struct HeaderType *type; /* runtime */ - struct uiLayout *layout; /* runtime for drawing */ + struct HeaderType *type; /* runtime */ + struct uiLayout *layout; /* runtime for drawing */ } Header; @@ -205,22 +205,22 @@ typedef struct Header { typedef struct MenuType { struct MenuType *next, *prev; - char idname[BKE_ST_MAXNAME]; /* unique name */ - char label[BKE_ST_MAXNAME]; /* for button text */ + char idname[BKE_ST_MAXNAME]; /* unique name */ + char label[BKE_ST_MAXNAME]; /* for button text */ char *description; /* verify if the menu should draw or not */ - int (*poll)(const struct bContext *, struct MenuType *); + int (*poll)(const struct bContext *, struct MenuType *); /* draw entirely, view changes should be handled here */ - void (*draw)(const struct bContext *, struct Menu *); + void (*draw)(const struct bContext *, struct Menu *); /* RNA integration */ ExtensionRNA ext; } MenuType; typedef struct Menu { - struct MenuType *type; /* runtime */ - struct uiLayout *layout; /* runtime for drawing */ + struct MenuType *type; /* runtime */ + struct uiLayout *layout; /* runtime for drawing */ } Menu; /* spacetypes */ @@ -228,7 +228,7 @@ struct SpaceType *BKE_spacetype_from_id(int spaceid); struct ARegionType *BKE_regiontype_from_id(struct SpaceType *st, int regionid); const struct ListBase *BKE_spacetypes_list(void); void BKE_spacetype_register(struct SpaceType *st); -void BKE_spacetypes_free(void); /* only for quitting blender */ +void BKE_spacetypes_free(void); /* only for quitting blender */ /* spacedata */ void BKE_spacedata_freelist(ListBase *lb); @@ -237,8 +237,8 @@ void BKE_spacedata_draw_locks(int set); /* area/regions */ struct ARegion *BKE_area_region_copy(struct SpaceType *st, struct ARegion *ar); -void BKE_area_region_free(struct SpaceType *st, struct ARegion *ar); -void BKE_screen_area_free(struct ScrArea *sa); +void BKE_area_region_free(struct SpaceType *st, struct ARegion *ar); +void BKE_screen_area_free(struct ScrArea *sa); struct ARegion *BKE_area_find_region_type(struct ScrArea *sa, int type); struct ScrArea *BKE_screen_find_big_area(struct bScreen *sc, const int spacetype, const short min); diff --git a/source/blender/blenkernel/BKE_script.h b/source/blender/blenkernel/BKE_script.h index 7bd801a8177..9976009c4c2 100644 --- a/source/blender/blenkernel/BKE_script.h +++ b/source/blender/blenkernel/BKE_script.h @@ -40,7 +40,7 @@ extern "C" { struct Script; -void free_script (struct Script *script); +void free_script(struct Script *script); #ifdef __cplusplus } diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index decbf5d0d2a..4ddafbbaae9 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -46,10 +46,10 @@ struct SeqIndexBuildContext; #define BUILD_SEQAR_COUNT_CURRENT 1 #define BUILD_SEQAR_COUNT_CHILDREN 2 -#define EARLY_NO_INPUT -1 -#define EARLY_DO_EFFECT 0 -#define EARLY_USE_INPUT_1 1 -#define EARLY_USE_INPUT_2 2 +#define EARLY_NO_INPUT -1 +#define EARLY_DO_EFFECT 0 +#define EARLY_USE_INPUT_1 1 +#define EARLY_USE_INPUT_2 2 /* sequence iterator */ @@ -67,8 +67,8 @@ void seq_end(SeqIterator *iter); void seq_array(struct Editing *ed, struct Sequence ***seqarray, int *tot, int use_pointer); #define SEQP_BEGIN(ed, _seq) \ -{ \ - SeqIterator iter; \ + { \ + SeqIterator iter; \ for (seq_begin(ed, &iter, 1); iter.valid; seq_next(&iter)) { \ _seq = iter.seq; @@ -79,8 +79,8 @@ void seq_array(struct Editing *ed, struct Sequence ***seqarray, int *tot, int us _seq = iter.seq; #define SEQ_END \ - } \ - seq_end(&iter); \ + } \ + seq_end(&iter); \ } typedef struct SeqRenderData { @@ -94,11 +94,11 @@ typedef struct SeqRenderData { } SeqRenderData; SeqRenderData seq_new_render_data( - struct Main * bmain, struct Scene * scene, - int rectx, int recty, int preview_render_size); + struct Main *bmain, struct Scene *scene, + int rectx, int recty, int preview_render_size); -int seq_cmp_render_data(const SeqRenderData * a, const SeqRenderData * b); -unsigned int seq_hash_render_data(const SeqRenderData * a); +int seq_cmp_render_data(const SeqRenderData *a, const SeqRenderData *b); +unsigned int seq_hash_render_data(const SeqRenderData *a); /* Wipe effect */ enum { @@ -138,22 +138,21 @@ struct SeqEffectHandle { int (*early_out)(struct Sequence *seq, float facf0, float facf1); /* stores the y-range of the effect IPO */ - void (*store_icu_yrange)(struct Sequence * seq, short adrcode, float *ymin, float *ymax); + void (*store_icu_yrange)(struct Sequence *seq, short adrcode, float *ymin, float *ymax); /* stores the default facf0 and facf1 if no IPO is present */ - void (*get_default_fac)(struct Sequence *seq, float cfra, float * facf0, float * facf1); + void (*get_default_fac)(struct Sequence *seq, float cfra, float *facf0, float *facf1); /* execute the effect * sequence effects are only required to either support * float-rects or byte-rects * (mixed cases are handled one layer up...) */ - struct ImBuf* (*execute)( - SeqRenderData context, - struct Sequence *seq, float cfra, - float facf0, float facf1, - struct ImBuf *ibuf1, struct ImBuf *ibuf2, - struct ImBuf *ibuf3); + struct ImBuf * (*execute)(SeqRenderData context, + struct Sequence *seq, float cfra, + float facf0, float facf1, + struct ImBuf *ibuf1, struct ImBuf *ibuf2, + struct ImBuf *ibuf3); }; /* ********************* prototypes *************** */ @@ -200,9 +199,9 @@ void seq_free_clipboard(void); const char *give_seqname(struct Sequence *seq); void calc_sequence(struct Scene *scene, struct Sequence *seq); void calc_sequence_disp(struct Scene *scene, struct Sequence *seq); -void reload_sequence_new_file(struct Scene *scene, struct Sequence * seq, int lock_range); +void reload_sequence_new_file(struct Scene *scene, struct Sequence *seq, int lock_range); void build_seqar_cb(struct ListBase *seqbase, struct Sequence ***seqar, int *totseq, - int (*test_func)(struct Sequence * seq)); + int (*test_func)(struct Sequence *seq)); int evaluate_seq_frame(struct Scene *scene, int cfra); struct StripElem *give_stripelem(struct Sequence *seq, int cfra); @@ -211,7 +210,7 @@ void printf_strip(struct Sequence *seq); // debugging function (unused) void update_changed_seq_and_deps(struct Scene *scene, struct Sequence *changed_seq, int len_change, int ibuf_change); int input_have_to_preprocess( - SeqRenderData context, struct Sequence * seq, float cfra); + SeqRenderData context, struct Sequence *seq, float cfra); struct SeqIndexBuildContext *seq_proxy_rebuild_context(struct Main *bmain, struct Scene *scene, struct Sequence *seq); void seq_proxy_rebuild(struct SeqIndexBuildContext *context, @@ -236,18 +235,16 @@ void seq_stripelem_cache_destruct(void); void seq_stripelem_cache_cleanup(void); /* returned ImBuf is properly refed and has to be freed */ -struct ImBuf * seq_stripelem_cache_get( - SeqRenderData context, struct Sequence * seq, - float cfra, seq_stripelem_ibuf_t type); +struct ImBuf *seq_stripelem_cache_get(SeqRenderData context, struct Sequence *seq, + float cfra, seq_stripelem_ibuf_t type); /* passed ImBuf is properly refed, so ownership is *not* * transfered to the cache. * you can pass the same ImBuf multiple times to the cache without problems. */ -void seq_stripelem_cache_put( - SeqRenderData context, struct Sequence * seq, - float cfra, seq_stripelem_ibuf_t type, struct ImBuf * nval); +void seq_stripelem_cache_put(SeqRenderData context, struct Sequence *seq, + float cfra, seq_stripelem_ibuf_t type, struct ImBuf *nval); /* ********************************************************************** * seqeffects.c @@ -278,29 +275,28 @@ int seq_tx_get_final_right(struct Sequence *seq, int metaclip); void seq_tx_set_final_left(struct Sequence *seq, int val); void seq_tx_set_final_right(struct Sequence *seq, int val); void seq_tx_handle_xlimits(struct Sequence *seq, int leftflag, int rightflag); -int seq_tx_test(struct Sequence * seq); +int seq_tx_test(struct Sequence *seq); int seq_single_check(struct Sequence *seq); void seq_single_fix(struct Sequence *seq); -int seq_test_overlap(struct ListBase * seqbasep, struct Sequence *test); +int seq_test_overlap(struct ListBase *seqbasep, struct Sequence *test); void seq_translate(struct Scene *scene, struct Sequence *seq, int delta); void seq_sound_init(struct Scene *scene, struct Sequence *seq); struct Sequence *seq_foreground_frame_get(struct Scene *scene, int frame); struct ListBase *seq_seqbase(struct ListBase *seqbase, struct Sequence *seq); -struct Sequence *seq_metastrip( - ListBase * seqbase /* = ed->seqbase */, - struct Sequence * meta /* = NULL */, struct Sequence *seq); +struct Sequence *seq_metastrip(ListBase *seqbase /* = ed->seqbase */, + struct Sequence *meta /* = NULL */, struct Sequence *seq); void seq_offset_animdata(struct Scene *scene, struct Sequence *seq, int ofs); void seq_dupe_animdata(struct Scene *scene, const char *name_src, const char *name_dst); -int shuffle_seq(struct ListBase * seqbasep, struct Sequence *test, struct Scene *evil_scene); -int shuffle_seq_time(ListBase * seqbasep, struct Scene *evil_scene); +int shuffle_seq(struct ListBase *seqbasep, struct Sequence *test, struct Scene *evil_scene); +int shuffle_seq_time(ListBase *seqbasep, struct Scene *evil_scene); int seqbase_isolated_sel_check(struct ListBase *seqbase); -void free_imbuf_seq(struct Scene *scene, struct ListBase * seqbasep, int check_mem_usage, int keep_file_handles); -struct Sequence *seq_dupli_recursive(struct Scene *scene, struct Scene *scene_to, struct Sequence * seq, int dupe_flag); +void free_imbuf_seq(struct Scene *scene, struct ListBase *seqbasep, int check_mem_usage, int keep_file_handles); +struct Sequence *seq_dupli_recursive(struct Scene *scene, struct Scene *scene_to, struct Sequence *seq, int dupe_flag); int seq_swap(struct Sequence *seq_a, struct Sequence *seq_b, const char **error_str); void seq_update_sound_bounds_all(struct Scene *scene); -void seq_update_sound_bounds(struct Scene* scene, struct Sequence *seq); +void seq_update_sound_bounds(struct Scene *scene, struct Sequence *seq); void seq_update_muting(struct Editing *ed); void seq_update_sound(struct Scene *scene, struct bSound *sound); void seqbase_unique_name_recursive(ListBase *seqbasep, struct Sequence *seq); @@ -315,27 +311,27 @@ typedef struct SeqLoadInfo { int start_frame; int end_frame; int channel; - int flag; /* use sound, replace sel */ + int flag; /* use sound, replace sel */ int type; int tot_success; int tot_error; - int len; /* only for image strips */ + int len; /* only for image strips */ char path[512]; char name[64]; } SeqLoadInfo; /* SeqLoadInfo.flag */ -#define SEQ_LOAD_REPLACE_SEL (1<<0) -#define SEQ_LOAD_FRAME_ADVANCE (1<<1) -#define SEQ_LOAD_MOVIE_SOUND (1<<2) -#define SEQ_LOAD_SOUND_CACHE (1<<3) +#define SEQ_LOAD_REPLACE_SEL (1 << 0) +#define SEQ_LOAD_FRAME_ADVANCE (1 << 1) +#define SEQ_LOAD_MOVIE_SOUND (1 << 2) +#define SEQ_LOAD_SOUND_CACHE (1 << 3) /* seq_dupli' flags */ -#define SEQ_DUPE_UNIQUE_NAME (1<<0) -#define SEQ_DUPE_CONTEXT (1<<1) -#define SEQ_DUPE_ANIM (1<<2) -#define SEQ_DUPE_ALL (1<<3) /* otherwise only selected are copied */ +#define SEQ_DUPE_UNIQUE_NAME (1 << 0) +#define SEQ_DUPE_CONTEXT (1 << 1) +#define SEQ_DUPE_ANIM (1 << 2) +#define SEQ_DUPE_ALL (1 << 3) /* otherwise only selected are copied */ /* use as an api function */ typedef struct Sequence *(*SeqLoadFunc)(struct bContext *, ListBase *, struct SeqLoadInfo *); diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h index 626dd64e21e..5b09f8fdf3d 100644 --- a/source/blender/blenkernel/BKE_shrinkwrap.h +++ b/source/blender/blenkernel/BKE_shrinkwrap.h @@ -65,8 +65,7 @@ struct DerivedMesh *object_get_derived_final(struct Object *ob); */ struct Object; -typedef struct SpaceTransform -{ +typedef struct SpaceTransform { float local2target[4][4]; float target2local[4][4]; @@ -103,23 +102,22 @@ struct MDeformVert; struct BVHTree; -typedef struct ShrinkwrapCalcData -{ - ShrinkwrapModifierData *smd; //shrinkwrap modifier data +typedef struct ShrinkwrapCalcData { + ShrinkwrapModifierData *smd; //shrinkwrap modifier data - struct Object *ob; //object we are applying shrinkwrap to + struct Object *ob; //object we are applying shrinkwrap to - struct MVert *vert; //Array of verts being projected (to fetch normals or other data) - float (*vertexCos)[3]; //vertexs being shrinkwraped + struct MVert *vert; //Array of verts being projected (to fetch normals or other data) + float (*vertexCos)[3]; //vertexs being shrinkwraped int numVerts; - struct MDeformVert* dvert; //Pointer to mdeform array - int vgroup; //Vertex group num + struct MDeformVert *dvert; //Pointer to mdeform array + int vgroup; //Vertex group num - struct DerivedMesh *target; //mesh we are shrinking to - SpaceTransform local2target; //transform to move between local and target space + struct DerivedMesh *target; //mesh we are shrinking to + SpaceTransform local2target; //transform to move between local and target space - float keepDist; //Distance to keep above target surface (units are in local space) + float keepDist; //Distance to keep above target surface (units are in local space) } ShrinkwrapCalcData; @@ -139,10 +137,10 @@ int normal_projection_project_vertex(char options, const float *vert, const floa /* * NULL initializers to local data */ -#define NULL_ShrinkwrapCalcData {NULL, } -#define NULL_BVHTreeFromMesh {NULL, } -#define NULL_BVHTreeRayHit {NULL, } -#define NULL_BVHTreeNearest {0, } +#define NULL_ShrinkwrapCalcData {NULL, } +#define NULL_BVHTreeFromMesh {NULL, } +#define NULL_BVHTreeRayHit {NULL, } +#define NULL_BVHTreeNearest {0, } #endif diff --git a/source/blender/blenkernel/BKE_sketch.h b/source/blender/blenkernel/BKE_sketch.h index 9cdf9a8fb62..50ee1184b3e 100644 --- a/source/blender/blenkernel/BKE_sketch.h +++ b/source/blender/blenkernel/BKE_sketch.h @@ -38,8 +38,7 @@ typedef enum SK_PMode PT_PROJECT, } SK_PMode; -typedef struct SK_Point -{ +typedef struct SK_Point { float p[3]; short p2d[2]; float no[3]; @@ -48,8 +47,7 @@ typedef struct SK_Point SK_PMode mode; } SK_Point; -typedef struct SK_Stroke -{ +typedef struct SK_Stroke { struct SK_Stroke *next, *prev; SK_Point *points; @@ -58,68 +56,64 @@ typedef struct SK_Stroke int selected; } SK_Stroke; -#define SK_OVERDRAW_LIMIT 5 +#define SK_OVERDRAW_LIMIT 5 -typedef struct SK_Overdraw -{ +typedef struct SK_Overdraw { SK_Stroke *target; - int start, end; + int start, end; int count; } SK_Overdraw; #define SK_Stroke_BUFFER_INIT_SIZE 20 -typedef struct SK_DrawData -{ +typedef struct SK_DrawData { int mval[2]; int previous_mval[2]; SK_PType type; } SK_DrawData; -typedef struct SK_Intersection -{ +typedef struct SK_Intersection { struct SK_Intersection *next, *prev; SK_Stroke *stroke; - int before; - int after; - int gesture_index; - float p[3]; - float lambda; /* used for sorting intersection points */ + int before; + int after; + int gesture_index; + float p[3]; + float lambda; /* used for sorting intersection points */ } SK_Intersection; -typedef struct SK_Sketch -{ - ListBase strokes; - ListBase depth_peels; - SK_Stroke *active_stroke; - SK_Stroke *gesture; - SK_Point next_point; +typedef struct SK_Sketch { + ListBase strokes; + ListBase depth_peels; + SK_Stroke *active_stroke; + SK_Stroke *gesture; + SK_Point next_point; SK_Overdraw over; } SK_Sketch; typedef struct SK_Gesture { - SK_Stroke *stk; - SK_Stroke *segments; + SK_Stroke *stk; + SK_Stroke *segments; - ListBase intersections; - ListBase self_intersections; + ListBase intersections; + ListBase self_intersections; - int nb_self_intersections; - int nb_intersections; - int nb_segments; + int nb_self_intersections; + int nb_intersections; + int nb_segments; } SK_Gesture; /************************************************/ void freeSketch(SK_Sketch *sketch); -SK_Sketch* createSketch(void); +SK_Sketch *createSketch(void); void sk_removeStroke(SK_Sketch *sketch, SK_Stroke *stk); void sk_freeStroke(SK_Stroke *stk); -SK_Stroke* sk_createStroke(void); +SK_Stroke *sk_createStroke(void); SK_Point *sk_lastStrokePoint(SK_Stroke *stk); @@ -134,7 +128,7 @@ void sk_appendStrokePoint(SK_Stroke *stk, SK_Point *pt); void sk_insertStrokePoints(SK_Stroke *stk, SK_Point *pts, int len, int start, int end); void sk_trimStroke(SK_Stroke *stk, int start, int end); -void sk_straightenStroke(SK_Stroke *stk, int start, int end, float p_start[3], float p_end[3]); +void sk_straightenStroke(SK_Stroke * stk, int start, int end, float p_start[3], float p_end[3]); void sk_polygonizeStroke(SK_Stroke *stk, int start, int end); void sk_flattenStroke(SK_Stroke *stk, int start, int end); void sk_reverseStroke(SK_Stroke *stk); diff --git a/source/blender/blenkernel/BKE_smoke.h b/source/blender/blenkernel/BKE_smoke.h index 1e97bc07f99..1f824ccbafc 100644 --- a/source/blender/blenkernel/BKE_smoke.h +++ b/source/blender/blenkernel/BKE_smoke.h @@ -33,11 +33,11 @@ * \author Daniel Genrich */ -typedef float (*bresenham_callback) (float *result, float *input, int res[3], int *pixel, float *tRay, float correct); +typedef float (*bresenham_callback)(float *result, float *input, int res[3], int *pixel, float *tRay, float correct); void smokeModifier_do(struct SmokeModifierData *smd, struct Scene *scene, struct Object *ob, struct DerivedMesh *dm); -void smokeModifier_free (struct SmokeModifierData *smd); +void smokeModifier_free(struct SmokeModifierData *smd); void smokeModifier_reset(struct SmokeModifierData *smd); void smokeModifier_reset_turbulence(struct SmokeModifierData *smd); void smokeModifier_createType(struct SmokeModifierData *smd); diff --git a/source/blender/blenkernel/BKE_softbody.h b/source/blender/blenkernel/BKE_softbody.h index 547fd9e4393..95581958328 100644 --- a/source/blender/blenkernel/BKE_softbody.h +++ b/source/blender/blenkernel/BKE_softbody.h @@ -50,25 +50,25 @@ typedef struct BodyPoint { } BodyPoint; /* allocates and initializes general main data */ -extern struct SoftBody *sbNew(struct Scene *scene); +extern struct SoftBody *sbNew(struct Scene *scene); /* frees internal data and softbody itself */ -extern void sbFree(struct SoftBody *sb); +extern void sbFree(struct SoftBody *sb); /* frees simulation data to reset simulation */ -extern void sbFreeSimulation(struct SoftBody *sb); +extern void sbFreeSimulation(struct SoftBody *sb); /* do one simul step, reading and writing vertex locs from given array */ -extern void sbObjectStep(struct Scene *scene, struct Object *ob, float framnr, float (*vertexCos)[3], int numVerts); +extern void sbObjectStep(struct Scene *scene, struct Object *ob, float framnr, float (*vertexCos)[3], int numVerts); /* makes totally fresh start situation, resets time */ -extern void sbObjectToSoftbody(struct Object *ob); +extern void sbObjectToSoftbody(struct Object *ob); /* links the softbody module to a 'test for Interrupt' function */ /* pass NULL to unlink again */ extern void sbSetInterruptCallBack(int (*f)(void)); -extern void SB_estimate_transform(Object *ob, float lloc[3], float lrot[3][3], float lscale[3][3]); +extern void SB_estimate_transform(Object * ob, float lloc[3], float lrot[3][3], float lscale[3][3]); #endif diff --git a/source/blender/blenkernel/BKE_subsurf.h b/source/blender/blenkernel/BKE_subsurf.h index ea824a9998d..3b8d0eafd4d 100644 --- a/source/blender/blenkernel/BKE_subsurf.h +++ b/source/blender/blenkernel/BKE_subsurf.h @@ -64,10 +64,10 @@ typedef enum { } SubsurfFlags; struct DerivedMesh *subsurf_make_derived_from_derived( - struct DerivedMesh *dm, - struct SubsurfModifierData *smd, - float (*vertCos)[3], - SubsurfFlags flags); + struct DerivedMesh *dm, + struct SubsurfModifierData *smd, + float (*vertCos)[3], + SubsurfFlags flags); void subsurf_calculate_limit_positions(struct Mesh *me, float (*positions_r)[3]); @@ -107,7 +107,7 @@ typedef struct CCGDerivedMesh { struct {int startVert; struct CCGVert *vert; } *vertMap; struct {int startVert; int startEdge; struct CCGEdge *edge; } *edgeMap; struct {int startVert; int startEdge; - int startFace; struct CCGFace *face; } *faceMap; + int startFace; struct CCGFace *face; } *faceMap; short *edgeFlags; struct DMFlagMat *faceFlags; diff --git a/source/blender/blenkernel/BKE_texture.h b/source/blender/blenkernel/BKE_texture.h index ed58620b716..339b78ae2d1 100644 --- a/source/blender/blenkernel/BKE_texture.h +++ b/source/blender/blenkernel/BKE_texture.h @@ -93,8 +93,8 @@ struct Tex *give_current_particle_texture(struct ParticleSettings *part); struct bNode *give_current_material_texture_node(struct Material *ma); -int give_active_mtex(struct ID *id, struct MTex ***mtex_ar, short *act); -void set_active_mtex(struct ID *id, short act); +int give_active_mtex(struct ID *id, struct MTex ***mtex_ar, short *act); +void set_active_mtex(struct ID *id, short act); void set_current_brush_texture(struct Brush *br, struct Tex *tex); void set_current_world_texture(struct World *wo, struct Tex *tex); diff --git a/source/blender/blenkernel/BKE_unit.h b/source/blender/blenkernel/BKE_unit.h index e3ad49e2225..86f46820c97 100644 --- a/source/blender/blenkernel/BKE_unit.h +++ b/source/blender/blenkernel/BKE_unit.h @@ -34,10 +34,10 @@ extern "C" { /* in all cases the value is assumed to be scaled by the user preference */ /* humanly readable representation of a value in units (used for button drawing) */ -void bUnit_AsString(char *str, int len_max, double value, int prec, int system, int type, int split, int pad); +void bUnit_AsString(char *str, int len_max, double value, int prec, int system, int type, int split, int pad); /* replace units with values, used before python button evaluation */ -int bUnit_ReplaceString(char *str, int len_max, const char *str_prev, double scale_pref, int system, int type); +int bUnit_ReplaceString(char *str, int len_max, const char *str_prev, double scale_pref, int system, int type); /* make string keyboard-friendly: 10µm --> 10um */ void bUnit_ToUnitAltName(char *str, int len_max, const char *orig_str, int system, int type); @@ -54,23 +54,23 @@ int bUnit_IsValid(int system, int type); /* loop over scales, coudl add names later */ //double bUnit_Iter(void **unit, char **name, int system, int type); -void bUnit_GetSystem(void **usys_pt, int *len, int system, int type); -int bUnit_GetBaseUnit(void *usys_pt); -const char* bUnit_GetName(void *usys_pt, int index); -const char* bUnit_GetNameDisplay(void *usys_pt, int index); -double bUnit_GetScaler(void *usys_pt, int index); +void bUnit_GetSystem(void **usys_pt, int *len, int system, int type); +int bUnit_GetBaseUnit(void *usys_pt); +const char *bUnit_GetName(void *usys_pt, int index); +const char *bUnit_GetNameDisplay(void *usys_pt, int index); +double bUnit_GetScaler(void *usys_pt, int index); /* aligned with PropertyUnit */ -#define B_UNIT_NONE 0 -#define B_UNIT_LENGTH 1 -#define B_UNIT_AREA 2 -#define B_UNIT_VOLUME 3 -#define B_UNIT_MASS 4 -#define B_UNIT_ROTATION 5 -#define B_UNIT_TIME 6 -#define B_UNIT_VELOCITY 7 -#define B_UNIT_ACCELERATION 8 -#define B_UNIT_TYPE_TOT 9 +#define B_UNIT_NONE 0 +#define B_UNIT_LENGTH 1 +#define B_UNIT_AREA 2 +#define B_UNIT_VOLUME 3 +#define B_UNIT_MASS 4 +#define B_UNIT_ROTATION 5 +#define B_UNIT_TIME 6 +#define B_UNIT_VELOCITY 7 +#define B_UNIT_ACCELERATION 8 +#define B_UNIT_TYPE_TOT 9 #ifdef __cplusplus } diff --git a/source/blender/blenkernel/BKE_utildefines.h b/source/blender/blenkernel/BKE_utildefines.h index 591be9e81c4..0ed2db2aad2 100644 --- a/source/blender/blenkernel/BKE_utildefines.h +++ b/source/blender/blenkernel/BKE_utildefines.h @@ -42,9 +42,9 @@ extern "C" { /* these values need to be hardcoded in structs, dna does not recognize defines */ /* also defined in DNA_space_types.h */ #ifndef FILE_MAXDIR -#define FILE_MAXDIR 768 -#define FILE_MAXFILE 256 -#define FILE_MAX 1024 +#define FILE_MAXDIR 768 +#define FILE_MAXFILE 256 +#define FILE_MAX 1024 #endif /* this weirdo pops up in two places ... */ @@ -56,33 +56,31 @@ extern "C" { /* INTEGER CODES */ #ifdef __BIG_ENDIAN__ - /* Big Endian */ -# define MAKE_ID(a,b,c,d) ( (int)(a)<<24 | (int)(b)<<16 | (c)<<8 | (d) ) +/* Big Endian */ +# define MAKE_ID(a, b, c, d) ( (int)(a) << 24 | (int)(b) << 16 | (c) << 8 | (d) ) #else - /* Little Endian */ -# define MAKE_ID(a,b,c,d) ( (int)(d)<<24 | (int)(c)<<16 | (b)<<8 | (a) ) +/* Little Endian */ +# define MAKE_ID(a, b, c, d) ( (int)(d) << 24 | (int)(c) << 16 | (b) << 8 | (a) ) #endif -#define ID_NEW(a) if( (a) && (a)->id.newid ) (a)= (void *)(a)->id.newid +#define DATA MAKE_ID('D', 'A', 'T', 'A') +#define GLOB MAKE_ID('G', 'L', 'O', 'B') -#define DATA MAKE_ID('D','A','T','A') -#define GLOB MAKE_ID('G','L','O','B') +#define DNA1 MAKE_ID('D', 'N', 'A', '1') +#define TEST MAKE_ID('T', 'E', 'S', 'T') /* used as preview between 'REND' and 'GLOB' */ +#define REND MAKE_ID('R', 'E', 'N', 'D') +#define USER MAKE_ID('U', 'S', 'E', 'R') -#define DNA1 MAKE_ID('D','N','A','1') -#define TEST MAKE_ID('T','E','S','T') /* used as preview between 'REND' and 'GLOB' */ -#define REND MAKE_ID('R','E','N','D') -#define USER MAKE_ID('U','S','E','R') - -#define ENDB MAKE_ID('E','N','D','B') +#define ENDB MAKE_ID('E', 'N', 'D', 'B') /* Bit operations */ -#define BTST(a,b) ( ( (a) & 1<<(b) )!=0 ) -#define BNTST(a,b) ( ( (a) & 1<<(b) )==0 ) -#define BTST2(a,b,c) ( BTST( (a), (b) ) || BTST( (a), (c) ) ) -#define BSET(a,b) ( (a) | 1<<(b) ) -#define BCLR(a,b) ( (a) & ~(1<<(b)) ) +#define BTST(a, b) ( ( (a) & 1 << (b) ) != 0) +#define BNTST(a, b) ( ( (a) & 1 << (b) ) == 0) +#define BTST2(a, b, c) (BTST( (a), (b) ) || BTST( (a), (c) ) ) +#define BSET(a, b) ( (a) | 1 << (b) ) +#define BCLR(a, b) ( (a) & ~(1 << (b)) ) /* bit-row */ -#define BROW(min, max) (((max)>=31? 0xFFFFFFFF: (1<<(max+1))-1) - ((min)? ((1<<(min))-1):0) ) +#define BROW(min, max) (((max) >= 31 ? 0xFFFFFFFF : (1 << (max + 1)) - 1) - ((min) ? ((1 << (min)) - 1) : 0) ) #ifdef __cplusplus } diff --git a/source/blender/blenkernel/BKE_writeffmpeg.h b/source/blender/blenkernel/BKE_writeffmpeg.h index f8382f75c0a..8a11d48d063 100644 --- a/source/blender/blenkernel/BKE_writeffmpeg.h +++ b/source/blender/blenkernel/BKE_writeffmpeg.h @@ -38,12 +38,12 @@ extern "C" { #endif -#define FFMPEG_MPEG1 0 -#define FFMPEG_MPEG2 1 -#define FFMPEG_MPEG4 2 -#define FFMPEG_AVI 3 -#define FFMPEG_MOV 4 -#define FFMPEG_DV 5 +#define FFMPEG_MPEG1 0 +#define FFMPEG_MPEG2 1 +#define FFMPEG_MPEG4 2 +#define FFMPEG_AVI 3 +#define FFMPEG_MOV 4 +#define FFMPEG_DV 5 #define FFMPEG_H264 6 #define FFMPEG_XVID 7 #define FFMPEG_FLV 8 @@ -52,14 +52,14 @@ extern "C" { #define FFMPEG_WAV 11 #define FFMPEG_MP3 12 -#define FFMPEG_PRESET_NONE 0 -#define FFMPEG_PRESET_DVD 1 -#define FFMPEG_PRESET_SVCD 2 -#define FFMPEG_PRESET_VCD 3 -#define FFMPEG_PRESET_DV 4 -#define FFMPEG_PRESET_H264 5 -#define FFMPEG_PRESET_THEORA 6 -#define FFMPEG_PRESET_XVID 7 +#define FFMPEG_PRESET_NONE 0 +#define FFMPEG_PRESET_DVD 1 +#define FFMPEG_PRESET_SVCD 2 +#define FFMPEG_PRESET_VCD 3 +#define FFMPEG_PRESET_DV 4 +#define FFMPEG_PRESET_H264 5 +#define FFMPEG_PRESET_THEORA 6 +#define FFMPEG_PRESET_XVID 7 struct IDProperty; struct RenderData; @@ -69,8 +69,8 @@ struct Scene; int BKE_ffmpeg_start(struct Scene *scene, struct RenderData *rd, int rectx, int recty, struct ReportList *reports); void BKE_ffmpeg_end(void); int BKE_ffmpeg_append(struct RenderData *rd, int start_frame, int frame, int *pixels, - int rectx, int recty, struct ReportList *reports); -void BKE_ffmpeg_filepath_get(char* string, struct RenderData* rd); + int rectx, int recty, struct ReportList *reports); +void BKE_ffmpeg_filepath_get(char *string, struct RenderData *rd); void BKE_ffmpeg_preset_set(struct RenderData *rd, int preset); void BKE_ffmpeg_image_type_verify(struct RenderData *rd, struct ImageFormatData *imf); diff --git a/source/blender/blenkernel/depsgraph_private.h b/source/blender/blenkernel/depsgraph_private.h index c5e2f0900f0..512b799aeed 100644 --- a/source/blender/blenkernel/depsgraph_private.h +++ b/source/blender/blenkernel/depsgraph_private.h @@ -35,8 +35,8 @@ #include "BKE_constraint.h" -#define DEPSX 5.0f -#define DEPSY 1.8f +#define DEPSX 5.0f +#define DEPSY 1.8f #define DAGQUEUEALLOC 50 @@ -48,33 +48,31 @@ enum { -typedef struct DagAdjList -{ +typedef struct DagAdjList { struct DagNode *node; short type; - int count; // number of identical arcs + int count; /* number of identical arcs */ unsigned int lay; // for flushing redraw/rebuild events const char *name; struct DagAdjList *next; } DagAdjList; -typedef struct DagNode -{ +typedef struct DagNode { int color; short type; float x, y, k; - void * ob; - void * first_ancestor; + void *ob; + void *first_ancestor; int ancestor_count; - unsigned int lay; // accumulated layers of its relations + itself - unsigned int scelay; // layers due to being in scene - uint64_t customdata_mask; // customdata mask - int lasttime; // if lasttime != DagForest->time, this node was not evaluated yet for flushing - int BFS_dist; // BFS distance - int DFS_dist; // DFS distance - int DFS_dvtm; // DFS discovery time - int DFS_fntm; // DFS Finishing time + unsigned int lay; /* accumulated layers of its relations + itself */ + unsigned int scelay; /* layers due to being in scene */ + uint64_t customdata_mask; /* customdata mask */ + int lasttime; /* if lasttime != DagForest->time, this node was not evaluated yet for flushing */ + int BFS_dist; /* BFS distance */ + int DFS_dist; /* DFS distance */ + int DFS_dvtm; /* DFS discovery time */ + int DFS_fntm; /* DFS Finishing time */ struct DagAdjList *child; struct DagAdjList *parent; struct DagNode *next; @@ -85,8 +83,7 @@ typedef struct DagNodeQueueElem { struct DagNodeQueueElem *next; } DagNodeQueueElem; -typedef struct DagNodeQueue -{ +typedef struct DagNodeQueue { DagNodeQueueElem *first; DagNodeQueueElem *last; int count; @@ -95,37 +92,36 @@ typedef struct DagNodeQueue } DagNodeQueue; // forest as we may have more than one DAG unnconected -typedef struct DagForest -{ +typedef struct DagForest { ListBase DagNode; struct GHash *nodeHash; int numNodes; int is_acyclic; - int time; // for flushing/tagging, compare with node->lasttime + int time; /* for flushing/tagging, compare with node->lasttime */ } DagForest; // queue operations -DagNodeQueue * queue_create (int slots); +DagNodeQueue *queue_create(int slots); void queue_raz(DagNodeQueue *queue); void push_queue(DagNodeQueue *queue, DagNode *node); void push_stack(DagNodeQueue *queue, DagNode *node); -DagNode * pop_queue(DagNodeQueue *queue); -DagNode * get_top_node_queue(DagNodeQueue *queue); +DagNode *pop_queue(DagNodeQueue *queue); +DagNode *get_top_node_queue(DagNodeQueue *queue); // Dag management DagForest *getMainDag(void); void setMainDag(DagForest *dag); -DagForest * dag_init(void); -DagNode * dag_find_node (DagForest *forest, void * fob); -DagNode * dag_add_node (DagForest *forest, void * fob); -DagNode * dag_get_node (DagForest *forest, void * fob); -DagNode * dag_get_sub_node (DagForest *forest, void * fob); +DagForest *dag_init(void); +DagNode *dag_find_node(DagForest *forest, void *fob); +DagNode *dag_add_node(DagForest *forest, void *fob); +DagNode *dag_get_node(DagForest *forest, void *fob); +DagNode *dag_get_sub_node(DagForest *forest, void *fob); void dag_add_relation(DagForest *forest, DagNode *fob1, DagNode *fob2, short rel, const char *name); void graph_bfs(void); -DagNodeQueue * graph_dfs(void); +DagNodeQueue *graph_dfs(void); void set_node_xy(DagNode *node, float x, float y); void graph_print_queue(DagNodeQueue *nqueue); diff --git a/source/blender/blenkernel/nla_private.h b/source/blender/blenkernel/nla_private.h index 51a7ac7ee62..941a74ec2ab 100644 --- a/source/blender/blenkernel/nla_private.h +++ b/source/blender/blenkernel/nla_private.h @@ -39,23 +39,23 @@ typedef struct NlaEvalStrip { struct NlaEvalStrip *next, *prev; - NlaTrack *track; /* track that this strip belongs to */ - NlaStrip *strip; /* strip that's being used */ + NlaTrack *track; /* track that this strip belongs to */ + NlaStrip *strip; /* strip that's being used */ - short track_index; /* the index of the track within the list */ - short strip_mode; /* which end of the strip are we looking at */ + short track_index; /* the index of the track within the list */ + short strip_mode; /* which end of the strip are we looking at */ - float strip_time; /* time at which which strip is being evaluated */ + float strip_time; /* time at which which strip is being evaluated */ } NlaEvalStrip; /* NlaEvalStrip->strip_mode */ enum { - /* standard evaluation */ + /* standard evaluation */ NES_TIME_BEFORE = -1, NES_TIME_WITHIN, NES_TIME_AFTER, - /* transition-strip evaluations */ + /* transition-strip evaluations */ NES_TIME_TRANSITION_START, NES_TIME_TRANSITION_END, } eNlaEvalStrip_StripMode; @@ -66,11 +66,11 @@ enum { typedef struct NlaEvalChannel { struct NlaEvalChannel *next, *prev; - PointerRNA ptr; /* pointer to struct containing property to use */ - PropertyRNA *prop; /* RNA-property type to use (should be in the struct given) */ - int index; /* array index (where applicable) */ + PointerRNA ptr; /* pointer to struct containing property to use */ + PropertyRNA *prop; /* RNA-property type to use (should be in the struct given) */ + int index; /* array index (where applicable) */ - float value; /* value of this channel */ + float value; /* value of this channel */ } NlaEvalChannel; /* --------------- NLA Functions (not to be used as a proper API) ----------------------- */ diff --git a/source/blender/blenlib/BLI_args.h b/source/blender/blenlib/BLI_args.h index 7a7529fa3c3..7a240e0e08a 100644 --- a/source/blender/blenlib/BLI_args.h +++ b/source/blender/blenlib/BLI_args.h @@ -37,7 +37,7 @@ struct bArgs; typedef struct bArgs bArgs; /* returns the number of extra arguments consumed by the function. 0 is normal value, -1 stops parsing arguments, other negative indicates skip */ -typedef int (*BA_ArgCallback)(int argc, const char **argv, void *data); +typedef int (*BA_ArgCallback)(int argc, const char **argv, void *data); struct bArgs *BLI_argsInit(int argc, const char **argv); void BLI_argsFree(struct bArgs *ba); diff --git a/source/blender/blenlib/BLI_array.h b/source/blender/blenlib/BLI_array.h index 7069732eeb6..4fbed23d5e6 100644 --- a/source/blender/blenlib/BLI_array.h +++ b/source/blender/blenlib/BLI_array.h @@ -45,7 +45,7 @@ * * for (i=0; i<10; i++) { * BLI_array_grow_one(arr); - * arr[i] = something; + * arr[i] = something; * } * BLI_array_free(arr); * @@ -105,7 +105,7 @@ arr, \ sizeof(*arr) * _##arr##_count) \ ), \ - (void) (arr && ((void *)(arr) != (void*)_##arr##_static ? \ + (void) (arr && ((void *)(arr) != (void *)_##arr##_static ? \ (MEM_freeN(arr), arr) : \ arr) \ ), \ @@ -118,7 +118,7 @@ /* grow an array by a specified number of items */ #define BLI_array_grow_items(arr, num) ( \ ((void *)(arr) == NULL && (void *)(_##arr##_static) != NULL) ? \ - ((arr = (void*)_##arr##_static), (_##arr##_count += num)) : \ + ((arr = (void *)_##arr##_static), (_##arr##_count += num)) : \ _bli_array_grow_items(arr, num) \ ) diff --git a/source/blender/blenlib/BLI_bitmap.h b/source/blender/blenlib/BLI_bitmap.h index f19d6d6f465..02e5d6bd797 100644 --- a/source/blender/blenlib/BLI_bitmap.h +++ b/source/blender/blenlib/BLI_bitmap.h @@ -26,7 +26,7 @@ #ifndef __BLI_BITMAP_H__ #define __BLI_BITMAP_H__ -typedef unsigned int* BLI_bitmap; +typedef unsigned int *BLI_bitmap; /* warning: the bitmap does not keep track of its own size or check * for out-of-bounds access */ @@ -49,7 +49,7 @@ typedef unsigned int* BLI_bitmap; * with MEM_freeN() */ #define BLI_BITMAP_NEW(_tot, _alloc_string) \ ((BLI_bitmap)MEM_callocN(BLI_BITMAP_SIZE(_tot), \ - _alloc_string)) + _alloc_string)) /* get the value of a single bit at '_index' */ #define BLI_BITMAP_GET(_bitmap, _index) \ @@ -73,7 +73,7 @@ typedef unsigned int* BLI_bitmap; BLI_BITMAP_SET(_bitmap, _index); \ else \ BLI_BITMAP_CLEAR(_bitmap, _index); \ - } while(0) + } while (0) /* resize bitmap to have space for '_tot' bits */ #define BLI_BITMAP_RESIZE(_bitmap, _tot) \ diff --git a/source/blender/blenlib/BLI_bpath.h b/source/blender/blenlib/BLI_bpath.h index 27b373e6eb8..52b839d11a9 100644 --- a/source/blender/blenlib/BLI_bpath.h +++ b/source/blender/blenlib/BLI_bpath.h @@ -48,13 +48,13 @@ void BLI_bpath_traverse_id_list(struct Main *bmain, struct ListBase *lb, BPathVi void BLI_bpath_traverse_main(struct Main *bmain, BPathVisitor visit_cb, const int flag, void *userdata); int BLI_bpath_relocate_visitor(void *oldbasepath, char *path_dst, const char *path_src); -#define BLI_BPATH_TRAVERSE_ABS (1<<0) /* convert paths to absolute */ -#define BLI_BPATH_TRAVERSE_SKIP_LIBRARY (1<<2) /* skip library paths */ -#define BLI_BPATH_TRAVERSE_SKIP_PACKED (1<<3) /* skip packed data */ -#define BLI_BPATH_TRAVERSE_SKIP_MULTIFILE (1<<4) /* skip paths where a single dir is used with an array of files, eg. - * sequence strip images and pointcache. in this case only use the first - * file, this is needed for directory manipulation functions which might - * otherwise modify the same directory multiple times */ +#define BLI_BPATH_TRAVERSE_ABS (1 << 0) /* convert paths to absolute */ +#define BLI_BPATH_TRAVERSE_SKIP_LIBRARY (1 << 2) /* skip library paths */ +#define BLI_BPATH_TRAVERSE_SKIP_PACKED (1 << 3) /* skip packed data */ +#define BLI_BPATH_TRAVERSE_SKIP_MULTIFILE (1 << 4) /* skip paths where a single dir is used with an array of files, eg. + * sequence strip images and pointcache. in this case only use the first + * file, this is needed for directory manipulation functions which might + * otherwise modify the same directory multiple times */ /* high level funcs */ diff --git a/source/blender/blenlib/BLI_callbacks.h b/source/blender/blenlib/BLI_callbacks.h index bfc336781aa..1e95510f6ec 100644 --- a/source/blender/blenlib/BLI_callbacks.h +++ b/source/blender/blenlib/BLI_callbacks.h @@ -56,7 +56,7 @@ typedef enum { typedef struct { struct bCallbackFuncStore *next, *prev; - void (* func)(struct Main *, struct ID *, void *arg); + void (*func)(struct Main *, struct ID *, void *arg); void *arg; short alloc; } bCallbackFuncStore; @@ -70,6 +70,6 @@ void BLI_callback_global_finalize(void); /* This is blenlib internal only, unrelated to above */ -void callLocalErrorCallBack(const char* msg); +void callLocalErrorCallBack(const char *msg); #endif /* __BLI_CALLBACKS_H__ */ diff --git a/source/blender/blenlib/BLI_dlrbTree.h b/source/blender/blenlib/BLI_dlrbTree.h index 7443d7a07fe..92356b24403 100644 --- a/source/blender/blenlib/BLI_dlrbTree.h +++ b/source/blender/blenlib/BLI_dlrbTree.h @@ -58,7 +58,7 @@ typedef struct DLRBT_Node { /* Red/Black defines for tree_col */ typedef enum eDLRBT_Colors { - DLRBT_BLACK= 0, + DLRBT_BLACK = 0, DLRBT_RED, } eDLRBT_Colors; @@ -67,10 +67,10 @@ typedef enum eDLRBT_Colors { /* The Tree Data */ typedef struct DLRBT_Tree { /* ListBase capabilities */ - void *first, *last; /* these should be based on DLRBT_Node-s */ + void *first, *last; /* these should be based on DLRBT_Node-s */ /* Root Node */ - void *root; /* this should be based on DLRBT_Node-s */ + void *root; /* this should be based on DLRBT_Node-s */ } DLRBT_Tree; /* Callback Types --------------------------------- */ @@ -87,7 +87,7 @@ typedef short (*DLRBT_Comparator_FP)(void *node, void *data); typedef DLRBT_Node *(*DLRBT_NAlloc_FP)(void *data); /* update an existing node instance accordingly to be in sync with the given data * - * - node: <DLRBT_Node> the node to update + * - node: <DLRBT_Node> the node to update * - data: pointer to the relevant data or values stored in the bitpattern dependent on the function */ typedef void (*DLRBT_NUpdate_FP)(void *node, void *data); @@ -137,7 +137,7 @@ short BLI_dlrbTree_contains(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, void * /* Add the given data to the tree, and return the node added */ // NOTE: for duplicates, the update_cb is called (if available), and the existing node is returned DLRBT_Node *BLI_dlrbTree_add(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, - DLRBT_NAlloc_FP new_cb, DLRBT_NUpdate_FP update_cb, void *data); + DLRBT_NAlloc_FP new_cb, DLRBT_NUpdate_FP update_cb, void *data); /* Remove the given element from the tree and balance again */ diff --git a/source/blender/blenlib/BLI_dynlib.h b/source/blender/blenlib/BLI_dynlib.h index d7c8706a7b8..7d5eb888021 100644 --- a/source/blender/blenlib/BLI_dynlib.h +++ b/source/blender/blenlib/BLI_dynlib.h @@ -35,9 +35,9 @@ typedef struct DynamicLibrary DynamicLibrary; DynamicLibrary *BLI_dynlib_open(char *name); -void *BLI_dynlib_find_symbol(DynamicLibrary* lib, const char *symname); -char *BLI_dynlib_get_error_as_string(DynamicLibrary* lib); -void BLI_dynlib_close(DynamicLibrary* lib); +void *BLI_dynlib_find_symbol(DynamicLibrary *lib, const char *symname); +char *BLI_dynlib_get_error_as_string(DynamicLibrary *lib); +void BLI_dynlib_close(DynamicLibrary *lib); #endif /* __BLI_DYNLIB_H__ */ diff --git a/source/blender/blenlib/BLI_dynstr.h b/source/blender/blenlib/BLI_dynstr.h index f2e62d6e6bd..3b7f2d6bbaf 100644 --- a/source/blender/blenlib/BLI_dynstr.h +++ b/source/blender/blenlib/BLI_dynstr.h @@ -42,23 +42,23 @@ struct DynStr; - /** The abstract DynStr type */ +/** The abstract DynStr type */ typedef struct DynStr DynStr; - /** - * Create a new DynStr. - * - * \return Pointer to a new DynStr. - */ -DynStr* BLI_dynstr_new (void); +/** + * Create a new DynStr. + * + * \return Pointer to a new DynStr. + */ +DynStr *BLI_dynstr_new(void); - /** - * Append a c-string to a DynStr. - * - * \param ds The DynStr to append to. - * \param cstr The c-string to append. - */ -void BLI_dynstr_append (DynStr *ds, const char *cstr); +/** + * Append a c-string to a DynStr. + * + * \param ds The DynStr to append to. + * \param cstr The c-string to append. + */ +void BLI_dynstr_append(DynStr *ds, const char *cstr); /** * Append a length clamped c-string to a DynStr. @@ -67,38 +67,38 @@ void BLI_dynstr_append (DynStr *ds, const char *cstr); * \param cstr The c-string to append. * \param len The maximum length of the c-string to copy. */ -void BLI_dynstr_nappend (DynStr *ds, const char *cstr, int len); +void BLI_dynstr_nappend(DynStr *ds, const char *cstr, int len); - /** - * Append a c-string to a DynStr, but with formatting like printf. - * - * \param ds The DynStr to append to. - * \param format The printf format string to use. - */ -void BLI_dynstr_appendf (DynStr *ds, const char *format, ...) +/** + * Append a c-string to a DynStr, but with formatting like printf. + * + * \param ds The DynStr to append to. + * \param format The printf format string to use. + */ +void BLI_dynstr_appendf(DynStr *ds, const char *format, ...) #ifdef __GNUC__ -__attribute__ ((format (printf, 2, 3))) +__attribute__ ((format(printf, 2, 3))) #endif ; -void BLI_dynstr_vappendf (DynStr *ds, const char *format, va_list args); +void BLI_dynstr_vappendf(DynStr *ds, const char *format, va_list args); - /** - * Find the length of a DynStr. - * - * \param ds The DynStr of interest. - * \return The length of \a ds. - */ -int BLI_dynstr_get_len (DynStr *ds); +/** + * Find the length of a DynStr. + * + * \param ds The DynStr of interest. + * \return The length of \a ds. + */ +int BLI_dynstr_get_len(DynStr *ds); - /** - * Get a DynStr's contents as a c-string. - * <i> The returned c-string should be freed - * using MEM_freeN. </i> - * - * \param ds The DynStr of interest. - * \return The contents of \a ds as a c-string. - */ -char* BLI_dynstr_get_cstring (DynStr *ds); +/** + * Get a DynStr's contents as a c-string. + * <i> The returned c-string should be freed + * using MEM_freeN. </i> + * + * \param ds The DynStr of interest. + * \return The contents of \a ds as a c-string. + */ +char *BLI_dynstr_get_cstring(DynStr *ds); /** * Get a DynStr's contents as a c-string. @@ -109,14 +109,14 @@ char* BLI_dynstr_get_cstring (DynStr *ds); * \param str The string to fill. * \return The contents of \a ds as a c-string. */ -void BLI_dynstr_get_cstring_ex (DynStr *ds, char *str); +void BLI_dynstr_get_cstring_ex(DynStr *ds, char *str); - /** - * Free the DynStr - * - * \param ds The DynStr to free. - */ -void BLI_dynstr_free (DynStr *ds); +/** + * Free the DynStr + * + * \param ds The DynStr to free. + */ +void BLI_dynstr_free(DynStr *ds); #endif diff --git a/source/blender/blenlib/BLI_edgehash.h b/source/blender/blenlib/BLI_edgehash.h index b00ac683eb1..8d7d3b05653 100644 --- a/source/blender/blenlib/BLI_edgehash.h +++ b/source/blender/blenlib/BLI_edgehash.h @@ -39,62 +39,62 @@ struct EdgeHashIterator; typedef struct EdgeHash EdgeHash; typedef struct EdgeHashIterator EdgeHashIterator; -typedef void (*EdgeHashFreeFP)(void *key); +typedef void (*EdgeHashFreeFP)(void *key); -EdgeHash* BLI_edgehash_new (void); -void BLI_edgehash_free (EdgeHash *eh, EdgeHashFreeFP valfreefp); +EdgeHash *BLI_edgehash_new(void); +void BLI_edgehash_free(EdgeHash *eh, EdgeHashFreeFP valfreefp); - /* Insert edge (v0,v1) into hash with given value, does - * not check for duplicates. - */ -void BLI_edgehash_insert (EdgeHash *eh, unsigned int v0, unsigned int v1, void *val); +/* Insert edge (v0,v1) into hash with given value, does + * not check for duplicates. + */ +void BLI_edgehash_insert(EdgeHash *eh, unsigned int v0, unsigned int v1, void *val); - /* Return value for given edge (v0,v1), or NULL if - * if key does not exist in hash. (If need exists - * to differentiate between key-value being NULL and - * lack of key then see BLI_edgehash_lookup_p(). - */ -void* BLI_edgehash_lookup (EdgeHash *eh, unsigned int v0, unsigned int v1); +/* Return value for given edge (v0,v1), or NULL if + * if key does not exist in hash. (If need exists + * to differentiate between key-value being NULL and + * lack of key then see BLI_edgehash_lookup_p(). + */ +void *BLI_edgehash_lookup(EdgeHash *eh, unsigned int v0, unsigned int v1); - /* Return pointer to value for given edge (v0,v1), - * or NULL if key does not exist in hash. - */ -void** BLI_edgehash_lookup_p (EdgeHash *eh, unsigned int v0, unsigned int v1); +/* Return pointer to value for given edge (v0,v1), + * or NULL if key does not exist in hash. + */ +void **BLI_edgehash_lookup_p(EdgeHash *eh, unsigned int v0, unsigned int v1); - /* Return boolean true/false if edge (v0,v1) in hash. */ -int BLI_edgehash_haskey (EdgeHash *eh, unsigned int v0, unsigned int v1); +/* Return boolean true/false if edge (v0,v1) in hash. */ +int BLI_edgehash_haskey(EdgeHash *eh, unsigned int v0, unsigned int v1); - /* Return number of keys in hash. */ -int BLI_edgehash_size (EdgeHash *eh); +/* Return number of keys in hash. */ +int BLI_edgehash_size(EdgeHash *eh); - /* Remove all edges from hash. */ -void BLI_edgehash_clear (EdgeHash *eh, EdgeHashFreeFP valfreefp); +/* Remove all edges from hash. */ +void BLI_edgehash_clear(EdgeHash *eh, EdgeHashFreeFP valfreefp); /***/ - /** - * Create a new EdgeHashIterator. The hash table must not be mutated - * while the iterator is in use, and the iterator will step exactly - * BLI_edgehash_size(gh) times before becoming done. - */ -EdgeHashIterator* BLI_edgehashIterator_new (EdgeHash *eh); +/** + * Create a new EdgeHashIterator. The hash table must not be mutated + * while the iterator is in use, and the iterator will step exactly + * BLI_edgehash_size(gh) times before becoming done. + */ +EdgeHashIterator *BLI_edgehashIterator_new(EdgeHash *eh); + +/* Free an EdgeHashIterator. */ +void BLI_edgehashIterator_free(EdgeHashIterator *ehi); - /* Free an EdgeHashIterator. */ -void BLI_edgehashIterator_free (EdgeHashIterator *ehi); +/* Retrieve the key from an iterator. */ +void BLI_edgehashIterator_getKey(EdgeHashIterator *ehi, unsigned int *v0_r, unsigned int *v1_r); - /* Retrieve the key from an iterator. */ -void BLI_edgehashIterator_getKey (EdgeHashIterator *ehi, unsigned int *v0_r, unsigned int *v1_r); - - /* Retrieve the value from an iterator. */ -void* BLI_edgehashIterator_getValue (EdgeHashIterator *ehi); +/* Retrieve the value from an iterator. */ +void *BLI_edgehashIterator_getValue(EdgeHashIterator *ehi); - /* Set the value for an iterator. */ -void BLI_edgehashIterator_setValue (EdgeHashIterator *ehi, void *val); +/* Set the value for an iterator. */ +void BLI_edgehashIterator_setValue(EdgeHashIterator *ehi, void *val); - /* Steps the iterator to the next index. */ -void BLI_edgehashIterator_step (EdgeHashIterator *ehi); +/* Steps the iterator to the next index. */ +void BLI_edgehashIterator_step(EdgeHashIterator *ehi); - /* Determine if an iterator is done. */ -int BLI_edgehashIterator_isDone (EdgeHashIterator *ehi); +/* Determine if an iterator is done. */ +int BLI_edgehashIterator_isDone(EdgeHashIterator *ehi); #endif diff --git a/source/blender/blenlib/BLI_fileops.h b/source/blender/blenlib/BLI_fileops.h index 1bf4efca8a0..ca810ee5b93 100644 --- a/source/blender/blenlib/BLI_fileops.h +++ b/source/blender/blenlib/BLI_fileops.h @@ -84,10 +84,10 @@ char *BLI_file_ungzip_to_mem(const char *from_file, int *size_r); size_t BLI_file_descriptor_size(int file); size_t BLI_file_size(const char *file); - /* compare if one was last modified before the other */ +/* compare if one was last modified before the other */ int BLI_file_older(const char *file1, const char *file2); - /* read ascii file as lines, empty list if reading fails */ +/* read ascii file as lines, empty list if reading fails */ struct LinkNode *BLI_file_read_as_lines(const char *file); void BLI_file_free_lines(struct LinkNode *lines); diff --git a/source/blender/blenlib/BLI_fileops_types.h b/source/blender/blenlib/BLI_fileops_types.h index d9f8549e8f5..a19909a8f26 100644 --- a/source/blender/blenlib/BLI_fileops_types.h +++ b/source/blender/blenlib/BLI_fileops_types.h @@ -41,35 +41,34 @@ typedef unsigned int mode_t; struct ImBuf; -struct direntry{ - char *string; - mode_t type; - char *relname; - char *path; -#if (defined(WIN32) || defined(WIN64)) && (_MSC_VER>=1500) +struct direntry { + char *string; + mode_t type; + char *relname; + char *path; +#if (defined(WIN32) || defined(WIN64)) && (_MSC_VER >= 1500) struct _stat64 s; #elif defined(__MINGW32__) struct _stati64 s; #else - struct stat s; + struct stat s; #endif unsigned int flags; - char size[16]; - char mode1[4]; - char mode2[4]; - char mode3[4]; - char owner[16]; - char time[8]; - char date[16]; - char extra[16]; - void *poin; - int nr; + char size[16]; + char mode1[4]; + char mode2[4]; + char mode3[4]; + char owner[16]; + char time[8]; + char date[16]; + char extra[16]; + void *poin; + int nr; struct ImBuf *image; unsigned int selflag; /* selection flag */ }; -struct dirlink -{ +struct dirlink { struct dirlink *next, *prev; char *name; }; diff --git a/source/blender/blenlib/BLI_fnmatch.h b/source/blender/blenlib/BLI_fnmatch.h index 5914d150d56..6c466759010 100644 --- a/source/blender/blenlib/BLI_fnmatch.h +++ b/source/blender/blenlib/BLI_fnmatch.h @@ -17,23 +17,23 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef __BLI_FNMATCH_H__ -#define __BLI_FNMATCH_H__ +#ifndef __BLI_FNMATCH_H__ +#define __BLI_FNMATCH_H__ /** \file BLI_fnmatch.h * \ingroup bli */ -#ifdef __cplusplus +#ifdef __cplusplus extern "C" { #endif -#if defined (__cplusplus) || (defined (__STDC__) && __STDC__) -#undef __P -#define __P(protos) protos +#if defined(__cplusplus) || (defined(__STDC__) && __STDC__) +#undef __P +#define __P(protos) protos #else /* Not C++ or ANSI C. */ -#undef __P -#define __P(protos) () +#undef __P +#define __P(protos) () /* We can get away without defining `const' here only because in this file * it is used only inside the prototype for `fnmatch', which is elided in * non-ANSI C where `const' is problematical. */ @@ -42,30 +42,30 @@ extern "C" { /* We #undef these before defining them because some losing systems * (HP-UX A.08.07 for example) define these in <unistd.h>. */ -#undef FNM_PATHNAME -#undef FNM_NOESCAPE -#undef FNM_PERIOD +#undef FNM_PATHNAME +#undef FNM_NOESCAPE +#undef FNM_PERIOD /* Bits set in the FLAGS argument to `fnmatch'. */ -#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */ -#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ -#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ - -#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE) || defined( __SUNPRO_C) -#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ -#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ -#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ +#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */ +#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ +#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ + +#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined(_GNU_SOURCE) || defined(__SUNPRO_C) +#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ +#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ +#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ #endif /* Value returned by `fnmatch' if STRING does not match PATTERN. */ -#define FNM_NOMATCH 1 +#define FNM_NOMATCH 1 /* Match STRING against the filename pattern PATTERN, * returning zero if it matches, FNM_NOMATCH if not. */ -extern int fnmatch __P ((const char *__pattern, const char *__string, - int __flags)); +extern int fnmatch __P((const char *__pattern, const char *__string, + int __flags)); -#ifdef __cplusplus +#ifdef __cplusplus } #endif diff --git a/source/blender/blenlib/BLI_ghash.h b/source/blender/blenlib/BLI_ghash.h index b178538edf2..b2532d0e486 100644 --- a/source/blender/blenlib/BLI_ghash.h +++ b/source/blender/blenlib/BLI_ghash.h @@ -37,10 +37,10 @@ extern "C" { #endif -typedef unsigned int (*GHashHashFP) (const void *key); -typedef int (*GHashCmpFP) (const void *a, const void *b); -typedef void (*GHashKeyFreeFP) (void *key); -typedef void (*GHashValFreeFP) (void *val); +typedef unsigned int (*GHashHashFP) (const void *key); +typedef int (*GHashCmpFP) (const void *a, const void *b); +typedef void (*GHashKeyFreeFP) (void *key); +typedef void (*GHashValFreeFP) (void *val); typedef struct Entry { struct Entry *next; @@ -49,8 +49,8 @@ typedef struct Entry { } Entry; typedef struct GHash { - GHashHashFP hashfp; - GHashCmpFP cmpfp; + GHashHashFP hashfp; + GHashCmpFP cmpfp; Entry **buckets; struct BLI_mempool *entrypool; @@ -65,71 +65,71 @@ typedef struct GHashIterator { /* *** */ -GHash* BLI_ghash_new (GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info); -void BLI_ghash_free (GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp); +GHash *BLI_ghash_new(GHashHashFP hashfp, GHashCmpFP cmpfp, const char *info); +void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp); void BLI_ghash_insert(GHash *gh, void *key, void *val); -void * BLI_ghash_lookup(GHash *gh, const void *key); +void *BLI_ghash_lookup(GHash *gh, const void *key); int BLI_ghash_remove(GHash *gh, void *key, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp); int BLI_ghash_haskey(GHash *gh, void *key); -int BLI_ghash_size (GHash *gh); +int BLI_ghash_size(GHash *gh); /* *** */ - /** - * Create a new GHashIterator. The hash table must not be mutated - * while the iterator is in use, and the iterator will step exactly - * BLI_ghash_size(gh) times before becoming done. - * - * \param gh The GHash to iterate over. - * \return Pointer to a new DynStr. - */ -GHashIterator* BLI_ghashIterator_new (GHash *gh); - /** - * Init an already allocated GHashIterator. The hash table must not - * be mutated while the iterator is in use, and the iterator will - * step exactly BLI_ghash_size(gh) times before becoming done. - * - * \param ghi The GHashIterator to initialize. - * \param gh The GHash to iterate over. - */ +/** + * Create a new GHashIterator. The hash table must not be mutated + * while the iterator is in use, and the iterator will step exactly + * BLI_ghash_size(gh) times before becoming done. + * + * \param gh The GHash to iterate over. + * \return Pointer to a new DynStr. + */ +GHashIterator *BLI_ghashIterator_new(GHash *gh); +/** + * Init an already allocated GHashIterator. The hash table must not + * be mutated while the iterator is in use, and the iterator will + * step exactly BLI_ghash_size(gh) times before becoming done. + * + * \param ghi The GHashIterator to initialize. + * \param gh The GHash to iterate over. + */ void BLI_ghashIterator_init(GHashIterator *ghi, GHash *gh); - /** - * Free a GHashIterator. - * - * \param ghi The iterator to free. - */ -void BLI_ghashIterator_free (GHashIterator *ghi); - - /** - * Retrieve the key from an iterator. - * - * \param ghi The iterator. - * \return The key at the current index, or NULL if the - * iterator is done. - */ -void* BLI_ghashIterator_getKey (GHashIterator *ghi); - /** - * Retrieve the value from an iterator. - * - * \param ghi The iterator. - * \return The value at the current index, or NULL if the - * iterator is done. - */ -void* BLI_ghashIterator_getValue (GHashIterator *ghi); - /** - * Steps the iterator to the next index. - * - * \param ghi The iterator. - */ -void BLI_ghashIterator_step (GHashIterator *ghi); - /** - * Determine if an iterator is done (has reached the end of - * the hash table). - * - * \param ghi The iterator. - * \return True if done, False otherwise. - */ -int BLI_ghashIterator_isDone (GHashIterator *ghi); +/** + * Free a GHashIterator. + * + * \param ghi The iterator to free. + */ +void BLI_ghashIterator_free(GHashIterator *ghi); + +/** + * Retrieve the key from an iterator. + * + * \param ghi The iterator. + * \return The key at the current index, or NULL if the + * iterator is done. + */ +void *BLI_ghashIterator_getKey(GHashIterator *ghi); +/** + * Retrieve the value from an iterator. + * + * \param ghi The iterator. + * \return The value at the current index, or NULL if the + * iterator is done. + */ +void *BLI_ghashIterator_getValue(GHashIterator *ghi); +/** + * Steps the iterator to the next index. + * + * \param ghi The iterator. + */ +void BLI_ghashIterator_step(GHashIterator *ghi); +/** + * Determine if an iterator is done (has reached the end of + * the hash table). + * + * \param ghi The iterator. + * \return True if done, False otherwise. + */ +int BLI_ghashIterator_isDone(GHashIterator *ghi); #define GHASH_ITER(gh_iter_, ghash_) \ for (BLI_ghashIterator_init(&gh_iter_, ghash_); \ @@ -138,24 +138,24 @@ int BLI_ghashIterator_isDone (GHashIterator *ghi); /* *** */ -unsigned int BLI_ghashutil_ptrhash (const void *key); -int BLI_ghashutil_ptrcmp (const void *a, const void *b); +unsigned int BLI_ghashutil_ptrhash(const void *key); +int BLI_ghashutil_ptrcmp(const void *a, const void *b); -unsigned int BLI_ghashutil_strhash (const void *key); -int BLI_ghashutil_strcmp (const void *a, const void *b); +unsigned int BLI_ghashutil_strhash(const void *key); +int BLI_ghashutil_strcmp(const void *a, const void *b); -unsigned int BLI_ghashutil_inthash (const void *ptr); -int BLI_ghashutil_intcmp (const void *a, const void *b); +unsigned int BLI_ghashutil_inthash(const void *ptr); +int BLI_ghashutil_intcmp(const void *a, const void *b); typedef struct GHashPair { const void *first; const void *second; } GHashPair; -GHashPair* BLI_ghashutil_pairalloc (const void *first, const void *second); -unsigned int BLI_ghashutil_pairhash (const void *ptr); -int BLI_ghashutil_paircmp (const void *a, const void *b); -void BLI_ghashutil_pairfree (void *ptr); +GHashPair *BLI_ghashutil_pairalloc(const void *first, const void *second); +unsigned int BLI_ghashutil_pairhash(const void *ptr); +int BLI_ghashutil_paircmp(const void *a, const void *b); +void BLI_ghashutil_pairfree(void *ptr); #ifdef __cplusplus } diff --git a/source/blender/blenlib/BLI_graph.h b/source/blender/blenlib/BLI_graph.h index 52613f9869f..d45523aac7d 100644 --- a/source/blender/blenlib/BLI_graph.h +++ b/source/blender/blenlib/BLI_graph.h @@ -37,10 +37,10 @@ struct BArc; struct RadialArc; -typedef void (*FreeArc)(struct BArc*); -typedef void (*FreeNode)(struct BNode*); -typedef void (*RadialSymmetry)(struct BNode* root_node, struct RadialArc* ring, int total); -typedef void (*AxialSymmetry)(struct BNode* root_node, struct BNode* node1, struct BNode* node2, struct BArc* arc1, struct BArc* arc2); +typedef void (*FreeArc)(struct BArc *); +typedef void (*FreeNode)(struct BNode *); +typedef void (*RadialSymmetry)(struct BNode *root_node, struct RadialArc *ring, int total); +typedef void (*AxialSymmetry)(struct BNode *root_node, struct BNode *node1, struct BNode *node2, struct BArc *arc1, struct BArc *arc2); /* IF YOU MODIFY THOSE TYPES, YOU NEED TO UPDATE ALL THOSE THAT "INHERIT" FROM THEM * @@ -49,16 +49,16 @@ typedef void (*AxialSymmetry)(struct BNode* root_node, struct BNode* node1, stru * */ typedef struct BGraph { - ListBase arcs; - ListBase nodes; + ListBase arcs; + ListBase nodes; float length; /* function pointer to deal with custom fonctionnality */ - FreeArc free_arc; - FreeNode free_node; - RadialSymmetry radial_symmetry; - AxialSymmetry axial_symmetry; + FreeArc free_arc; + FreeNode free_node; + RadialSymmetry radial_symmetry; + AxialSymmetry axial_symmetry; } BGraph; typedef struct BNode { @@ -90,30 +90,30 @@ typedef struct BArc { struct BArcIterator; -void* IT_head(void* iter); -void* IT_tail(void* iter); -void* IT_peek(void* iter, int n); -void* IT_next(void* iter); -void* IT_nextN(void* iter, int n); -void* IT_previous(void* iter); -int IT_stopped(void* iter); - -typedef void* (*HeadFct)(void* iter); -typedef void* (*TailFct)(void* iter); -typedef void* (*PeekFct)(void* iter, int n); -typedef void* (*NextFct)(void* iter); -typedef void* (*NextNFct)(void* iter, int n); -typedef void* (*PreviousFct)(void* iter); -typedef int (*StoppedFct)(void* iter); +void *IT_head(void *iter); +void *IT_tail(void *iter); +void *IT_peek(void *iter, int n); +void *IT_next(void *iter); +void *IT_nextN(void *iter, int n); +void *IT_previous(void *iter); +int IT_stopped(void *iter); + +typedef void * (*HeadFct)(void *iter); +typedef void * (*TailFct)(void *iter); +typedef void * (*PeekFct)(void *iter, int n); +typedef void * (*NextFct)(void *iter); +typedef void * (*NextNFct)(void *iter, int n); +typedef void * (*PreviousFct)(void *iter); +typedef int (*StoppedFct)(void *iter); typedef struct BArcIterator { - HeadFct head; - TailFct tail; - PeekFct peek; - NextFct next; - NextNFct nextN; - PreviousFct previous; - StoppedFct stopped; + HeadFct head; + TailFct tail; + PeekFct peek; + NextFct next; + NextNFct nextN; + PreviousFct previous; + StoppedFct stopped; float *p, *no; float size; @@ -123,8 +123,7 @@ typedef struct BArcIterator { } BArcIterator; /* Helper structure for radial symmetry */ -typedef struct RadialArc -{ +typedef struct RadialArc { struct BArc *arc; float n[3]; /* normalized vector joining the nodes of the arc */ } RadialArc; @@ -141,7 +140,7 @@ void BLI_flagArcs(BGraph *graph, int flag); int BLI_hasAdjacencyList(BGraph *rg); void BLI_buildAdjacencyList(BGraph *rg); -void BLI_rebuildAdjacencyListForNode(BGraph* rg, BNode *node); +void BLI_rebuildAdjacencyListForNode(BGraph *rg, BNode *node); void BLI_freeAdjacencyList(BGraph *rg); int BLI_FlagSubgraphs(BGraph *graph); @@ -156,11 +155,11 @@ void BLI_calcGraphLength(BGraph *graph); void BLI_replaceNode(BGraph *graph, BNode *node_src, BNode *node_replaced); void BLI_replaceNodeInArc(BGraph *graph, BArc *arc, BNode *node_src, BNode *node_replaced); void BLI_removeDoubleNodes(BGraph *graph, float limit); -BNode * BLI_FindNodeByPosition(BGraph *graph, float *p, float limit); +BNode *BLI_FindNodeByPosition(BGraph *graph, float *p, float limit); -BArc * BLI_findConnectedArc(BGraph *graph, BArc *arc, BNode *v); +BArc *BLI_findConnectedArc(BGraph *graph, BArc *arc, BNode *v); -int BLI_isGraphCyclic(BGraph *graph); +int BLI_isGraphCyclic(BGraph *graph); /*------------ Symmetry handling ------------*/ void BLI_markdownSymmetry(BGraph *graph, BNode *root_node, float limit); @@ -168,19 +167,19 @@ void BLI_markdownSymmetry(BGraph *graph, BNode *root_node, float limit); void BLI_mirrorAlongAxis(float v[3], float center[3], float axis[3]); /* BNode symmetry flags */ -#define SYM_TOPOLOGICAL 1 -#define SYM_PHYSICAL 2 +#define SYM_TOPOLOGICAL 1 +#define SYM_PHYSICAL 2 /* the following two are exclusive */ -#define SYM_AXIAL 4 -#define SYM_RADIAL 8 +#define SYM_AXIAL 4 +#define SYM_RADIAL 8 /* BArc symmetry flags * * axial symmetry sides */ -#define SYM_SIDE_POSITIVE 1 -#define SYM_SIDE_NEGATIVE 2 +#define SYM_SIDE_POSITIVE 1 +#define SYM_SIDE_NEGATIVE 2 /* Anything higher is the order in radial symmetry */ -#define SYM_SIDE_RADIAL 3 +#define SYM_SIDE_RADIAL 3 #endif /*__BLI_GRAPH_H__*/ diff --git a/source/blender/blenlib/BLI_gsqueue.h b/source/blender/blenlib/BLI_gsqueue.h index 29c31c19047..b4cb1edd45a 100644 --- a/source/blender/blenlib/BLI_gsqueue.h +++ b/source/blender/blenlib/BLI_gsqueue.h @@ -36,64 +36,64 @@ typedef struct _GSQueue GSQueue; - /** - * Create a new GSQueue. - * - * \param elem_size The size of the structures in the queue. - * \retval The new queue - */ -GSQueue* BLI_gsqueue_new (int elem_size); +/** + * Create a new GSQueue. + * + * \param elem_size The size of the structures in the queue. + * \retval The new queue + */ +GSQueue *BLI_gsqueue_new(int elem_size); - /** - * Query if the queue is empty - */ -int BLI_gsqueue_is_empty(GSQueue *gq); +/** + * Query if the queue is empty + */ +int BLI_gsqueue_is_empty(GSQueue *gq); - /** - * Query number elements in the queue - */ -int BLI_gsqueue_size(GSQueue *gq); +/** + * Query number elements in the queue + */ +int BLI_gsqueue_size(GSQueue *gq); - /** - * Access the item at the head of the queue - * without removing it. - * - * \param item_r A pointer to an appropriately - * sized structure (the size passed to BLI_gsqueue_new) - */ -void BLI_gsqueue_peek (GSQueue *gq, void *item_r); +/** + * Access the item at the head of the queue + * without removing it. + * + * \param item_r A pointer to an appropriately + * sized structure (the size passed to BLI_gsqueue_new) + */ +void BLI_gsqueue_peek(GSQueue *gq, void *item_r); - /** - * Access the item at the head of the queue - * and remove it. - * - * \param item_r A pointer to an appropriately - * sized structure (the size passed to BLI_gsqueue_new). - * Can be NULL if desired. - */ -void BLI_gsqueue_pop (GSQueue *gq, void *item_r); +/** + * Access the item at the head of the queue + * and remove it. + * + * \param item_r A pointer to an appropriately + * sized structure (the size passed to BLI_gsqueue_new). + * Can be NULL if desired. + */ +void BLI_gsqueue_pop(GSQueue *gq, void *item_r); - /** - * Push an element onto the tail of the queue. - * - * \param item A pointer to an appropriately - * sized structure (the size passed to BLI_gsqueue_new). - */ -void BLI_gsqueue_push (GSQueue *gq, void *item); +/** + * Push an element onto the tail of the queue. + * + * \param item A pointer to an appropriately + * sized structure (the size passed to BLI_gsqueue_new). + */ +void BLI_gsqueue_push(GSQueue *gq, void *item); - /** - * Push an element back onto the head of the queue (so - * it would be returned from the next call to BLI_gsqueue_pop). - * - * \param item A pointer to an appropriately - * sized structure (the size passed to BLI_gsqueue_new). - */ -void BLI_gsqueue_pushback (GSQueue *gq, void *item); +/** + * Push an element back onto the head of the queue (so + * it would be returned from the next call to BLI_gsqueue_pop). + * + * \param item A pointer to an appropriately + * sized structure (the size passed to BLI_gsqueue_new). + */ +void BLI_gsqueue_pushback(GSQueue *gq, void *item); - /** - * Free the queue - */ -void BLI_gsqueue_free (GSQueue *gq); +/** + * Free the queue + */ +void BLI_gsqueue_free(GSQueue *gq); #endif /* __BLI_GSQUEUE_H__ */ diff --git a/source/blender/blenlib/BLI_heap.h b/source/blender/blenlib/BLI_heap.h index 5ceccda96e4..b378f2bb365 100644 --- a/source/blender/blenlib/BLI_heap.h +++ b/source/blender/blenlib/BLI_heap.h @@ -38,35 +38,35 @@ struct HeapNode; typedef struct Heap Heap; typedef struct HeapNode HeapNode; -typedef void (*HeapFreeFP)(void *ptr); +typedef void (*HeapFreeFP)(void *ptr); /* Creates a new heap. BLI_memarena is used for allocating nodes. Removed nodes * are recycled, so memory usage will not shrink. */ -Heap* BLI_heap_new (void); -void BLI_heap_free (Heap *heap, HeapFreeFP ptrfreefp); +Heap *BLI_heap_new(void); +void BLI_heap_free(Heap *heap, HeapFreeFP ptrfreefp); /* Insert heap node with a value (often a 'cost') and pointer into the heap, * duplicate values are allowed. */ -HeapNode* BLI_heap_insert (Heap *heap, float value, void *ptr); +HeapNode *BLI_heap_insert(Heap *heap, float value, void *ptr); /* Remove a heap node. */ -void BLI_heap_remove (Heap *heap, HeapNode *node); +void BLI_heap_remove(Heap *heap, HeapNode *node); /* Return 0 if the heap is empty, 1 otherwise. */ -int BLI_heap_empty (Heap *heap); +int BLI_heap_empty(Heap *heap); /* Return the size of the heap. */ -int BLI_heap_size (Heap *heap); +int BLI_heap_size(Heap *heap); /* Return the top node of the heap. This is the node with the lowest value. */ -HeapNode* BLI_heap_top (Heap *heap); +HeapNode *BLI_heap_top(Heap *heap); /* Pop the top node off the heap and return it's pointer. */ -void* BLI_heap_popmin (Heap *heap); +void *BLI_heap_popmin(Heap *heap); /* Return the value or pointer of a heap node. */ -float BLI_heap_node_value (HeapNode *heap); -void* BLI_heap_node_ptr (HeapNode *heap); +float BLI_heap_node_value(HeapNode *heap); +void *BLI_heap_node_ptr(HeapNode *heap); #endif diff --git a/source/blender/blenlib/BLI_jitter.h b/source/blender/blenlib/BLI_jitter.h index c2a6250c154..432bf73ad90 100644 --- a/source/blender/blenlib/BLI_jitter.h +++ b/source/blender/blenlib/BLI_jitter.h @@ -32,7 +32,7 @@ * \ingroup bli */ -void BLI_jitter_init(float *jitarr, int num); +void BLI_jitter_init(float *jitarr, int num); void BLI_jitterate1(float *jit1, float *jit2, int num, float rad1); void BLI_jitterate2(float *jit1, float *jit2, int num, float rad2); diff --git a/source/blender/blenlib/BLI_kdopbvh.h b/source/blender/blenlib/BLI_kdopbvh.h index ff3017fef03..7041c122ff9 100644 --- a/source/blender/blenlib/BLI_kdopbvh.h +++ b/source/blender/blenlib/BLI_kdopbvh.h @@ -49,37 +49,34 @@ typedef struct BVHTreeOverlap { int indexB; } BVHTreeOverlap; -typedef struct BVHTreeNearest -{ - int index; /* the index of the nearest found (untouched if none is found within a dist radius from the given coordinates) */ - float co[3]; /* nearest coordinates (untouched it none is found within a dist radius from the given coordinates) */ - float no[3]; /* normal at nearest coordinates (untouched it none is found within a dist radius from the given coordinates) */ - float dist; /* squared distance to search arround */ +typedef struct BVHTreeNearest { + int index; /* the index of the nearest found (untouched if none is found within a dist radius from the given coordinates) */ + float co[3]; /* nearest coordinates (untouched it none is found within a dist radius from the given coordinates) */ + float no[3]; /* normal at nearest coordinates (untouched it none is found within a dist radius from the given coordinates) */ + float dist; /* squared distance to search arround */ } BVHTreeNearest; -typedef struct BVHTreeRay -{ - float origin[3]; /* ray origin */ - float direction[3]; /* ray direction */ - float radius; /* radius around ray */ +typedef struct BVHTreeRay { + float origin[3]; /* ray origin */ + float direction[3]; /* ray direction */ + float radius; /* radius around ray */ } BVHTreeRay; -typedef struct BVHTreeRayHit -{ - int index; /* index of the tree node (untouched if no hit is found) */ - float co[3]; /* coordinates of the hit point */ - float no[3]; /* normal on hit point */ - float dist; /* distance to the hit point */ +typedef struct BVHTreeRayHit { + int index; /* index of the tree node (untouched if no hit is found) */ + float co[3]; /* coordinates of the hit point */ + float no[3]; /* normal on hit point */ + float dist; /* distance to the hit point */ } BVHTreeRayHit; /* callback must update nearest in case it finds a nearest result */ -typedef void (*BVHTree_NearestPointCallback) (void *userdata, int index, const float *co, BVHTreeNearest *nearest); +typedef void (*BVHTree_NearestPointCallback)(void *userdata, int index, const float *co, BVHTreeNearest *nearest); /* callback must update hit in case it finds a nearest successful hit */ -typedef void (*BVHTree_RayCastCallback) (void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit); +typedef void (*BVHTree_RayCastCallback)(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit); /* callback to range search query */ -typedef void (*BVHTree_RangeQuery) (void *userdata, int index, float squared_dist); +typedef void (*BVHTree_RangeQuery)(void *userdata, int index, float squared_dist); BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis); void BLI_bvhtree_free(BVHTree *tree); diff --git a/source/blender/blenlib/BLI_kdtree.h b/source/blender/blenlib/BLI_kdtree.h index a58f58020d7..ae5e32d73eb 100644 --- a/source/blender/blenlib/BLI_kdtree.h +++ b/source/blender/blenlib/BLI_kdtree.h @@ -46,7 +46,7 @@ typedef struct KDTreeNearest { } KDTreeNearest; /* Creates or free a kdtree */ -KDTree* BLI_kdtree_new(int maxsize); +KDTree *BLI_kdtree_new(int maxsize); void BLI_kdtree_free(KDTree *tree); /* Construction: first insert points, then call balance. Normal is optional. */ @@ -56,12 +56,11 @@ void BLI_kdtree_balance(KDTree *tree); /* Find nearest returns index, and -1 if no node is found. * Find n nearest returns number of points found, with results in nearest. * Normal is optional, but if given will limit results to points in normal direction from co. */ -int BLI_kdtree_find_nearest(KDTree *tree, float *co, float *nor, KDTreeNearest *nearest); -int BLI_kdtree_find_n_nearest(KDTree *tree, int n, float *co, float *nor, KDTreeNearest *nearest); +int BLI_kdtree_find_nearest(KDTree *tree, float *co, float *nor, KDTreeNearest *nearest); +int BLI_kdtree_find_n_nearest(KDTree *tree, int n, float *co, float *nor, KDTreeNearest *nearest); /* Range search returns number of points found, with results in nearest */ /* Normal is optional, but if given will limit results to points in normal direction from co. */ /* Remember to free nearest after use! */ int BLI_kdtree_range_search(KDTree *tree, float range, float *co, float *nor, KDTreeNearest **nearest); #endif - diff --git a/source/blender/blenlib/BLI_linklist.h b/source/blender/blenlib/BLI_linklist.h index 664beb4eb98..da56a300b9b 100644 --- a/source/blender/blenlib/BLI_linklist.h +++ b/source/blender/blenlib/BLI_linklist.h @@ -46,20 +46,19 @@ typedef struct LinkNode { void *link; } LinkNode; -int BLI_linklist_length (struct LinkNode *list); -int BLI_linklist_index (struct LinkNode *list, void *ptr); +int BLI_linklist_length(struct LinkNode *list); +int BLI_linklist_index(struct LinkNode *list, void *ptr); -struct LinkNode *BLI_linklist_find (struct LinkNode *list, int index); +struct LinkNode *BLI_linklist_find(struct LinkNode *list, int index); -void BLI_linklist_reverse (struct LinkNode **listp); +void BLI_linklist_reverse(struct LinkNode **listp); -void BLI_linklist_prepend (struct LinkNode **listp, void *ptr); -void BLI_linklist_append (struct LinkNode **listp, void *ptr); -void BLI_linklist_prepend_arena (struct LinkNode **listp, void *ptr, struct MemArena *ma); -void BLI_linklist_insert_after (struct LinkNode **listp, void *ptr); +void BLI_linklist_prepend(struct LinkNode **listp, void *ptr); +void BLI_linklist_append(struct LinkNode **listp, void *ptr); +void BLI_linklist_prepend_arena(struct LinkNode **listp, void *ptr, struct MemArena *ma); +void BLI_linklist_insert_after(struct LinkNode **listp, void *ptr); -void BLI_linklist_free (struct LinkNode *list, LinkNodeFreeFP freefunc); -void BLI_linklist_apply (struct LinkNode *list, LinkNodeApplyFP applyfunc, void *userdata); +void BLI_linklist_free(struct LinkNode *list, LinkNodeFreeFP freefunc); +void BLI_linklist_apply(struct LinkNode *list, LinkNodeApplyFP applyfunc, void *userdata); #endif - diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h index 7e5f1f2a72a..02065c4b86f 100644 --- a/source/blender/blenlib/BLI_math_base.h +++ b/source/blender/blenlib/BLI_math_base.h @@ -127,19 +127,19 @@ #endif #ifdef WIN32 -#ifndef FREE_WINDOWS -#define isnan(n) _isnan(n) -#define finite _finite -#define hypot _hypot -#endif +# ifndef FREE_WINDOWS +# define isnan(n) _isnan(n) +# define finite _finite +# define hypot _hypot +# endif #endif #ifndef SWAP -#define SWAP(type, a, b) { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; } +# define SWAP(type, a, b) { type sw_ap; sw_ap = (a); (a) = (b); (b) = sw_ap; } #endif #ifndef CLAMP -#define CLAMP(a, b, c) if((a)<(b)) (a)=(b); else if((a)>(c)) (a)=(c) +# define CLAMP(a, b, c) if ((a) < (b)) (a) = (b); else if ((a) > (c)) (a) = (c) #endif #ifdef __BLI_MATH_INLINE_H__ diff --git a/source/blender/blenlib/BLI_math_color.h b/source/blender/blenlib/BLI_math_color.h index 4771fdbcb69..afdb5d40bd5 100644 --- a/source/blender/blenlib/BLI_math_color.h +++ b/source/blender/blenlib/BLI_math_color.h @@ -37,19 +37,19 @@ extern "C" { #include "BLI_math_inline.h" /* primaries */ -#define BLI_XYZ_SMPTE 0 -#define BLI_XYZ_REC709_SRGB 1 -#define BLI_XYZ_CIE 2 +#define BLI_XYZ_SMPTE 0 +#define BLI_XYZ_REC709_SRGB 1 +#define BLI_XYZ_CIE 2 /* built-in profiles */ -#define BLI_PR_NONE 0 -#define BLI_PR_SRGB 1 -#define BLI_PR_REC709 2 +#define BLI_PR_NONE 0 +#define BLI_PR_SRGB 1 +#define BLI_PR_REC709 2 /* YCbCr */ -#define BLI_YCC_ITU_BT601 0 -#define BLI_YCC_ITU_BT709 1 -#define BLI_YCC_JFIF_0_255 2 +#define BLI_YCC_ITU_BT601 0 +#define BLI_YCC_ITU_BT709 1 +#define BLI_YCC_JFIF_0_255 2 /******************* Conversion to RGB ********************/ @@ -101,8 +101,8 @@ void BLI_init_srgb_conversion(void); int constrain_rgb(float *r, float *g, float *b); void minmax_rgb(short c[3]); -void rgb_float_set_hue_float_offset(float * rgb, float hue_offset); -void rgb_byte_set_hue_float_offset(unsigned char * rgb, float hue_offset); +void rgb_float_set_hue_float_offset(float *rgb, float hue_offset); +void rgb_byte_set_hue_float_offset(unsigned char *rgb, float hue_offset); void rgb_uchar_to_float(float col_r[3], const unsigned char col_ub[3]); void rgba_uchar_to_float(float col_r[4], const unsigned char col_ub[4]); diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h index 85129d5b68d..0560a3f6e64 100644 --- a/source/blender/blenlib/BLI_math_geom.h +++ b/source/blender/blenlib/BLI_math_geom.h @@ -67,23 +67,23 @@ float dist_to_plane_v3(const float p[3], const float plane_co[3], const float pl float dist_to_line_segment_v3(const float p[3], const float l1[3], const float l2[3]); float closest_to_line_v3(float r[3], const float p[3], const float l1[3], const float l2[3]); float closest_to_line_v2(float r[2], const float p[2], const float l1[2], const float l2[2]); -void closest_to_line_segment_v3(float r[3], const float p[3], const float l1[3], const float l2[3]); -void closest_to_plane_v3(float r[3], const float plane_co[3], const float plane_no_unit[3], const float pt[3]); +void closest_to_line_segment_v3(float r[3], const float p[3], const float l1[3], const float l2[3]); +void closest_to_plane_v3(float r[3], const float plane_co[3], const float plane_no_unit[3], const float pt[3]); float line_point_factor_v3(const float p[3], const float l1[3], const float l2[3]); float line_point_factor_v2(const float p[2], const float l1[2], const float l2[2]); -void limit_dist_v3(float v1[3], float v2[3], const float dist); +void limit_dist_v3(float v1[3], float v2[3], const float dist); /******************************* Intersection ********************************/ /* TODO int return value consistency */ /* line-line */ -#define ISECT_LINE_LINE_COLINEAR -1 -#define ISECT_LINE_LINE_NONE 0 -#define ISECT_LINE_LINE_EXACT 1 -#define ISECT_LINE_LINE_CROSS 2 +#define ISECT_LINE_LINE_COLINEAR -1 +#define ISECT_LINE_LINE_NONE 0 +#define ISECT_LINE_LINE_EXACT 1 +#define ISECT_LINE_LINE_CROSS 2 int isect_line_line_v2(const float a1[2], const float a2[2], const float b1[2], const float b2[2]); int isect_line_line_v2_int(const int a1[2], const int a2[2], const int b1[2], const int b2[2]); @@ -139,13 +139,13 @@ void isect_plane_plane_v3(float r_isect_co[3], float r_isect_no[3], /* line/ray triangle */ int isect_line_tri_v3(const float p1[3], const float p2[3], - const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2]); + const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2]); int isect_ray_tri_v3(const float p1[3], const float d[3], - const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2]); + const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2]); int isect_ray_tri_threshold_v3(const float p1[3], const float d[3], - const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2], const float threshold); + const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2], const float threshold); int isect_ray_tri_epsilon_v3(const float p1[3], const float d[3], - const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2], const float epsilon); + const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2], const float epsilon); /* point in polygon */ int isect_point_quad_v2(const float p[2], const float a[2], const float b[2], const float c[2], const float d[2]); @@ -161,10 +161,10 @@ void isect_point_face_uv_v2(const int isquad, const float v0[2], const float v1[ /* other */ int isect_sweeping_sphere_tri_v3(const float p1[3], const float p2[3], const float radius, - const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float ipoint[3]); + const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float ipoint[3]); int isect_axial_line_tri_v3(const int axis, const float co1[3], const float co2[3], - const float v0[3], const float v1[3], const float v2[3], float *r_lambda); + const float v0[3], const float v1[3], const float v2[3], float *r_lambda); int isect_aabb_aabb_v3(const float min1[3], const float max1[3], const float min2[3], const float max2[3]); @@ -176,20 +176,20 @@ void plot_line_v2v2i(const int p1[2], const int p2[2], int (*callback)(int, int, /* tri or quad, d can be NULL */ void interp_weights_face_v3(float w[4], - const float a[3], const float b[3], const float c[3], const float d[3], const float p[3]); + const float a[3], const float b[3], const float c[3], const float d[3], const float p[3]); void interp_weights_poly_v3(float w[], float v[][3], const int n, const float p[3]); void interp_cubic_v3(float x[3], float v[3], - const float x1[3], const float v1[3], const float x2[3], const float v2[3], const float t); + const float x1[3], const float v1[3], const float x2[3], const float v2[3], const float t); int interp_sparse_array(float *array, const int list_size, const float invalid); void barycentric_transform(float pt_tar[3], float const pt_src[3], - const float tri_tar_p1[3], const float tri_tar_p2[3], const float tri_tar_p3[3], - const float tri_src_p1[3], const float tri_src_p2[3], const float tri_src_p3[3]); + const float tri_tar_p1[3], const float tri_tar_p2[3], const float tri_tar_p3[3], + const float tri_src_p1[3], const float tri_src_p2[3], const float tri_src_p3[3]); void barycentric_weights_v2(const float v1[2], const float v2[2], const float v3[2], - const float co[2], float w[3]); + const float co[2], float w[3]); void resolve_tri_uv(float r_uv[2], const float st[2], const float st0[2], const float st1[2], const float st2[2]); void resolve_quad_uv(float uv[2], const float st[2], const float st0[2], const float st1[2], const float st2[2], const float st3[2]); @@ -197,21 +197,21 @@ void resolve_quad_uv(float uv[2], const float st[2], const float st0[2], const f /***************************** View & Projection *****************************/ void lookat_m4(float mat[4][4], float vx, float vy, - float vz, float px, float py, float pz, float twist); + float vz, float px, float py, float pz, float twist); void polarview_m4(float mat[4][4], float dist, float azimuth, - float incidence, float twist); + float incidence, float twist); void perspective_m4(float mat[4][4], const float left, const float right, - const float bottom, const float top, const float nearClip, const float farClip); + const float bottom, const float top, const float nearClip, const float farClip); void orthographic_m4(float mat[4][4], const float left, const float right, - const float bottom, const float top, const float nearClip, const float farClip); + const float bottom, const float top, const float nearClip, const float farClip); void window_translate_m4(float winmat[][4], float perspmat[][4], - const float x, const float y); + const float x, const float y); int box_clip_bounds_m4(float boundbox[2][3], - const float bounds[4], float winmat[4][4]); + const float bounds[4], float winmat[4][4]); void box_minmax_bounds_m4(float min[3], float max[3], - float boundbox[2][3], float mat[4][4]); + float boundbox[2][3], float mat[4][4]); /********************************** Mapping **********************************/ @@ -221,11 +221,11 @@ void map_to_sphere(float *r_u, float *r_v, const float x, const float y, const f /********************************** Normals **********************************/ void accumulate_vertex_normals(float n1[3], float n2[3], float n3[3], - float n4[3], const float f_no[3], const float co1[3], const float co2[3], - const float co3[3], const float co4[3]); + float n4[3], const float f_no[3], const float co1[3], const float co2[3], + const float co3[3], const float co4[3]); void accumulate_vertex_normals_poly(float **vertnos, float polyno[3], - float **vertcos, float vdiffs[][3], int nverts); + float **vertcos, float vdiffs[][3], int nverts); /********************************* Tangents **********************************/ @@ -236,15 +236,15 @@ typedef struct VertexTangent { float *find_vertex_tangent(VertexTangent *vtang, const float uv[2]); void sum_or_add_vertex_tangent(void *arena, VertexTangent **vtang, - const float tang[3], const float uv[2]); + const float tang[3], const float uv[2]); void tangent_from_uv(float uv1[2], float uv2[2], float uv3[2], - float co1[3], float co2[3], float co3[3], float n[3], float tang[3]); + float co1[3], float co2[3], float co3[3], float n[3], float tang[3]); /******************************** Vector Clouds ******************************/ void vcloud_estimate_transform(int list_size, float (*pos)[3], float *weight, - float (*rpos)[3], float *rweight, - float lloc[3], float rloc[3], float lrot[3][3], float lscale[3][3]); + float (*rpos)[3], float *rweight, + float lloc[3], float rloc[3], float lrot[3][3], float lscale[3][3]); /****************************** Spherical Harmonics *************************/ @@ -266,7 +266,7 @@ MINLINE void madd_sh_shfl(float r[9], const float sh[3], const float f); /********************************* Form Factor *******************************/ float form_factor_hemi_poly(float p[3], float n[3], - float v1[3], float v2[3], float v3[3], float v4[3]); + float v1[3], float v2[3], float v3[3], float v4[3]); void axis_dominant_v3(int *axis_a, int *axis_b, const float axis[3]); diff --git a/source/blender/blenlib/BLI_math_matrix.h b/source/blender/blenlib/BLI_math_matrix.h index 1d99fd4fa27..8e9955beb61 100644 --- a/source/blender/blenlib/BLI_math_matrix.h +++ b/source/blender/blenlib/BLI_math_matrix.h @@ -36,13 +36,13 @@ extern "C" { /********************************* Init **************************************/ -#define MAT4_UNITY {{ 1.0, 0.0, 0.0, 0.0},\ - { 0.0, 1.0, 0.0, 0.0},\ - { 0.0, 0.0, 1.0, 0.0},\ +#define MAT4_UNITY {{ 1.0, 0.0, 0.0, 0.0}, \ + { 0.0, 1.0, 0.0, 0.0}, \ + { 0.0, 0.0, 1.0, 0.0}, \ { 0.0, 0.0, 0.0, 1.0}} -#define MAT3_UNITY {{ 1.0, 0.0, 0.0},\ - { 0.0, 1.0, 0.0},\ +#define MAT3_UNITY {{ 1.0, 0.0, 0.0}, \ + { 0.0, 1.0, 0.0}, \ { 0.0, 0.0, 1.0}} void zero_m3(float R[3][3]); @@ -76,11 +76,11 @@ void mult_m4_m4m4(float R[4][4], float A[4][4], float B[4][4]); void mult_m3_m3m4(float R[3][3], float A[4][4], float B[3][3]); void mul_serie_m3(float R[3][3], - float M1[3][3], float M2[3][3], float M3[3][3], float M4[3][3], - float M5[3][3], float M6[3][3], float M7[3][3], float M8[3][3]); + float M1[3][3], float M2[3][3], float M3[3][3], float M4[3][3], + float M5[3][3], float M6[3][3], float M7[3][3], float M8[3][3]); void mul_serie_m4(float R[4][4], - float M1[4][4], float M2[4][4], float M3[4][4], float M4[4][4], - float M5[4][4], float M6[4][4], float M7[4][4], float M8[4][4]); + float M1[4][4], float M2[4][4], float M3[4][4], float M4[4][4], + float M5[4][4], float M6[4][4], float M7[4][4], float M8[4][4]); void mul_m4_v3(float M[4][4], float r[3]); void mul_v3_m4v3(float r[3], float M[4][4], const float v[3]); @@ -131,13 +131,11 @@ int is_uniform_scaled_m3(float mat[3][3]); void adjoint_m3_m3(float R[3][3], float A[3][3]); void adjoint_m4_m4(float R[4][4], float A[4][4]); -float determinant_m2( - float a, float b, - float c, float d); -float determinant_m3( - float a, float b, float c, - float d, float e, float f, - float g, float h, float i); +float determinant_m2(float a, float b, + float c, float d); +float determinant_m3(float a, float b, float c, + float d, float e, float f, + float g, float h, float i); float determinant_m4(float A[4][4]); void svd_m4(float U[4][4], float s[4], float V[4][4], float A[4][4]); @@ -165,13 +163,13 @@ void mat3_to_rot_size(float rot[3][3], float size[3], float mat3[][3]); void mat4_to_loc_rot_size(float loc[3], float rot[3][3], float size[3], float wmat[][4]); void loc_eul_size_to_mat4(float R[4][4], - const float loc[3], const float eul[3], const float size[3]); + const float loc[3], const float eul[3], const float size[3]); void loc_eulO_size_to_mat4(float R[4][4], - const float loc[3], const float eul[3], const float size[3], const short order); + const float loc[3], const float eul[3], const float size[3], const short order); void loc_quat_size_to_mat4(float R[4][4], - const float loc[3], const float quat[4], const float size[3]); + const float loc[3], const float quat[4], const float size[3]); void loc_axisangle_size_to_mat4(float R[4][4], - const float loc[3], const float axis[4], const float angle, const float size[3]); + const float loc[3], const float axis[4], const float angle, const float size[3]); void blend_m3_m3m3(float R[3][3], float A[3][3], float B[3][3], const float t); void blend_m4_m4m4(float R[4][4], float A[4][4], float B[4][4], const float t); diff --git a/source/blender/blenlib/BLI_math_rotation.h b/source/blender/blenlib/BLI_math_rotation.h index 62b81530c65..912534e0aca 100644 --- a/source/blender/blenlib/BLI_math_rotation.h +++ b/source/blender/blenlib/BLI_math_rotation.h @@ -34,12 +34,12 @@ extern "C" { #endif -#define RAD2DEG(_rad) ((_rad)*(180.0/M_PI)) -#define DEG2RAD(_deg) ((_deg)*(M_PI/180.0)) +#define RAD2DEG(_rad) ((_rad) * (180.0 / M_PI)) +#define DEG2RAD(_deg) ((_deg) * (M_PI / 180.0)) -#define RAD2DEGF(_rad) ((_rad)*(float)(180.0/M_PI)) -#define DEG2RADF(_deg) ((_deg)*(float)(M_PI/180.0)) +#define RAD2DEGF(_rad) ((_rad) * (float)(180.0 / M_PI)) +#define DEG2RADF(_deg) ((_deg) * (float)(M_PI / 180.0)) /******************************** Quaternions ********************************/ /* stored in (w, x, y, z) order */ @@ -171,10 +171,10 @@ typedef struct DualQuat { void copy_dq_dq(DualQuat *r, DualQuat *dq); void normalize_dq(DualQuat *dq, float totw); void add_weighted_dq_dq(DualQuat *r, DualQuat *dq, float weight); -void mul_v3m3_dq(float r[3], float R[3][3], DualQuat *dq); +void mul_v3m3_dq(float r[3], float R[3][3], DualQuat * dq); -void mat4_to_dquat(DualQuat *r, float base[4][4], float M[4][4]); -void dquat_to_mat4(float R[4][4], DualQuat *dq); +void mat4_to_dquat(DualQuat * r, float base[4][4], float M[4][4]); +void dquat_to_mat4(float R[4][4], DualQuat * dq); void quat_apply_track(float quat[4], short axis, short upflag); void vec_apply_track(float vec[3], short axis); diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h index 249f2265440..d0f883e1c99 100644 --- a/source/blender/blenlib/BLI_math_vector.h +++ b/source/blender/blenlib/BLI_math_vector.h @@ -189,7 +189,7 @@ float angle_normalized_v3v3(const float v1[3], const float v2[3]); float angle_on_axis_v3v3v3_v3(const float v1[3], const float v2[3], const float v3[3], const float axis[3]); void angle_tri_v3(float angles[3], const float v1[3], const float v2[3], const float v3[3]); void angle_quad_v3(float angles[4], const float v1[3], const float v2[3], const float v3[3], const float v4[3]); -void angle_poly_v3(float* angles, const float* verts[3], int len); +void angle_poly_v3(float *angles, const float *verts[3], int len); /********************************* Geometry **********************************/ @@ -237,4 +237,3 @@ void fill_vn_fl(float *array_tar, const int size, const float val); #endif #endif /* __BLI_MATH_VECTOR_H__ */ - diff --git a/source/blender/blenlib/BLI_memarena.h b/source/blender/blenlib/BLI_memarena.h index 508cc03d848..abba03ece9d 100644 --- a/source/blender/blenlib/BLI_memarena.h +++ b/source/blender/blenlib/BLI_memarena.h @@ -41,25 +41,25 @@ extern "C" { #endif - /* A reasonable standard buffer size, big - * enough to not cause much internal fragmentation, - * small enough not to waste resources - */ -#define BLI_MEMARENA_STD_BUFSIZE (1<<14) +/* A reasonable standard buffer size, big + * enough to not cause much internal fragmentation, + * small enough not to waste resources + */ +#define BLI_MEMARENA_STD_BUFSIZE (1 << 14) struct MemArena; typedef struct MemArena MemArena; -struct MemArena* BLI_memarena_new (int bufsize, const char *name); -void BLI_memarena_free (struct MemArena *ma); +struct MemArena *BLI_memarena_new(int bufsize, const char *name); +void BLI_memarena_free(struct MemArena *ma); -void BLI_memarena_use_malloc (struct MemArena *ma); -void BLI_memarena_use_calloc (struct MemArena *ma); +void BLI_memarena_use_malloc(struct MemArena *ma); +void BLI_memarena_use_calloc(struct MemArena *ma); -void BLI_memarena_use_align(struct MemArena *ma, int align); +void BLI_memarena_use_align(struct MemArena *ma, int align); -void* BLI_memarena_alloc (struct MemArena *ma, int size); +void *BLI_memarena_alloc(struct MemArena *ma, int size); #ifdef __cplusplus } diff --git a/source/blender/blenlib/BLI_noise.h b/source/blender/blenlib/BLI_noise.h index 9f5475ced25..d9457fbaae7 100644 --- a/source/blender/blenlib/BLI_noise.h +++ b/source/blender/blenlib/BLI_noise.h @@ -54,7 +54,7 @@ float mg_HeteroTerrain(float x, float y, float z, float H, float lacunarity, flo float mg_HybridMultiFractal(float x, float y, float z, float H, float lacunarity, float octaves, float offset, float gain, int noisebasis); float mg_RidgedMultiFractal(float x, float y, float z, float H, float lacunarity, float octaves, float offset, float gain, int noisebasis); /* newnoise: voronoi */ -void voronoi(float x, float y, float z, float* da, float* pa, float me, int dtype); +void voronoi(float x, float y, float z, float *da, float *pa, float me, int dtype); /* newnoise: cellNoise & cellNoiseV (for vector/point/color) */ float cellNoise(float x, float y, float z); void cellNoiseV(float x, float y, float z, float *ca); diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h index 1d085a46a19..3664d7bcd77 100644 --- a/source/blender/blenlib/BLI_path_util.h +++ b/source/blender/blenlib/BLI_path_util.h @@ -48,29 +48,29 @@ char *BLI_get_folder_version(const int id, const int ver, const int do_check); /* folder_id */ /* general, will find based on user/local/system priority */ -#define BLENDER_DATAFILES 2 +#define BLENDER_DATAFILES 2 /* user-specific */ -#define BLENDER_USER_CONFIG 31 -#define BLENDER_USER_DATAFILES 32 -#define BLENDER_USER_SCRIPTS 33 -#define BLENDER_USER_PLUGINS 34 -#define BLENDER_USER_AUTOSAVE 35 +#define BLENDER_USER_CONFIG 31 +#define BLENDER_USER_DATAFILES 32 +#define BLENDER_USER_SCRIPTS 33 +#define BLENDER_USER_PLUGINS 34 +#define BLENDER_USER_AUTOSAVE 35 /* system */ -#define BLENDER_SYSTEM_DATAFILES 52 -#define BLENDER_SYSTEM_SCRIPTS 53 -#define BLENDER_SYSTEM_PLUGINS 54 -#define BLENDER_SYSTEM_PYTHON 54 +#define BLENDER_SYSTEM_DATAFILES 52 +#define BLENDER_SYSTEM_SCRIPTS 53 +#define BLENDER_SYSTEM_PLUGINS 54 +#define BLENDER_SYSTEM_PYTHON 54 /* for BLI_get_folder_version only */ -#define BLENDER_RESOURCE_PATH_USER 0 -#define BLENDER_RESOURCE_PATH_LOCAL 1 -#define BLENDER_RESOURCE_PATH_SYSTEM 2 +#define BLENDER_RESOURCE_PATH_USER 0 +#define BLENDER_RESOURCE_PATH_LOCAL 1 +#define BLENDER_RESOURCE_PATH_SYSTEM 2 -#define BLENDER_STARTUP_FILE "startup.blend" -#define BLENDER_BOOKMARK_FILE "bookmarks.txt" -#define BLENDER_HISTORY_FILE "recent-files.txt" +#define BLENDER_STARTUP_FILE "startup.blend" +#define BLENDER_BOOKMARK_FILE "bookmarks.txt" +#define BLENDER_HISTORY_FILE "recent-files.txt" #ifdef WIN32 #define SEP '\\' @@ -81,7 +81,7 @@ char *BLI_get_folder_version(const int id, const int ver, const int do_check); #endif void BLI_setenv(const char *env, const char *val); -void BLI_setenv_if_new(const char *env, const char* val); +void BLI_setenv_if_new(const char *env, const char *val); void BLI_make_file_string(const char *relabase, char *string, const char *dir, const char *file); void BLI_make_exist(char *dir); @@ -93,11 +93,11 @@ void BLI_join_dirfile(char *string, const size_t maxlen, const char *dir, const char *BLI_path_basename(char *path); int BKE_rebase_path(char *abs, size_t abs_len, char *rel, size_t rel_len, const char *base_dir, const char *src_dir, const char *dest_dir); char *BLI_last_slash(const char *string); -int BLI_add_slash(char *string); +int BLI_add_slash(char *string); void BLI_del_slash(char *string); char *BLI_first_slash(char *string); -void BLI_getlastdir(const char* dir, char *last, const size_t maxlen); +void BLI_getlastdir(const char *dir, char *last, const size_t maxlen); int BLI_testextensie(const char *str, const char *ext); int BLI_testextensie_array(const char *str, const char **ext_array); int BLI_testextensie_glob(const char *str, const char *ext_fnmatch); @@ -105,7 +105,7 @@ int BLI_replace_extension(char *path, size_t maxlen, const char *ext); int BLI_ensure_extension(char *path, size_t maxlen, const char *ext); void BLI_uniquename(struct ListBase *list, void *vlink, const char defname[], char delim, short name_offs, short len); int BLI_uniquename_cb(int (*unique_check)(void *, const char *), void *arg, const char defname[], char delim, char *name, short name_len); -void BLI_newname(char * name, int add); +void BLI_newname(char *name, int add); int BLI_stringdec(const char *string, char *head, char *start, unsigned short *numlen); void BLI_stringenc(char *string, const char *head, const char *tail, unsigned short numlen, int pic); int BLI_split_name_num(char *left, int *nr, const char *name, const char delim); @@ -165,19 +165,19 @@ void BLI_path_rel(char *file, const char *relfile); */ void BLI_char_switch(char *string, char from, char to); - /* Initialize path to program executable */ +/* Initialize path to program executable */ void BLI_init_program_path(const char *argv0); - /* Initialize path to temporary directory. - * NOTE: On Window userdir will be set to the temporary directory! */ +/* Initialize path to temporary directory. + * NOTE: On Window userdir will be set to the temporary directory! */ void BLI_init_temporary_dir(char *userdir); - /* Path to executable */ +/* Path to executable */ const char *BLI_program_path(void); - /* Path to directory of executable */ +/* Path to directory of executable */ const char *BLI_program_dir(void); - /* Path to temporary directory (with trailing slash) */ +/* Path to temporary directory (with trailing slash) */ const char *BLI_temporary_dir(void); - /* Path to the system temporary directory (with trailing slash) */ +/* Path to the system temporary directory (with trailing slash) */ void BLI_system_temporary_dir(char *dir); #ifdef WITH_ICONV diff --git a/source/blender/blenlib/BLI_rand.h b/source/blender/blenlib/BLI_rand.h index d4d6563ac99..7dd6c8575c9 100644 --- a/source/blender/blenlib/BLI_rand.h +++ b/source/blender/blenlib/BLI_rand.h @@ -40,59 +40,59 @@ struct RNG; typedef struct RNG RNG; -struct RNG* rng_new (unsigned int seed); -void rng_free (struct RNG* rng); +struct RNG *rng_new(unsigned int seed); +void rng_free(struct RNG *rng); -void rng_seed (struct RNG* rng, unsigned int seed); +void rng_seed(struct RNG *rng, unsigned int seed); void rng_srandom(struct RNG *rng, unsigned int seed); -int rng_getInt (struct RNG* rng); -double rng_getDouble (struct RNG* rng); -float rng_getFloat (struct RNG* rng); -void rng_shuffleArray(struct RNG *rng, void *data, int elemSize, int numElems); +int rng_getInt(struct RNG *rng); +double rng_getDouble(struct RNG *rng); +float rng_getFloat(struct RNG *rng); +void rng_shuffleArray(struct RNG *rng, void *data, int elemSize, int numElems); - /** Note that skipping is as slow as generating n numbers! */ -void rng_skip (struct RNG *rng, int n); +/** Note that skipping is as slow as generating n numbers! */ +void rng_skip(struct RNG *rng, int n); - /** Seed the random number generator */ -void BLI_srand (unsigned int seed); +/** Seed the random number generator */ +void BLI_srand(unsigned int seed); - /** Better seed for the random number generator, using noise.c hash[] */ -void BLI_srandom (unsigned int seed); +/** Better seed for the random number generator, using noise.c hash[] */ +void BLI_srandom(unsigned int seed); - /** Return a pseudo-random number N where 0<=N<(2^31) */ -int BLI_rand (void); +/** Return a pseudo-random number N where 0<=N<(2^31) */ +int BLI_rand(void); - /** Return a pseudo-random number N where 0.0<=N<1.0 */ -double BLI_drand (void); +/** Return a pseudo-random number N where 0.0<=N<1.0 */ +double BLI_drand(void); - /** Return a pseudo-random number N where 0.0f<=N<1.0f */ -float BLI_frand (void); +/** Return a pseudo-random number N where 0.0f<=N<1.0f */ +float BLI_frand(void); - /** Fills a block of memory starting at \a addr - * and extending \a len bytes with pseudo-random - * contents. This routine does not use nor modify - * the state of the BLI random number generator. - */ -void BLI_fillrand (void *addr, int len); +/** Fills a block of memory starting at \a addr + * and extending \a len bytes with pseudo-random + * contents. This routine does not use nor modify + * the state of the BLI random number generator. + */ +void BLI_fillrand(void *addr, int len); - /** Shuffle an array randomly using the given seed. - * contents. This routine does not use nor modify - * the state of the BLI random number generator. - */ -void BLI_array_randomize (void *data, int elemSize, int numElems, unsigned int seed); +/** Shuffle an array randomly using the given seed. + * contents. This routine does not use nor modify + * the state of the BLI random number generator. + */ +void BLI_array_randomize(void *data, int elemSize, int numElems, unsigned int seed); - /** Better seed for the random number generator, using noise.c hash[] */ - /** Allows up to BLENDER_MAX_THREADS threads to address */ -void BLI_thread_srandom (int thread, unsigned int seed); +/** Better seed for the random number generator, using noise.c hash[] */ +/** Allows up to BLENDER_MAX_THREADS threads to address */ +void BLI_thread_srandom(int thread, unsigned int seed); - /** Return a pseudo-random number N where 0<=N<(2^31) */ - /** Allows up to BLENDER_MAX_THREADS threads to address */ -int BLI_thread_rand (int thread); +/** Return a pseudo-random number N where 0<=N<(2^31) */ +/** Allows up to BLENDER_MAX_THREADS threads to address */ +int BLI_thread_rand(int thread); - /** Return a pseudo-random number N where 0.0f<=N<1.0f */ - /** Allows up to BLENDER_MAX_THREADS threads to address */ -float BLI_thread_frand (int thread); +/** Return a pseudo-random number N where 0.0f<=N<1.0f */ +/** Allows up to BLENDER_MAX_THREADS threads to address */ +float BLI_thread_frand(int thread); diff --git a/source/blender/blenlib/BLI_rect.h b/source/blender/blenlib/BLI_rect.h index 7ce19ce8583..0cf32eeb276 100644 --- a/source/blender/blenlib/BLI_rect.h +++ b/source/blender/blenlib/BLI_rect.h @@ -58,7 +58,7 @@ void BLI_resize_rcti(struct rcti *rect, int x, int y); void BLI_resize_rctf(struct rctf *rect, float x, float y); int BLI_in_rcti(struct rcti *rect, int x, int y); int BLI_in_rctf(struct rctf *rect, float x, float y); -int BLI_segment_in_rcti(struct rcti *rect, int s1[2], int s2[2]); +int BLI_segment_in_rcti(struct rcti *rect, int s1[2], int s2[2]); // int BLI_segment_in_rctf(struct rcti *rect, int s1[2], int s2[2]); // NOT NEEDED YET int BLI_isect_rctf(struct rctf *src1, struct rctf *src2, struct rctf *dest); int BLI_isect_rcti(struct rcti *src1, struct rcti *src2, struct rcti *dest); diff --git a/source/blender/blenlib/BLI_scanfill.h b/source/blender/blenlib/BLI_scanfill.h index 081d5ccfb66..ceef378358b 100644 --- a/source/blender/blenlib/BLI_scanfill.h +++ b/source/blender/blenlib/BLI_scanfill.h @@ -41,8 +41,7 @@ struct ScanFillVert; extern "C" { #endif -typedef struct ScanFillContext -{ +typedef struct ScanFillContext { ListBase fillvertbase; ListBase filledgebase; ListBase fillfacebase; @@ -61,13 +60,12 @@ typedef struct ScanFillContext } ScanFillContext; /* note; changing this also might affect the undo copy in editmesh.c */ -typedef struct ScanFillVert -{ +typedef struct ScanFillVert { struct ScanFillVert *next, *prev; union { struct ScanFillVert *v; void *p; - intptr_t l; + intptr_t l; } tmp; float co[3]; /* vertex location */ float xy[2]; /* 2D copy of vertex location (using dominant axis) */ @@ -76,16 +74,14 @@ typedef struct ScanFillVert unsigned char f, h; } ScanFillVert; -typedef struct ScanFillEdge -{ +typedef struct ScanFillEdge { struct ScanFillEdge *next, *prev; struct ScanFillVert *v1, *v2; short poly_nr; unsigned char f; } ScanFillEdge; -typedef struct ScanFillFace -{ +typedef struct ScanFillFace { struct ScanFillFace *next, *prev; struct ScanFillVert *v1, *v2, *v3; } ScanFillFace; @@ -97,7 +93,7 @@ struct ScanFillEdge *BLI_scanfill_edge_add(ScanFillContext *sf_ctx, struct ScanF int BLI_scanfill_begin(ScanFillContext *sf_ctx); int BLI_scanfill_calc(ScanFillContext *sf_ctx, const short do_quad_tri_speedup); int BLI_scanfill_calc_ex(ScanFillContext *sf_ctx, const short do_quad_tri_speedup, - const float nor_proj[3]); + const float nor_proj[3]); void BLI_scanfill_end(ScanFillContext *sf_ctx); /* These callbacks are needed to make the lib finction properly */ @@ -108,7 +104,7 @@ void BLI_scanfill_end(ScanFillContext *sf_ctx); * \param f The function to use as callback * \attention used in creator.c */ -void BLI_setErrorCallBack(void (*f)(const char*)); +void BLI_setErrorCallBack(void (*f)(const char *)); /** * Set a function to be able to interrupt the execution of processing diff --git a/source/blender/blenlib/BLI_smallhash.h b/source/blender/blenlib/BLI_smallhash.h index 50631769ba9..09dd254c3fa 100644 --- a/source/blender/blenlib/BLI_smallhash.h +++ b/source/blender/blenlib/BLI_smallhash.h @@ -43,7 +43,7 @@ typedef struct { } SmallHashEntry; /*how much stack space to use before dynamically allocating memory*/ -#define SMSTACKSIZE 521 +#define SMSTACKSIZE 521 typedef struct SmallHash { SmallHashEntry *table; SmallHashEntry _stacktable[SMSTACKSIZE]; @@ -59,15 +59,15 @@ typedef struct { int i; } SmallHashIter; -void BLI_smallhash_init(SmallHash *hash); -void BLI_smallhash_release(SmallHash *hash); -void BLI_smallhash_insert(SmallHash *hash, uintptr_t key, void *item); -void BLI_smallhash_remove(SmallHash *hash, uintptr_t key); -void * BLI_smallhash_lookup(SmallHash *hash, uintptr_t key); -int BLI_smallhash_haskey(SmallHash *hash, uintptr_t key); -int BLI_smallhash_count(SmallHash *hash); -void * BLI_smallhash_iternext(SmallHashIter *iter, uintptr_t *key); -void * BLI_smallhash_iternew(SmallHash *hash, SmallHashIter *iter, uintptr_t *key); +void BLI_smallhash_init(SmallHash *hash); +void BLI_smallhash_release(SmallHash *hash); +void BLI_smallhash_insert(SmallHash *hash, uintptr_t key, void *item); +void BLI_smallhash_remove(SmallHash *hash, uintptr_t key); +void *BLI_smallhash_lookup(SmallHash *hash, uintptr_t key); +int BLI_smallhash_haskey(SmallHash *hash, uintptr_t key); +int BLI_smallhash_count(SmallHash *hash); +void *BLI_smallhash_iternext(SmallHashIter *iter, uintptr_t *key); +void *BLI_smallhash_iternew(SmallHash *hash, SmallHashIter *iter, uintptr_t *key); /* void BLI_smallhash_print(SmallHash *hash); */ /* UNUSED */ #endif /* __BLI_SMALLHASH_H__ */ diff --git a/source/blender/blenlib/BLI_string.h b/source/blender/blenlib/BLI_string.h index ec36d587d92..c8f439c677f 100644 --- a/source/blender/blenlib/BLI_string.h +++ b/source/blender/blenlib/BLI_string.h @@ -36,95 +36,95 @@ extern "C" { #endif - /** - * Duplicates the cstring \a str into a newly mallocN'd - * string and returns it. - * - * \param str The string to be duplicated - * \retval Returns the duplicated string - */ +/** + * Duplicates the cstring \a str into a newly mallocN'd + * string and returns it. + * + * \param str The string to be duplicated + * \retval Returns the duplicated string + */ char *BLI_strdup(const char *str); - /** - * Duplicates the first \a len bytes of cstring \a str - * into a newly mallocN'd string and returns it. \a str - * is assumed to be at least len bytes long. - * - * \param str The string to be duplicated - * \param len The number of bytes to duplicate - * \retval Returns the duplicated string - */ +/** + * Duplicates the first \a len bytes of cstring \a str + * into a newly mallocN'd string and returns it. \a str + * is assumed to be at least len bytes long. + * + * \param str The string to be duplicated + * \param len The number of bytes to duplicate + * \retval Returns the duplicated string + */ char *BLI_strdupn(const char *str, const size_t len); - /** - * Appends the two strings, and returns new mallocN'ed string - * \param str1 first string for copy - * \param str2 second string for append - * \retval Returns dst - */ +/** + * Appends the two strings, and returns new mallocN'ed string + * \param str1 first string for copy + * \param str2 second string for append + * \retval Returns dst + */ char *BLI_strdupcat(const char *str1, const char *str2); - /** - * Like strncpy but ensures dst is always - * '\0' terminated. - * - * \param dst Destination for copy - * \param src Source string to copy - * \param maxncpy Maximum number of characters to copy (generally - * the size of dst) - * \retval Returns dst - */ +/** + * Like strncpy but ensures dst is always + * '\0' terminated. + * + * \param dst Destination for copy + * \param src Source string to copy + * \param maxncpy Maximum number of characters to copy (generally + * the size of dst) + * \retval Returns dst + */ char *BLI_strncpy(char *dst, const char *src, const size_t maxncpy); - /* Makes a copy of the text within the "" that appear after some text 'blahblah' - * i.e. for string 'pose["apples"]' with prefix 'pose[', it should grab "apples" - * - * - str: is the entire string to chop - * - prefix: is the part of the string to leave out - * - * Assume that the strings returned must be freed afterwards, and that the inputs will contain - * data we want... - */ +/* Makes a copy of the text within the "" that appear after some text 'blahblah' + * i.e. for string 'pose["apples"]' with prefix 'pose[', it should grab "apples" + * + * - str: is the entire string to chop + * - prefix: is the part of the string to leave out + * + * Assume that the strings returned must be freed afterwards, and that the inputs will contain + * data we want... + */ char *BLI_getQuotedStr(const char *str, const char *prefix); - /** - * Returns a copy of the cstring \a str into a newly mallocN'd - * string with all instances of oldText replaced with newText, - * and returns it. - * - * \param str The string to replace occurrences of oldText in - * \param oldText The text in the string to find and replace - * \param newText The text in the string to find and replace - * \retval Returns the duplicated string - */ +/** + * Returns a copy of the cstring \a str into a newly mallocN'd + * string with all instances of oldText replaced with newText, + * and returns it. + * + * \param str The string to replace occurrences of oldText in + * \param oldText The text in the string to find and replace + * \param newText The text in the string to find and replace + * \retval Returns the duplicated string + */ char *BLI_replacestr(char *str, const char *oldText, const char *newText); - /* - * Replacement for snprintf - */ +/* + * Replacement for snprintf + */ size_t BLI_snprintf(char *buffer, size_t len, const char *format, ...) #ifdef __GNUC__ -__attribute__ ((format (printf, 3, 4))) +__attribute__ ((format(printf, 3, 4))) #endif ; - /* - * Print formatted string into a newly mallocN'd string - * and return it. - */ +/* + * Print formatted string into a newly mallocN'd string + * and return it. + */ char *BLI_sprintfN(const char *format, ...) #ifdef __GNUC__ -__attribute__ ((format (printf, 1, 2))) +__attribute__ ((format(printf, 1, 2))) #endif ; size_t BLI_strescape(char *dst, const char *src, const size_t maxlen); - /** - * Compare two strings without regard to case. - * - * \retval True if the strings are equal, false otherwise. - */ +/** + * Compare two strings without regard to case. + * + * \retval True if the strings are equal, false otherwise. + */ int BLI_strcaseeq(const char *a, const char *b); char *BLI_strcasestr(const char *s, const char *find); diff --git a/source/blender/blenlib/BLI_string_utf8.h b/source/blender/blenlib/BLI_string_utf8.h index 7799c32c4b7..56ed4beba53 100644 --- a/source/blender/blenlib/BLI_string_utf8.h +++ b/source/blender/blenlib/BLI_string_utf8.h @@ -37,17 +37,17 @@ int BLI_utf8_invalid_byte(const char *str, int length); int BLI_utf8_invalid_strip(char *str, int length); int BLI_str_utf8_size(const char *p); /* warning, can return -1 on bad chars */ - /* copied from glib */ +/* copied from glib */ unsigned int BLI_str_utf8_as_unicode(const char *p); unsigned int BLI_str_utf8_as_unicode_and_size(const char *p, size_t *index); unsigned int BLI_str_utf8_as_unicode_step(const char *p, size_t *index); -size_t BLI_str_utf8_from_unicode(unsigned int c, char *outbuf); +size_t BLI_str_utf8_from_unicode(unsigned int c, char *outbuf); char *BLI_str_find_prev_char_utf8(const char *str, const char *p); char *BLI_str_find_next_char_utf8(const char *p, const char *end); char *BLI_str_prev_char_utf8(const char *p); - /* wchar_t functions, copied from blenders own font.c originally */ +/* wchar_t functions, copied from blenders own font.c originally */ size_t BLI_wstrlen_utf8(const wchar_t *src); size_t BLI_strlen_utf8(const char *strc); size_t BLI_strncpy_wchar_as_utf8(char *dst, const wchar_t *src, const size_t maxcpy); diff --git a/source/blender/blenlib/BLI_threads.h b/source/blender/blenlib/BLI_threads.h index a4698ab4dd0..b13da9f0dd4 100644 --- a/source/blender/blenlib/BLI_threads.h +++ b/source/blender/blenlib/BLI_threads.h @@ -35,7 +35,7 @@ #include <pthread.h> /* for tables, button in UI, etc */ -#define BLENDER_MAX_THREADS 64 +#define BLENDER_MAX_THREADS 64 struct ListBase; @@ -44,15 +44,15 @@ struct ListBase; /*this is run once at startup*/ void BLI_threadapi_init(void); -void BLI_init_threads (struct ListBase *threadbase, void *(*do_thread)(void *), int tot); -int BLI_available_threads(struct ListBase *threadbase); -int BLI_available_thread_index(struct ListBase *threadbase); -void BLI_insert_thread (struct ListBase *threadbase, void *callerdata); -void BLI_remove_thread (struct ListBase *threadbase, void *callerdata); -void BLI_remove_thread_index(struct ListBase *threadbase, int index); -void BLI_remove_threads(struct ListBase *threadbase); -void BLI_end_threads (struct ListBase *threadbase); -int BLI_thread_is_main(void); +void BLI_init_threads(struct ListBase *threadbase, void *(*do_thread)(void *), int tot); +int BLI_available_threads(struct ListBase *threadbase); +int BLI_available_thread_index(struct ListBase *threadbase); +void BLI_insert_thread(struct ListBase *threadbase, void *callerdata); +void BLI_remove_thread(struct ListBase *threadbase, void *callerdata); +void BLI_remove_thread_index(struct ListBase *threadbase, int index); +void BLI_remove_threads(struct ListBase *threadbase); +void BLI_end_threads(struct ListBase *threadbase); +int BLI_thread_is_main(void); void BLI_begin_threaded_malloc(void); @@ -60,28 +60,28 @@ void BLI_end_threaded_malloc(void); /* System Information */ -int BLI_system_thread_count(void); /* gets the number of threads the system can make use of */ +int BLI_system_thread_count(void); /* gets the number of threads the system can make use of */ /* Global Mutex Locks * * One custom lock available now. can be extended. */ -#define LOCK_IMAGE 0 -#define LOCK_PREVIEW 1 -#define LOCK_VIEWER 2 -#define LOCK_CUSTOM1 3 -#define LOCK_RCACHE 4 -#define LOCK_OPENGL 5 -#define LOCK_NODES 6 -#define LOCK_MOVIECLIP 7 +#define LOCK_IMAGE 0 +#define LOCK_PREVIEW 1 +#define LOCK_VIEWER 2 +#define LOCK_CUSTOM1 3 +#define LOCK_RCACHE 4 +#define LOCK_OPENGL 5 +#define LOCK_NODES 6 +#define LOCK_MOVIECLIP 7 -void BLI_lock_thread(int type); -void BLI_unlock_thread(int type); +void BLI_lock_thread(int type); +void BLI_unlock_thread(int type); /* Mutex Lock */ typedef pthread_mutex_t ThreadMutex; -#define BLI_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER +#define BLI_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER void BLI_mutex_init(ThreadMutex *mutex); void BLI_mutex_lock(ThreadMutex *mutex); @@ -90,8 +90,8 @@ void BLI_mutex_end(ThreadMutex *mutex); /* Read/Write Mutex Lock */ -#define THREAD_LOCK_READ 1 -#define THREAD_LOCK_WRITE 2 +#define THREAD_LOCK_READ 1 +#define THREAD_LOCK_WRITE 2 typedef pthread_rwlock_t ThreadRWMutex; diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h index 18c2aa3313c..d027a3da2ef 100644 --- a/source/blender/blenlib/BLI_utildefines.h +++ b/source/blender/blenlib/BLI_utildefines.h @@ -41,16 +41,16 @@ #endif -#define ELEM(a, b, c) ( (a)==(b) || (a)==(c) ) -#define ELEM3(a, b, c, d) ( ELEM(a, b, c) || (a)==(d) ) -#define ELEM4(a, b, c, d, e) ( ELEM(a, b, c) || ELEM(a, d, e) ) -#define ELEM5(a, b, c, d, e, f) ( ELEM(a, b, c) || ELEM3(a, d, e, f) ) -#define ELEM6(a, b, c, d, e, f, g) ( ELEM(a, b, c) || ELEM4(a, d, e, f, g) ) -#define ELEM7(a, b, c, d, e, f, g, h) ( ELEM3(a, b, c, d) || ELEM4(a, e, f, g, h) ) -#define ELEM8(a, b, c, d, e, f, g, h, i) ( ELEM4(a, b, c, d, e) || ELEM4(a, f, g, h, i) ) -#define ELEM9(a, b, c, d, e, f, g, h, i, j) ( ELEM4(a, b, c, d, e) || ELEM5(a, f, g, h, i, j) ) -#define ELEM10(a, b, c, d, e, f, g, h, i, j, k) ( ELEM4(a, b, c, d, e) || ELEM6(a, f, g, h, i, j, k) ) -#define ELEM11(a, b, c, d, e, f, g, h, i, j, k, l) ( ELEM4(a, b, c, d, e) || ELEM7(a, f, g, h, i, j, k, l) ) +#define ELEM(a, b, c) ((a) == (b) || (a) == (c)) +#define ELEM3(a, b, c, d) (ELEM(a, b, c) || (a) == (d) ) +#define ELEM4(a, b, c, d, e) (ELEM(a, b, c) || ELEM(a, d, e) ) +#define ELEM5(a, b, c, d, e, f) (ELEM(a, b, c) || ELEM3(a, d, e, f) ) +#define ELEM6(a, b, c, d, e, f, g) (ELEM(a, b, c) || ELEM4(a, d, e, f, g) ) +#define ELEM7(a, b, c, d, e, f, g, h) (ELEM3(a, b, c, d) || ELEM4(a, e, f, g, h) ) +#define ELEM8(a, b, c, d, e, f, g, h, i) (ELEM4(a, b, c, d, e) || ELEM4(a, f, g, h, i) ) +#define ELEM9(a, b, c, d, e, f, g, h, i, j) (ELEM4(a, b, c, d, e) || ELEM5(a, f, g, h, i, j) ) +#define ELEM10(a, b, c, d, e, f, g, h, i, j, k) (ELEM4(a, b, c, d, e) || ELEM6(a, f, g, h, i, j, k) ) +#define ELEM11(a, b, c, d, e, f, g, h, i, j, k, l) (ELEM4(a, b, c, d, e) || ELEM7(a, f, g, h, i, j, k, l) ) /* shift around elements */ #define SHIFT3(type, a, b, c) { \ @@ -59,7 +59,7 @@ a = c; \ c = b; \ b = tmp; \ - } (void)0 +} (void)0 #define SHIFT4(type, a, b, c, d) { \ type tmp; \ tmp = a; \ @@ -67,16 +67,16 @@ d = c; \ c = b; \ b = tmp; \ - } (void)0 +} (void)0 /* min/max */ -#define MIN2(x,y) ( (x)<(y) ? (x) : (y) ) -#define MIN3(x,y,z) MIN2( MIN2((x),(y)) , (z) ) -#define MIN4(x,y,z,a) MIN2( MIN2((x),(y)) , MIN2((z),(a)) ) +#define MIN2(x, y) ( (x) < (y) ? (x) : (y) ) +#define MIN3(x, y, z) MIN2(MIN2((x), (y)), (z) ) +#define MIN4(x, y, z, a) MIN2(MIN2((x), (y)), MIN2((z), (a)) ) -#define MAX2(x,y) ( (x)>(y) ? (x) : (y) ) -#define MAX3(x,y,z) MAX2( MAX2((x),(y)) , (z) ) -#define MAX4(x,y,z,a) MAX2( MAX2((x),(y)) , MAX2((z),(a)) ) +#define MAX2(x, y) ( (x) > (y) ? (x) : (y) ) +#define MAX3(x, y, z) MAX2(MAX2((x), (y)), (z) ) +#define MAX4(x, y, z, a) MAX2(MAX2((x), (y)), MAX2((z), (a)) ) #define INIT_MINMAX(min, max) { \ (min)[0] = (min)[1] = (min)[2] = 1.0e30f; \ @@ -114,70 +114,71 @@ /* some math and copy defines */ #ifndef SWAP -# define SWAP(type, a, b) { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; } +# define SWAP(type, a, b) { type sw_ap; sw_ap = (a); (a) = (b); (b) = sw_ap; } #endif -#define ABS(a) ( (a)<0 ? (-(a)) : (a) ) +#define ABS(a) ( (a) < 0 ? (-(a)) : (a) ) -#define FTOCHAR(val) ((val)<=0.0f)? 0 : (((val)>(1.0f-0.5f/255.0f))? 255 : (char)((255.0f*(val))+0.5f)) -#define FTOUSHORT(val) ((val >= 1.0f-0.5f/65535)? 65535: (val <= 0.0f)? 0: (unsigned short)(val*65535.0f + 0.5f)) -#define USHORTTOUCHAR(val) ((unsigned char)(((val) >= 65535-128)? 255: ((val)+128)>>8)) +#define FTOCHAR(val) ((val) <= 0.0f) ? 0 : (((val) > (1.0f - 0.5f / 255.0f)) ? 255 : (char)((255.0f * (val)) + 0.5f)) +#define FTOUSHORT(val) ((val >= 1.0f - 0.5f / 65535) ? 65535 : (val <= 0.0f) ? 0 : (unsigned short)(val * 65535.0f + 0.5f)) +#define USHORTTOUCHAR(val) ((unsigned char)(((val) >= 65535 - 128) ? 255 : ((val) + 128) >> 8)) #define F3TOCHAR3(v2, v1) { \ - (v1)[0]= FTOCHAR((v2[0])); \ - (v1)[1]= FTOCHAR((v2[1])); \ - (v1)[2]= FTOCHAR((v2[2])); \ - } (void)0 + (v1)[0] = FTOCHAR((v2[0])); \ + (v1)[1] = FTOCHAR((v2[1])); \ + (v1)[2] = FTOCHAR((v2[2])); \ +} (void)0 #define F3TOCHAR4(v2, v1) { \ - (v1)[0]= FTOCHAR((v2[0])); \ - (v1)[1]= FTOCHAR((v2[1])); \ - (v1)[2]= FTOCHAR((v2[2])); \ - (v1)[3]= 255; \ - } (void)0 + (v1)[0] = FTOCHAR((v2[0])); \ + (v1)[1] = FTOCHAR((v2[1])); \ + (v1)[2] = FTOCHAR((v2[2])); \ + (v1)[3] = 255; \ +} (void)0 #define F4TOCHAR4(v2, v1) { \ - (v1)[0]= FTOCHAR((v2[0])); \ - (v1)[1]= FTOCHAR((v2[1])); \ - (v1)[2]= FTOCHAR((v2[2])); \ - (v1)[3]= FTOCHAR((v2[3])); \ - } (void)0 + (v1)[0] = FTOCHAR((v2[0])); \ + (v1)[1] = FTOCHAR((v2[1])); \ + (v1)[2] = FTOCHAR((v2[2])); \ + (v1)[3] = FTOCHAR((v2[3])); \ +} (void)0 #define VECCOPY(v1, v2) { \ - *(v1)= *(v2); \ - *(v1+1)= *(v2+1); \ - *(v1+2)= *(v2+2); \ - } (void)0 + *(v1) = *(v2); \ + *(v1 + 1) = *(v2 + 1); \ + *(v1 + 2) = *(v2 + 2); \ +} (void)0 #define VECCOPY2D(v1, v2) { \ - *(v1)= *(v2); \ - *(v1+1)= *(v2+1); \ - } (void)0 -#define VECADD(v1,v2,v3) { \ - *(v1)= *(v2) + *(v3); \ - *(v1+1)= *(v2+1) + *(v3+1); \ - *(v1+2)= *(v2+2) + *(v3+2); \ - } (void)0 -#define VECSUB(v1,v2,v3) { \ - *(v1)= *(v2) - *(v3); \ - *(v1+1)= *(v2+1) - *(v3+1); \ - *(v1+2)= *(v2+2) - *(v3+2); \ - } (void)0 -#define VECSUB2D(v1,v2,v3) { \ - *(v1)= *(v2) - *(v3); \ - *(v1+1)= *(v2+1) - *(v3+1); \ - } (void)0 -#define VECADDFAC(v1,v2,v3,fac) { \ - *(v1)= *(v2) + *(v3)*(fac); \ - *(v1+1)= *(v2+1) + *(v3+1)*(fac); \ - *(v1+2)= *(v2+2) + *(v3+2)*(fac); \ - } (void)0 -#define VECSUBFAC(v1,v2,v3,fac) { \ - *(v1)= *(v2) - *(v3)*(fac); \ - *(v1+1)= *(v2+1) - *(v3+1)*(fac); \ - *(v1+2)= *(v2+2) - *(v3+2)*(fac); \ - } (void)0 - -#define INPR(v1, v2) ( (v1)[0]*(v2)[0] + (v1)[1]*(v2)[1] + (v1)[2]*(v2)[2] ) + *(v1) = *(v2); \ + *(v1 + 1) = *(v2 + 1); \ +} (void)0 +#define VECADD(v1, v2, v3) { \ + *(v1) = *(v2) + *(v3); \ + *(v1 + 1) = *(v2 + 1) + *(v3 + 1); \ + *(v1 + 2) = *(v2 + 2) + *(v3 + 2); \ +} (void)0 +#define VECSUB(v1, v2, v3) { \ + *(v1) = *(v2) - *(v3); \ + *(v1 + 1) = *(v2 + 1) - *(v3 + 1); \ + *(v1 + 2) = *(v2 + 2) - *(v3 + 2); \ +} (void)0 +#define VECSUB2D(v1, v2, v3) { \ + *(v1) = *(v2) - *(v3); \ + *(v1 + 1) = *(v2 + 1) - *(v3 + 1); \ +} (void)0 +#define VECADDFAC(v1, v2, v3, fac) { \ + *(v1) = *(v2) + *(v3) * (fac); \ + *(v1 + 1) = *(v2 + 1) + *(v3 + 1) * (fac); \ + *(v1 + 2) = *(v2 + 2) + *(v3 + 2) * (fac); \ +} (void)0 +#define VECSUBFAC(v1, v2, v3, fac) { \ + *(v1) = *(v2) - *(v3) * (fac); \ + *(v1 + 1) = *(v2 + 1) - *(v3 + 1) * (fac); \ + *(v1 + 2) = *(v2 + 2) - *(v3 + 2) * (fac); \ +} (void)0 + +#define INPR(v1, v2) ( (v1)[0] * (v2)[0] + (v1)[1] * (v2)[1] + (v1)[2] * (v2)[2]) /* some misc stuff.... */ -#define CLAMP(a, b, c) if((a)<(b)) (a)=(b); else if((a)>(c)) (a)=(c) -#define CLAMPIS(a, b, c) ((a)<(b) ? (b) : (a)>(c) ? (c) : (a)) +#define CLAMP(a, b, c) if ((a) < (b)) (a) = (b); else if ((a) > (c)) (a) = (c) + +#define CLAMPIS(a, b, c) ((a) < (b) ? (b) : (a) > (c) ? (c) : (a)) #define CLAMPTEST(a, b, c) \ if ((b) < (c)) { \ CLAMP(a, b, c); \ @@ -186,16 +187,16 @@ CLAMP(a, c, b); \ } (void) -#define IS_EQ(a,b) ((fabs((double)(a)-(b)) >= (double) FLT_EPSILON) ? 0 : 1) -#define IS_EQF(a,b) ((fabsf((float)(a)-(b)) >= (float) FLT_EPSILON) ? 0 : 1) +#define IS_EQ(a, b) ((fabs((double)(a) - (b)) >= (double) FLT_EPSILON) ? 0 : 1) +#define IS_EQF(a, b) ((fabsf((float)(a) - (b)) >= (float) FLT_EPSILON) ? 0 : 1) -#define IS_EQT(a, b, c) ((a > b)? (((a-b) <= c)? 1:0) : ((((b-a) <= c)? 1:0))) -#define IN_RANGE(a, b, c) ((b < c)? ((b<a && a<c)? 1:0) : ((c<a && a<b)? 1:0)) -#define IN_RANGE_INCL(a, b, c) ((b < c)? ((b<=a && a<=c)? 1:0) : ((c<=a && a<=b)? 1:0)) +#define IS_EQT(a, b, c) ((a > b) ? (((a - b) <= c) ? 1 : 0) : ((((b - a) <= c) ? 1 : 0))) +#define IN_RANGE(a, b, c) ((b < c) ? ((b < a && a < c) ? 1 : 0) : ((c < a && a < b) ? 1 : 0)) +#define IN_RANGE_INCL(a, b, c) ((b < c) ? ((b <= a && a <= c) ? 1 : 0) : ((c <= a && a <= b) ? 1 : 0)) /* array helpers */ #define ARRAY_LAST_ITEM(arr_start, arr_dtype, elem_size, tot) \ - (arr_dtype *)((char*)arr_start + (elem_size*(tot - 1))) + (arr_dtype *)((char *)arr_start + (elem_size * (tot - 1))) #define ARRAY_HAS_ITEM(item, arr_start, arr_dtype, elem_size, tot) ( \ (item >= arr_start) && \ @@ -205,24 +206,24 @@ /* This one rotates the bytes in an int64, int (32) and short (16) */ #define SWITCH_INT64(a) { \ char s_i, *p_i; \ - p_i= (char *)&(a); \ - s_i= p_i[0]; p_i[0]= p_i[7]; p_i[7]= s_i; \ - s_i= p_i[1]; p_i[1]= p_i[6]; p_i[6]= s_i; \ - s_i= p_i[2]; p_i[2]= p_i[5]; p_i[5]= s_i; \ - s_i= p_i[3]; p_i[3]= p_i[4]; p_i[4]= s_i; \ + p_i = (char *)&(a); \ + s_i = p_i[0]; p_i[0] = p_i[7]; p_i[7] = s_i; \ + s_i = p_i[1]; p_i[1] = p_i[6]; p_i[6] = s_i; \ + s_i = p_i[2]; p_i[2] = p_i[5]; p_i[5] = s_i; \ + s_i = p_i[3]; p_i[3] = p_i[4]; p_i[4] = s_i; \ } (void)0 #define SWITCH_INT(a) { \ char s_i, *p_i; \ - p_i= (char *)&(a); \ - s_i= p_i[0]; p_i[0]= p_i[3]; p_i[3]= s_i; \ - s_i= p_i[1]; p_i[1]= p_i[2]; p_i[2]= s_i; \ + p_i = (char *)&(a); \ + s_i = p_i[0]; p_i[0] = p_i[3]; p_i[3] = s_i; \ + s_i = p_i[1]; p_i[1] = p_i[2]; p_i[2] = s_i; \ } (void)0 #define SWITCH_SHORT(a) { \ char s_i, *p_i; \ - p_i= (char *)&(a); \ - s_i=p_i[0]; p_i[0]=p_i[1]; p_i[1]=s_i; \ + p_i = (char *)&(a); \ + s_i = p_i[0]; p_i[0] = p_i[1]; p_i[1] = s_i; \ } (void)0 diff --git a/source/blender/blenlib/BLI_vfontdata.h b/source/blender/blenlib/BLI_vfontdata.h index 0020ba308af..a63ec8e9f61 100644 --- a/source/blender/blenlib/BLI_vfontdata.h +++ b/source/blender/blenlib/BLI_vfontdata.h @@ -47,20 +47,19 @@ typedef struct VFontData { // float resol[MAX_VF_CHARS]; // float width[MAX_VF_CHARS]; // float *points[MAX_VF_CHARS]; - char name[128]; + char name[128]; } VFontData; typedef struct VChar { struct VChar *next, *prev; - ListBase nurbsbase; - intptr_t index; - float resol; - float width; + ListBase nurbsbase; + intptr_t index; + float resol; + float width; float *points; } VChar; -struct TmpFont -{ +struct TmpFont { struct TmpFont *next, *prev; struct PackedFile *pf; struct VFont *vfont; @@ -74,13 +73,9 @@ struct TmpFont * \retval A new VFontData structure, or NULL * if unable to load. */ - VFontData* -BLI_vfontdata_from_freetypefont( - struct PackedFile *pf); +VFontData *BLI_vfontdata_from_freetypefont(struct PackedFile *pf); - int -BLI_vfontchar_from_freetypefont( - struct VFont *vfont, unsigned long character); +int BLI_vfontchar_from_freetypefont(struct VFont *vfont, unsigned long character); #endif diff --git a/source/blender/blenlib/BLI_winstuff.h b/source/blender/blenlib/BLI_winstuff.h index a0ab88e8baf..70c7f1d9cae 100644 --- a/source/blender/blenlib/BLI_winstuff.h +++ b/source/blender/blenlib/BLI_winstuff.h @@ -52,7 +52,7 @@ #ifndef WIN32_SKIP_HKEY_PROTECTION # undef HKEY -# define HKEY WIN32_HKEY // prevent competing definitions +# define HKEY WIN32_HKEY /* prevent competing definitions */ # include <windows.h> # undef HKEY #else @@ -85,10 +85,10 @@ extern "C" { #define MAXPATHLEN MAX_PATH #ifndef S_ISREG -# define S_ISREG(x) (((x)&_S_IFREG) == _S_IFREG) +# define S_ISREG(x) (((x) & _S_IFREG) == _S_IFREG) #endif #ifndef S_ISDIR -# define S_ISDIR(x) (((x)&_S_IFDIR) == _S_IFDIR) +# define S_ISDIR(x) (((x) & _S_IFDIR) == _S_IFDIR) #endif /* defines for using ISO C++ conformant names */ @@ -139,9 +139,9 @@ typedef struct _DIR { } DIR; void RegisterBlendExtension(void); -DIR *opendir (const char *path); +DIR *opendir(const char *path); struct dirent *readdir(DIR *dp); -int closedir (DIR *dp); +int closedir(DIR *dp); void get_default_root(char *root); int check_file_chars(char *filename); const char *dirname(char *path); diff --git a/source/blender/blenlib/PIL_time.h b/source/blender/blenlib/PIL_time.h index c3c10239a8e..6153007be80 100644 --- a/source/blender/blenlib/PIL_time.h +++ b/source/blender/blenlib/PIL_time.h @@ -39,39 +39,39 @@ extern "C" { #endif extern - /** Return an indication of time, expressed as - * seconds since some fixed point. Successive calls - * are guaranteed to generate values greater than or - * equal to the last call. - */ -double PIL_check_seconds_timer (void); +/** Return an indication of time, expressed as + * seconds since some fixed point. Successive calls + * are guaranteed to generate values greater than or + * equal to the last call. + */ +double PIL_check_seconds_timer(void); - /** - * Platform-independent sleep function. - * \param ms Number of milliseconds to sleep - */ -void PIL_sleep_ms (int ms); +/** + * Platform-independent sleep function. + * \param ms Number of milliseconds to sleep + */ +void PIL_sleep_ms(int ms); /** Utility defines for timing. * requires BLI_utildefines.h for 'AT' * TIMEIT_VALUE returns the time since TIMEIT_START was called. */ -#define TIMEIT_START(var) \ -{ \ - double _timeit_##var= PIL_check_seconds_timer(); \ - printf("time start (" #var "): " AT "\n"); \ - fflush(stdout); \ - { \ +#define TIMEIT_START(var) \ + { \ + double _timeit_##var = PIL_check_seconds_timer(); \ + printf("time start (" #var "): " AT "\n"); \ + fflush(stdout); \ + { (void) \ #define TIMEIT_VALUE(var) (float)(PIL_check_seconds_timer() - _timeit_##var) -#define TIMEIT_END(var) \ - } \ - printf("time end (" #var "): %.6f" " " AT "\n", TIMEIT_VALUE(var)); \ - fflush(stdout); \ -} \ +#define TIMEIT_END(var) \ + } \ + printf("time end (" #var "): %.6f" " " AT "\n", TIMEIT_VALUE(var)); \ + fflush(stdout); \ +} (void) \ #ifdef __cplusplus } diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h index bddaa5f67d6..f0bf7e99758 100644 --- a/source/blender/blenloader/BLO_readfile.h +++ b/source/blender/blenloader/BLO_readfile.h @@ -49,54 +49,54 @@ struct bContext; struct BHead; struct FileData; -typedef struct BlendHandle BlendHandle; +typedef struct BlendHandle BlendHandle; typedef enum BlenFileType { - BLENFILETYPE_BLEND= 1, - BLENFILETYPE_PUB= 2, - BLENFILETYPE_RUNTIME= 3 + BLENFILETYPE_BLEND = 1, + BLENFILETYPE_PUB = 2, + BLENFILETYPE_RUNTIME = 3 } BlenFileType; typedef struct BlendFileData { - struct Main* main; - struct UserDef* user; + struct Main *main; + struct UserDef *user; int winpos; int fileflags; int displaymode; int globalf; - char filename[1024]; /* 1024 = FILE_MAX */ + char filename[1024]; /* 1024 = FILE_MAX */ - struct bScreen* curscreen; - struct Scene* curscene; + struct bScreen *curscreen; + struct Scene *curscene; - BlenFileType type; + BlenFileType type; } BlendFileData; - /** - * Open a blender file from a pathname. The function - * returns NULL and sets a report in the list if - * it cannot open the file. - * - * \param filepath The path of the file to open. - * \param reports If the return value is NULL, errors - * indicating the cause of the failure. - * \return The data of the file. - */ -BlendFileData* BLO_read_from_file(const char *filepath, struct ReportList *reports); - - /** - * Open a blender file from memory. The function - * returns NULL and sets a report in the list if - * it cannot open the file. - * - * \param mem The file data. - * \param memsize The length of \a mem. - * \param reports If the return value is NULL, errors - * indicating the cause of the failure. - * \return The data of the file. - */ -BlendFileData* BLO_read_from_memory(void *mem, int memsize, struct ReportList *reports); +/** + * Open a blender file from a pathname. The function + * returns NULL and sets a report in the list if + * it cannot open the file. + * + * \param filepath The path of the file to open. + * \param reports If the return value is NULL, errors + * indicating the cause of the failure. + * \return The data of the file. + */ +BlendFileData *BLO_read_from_file(const char *filepath, struct ReportList *reports); + +/** + * Open a blender file from memory. The function + * returns NULL and sets a report in the list if + * it cannot open the file. + * + * \param mem The file data. + * \param memsize The length of \a mem. + * \param reports If the return value is NULL, errors + * indicating the cause of the failure. + * \return The data of the file. + */ +BlendFileData *BLO_read_from_memory(void *mem, int memsize, struct ReportList *reports); /** * oldmain is old main, from which we will keep libraries, images, .. @@ -111,9 +111,8 @@ BlendFileData *BLO_read_from_memfile(struct Main *oldmain, const char *filename, * * \param bfd The structure to free. */ - void -BLO_blendfiledata_free( - BlendFileData *bfd); +void +BLO_blendfiledata_free(BlendFileData *bfd); /** * Open a blendhandle from a file path. @@ -122,10 +121,9 @@ BLO_blendfiledata_free( * \param reports Report errors in opening the file (can be NULL). * \return A handle on success, or NULL on failure. */ - BlendHandle* -BLO_blendhandle_from_file( - char *file, - struct ReportList *reports); +BlendHandle * +BLO_blendhandle_from_file(char *file, + struct ReportList *reports); /** * Open a blendhandle from memory. @@ -135,10 +133,9 @@ BLO_blendhandle_from_file( * \return A handle on success, or NULL on failure. */ - BlendHandle* -BLO_blendhandle_from_memory( - void *mem, - int memsize); +BlendHandle * +BLO_blendhandle_from_memory(void *mem, + int memsize); /** * Gets the names of all the datablocks in a file @@ -151,11 +148,10 @@ BLO_blendhandle_from_memory( * \return A BLI_linklist of strings. The string links * should be freed with malloc. */ - struct LinkNode* -BLO_blendhandle_get_datablock_names( - BlendHandle *bh, - int ofblocktype, - int *tot_names); +struct LinkNode * +BLO_blendhandle_get_datablock_names(BlendHandle *bh, + int ofblocktype, + int *tot_names); /** * Gets the previews of all the datablocks in a file @@ -168,11 +164,10 @@ BLO_blendhandle_get_datablock_names( * \return A BLI_linklist of PreviewImage. The PreviewImage links * should be freed with malloc. */ - struct LinkNode* -BLO_blendhandle_get_previews( - BlendHandle *bh, - int ofblocktype, - int *tot_prev); +struct LinkNode * +BLO_blendhandle_get_previews(BlendHandle *bh, + int ofblocktype, + int *tot_prev); /** * Gets the names of all the datablock groups in a @@ -183,9 +178,8 @@ BLO_blendhandle_get_previews( * \return A BLI_linklist of strings. The string links * should be freed with malloc. */ - struct LinkNode* -BLO_blendhandle_get_linkable_groups( - BlendHandle *bh); +struct LinkNode * +BLO_blendhandle_get_linkable_groups(BlendHandle *bh); /** * Close and free a blendhandle. The handle @@ -193,11 +187,10 @@ BLO_blendhandle_get_linkable_groups( * * \param bh The handle to close. */ - void -BLO_blendhandle_close( - BlendHandle *bh); +void +BLO_blendhandle_close(BlendHandle *bh); - /***/ +/***/ #define GROUP_MAX 32 @@ -217,7 +210,7 @@ int BLO_is_a_library(const char *path, char *dir, char *group); * \param filepath Used for relative linking, copied to the lib->name * \return the library Main, to be passed to BLO_library_append_named_part as mainl. */ -struct Main* BLO_library_append_begin(struct Main *mainvar, BlendHandle** bh, const char *filepath); +struct Main *BLO_library_append_begin(struct Main *mainvar, BlendHandle **bh, const char *filepath); /** @@ -229,7 +222,7 @@ struct Main* BLO_library_append_begin(struct Main *mainvar, BlendHandle** bh, co * \param idcode The kind of datablock to link. * \return the appended ID when found. */ -struct ID *BLO_library_append_named_part(struct Main *mainl, BlendHandle** bh, const char *idname, const int idcode); +struct ID *BLO_library_append_named_part(struct Main *mainl, BlendHandle **bh, const char *idname, const int idcode); /** * Link/Append a named datablock from an external blend file. @@ -243,13 +236,13 @@ struct ID *BLO_library_append_named_part(struct Main *mainl, BlendHandle** bh, c * \param flag Options for linking, used for instancing. * \return the appended ID when found. */ -struct ID *BLO_library_append_named_part_ex(const struct bContext *C, struct Main *mainl, BlendHandle** bh, const char *idname, const int idcode, const short flag); +struct ID *BLO_library_append_named_part_ex(const struct bContext *C, struct Main *mainl, BlendHandle **bh, const char *idname, const int idcode, const short flag); -void BLO_library_append_end(const struct bContext *C, struct Main *mainl, BlendHandle** bh, int idcode, short flag); +void BLO_library_append_end(const struct bContext *C, struct Main *mainl, BlendHandle **bh, int idcode, short flag); void *BLO_library_read_struct(struct FileData *fd, struct BHead *bh, const char *blockname); -BlendFileData* blo_read_blendafterruntime(int file, const char *name, int actualsize, struct ReportList *reports); +BlendFileData *blo_read_blendafterruntime(int file, const char *name, int actualsize, struct ReportList *reports); #ifdef __cplusplus } diff --git a/source/blender/blenloader/BLO_sys_types.h b/source/blender/blenloader/BLO_sys_types.h index 41e33eb2a05..4e76481c394 100644 --- a/source/blender/blenloader/BLO_sys_types.h +++ b/source/blender/blenloader/BLO_sys_types.h @@ -53,12 +53,12 @@ extern "C" { * need to include anything else here. */ -typedef signed __int8 int8_t; +typedef signed __int8 int8_t; typedef signed __int16 int16_t; typedef signed __int32 int32_t; typedef signed __int64 int64_t; -typedef unsigned __int8 uint8_t; +typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; typedef unsigned __int64 uint64_t; @@ -83,19 +83,19 @@ typedef unsigned long uintptr_t; #elif defined(__linux__) || defined(__NetBSD__) || defined(__OpenBSD__) - /* Linux-i386, Linux-Alpha, Linux-ppc */ +/* Linux-i386, Linux-Alpha, Linux-ppc */ #include <stdint.h> /* XXX */ #ifndef UINT64_MAX -# define UINT64_MAX 18446744073709551615 -typedef uint8_t u_int8_t; -typedef uint16_t u_int16_t; -typedef uint32_t u_int32_t; -typedef uint64_t u_int64_t; +# define UINT64_MAX 18446744073709551615 +typedef uint8_t u_int8_t; +typedef uint16_t u_int16_t; +typedef uint32_t u_int32_t; +typedef uint64_t u_int64_t; #endif -#elif defined (__APPLE__) +#elif defined(__APPLE__) #include <inttypes.h> @@ -108,7 +108,7 @@ unsigned long __attribute__((__stdcall__)) htonl(unsigned long); #else - /* FreeBSD, Solaris */ +/* FreeBSD, Solaris */ #include <sys/types.h> #endif /* ifdef platform for types */ @@ -123,9 +123,9 @@ unsigned long __attribute__((__stdcall__)) htonl(unsigned long); #define ntohl(x) correctByteOrder(x) #endif #endif -#elif defined (__FreeBSD__) || defined (__OpenBSD__) +#elif defined(__FreeBSD__) || defined(__OpenBSD__) #include <sys/param.h> -#elif defined (__APPLE__) +#elif defined(__APPLE__) #include <sys/types.h> #else /* sun linux */ #include <netinet/in.h> diff --git a/source/blender/blenloader/intern/readfile.h b/source/blender/blenloader/intern/readfile.h index 9be375977e9..aa388923f6b 100644 --- a/source/blender/blenloader/intern/readfile.h +++ b/source/blender/blenloader/intern/readfile.h @@ -75,8 +75,8 @@ typedef struct FileData { char *compflags; int fileversion; - int id_name_offs; /* used to retrieve ID names from (bhead+1) */ - int globalf, fileflags; /* for do_versions patching */ + int id_name_offs; /* used to retrieve ID names from (bhead+1) */ + int globalf, fileflags; /* for do_versions patching */ struct OldNewMap *datamap; struct OldNewMap *globmap; @@ -89,9 +89,9 @@ typedef struct FileData { ListBase mainlist; - /* ick ick, used to return - * data through streamglue. - */ + /* ick ick, used to return + * data through streamglue. + */ BlendFileData **bfd_r; struct ReportList *reports; } FileData; @@ -102,16 +102,16 @@ typedef struct BHeadN { } BHeadN; -#define FD_FLAGS_SWITCH_ENDIAN (1<<0) -#define FD_FLAGS_FILE_POINTSIZE_IS_4 (1<<1) -#define FD_FLAGS_POINTSIZE_DIFFERS (1<<2) -#define FD_FLAGS_FILE_OK (1<<3) -#define FD_FLAGS_NOT_MY_BUFFER (1<<4) -#define FD_FLAGS_NOT_MY_LIBMAP (1<<5) +#define FD_FLAGS_SWITCH_ENDIAN (1 << 0) +#define FD_FLAGS_FILE_POINTSIZE_IS_4 (1 << 1) +#define FD_FLAGS_POINTSIZE_DIFFERS (1 << 2) +#define FD_FLAGS_FILE_OK (1 << 3) +#define FD_FLAGS_NOT_MY_BUFFER (1 << 4) +#define FD_FLAGS_NOT_MY_LIBMAP (1 << 5) #define SIZEOFBLENDERHEADER 12 - /***/ +/***/ struct Main; void blo_join_main(ListBase *mainlist); void blo_split_main(ListBase *mainlist, struct Main *main); @@ -129,7 +129,7 @@ void blo_make_movieclip_pointer_map(FileData *fd, Main *oldmain); void blo_end_movieclip_pointer_map(FileData *fd, Main *oldmain); void blo_add_library_pointer_map(ListBase *mainlist, FileData *fd); -void blo_freefiledata( FileData *fd); +void blo_freefiledata(FileData *fd); BHead *blo_firstbhead(FileData *fd); BHead *blo_nextbhead(FileData *fd, BHead *thisblock); diff --git a/source/blender/editors/include/BIF_gl.h b/source/blender/editors/include/BIF_gl.h index e29e0af59b1..a5e5d7ce2e0 100644 --- a/source/blender/editors/include/BIF_gl.h +++ b/source/blender/editors/include/BIF_gl.h @@ -35,20 +35,20 @@ #include "GL/glew.h" - /* - * these should be phased out. cpack should be replaced in - * code with calls to glColor3ub. - zr - */ +/* + * these should be phased out. cpack should be replaced in + * code with calls to glColor3ub. - zr + */ /* * * This define converts a numerical value to the equivalent 24-bit * color, while not being endian-sensitive. On little-endians, this * is the same as doing a 'naive' indexing, on big-endian, it is not! * */ -#define cpack(x) glColor3ub( ((x)&0xFF), (((x)>>8)&0xFF), (((x)>>16)&0xFF) ) +#define cpack(x) glColor3ub( ((x) & 0xFF), (((x) >> 8) & 0xFF), (((x) >> 16) & 0xFF) ) -#define glMultMatrixf(x) glMultMatrixf( (float *)(x)) -#define glLoadMatrixf(x) glLoadMatrixf( (float *)(x)) +#define glMultMatrixf(x) glMultMatrixf( (float *)(x)) +#define glLoadMatrixf(x) glLoadMatrixf( (float *)(x)) #endif /* #ifdef __BIF_GL_H__ */ diff --git a/source/blender/editors/include/BIF_glutil.h b/source/blender/editors/include/BIF_glutil.h index 2172aa82acf..b939ae47ead 100644 --- a/source/blender/editors/include/BIF_glutil.h +++ b/source/blender/editors/include/BIF_glutil.h @@ -56,138 +56,138 @@ extern unsigned char stipple_quarttone[128]; extern unsigned char stipple_diag_stripes_pos[128]; extern unsigned char stipple_diag_stripes_neg[128]; - /** - * Draw a lined (non-looping) arc with the given - * \a radius, starting at angle \a start and arcing - * through \a angle. The arc is centered at the origin - * and drawn in the XY plane. - * - * \param start The initial angle (in radians). - * \param angle The length of the arc (in radians). - * \param radius The arc radius. - * \param nsegments The number of segments to use in drawing the arc. - */ -void glutil_draw_lined_arc (float start, float angle, float radius, int nsegments); - - /** - * Draw a filled arc with the given \a radius, - * starting at angle \a start and arcing through - * \a angle. The arc is centered at the origin - * and drawn in the XY plane. - * - * \param start The initial angle (in radians). - * \param angle The length of the arc (in radians). - * \param radius The arc radius. - * \param nsegments The number of segments to use in drawing the arc. - */ -void glutil_draw_filled_arc (float start, float angle, float radius, int nsegments); - - /** - * Routines an integer value as obtained by glGetIntegerv. - * The param must cause only one value to be gotten from GL. - */ -int glaGetOneInteger (int param); - - /** - * Routines a float value as obtained by glGetIntegerv. - * The param must cause only one value to be gotten from GL. - */ -float glaGetOneFloat (int param); - - /** - * Functions like glRasterPos2i, except ensures that the resulting - * raster position is valid. \a known_good_x and \a known_good_y - * should be coordinates of a point known to be within the current - * view frustum. - * \attention This routine should be used when the distance of \a x - * and \a y away from the known good point is small (ie. for small icons - * and for bitmap characters), when drawing large+zoomed images it is - * possible for overflow to occur, the glaDrawPixelsSafe routine should - * be used instead. - */ -void glaRasterPosSafe2f (float x, float y, float known_good_x, float known_good_y); - - /** - * Functions like a limited glDrawPixels, except ensures that - * the image is displayed onscreen even if the \a x and \a y - * coordinates for would be clipped. The routine respects the - * glPixelZoom values, pixel unpacking parameters are _not_ - * respected. - * - * \attention This routine makes many assumptions: the rect data - * is expected to be in RGBA unsigned byte format, the coordinate - * (0.375, 0.375) is assumed to be within the view frustum, and the - * modelview and projection matrices are assumed to define a - * 1-to-1 mapping to screen space. - * \attention Furthermore, in the case of zoomed or unpixel aligned - * images extending outside the view frustum, but still within the - * window, some portion of the image may be visible left and/or - * below of the given \a x and \a y coordinates. It is recommended - * to use the glScissor functionality if images are to be drawn - * with an inset view matrix. - */ -void glaDrawPixelsSafe (float x, float y, int img_w, int img_h, int row_w, int format, int type, void *rect); - - /** - * Functions like a limited glDrawPixels, but actually draws the - * image using textures, which can be tremendously faster on low-end - * cards, and also avoids problems with the raster position being - * clipped when offscreen. The routine respects the glPixelZoom values, - * pixel unpacking parameters are _not_ respected. - * - * \attention This routine makes many assumptions: the rect data - * is expected to be in RGBA byte or float format, and the - * modelview and projection matrices are assumed to define a - * 1-to-1 mapping to screen space. - */ - -void glaDrawPixelsTex (float x, float y, int img_w, int img_h, int format, void *rect); +/** + * Draw a lined (non-looping) arc with the given + * \a radius, starting at angle \a start and arcing + * through \a angle. The arc is centered at the origin + * and drawn in the XY plane. + * + * \param start The initial angle (in radians). + * \param angle The length of the arc (in radians). + * \param radius The arc radius. + * \param nsegments The number of segments to use in drawing the arc. + */ +void glutil_draw_lined_arc(float start, float angle, float radius, int nsegments); + +/** + * Draw a filled arc with the given \a radius, + * starting at angle \a start and arcing through + * \a angle. The arc is centered at the origin + * and drawn in the XY plane. + * + * \param start The initial angle (in radians). + * \param angle The length of the arc (in radians). + * \param radius The arc radius. + * \param nsegments The number of segments to use in drawing the arc. + */ +void glutil_draw_filled_arc(float start, float angle, float radius, int nsegments); + +/** + * Routines an integer value as obtained by glGetIntegerv. + * The param must cause only one value to be gotten from GL. + */ +int glaGetOneInteger(int param); + +/** + * Routines a float value as obtained by glGetIntegerv. + * The param must cause only one value to be gotten from GL. + */ +float glaGetOneFloat(int param); + +/** + * Functions like glRasterPos2i, except ensures that the resulting + * raster position is valid. \a known_good_x and \a known_good_y + * should be coordinates of a point known to be within the current + * view frustum. + * \attention This routine should be used when the distance of \a x + * and \a y away from the known good point is small (ie. for small icons + * and for bitmap characters), when drawing large+zoomed images it is + * possible for overflow to occur, the glaDrawPixelsSafe routine should + * be used instead. + */ +void glaRasterPosSafe2f(float x, float y, float known_good_x, float known_good_y); + +/** + * Functions like a limited glDrawPixels, except ensures that + * the image is displayed onscreen even if the \a x and \a y + * coordinates for would be clipped. The routine respects the + * glPixelZoom values, pixel unpacking parameters are _not_ + * respected. + * + * \attention This routine makes many assumptions: the rect data + * is expected to be in RGBA unsigned byte format, the coordinate + * (0.375, 0.375) is assumed to be within the view frustum, and the + * modelview and projection matrices are assumed to define a + * 1-to-1 mapping to screen space. + * \attention Furthermore, in the case of zoomed or unpixel aligned + * images extending outside the view frustum, but still within the + * window, some portion of the image may be visible left and/or + * below of the given \a x and \a y coordinates. It is recommended + * to use the glScissor functionality if images are to be drawn + * with an inset view matrix. + */ +void glaDrawPixelsSafe(float x, float y, int img_w, int img_h, int row_w, int format, int type, void *rect); + +/** + * Functions like a limited glDrawPixels, but actually draws the + * image using textures, which can be tremendously faster on low-end + * cards, and also avoids problems with the raster position being + * clipped when offscreen. The routine respects the glPixelZoom values, + * pixel unpacking parameters are _not_ respected. + * + * \attention This routine makes many assumptions: the rect data + * is expected to be in RGBA byte or float format, and the + * modelview and projection matrices are assumed to define a + * 1-to-1 mapping to screen space. + */ + +void glaDrawPixelsTex(float x, float y, int img_w, int img_h, int format, void *rect); void glaDrawPixelsTexScaled(float x, float y, int img_w, int img_h, int format, void *rect, float scaleX, float scaleY); - /* 2D Drawing Assistance */ - - /** Define a 2D area (viewport, scissor, matrices) for OpenGL rendering. - * - * glwDefine2DArea and glaBegin2DDraw set up an OpenGL state appropriate - * for drawing using both vertice (Vertex, etc) and raster (RasterPos, Rect) - * commands. All coordinates should be at integer positions. There is little - * to no reason to use glVertex2f etc. functions during 2D rendering, and - * thus no reason to +-0.5 the coordinates or perform other silly - * tricks. - * - * \param screen_rect The screen rectangle to be defined for 2D drawing. - */ -void glaDefine2DArea (struct rcti *screen_rect); +/* 2D Drawing Assistance */ + +/** Define a 2D area (viewport, scissor, matrices) for OpenGL rendering. + * + * glwDefine2DArea and glaBegin2DDraw set up an OpenGL state appropriate + * for drawing using both vertice (Vertex, etc) and raster (RasterPos, Rect) + * commands. All coordinates should be at integer positions. There is little + * to no reason to use glVertex2f etc. functions during 2D rendering, and + * thus no reason to +-0.5 the coordinates or perform other silly + * tricks. + * + * \param screen_rect The screen rectangle to be defined for 2D drawing. + */ +void glaDefine2DArea(struct rcti *screen_rect); typedef struct gla2DDrawInfo gla2DDrawInfo; - /** Save the current OpenGL state and initialize OpenGL for 2D - * rendering. glaEnd2DDraw should be called on the returned structure - * to free it and to return OpenGL to its previous state. The - * scissor rectangle is set to match the viewport. - * - * See glaDefine2DArea for an explanation of why this function uses integers. - * - * \param screen_rect The screen rectangle to be used for 2D drawing. - * \param world_rect The world rectangle that the 2D area represented - * by \a screen_rect is supposed to represent. If NULL it is assumed the - * world has a 1 to 1 mapping to the screen. - */ -gla2DDrawInfo* glaBegin2DDraw (struct rcti *screen_rect, struct rctf *world_rect); - - /** Translate the (\a wo_x, \a wo_y) point from world coordinates into screen space. */ -void gla2DDrawTranslatePt (gla2DDrawInfo *di, float wo_x, float wo_y, int *sc_x_r, int *sc_y_r); - - /** Translate the \a world point from world coordiantes into screen space. */ -void gla2DDrawTranslatePtv (gla2DDrawInfo *di, float world[2], int screen_r[2]); - - /* Restores the previous OpenGL state and free's the auxilary - * gla data. - */ -void glaEnd2DDraw (gla2DDrawInfo *di); - - /** Adjust the transformation mapping of a 2d area */ +/** Save the current OpenGL state and initialize OpenGL for 2D + * rendering. glaEnd2DDraw should be called on the returned structure + * to free it and to return OpenGL to its previous state. The + * scissor rectangle is set to match the viewport. + * + * See glaDefine2DArea for an explanation of why this function uses integers. + * + * \param screen_rect The screen rectangle to be used for 2D drawing. + * \param world_rect The world rectangle that the 2D area represented + * by \a screen_rect is supposed to represent. If NULL it is assumed the + * world has a 1 to 1 mapping to the screen. + */ +gla2DDrawInfo *glaBegin2DDraw(struct rcti *screen_rect, struct rctf *world_rect); + +/** Translate the (\a wo_x, \a wo_y) point from world coordinates into screen space. */ +void gla2DDrawTranslatePt(gla2DDrawInfo *di, float wo_x, float wo_y, int *sc_x_r, int *sc_y_r); + +/** Translate the \a world point from world coordiantes into screen space. */ +void gla2DDrawTranslatePtv(gla2DDrawInfo * di, float world[2], int screen_r[2]); + +/* Restores the previous OpenGL state and free's the auxilary + * gla data. + */ +void glaEnd2DDraw(gla2DDrawInfo *di); + +/** Adjust the transformation mapping of a 2d area */ void gla2DGetMap(gla2DDrawInfo *di, struct rctf *rect); void gla2DSetMap(gla2DDrawInfo *di, struct rctf *rect); diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 391286a2a88..f4d922dba3c 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -68,36 +68,36 @@ struct PropertyRNA; * 'context' information */ typedef struct bAnimContext { - void *data; /* data to be filtered for use in animation editor */ - short datatype; /* type of data eAnimCont_Types */ + void *data; /* data to be filtered for use in animation editor */ + short datatype; /* type of data eAnimCont_Types */ - short mode; /* editor->mode */ - short spacetype; /* sa->spacetype */ - short regiontype; /* active region -> type (channels or main) */ - struct ScrArea *sa; /* editor host */ - struct SpaceLink *sl; /* editor data */ - struct ARegion *ar; /* region within editor */ + short mode; /* editor->mode */ + short spacetype; /* sa->spacetype */ + short regiontype; /* active region -> type (channels or main) */ + struct ScrArea *sa; /* editor host */ + struct SpaceLink *sl; /* editor data */ + struct ARegion *ar; /* region within editor */ struct bDopeSheet *ads; /* dopesheet data for editor (or which is being used) */ - struct Scene *scene; /* active scene */ - struct Object *obact; /* active object */ - ListBase *markers; /* active set of markers */ + struct Scene *scene; /* active scene */ + struct Object *obact; /* active object */ + ListBase *markers; /* active set of markers */ - struct ReportList *reports; /* pointer to current reports list */ + struct ReportList *reports; /* pointer to current reports list */ } bAnimContext; /* Main Data container types */ typedef enum eAnimCont_Types { - ANIMCONT_NONE = 0, /* invalid or no data */ - ANIMCONT_ACTION, /* action (bAction) */ - ANIMCONT_SHAPEKEY, /* shapekey (Key) */ - ANIMCONT_GPENCIL, /* grease pencil (screen) */ - ANIMCONT_DOPESHEET, /* dopesheet (bDopesheet) */ - ANIMCONT_FCURVES, /* animation F-Curves (bDopesheet) */ - ANIMCONT_DRIVERS, /* drivers (bDopesheet) */ - ANIMCONT_NLA, /* nla (bDopesheet) */ - ANIMCONT_CHANNEL /* animation channel (bAnimListElem) */ + ANIMCONT_NONE = 0, /* invalid or no data */ + ANIMCONT_ACTION, /* action (bAction) */ + ANIMCONT_SHAPEKEY, /* shapekey (Key) */ + ANIMCONT_GPENCIL, /* grease pencil (screen) */ + ANIMCONT_DOPESHEET, /* dopesheet (bDopesheet) */ + ANIMCONT_FCURVES, /* animation F-Curves (bDopesheet) */ + ANIMCONT_DRIVERS, /* drivers (bDopesheet) */ + ANIMCONT_NLA, /* nla (bDopesheet) */ + ANIMCONT_CHANNEL /* animation channel (bAnimListElem) */ } eAnimCont_Types; /* --------------- Channels -------------------- */ @@ -108,26 +108,26 @@ typedef enum eAnimCont_Types { typedef struct bAnimListElem { struct bAnimListElem *next, *prev; - void *data; /* source data this elem represents */ - int type; /* one of the ANIMTYPE_* values */ - int flag; /* copy of elem's flags for quick access */ - int index; /* for un-named data, the index of the data in it's collection */ + void *data; /* source data this elem represents */ + int type; /* one of the ANIMTYPE_* values */ + int flag; /* copy of elem's flags for quick access */ + int index; /* for un-named data, the index of the data in it's collection */ - short datatype; /* type of motion data to expect */ - void *key_data; /* motion data - mostly F-Curves, but can be other types too */ + short datatype; /* type of motion data to expect */ + void *key_data; /* motion data - mostly F-Curves, but can be other types too */ - struct ID *id; /* ID block that channel is attached to */ - struct AnimData *adt; /* source of the animation data attached to ID block (for convenience) */ + struct ID *id; /* ID block that channel is attached to */ + struct AnimData *adt; /* source of the animation data attached to ID block (for convenience) */ } bAnimListElem; /* Some types for easier type-testing * NOTE: need to keep the order of these synchronized with the channels define code - * which is used for drawing and handling channel lists for + * which is used for drawing and handling channel lists for */ typedef enum eAnim_ChannelType { - ANIMTYPE_NONE= 0, + ANIMTYPE_NONE = 0, ANIMTYPE_ANIMDATA, ANIMTYPE_SPECIALDATA, @@ -164,22 +164,22 @@ typedef enum eAnim_ChannelType { ANIMTYPE_NLATRACK, ANIMTYPE_NLAACTION, - /* always as last item, the total number of channel types... */ + /* always as last item, the total number of channel types... */ ANIMTYPE_NUM_TYPES } eAnim_ChannelType; /* types of keyframe data in bAnimListElem */ typedef enum eAnim_KeyType { - ALE_NONE = 0, /* no keyframe data */ - ALE_FCURVE, /* F-Curve */ - ALE_GPFRAME, /* Grease Pencil Frames */ - ALE_NLASTRIP, /* NLA Strips */ - - ALE_ALL, /* All channels summary */ - ALE_SCE, /* Scene summary */ - ALE_OB, /* Object summary */ - ALE_ACT, /* Action summary */ - ALE_GROUP /* Action Group summary */ + ALE_NONE = 0, /* no keyframe data */ + ALE_FCURVE, /* F-Curve */ + ALE_GPFRAME, /* Grease Pencil Frames */ + ALE_NLASTRIP, /* NLA Strips */ + + ALE_ALL, /* All channels summary */ + ALE_SCE, /* Scene summary */ + ALE_OB, /* Object summary */ + ALE_ACT, /* Action summary */ + ALE_GROUP /* Action Group summary */ } eAnim_KeyType; /* ----------------- Filtering -------------------- */ @@ -188,53 +188,53 @@ typedef enum eAnim_KeyType { typedef enum eAnimFilter_Flags { /* data which channel represents is fits the dopesheet filters (i.e. scene visibility criteria) */ // XXX: it's hard to think of any examples where this *ISN'T* the case... perhaps becomes implicit? - ANIMFILTER_DATA_VISIBLE = (1<<0), + ANIMFILTER_DATA_VISIBLE = (1 << 0), /* channel is visible within the channel-list hierarchy (i.e. F-Curves within Groups in ActEdit) */ - ANIMFILTER_LIST_VISIBLE = (1<<1), + ANIMFILTER_LIST_VISIBLE = (1 << 1), /* channel has specifically been tagged as visible in Graph Editor (* Graph Editor Only) */ - ANIMFILTER_CURVE_VISIBLE = (1<<2), + ANIMFILTER_CURVE_VISIBLE = (1 << 2), /* include summary channels and "expanders" (for drawing/mouse-selection in channel list) */ - ANIMFILTER_LIST_CHANNELS = (1<<3), + ANIMFILTER_LIST_CHANNELS = (1 << 3), /* for its type, channel should be "active" one */ - ANIMFILTER_ACTIVE = (1<<4), + ANIMFILTER_ACTIVE = (1 << 4), /* channel is a child of the active group (* Actions speciality) */ - ANIMFILTER_ACTGROUPED = (1<<5), + ANIMFILTER_ACTGROUPED = (1 << 5), /* channel must be selected/not-selected, but both must not be set together */ - ANIMFILTER_SEL = (1<<6), - ANIMFILTER_UNSEL = (1<<7), + ANIMFILTER_SEL = (1 << 6), + ANIMFILTER_UNSEL = (1 << 7), /* editability status - must be editable to be included */ - ANIMFILTER_FOREDIT = (1<<8), + ANIMFILTER_FOREDIT = (1 << 8), /* only selected animchannels should be considerable as editable - mainly for Graph Editor's option for keys on select curves only */ - ANIMFILTER_SELEDIT = (1<<9), + ANIMFILTER_SELEDIT = (1 << 9), /* flags used to enforce certain data types */ // NOTE: the ones for curves and NLA tracks were redundant and have been removed for now... - ANIMFILTER_ANIMDATA = (1<<10), + ANIMFILTER_ANIMDATA = (1 << 10), /* duplicate entries for animation data attached to multi-user blocks must not occur */ - ANIMFILTER_NODUPLIS = (1<<11), + ANIMFILTER_NODUPLIS = (1 << 11), /* for checking if we should keep some collapsed channel around (internal use only!) */ - ANIMFILTER_TMP_PEEK = (1<<30) + ANIMFILTER_TMP_PEEK = (1 << 30) } eAnimFilter_Flags; /* ---------- Flag Checking Macros ------------ */ // xxx check on all of these flags again... /* Dopesheet only */ - /* 'Scene' channels */ +/* 'Scene' channels */ #define SEL_SCEC(sce) ((sce->flag & SCE_DS_SELECTED)) -#define EXPANDED_SCEC(sce) ((sce->flag & SCE_DS_COLLAPSED)==0) - /* 'Sub-Scene' channels (flags stored in Data block) */ +#define EXPANDED_SCEC(sce) ((sce->flag & SCE_DS_COLLAPSED) == 0) +/* 'Sub-Scene' channels (flags stored in Data block) */ #define FILTER_WOR_SCED(wo) ((wo->flag & WO_DS_EXPAND)) - /* 'Object' channels */ +/* 'Object' channels */ #define SEL_OBJC(base) ((base->flag & SELECT)) -#define EXPANDED_OBJC(ob) ((ob->nlaflag & OB_ADS_COLLAPSED)==0) - /* 'Sub-object' channels (flags stored in Data block) */ +#define EXPANDED_OBJC(ob) ((ob->nlaflag & OB_ADS_COLLAPSED) == 0) +/* 'Sub-object' channels (flags stored in Data block) */ #define FILTER_SKE_OBJD(key) ((key->flag & KEY_DS_EXPAND)) #define FILTER_MAT_OBJD(ma) ((ma->flag & MA_DS_EXPAND)) #define FILTER_LAM_OBJD(la) ((la->flag & LA_DS_EXPAND)) @@ -246,74 +246,74 @@ typedef enum eAnimFilter_Flags { #define FILTER_MESH_OBJD(me) ((me->flag & ME_DS_EXPAND)) #define FILTER_LATTICE_OBJD(lt) ((lt->flag & LT_DS_EXPAND)) #define FILTER_SPK_OBJD(spk) ((spk->flag & SPK_DS_EXPAND)) - /* Variable use expanders */ +/* Variable use expanders */ #define FILTER_NTREE_DATA(ntree) ((ntree->flag & NTREE_DS_EXPAND)) #define FILTER_TEX_DATA(tex) ((tex->flag & TEX_DS_EXPAND)) - /* 'Sub-object/Action' channels (flags stored in Action) */ +/* 'Sub-object/Action' channels (flags stored in Action) */ #define SEL_ACTC(actc) ((actc->flag & ACT_SELECTED)) -#define EXPANDED_ACTC(actc) ((actc->flag & ACT_COLLAPSED)==0) - /* 'Sub-AnimData' channels */ -#define EXPANDED_DRVD(adt) ((adt->flag & ADT_DRIVERS_COLLAPSED)==0) +#define EXPANDED_ACTC(actc) ((actc->flag & ACT_COLLAPSED) == 0) +/* 'Sub-AnimData' channels */ +#define EXPANDED_DRVD(adt) ((adt->flag & ADT_DRIVERS_COLLAPSED) == 0) /* Actions (also used for Dopesheet) */ - /* Action Channel Group */ -#define EDITABLE_AGRP(agrp) ((agrp->flag & AGRP_PROTECTED)==0) +/* Action Channel Group */ +#define EDITABLE_AGRP(agrp) ((agrp->flag & AGRP_PROTECTED) == 0) #define EXPANDED_AGRP(ac, agrp) \ ( ((!(ac) || ((ac)->spacetype != SPACE_IPO)) && (agrp->flag & AGRP_EXPANDED)) || \ (( (ac) && ((ac)->spacetype == SPACE_IPO)) && (agrp->flag & AGRP_EXPANDED_G)) ) #define SEL_AGRP(agrp) ((agrp->flag & AGRP_SELECTED) || (agrp->flag & AGRP_ACTIVE)) - /* F-Curve Channels */ -#define EDITABLE_FCU(fcu) ((fcu->flag & FCURVE_PROTECTED)==0) +/* F-Curve Channels */ +#define EDITABLE_FCU(fcu) ((fcu->flag & FCURVE_PROTECTED) == 0) #define SEL_FCU(fcu) (fcu->flag & FCURVE_SELECTED) /* ShapeKey mode only */ -#define EDITABLE_SHAPEKEY(kb) ((kb->flag & KEYBLOCK_LOCKED)==0) +#define EDITABLE_SHAPEKEY(kb) ((kb->flag & KEYBLOCK_LOCKED) == 0) #define SEL_SHAPEKEY(kb) (kb->flag & KEYBLOCK_SEL) /* Grease Pencil only */ - /* Grease Pencil datablock settings */ +/* Grease Pencil datablock settings */ #define EXPANDED_GPD(gpd) (gpd->flag & GP_DATA_EXPAND) - /* Grease Pencil Layer settings */ -#define EDITABLE_GPL(gpl) ((gpl->flag & GP_LAYER_LOCKED)==0) +/* Grease Pencil Layer settings */ +#define EDITABLE_GPL(gpl) ((gpl->flag & GP_LAYER_LOCKED) == 0) #define SEL_GPL(gpl) (gpl->flag & GP_LAYER_SELECT) /* NLA only */ #define SEL_NLT(nlt) (nlt->flag & NLATRACK_SELECTED) -#define EDITABLE_NLT(nlt) ((nlt->flag & NLATRACK_PROTECTED)==0) +#define EDITABLE_NLT(nlt) ((nlt->flag & NLATRACK_PROTECTED) == 0) /* -------------- Channel Defines -------------- */ /* channel heights */ -#define ACHANNEL_FIRST -16 -#define ACHANNEL_HEIGHT 16 -#define ACHANNEL_HEIGHT_HALF 8 -#define ACHANNEL_SKIP 2 -#define ACHANNEL_STEP (ACHANNEL_HEIGHT + ACHANNEL_SKIP) +#define ACHANNEL_FIRST -16 +#define ACHANNEL_HEIGHT 16 +#define ACHANNEL_HEIGHT_HALF 8 +#define ACHANNEL_SKIP 2 +#define ACHANNEL_STEP (ACHANNEL_HEIGHT + ACHANNEL_SKIP) /* channel widths */ -#define ACHANNEL_NAMEWIDTH 200 +#define ACHANNEL_NAMEWIDTH 200 /* channel toggle-buttons */ -#define ACHANNEL_BUTTON_WIDTH 16 +#define ACHANNEL_BUTTON_WIDTH 16 /* -------------- NLA Channel Defines -------------- */ /* NLA channel heights */ // XXX: NLACHANNEL_FIRST isn't used? -#define NLACHANNEL_FIRST -16 -#define NLACHANNEL_HEIGHT(snla) ((snla && (snla->flag & SNLA_NOSTRIPCURVES)) ? 16 : 24) -#define NLACHANNEL_HEIGHT_HALF(snla) ((snla && (snla->flag & SNLA_NOSTRIPCURVES)) ? 8 : 12) -#define NLACHANNEL_SKIP 2 +#define NLACHANNEL_FIRST -16 +#define NLACHANNEL_HEIGHT(snla) ((snla && (snla->flag & SNLA_NOSTRIPCURVES)) ? 16 : 24) +#define NLACHANNEL_HEIGHT_HALF(snla) ((snla && (snla->flag & SNLA_NOSTRIPCURVES)) ? 8 : 12) +#define NLACHANNEL_SKIP 2 #define NLACHANNEL_STEP(snla) (NLACHANNEL_HEIGHT(snla) + NLACHANNEL_SKIP) /* channel widths */ -#define NLACHANNEL_NAMEWIDTH 200 +#define NLACHANNEL_NAMEWIDTH 200 /* channel toggle-buttons */ -#define NLACHANNEL_BUTTON_WIDTH 16 +#define NLACHANNEL_BUTTON_WIDTH 16 /* ---------------- API -------------------- */ @@ -341,37 +341,37 @@ short ANIM_animdata_context_getdata(bAnimContext *ac); /* flag-setting behavior */ typedef enum eAnimChannels_SetFlag { - ACHANNEL_SETFLAG_CLEAR = 0, /* turn off */ - ACHANNEL_SETFLAG_ADD, /* turn on */ - ACHANNEL_SETFLAG_INVERT, /* on->off, off->on */ - ACHANNEL_SETFLAG_TOGGLE /* some on -> all off // all on */ + ACHANNEL_SETFLAG_CLEAR = 0, /* turn off */ + ACHANNEL_SETFLAG_ADD, /* turn on */ + ACHANNEL_SETFLAG_INVERT, /* on->off, off->on */ + ACHANNEL_SETFLAG_TOGGLE /* some on -> all off // all on */ } eAnimChannels_SetFlag; /* types of settings for AnimChannels */ typedef enum eAnimChannel_Settings { ACHANNEL_SETTING_SELECT = 0, - ACHANNEL_SETTING_PROTECT, // warning: for drawing UI's, need to check if this is off (maybe inverse this later) + ACHANNEL_SETTING_PROTECT, // warning: for drawing UI's, need to check if this is off (maybe inverse this later) ACHANNEL_SETTING_MUTE, ACHANNEL_SETTING_EXPAND, - ACHANNEL_SETTING_VISIBLE, /* only for Graph Editor */ - ACHANNEL_SETTING_SOLO /* only for NLA Tracks */ + ACHANNEL_SETTING_VISIBLE, /* only for Graph Editor */ + ACHANNEL_SETTING_SOLO /* only for NLA Tracks */ } eAnimChannel_Settings; /* Drawing, mouse handling, and flag setting behavior... */ typedef struct bAnimChannelType { /* type data */ - /* name of the channel type, for debugging */ + /* name of the channel type, for debugging */ const char *channel_type_name; /* drawing */ - /* get RGB color that is used to draw the majority of the backdrop */ + /* get RGB color that is used to draw the majority of the backdrop */ void (*get_backdrop_color)(bAnimContext *ac, bAnimListElem *ale, float r_color[3]); - /* draw backdrop strip for channel */ + /* draw backdrop strip for channel */ void (*draw_backdrop)(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc); - /* get depth of indention (relative to the depth channel is nested at) */ + /* get depth of indention (relative to the depth channel is nested at) */ short (*get_indent_level)(bAnimContext *ac, bAnimListElem *ale); - /* get offset in pixels for the start of the channel (in addition to the indent depth) */ + /* get offset in pixels for the start of the channel (in addition to the indent depth) */ short (*get_offset)(bAnimContext *ac, bAnimListElem *ale); /* get name (for channel lists) */ @@ -382,15 +382,15 @@ typedef struct bAnimChannelType { int (*icon)(bAnimListElem *ale); /* settings */ - /* check if the given setting is valid in the current context */ + /* check if the given setting is valid in the current context */ short (*has_setting)(bAnimContext *ac, bAnimListElem *ale, int setting); - /* get the flag used for this setting */ + /* get the flag used for this setting */ int (*setting_flag)(bAnimContext *ac, int setting, short *neg); - /* get the pointer to int/short where data is stored, - * with type being sizeof(ptr_data) which should be fine for runtime use... - * - assume that setting has been checked to be valid for current context - */ - void *(*setting_ptr)(bAnimListElem *ale, int setting, short *type); + /* get the pointer to int/short where data is stored, + * with type being sizeof(ptr_data) which should be fine for runtime use... + * - assume that setting has been checked to be valid for current context + */ + void *(*setting_ptr)(bAnimListElem * ale, int setting, short *type); } bAnimChannelType; /* ------------------------ Drawing API -------------------------- */ @@ -412,7 +412,7 @@ void ANIM_channel_draw_widgets(struct bContext *C, bAnimContext *ac, bAnimListEl /* Check if some setting for a channel is enabled * Returns: 1 = On, 0 = Off, -1 = Invalid * - * - setting: eAnimChannel_Settings + * - setting: eAnimChannel_Settings */ short ANIM_channel_setting_get(bAnimContext *ac, bAnimListElem *ale, int setting); @@ -456,14 +456,14 @@ void ANIM_timecode_string_from_frame(char *str, struct Scene *scene, int power, /* flags for Current Frame Drawing */ enum { - /* plain time indicator with no special indicators */ - DRAWCFRA_PLAIN = 0, - /* draw box indicating current frame number */ - DRAWCFRA_SHOW_NUMBOX = (1<<0), - /* time indication in seconds or frames */ - DRAWCFRA_UNIT_SECONDS = (1<<1), - /* draw indicator extra wide (for timeline) */ - DRAWCFRA_WIDE = (1<<2) + /* plain time indicator with no special indicators */ + DRAWCFRA_PLAIN = 0, + /* draw box indicating current frame number */ + DRAWCFRA_SHOW_NUMBOX = (1 << 0), + /* time indication in seconds or frames */ + DRAWCFRA_UNIT_SECONDS = (1 << 1), + /* draw indicator extra wide (for timeline) */ + DRAWCFRA_WIDE = (1 << 2) } eAnimEditDraw_CurrentFrame; /* main call to draw current-frame indicator in an Animation Editor */ @@ -531,14 +531,14 @@ void ED_nla_postop_refresh(bAnimContext *ac); /* flags for conversion mapping */ typedef enum eAnimUnitConv_Flags { - /* restore to original internal values */ - ANIM_UNITCONV_RESTORE = (1<<0), - /* ignore handles (i.e. only touch main keyframes) */ - ANIM_UNITCONV_ONLYKEYS = (1<<1), - /* only touch selected BezTriples */ - ANIM_UNITCONV_ONLYSEL = (1<<2), - /* only touch selected vertices */ - ANIM_UNITCONV_SELVERTS = (1<<3) + /* restore to original internal values */ + ANIM_UNITCONV_RESTORE = (1 << 0), + /* ignore handles (i.e. only touch main keyframes) */ + ANIM_UNITCONV_ONLYKEYS = (1 << 1), + /* only touch selected BezTriples */ + ANIM_UNITCONV_ONLYSEL = (1 << 2), + /* only touch selected vertices */ + ANIM_UNITCONV_SELVERTS = (1 << 3) } eAnimUnitConv_Flags; /* Get unit conversion factor for given ID + F-Curve */ @@ -561,9 +561,9 @@ void ANIM_unit_mapping_apply_fcurve(struct Scene *scene, struct ID *id, struct F */ #define ACHANNEL_SET_FLAG(channel, smode, sflag) \ { \ - if (smode == ACHANNEL_SETFLAG_INVERT) (channel)->flag ^= (sflag); \ - else if (smode == ACHANNEL_SETFLAG_ADD) (channel)->flag |= (sflag); \ - else (channel)->flag &= ~(sflag); \ + if (smode == ACHANNEL_SETFLAG_INVERT) (channel)->flag ^= (sflag); \ + else if (smode == ACHANNEL_SETFLAG_ADD) (channel)->flag |= (sflag); \ + else (channel)->flag &= ~(sflag); \ } /* set/clear/toggle macro, where the flag is negative @@ -573,9 +573,9 @@ void ANIM_unit_mapping_apply_fcurve(struct Scene *scene, struct ID *id, struct F */ #define ACHANNEL_SET_FLAG_NEG(channel, smode, sflag) \ { \ - if (smode == ACHANNEL_SETFLAG_INVERT) (channel)->flag ^= (sflag); \ - else if (smode == ACHANNEL_SETFLAG_ADD) (channel)->flag &= ~(sflag); \ - else (channel)->flag |= (sflag); \ + if (smode == ACHANNEL_SETFLAG_INVERT) (channel)->flag ^= (sflag); \ + else if (smode == ACHANNEL_SETFLAG_ADD) (channel)->flag &= ~(sflag); \ + else (channel)->flag |= (sflag); \ } @@ -590,17 +590,17 @@ void ANIM_sync_animchannels_to_data(const struct bContext *C); /* ************************************************* */ /* OPERATORS */ - /* generic animation channels */ +/* generic animation channels */ void ED_operatortypes_animchannels(void); void ED_keymap_animchannels(struct wmKeyConfig *keyconf); - /* generic time editing */ +/* generic time editing */ void ED_operatortypes_anim(void); void ED_keymap_anim(struct wmKeyConfig *keyconf); - /* space_graph */ +/* space_graph */ void ED_operatormacros_graph(void); - /* space_action */ +/* space_action */ void ED_operatormacros_action(void); /* ************************************************ */ diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h index 851bd09dd29..daf959b1f10 100644 --- a/source/blender/editors/include/ED_armature.h +++ b/source/blender/editors/include/ED_armature.h @@ -53,13 +53,12 @@ struct ViewContext; struct wmKeyConfig; struct wmOperator; -typedef struct EditBone -{ +typedef struct EditBone { struct EditBone *next, *prev; - struct IDProperty *prop;/* User-Defined Properties on this Bone */ - struct EditBone *parent;/* Editbones have a one-way link (i.e. children refer - * to parents. This is converted to a two-way link for - * normal bones when leaving editmode. */ + struct IDProperty *prop; /* User-Defined Properties on this Bone */ + struct EditBone *parent; /* Editbones have a one-way link (i.e. children refer + * to parents. This is converted to a two-way link for + * normal bones when leaving editmode. */ void *temp; /* Used to store temporary data */ char name[64]; /* MAX_NAME */ @@ -68,13 +67,13 @@ typedef struct EditBone * is tail-head while roll provides the angle. Refer to Graphics * Gems 1 p. 466 (section IX.6) if it's not already in here somewhere*/ - float head[3]; /* Orientation and length is implicit during editing */ - float tail[3]; - /* All joints are considered to have zero rotation with respect to - * their parents. Therefore any rotations specified during the - * animation are automatically relative to the bones' rest positions*/ - int flag; - int layer; + float head[3]; /* Orientation and length is implicit during editing */ + float tail[3]; + /* All joints are considered to have zero rotation with respect to + * their parents. Therefore any rotations specified during the + * animation are automatically relative to the bones' rest positions*/ + int flag; + int layer; float dist, weight; float xwidth, length, zwidth; /* put them in order! transform uses this as scale */ @@ -86,20 +85,20 @@ typedef struct EditBone short segments; } EditBone; -#define BONESEL_ROOT (1<<28) -#define BONESEL_TIP (1<<29) -#define BONESEL_BONE (1<<30) -#define BONESEL_ANY (BONESEL_TIP|BONESEL_ROOT|BONESEL_BONE) +#define BONESEL_ROOT (1 << 28) +#define BONESEL_TIP (1 << 29) +#define BONESEL_BONE (1 << 30) +#define BONESEL_ANY (BONESEL_TIP | BONESEL_ROOT | BONESEL_BONE) -#define BONESEL_NOSEL (1<<31) /* Indicates a negative number */ +#define BONESEL_NOSEL (1 << 31) /* Indicates a negative number */ /* useful macros */ #define EBONE_VISIBLE(arm, ebone) (((arm)->layer & (ebone)->layer) && !((ebone)->flag & BONE_HIDDEN_A)) #define EBONE_EDITABLE(ebone) (((ebone)->flag & BONE_SELECTED) && !((ebone)->flag & BONE_EDITMODE_LOCKED)) /* used in bone_select_hierachy() */ -#define BONE_SELECT_PARENT 0 -#define BONE_SELECT_CHILD 1 +#define BONE_SELECT_PARENT 0 +#define BONE_SELECT_CHILD 1 /* armature_ops.c */ void ED_operatortypes_armature(void); @@ -114,10 +113,10 @@ void ED_armature_deselect_all(struct Object *obedit, int toggle); void ED_armature_deselect_all_visible(struct Object *obedit); int ED_do_pose_selectbuffer(struct Scene *scene, struct Base *base, unsigned int *buffer, - short hits, short extend); + short hits, short extend); int mouse_armature(struct bContext *C, const int mval[2], int extend); int join_armature_exec(struct bContext *C, struct wmOperator *op); -struct Bone *get_indexed_bone (struct Object *ob, int index); +struct Bone *get_indexed_bone(struct Object *ob, int index); float ED_rollBoneToVector(EditBone *bone, const float new_up_axis[3], const short axis_only); EditBone *ED_armature_bone_get_mirrored(struct ListBase *edbo, EditBone *ebo); // XXX this is needed for populating the context iterators void ED_armature_sync_selection(struct ListBase *edbo); @@ -128,13 +127,13 @@ struct EditBone *ED_armature_edit_bone_add(struct bArmature *arm, const char *na void ED_armature_edit_bone_remove(struct bArmature *arm, EditBone *exBone); void transform_armature_mirror_update(struct Object *obedit); -void docenter_armature (struct Scene *scene, struct Object *ob, float cursor[3], int centermode, int around); +void docenter_armature(struct Scene *scene, struct Object *ob, float cursor[3], int centermode, int around); void ED_armature_apply_transform(struct Object *ob, float mat[4][4]); -#define ARM_GROUPS_NAME 1 -#define ARM_GROUPS_ENVELOPE 2 -#define ARM_GROUPS_AUTO 3 +#define ARM_GROUPS_NAME 1 +#define ARM_GROUPS_ENVELOPE 2 +#define ARM_GROUPS_AUTO 3 void create_vgroups_from_armature(struct ReportList *reports, struct Scene *scene, struct Object *ob, struct Object *par, int mode, int mirror); @@ -166,15 +165,15 @@ int BIF_currentTemplate(const struct bContext *C); void BIF_freeTemplates(struct bContext *C); void BIF_setTemplate(struct bContext *C, int index); int BIF_nbJointsTemplate(const struct bContext *C); -const char * BIF_nameBoneTemplate(const struct bContext *C); +const char *BIF_nameBoneTemplate(const struct bContext *C); void BDR_drawSketch(const struct bContext *vc); int BDR_drawSketchNames(struct ViewContext *vc); /* meshlaplacian.c */ void mesh_deform_bind(struct Scene *scene, - struct MeshDeformModifierData *mmd, - float *vertexcos, int totvert, float cagemat[][4]); + struct MeshDeformModifierData *mmd, + float *vertexcos, int totvert, float cagemat[][4]); #ifdef __cplusplus } diff --git a/source/blender/editors/include/ED_clip.h b/source/blender/editors/include/ED_clip.h index 302c2940fef..02a8b99c280 100644 --- a/source/blender/editors/include/ED_clip.h +++ b/source/blender/editors/include/ED_clip.h @@ -61,7 +61,7 @@ struct ImBuf *ED_space_clip_get_stable_buffer(struct SpaceClip *sc, float loc[2] void ED_clip_update_frame(const struct Main *mainp, int cfra); int ED_clip_view_selection(struct SpaceClip *sc, struct ARegion *ar, int fit); -void ED_clip_point_undistorted_pos(SpaceClip *sc, float co[2], float nco[2]); +void ED_clip_point_undistorted_pos(SpaceClip * sc, float co[2], float nco[2]); void ED_clip_point_stable_pos(struct bContext *C, float x, float y, float *xr, float *yr); void ED_clip_mouse_pos(struct bContext *C, struct wmEvent *event, float co[2]); diff --git a/source/blender/editors/include/ED_curve.h b/source/blender/editors/include/ED_curve.h index 73ff8e9304d..b42a6e391ce 100644 --- a/source/blender/editors/include/ED_curve.h +++ b/source/blender/editors/include/ED_curve.h @@ -46,9 +46,9 @@ struct BezTriple; struct BPoint; /* curve_ops.c */ -void ED_operatortypes_curve(void); -void ED_operatormacros_curve(void); -void ED_keymap_curve (struct wmKeyConfig *keyconf); +void ED_operatortypes_curve(void); +void ED_operatormacros_curve(void); +void ED_keymap_curve(struct wmKeyConfig *keyconf); /* editcurve.c */ void CU_deselect_all(struct Object *obedit); @@ -56,31 +56,31 @@ void CU_select_all(struct Object *obedit); void CU_select_swap(struct Object *obedit); -void undo_push_curve (struct bContext *C, const char *name); +void undo_push_curve(struct bContext *C, const char *name); ListBase *object_editcurve_get(struct Object *ob); -void load_editNurb (struct Object *obedit); -void make_editNurb (struct Object *obedit); -void free_editNurb (struct Object *obedit); +void load_editNurb(struct Object *obedit); +void make_editNurb(struct Object *obedit); +void free_editNurb(struct Object *obedit); -void BKE_curve_editNurb_free (struct Curve *cu); +void BKE_curve_editNurb_free(struct Curve *cu); -int mouse_nurb (struct bContext *C, const int mval[2], int extend); +int mouse_nurb(struct bContext *C, const int mval[2], int extend); struct Nurb *add_nurbs_primitive(struct bContext *C, float mat[4][4], int type, int newob); -int isNurbsel (struct Nurb *nu); -void ED_nurb_set_spline_type(struct Nurb *nu, int type); +int isNurbsel(struct Nurb *nu); +void ED_nurb_set_spline_type(struct Nurb *nu, int type); -int join_curve_exec (struct bContext *C, struct wmOperator *op); +int join_curve_exec(struct bContext *C, struct wmOperator *op); /* editfont.h */ -void undo_push_font (struct bContext *C, const char *name); -void make_editText (struct Object *obedit); -void load_editText (struct Object *obedit); -void free_editText (struct Object *obedit); +void undo_push_font(struct bContext *C, const char *name); +void make_editText(struct Object *obedit); +void load_editText(struct Object *obedit); +void free_editText(struct Object *obedit); -void ED_text_to_object(struct bContext *C, struct Text *text, int split_lines); +void ED_text_to_object(struct bContext *C, struct Text *text, int split_lines); int CU_select_nth(struct Object *obedit, int nth); diff --git a/source/blender/editors/include/ED_fileselect.h b/source/blender/editors/include/ED_fileselect.h index 7cf750f5a9b..d45504b3325 100644 --- a/source/blender/editors/include/ED_fileselect.h +++ b/source/blender/editors/include/ED_fileselect.h @@ -52,8 +52,7 @@ typedef enum FileListColumns { COLUMN_OWNER } FileListColumns; -typedef struct FileLayout -{ +typedef struct FileLayout { /* view settings - XXX - move into own struct */ int prv_w; int prv_h; @@ -80,7 +79,7 @@ typedef struct FileSelection { struct rcti; -struct FileSelectParams* ED_fileselect_get_params(struct SpaceFile *sfile); +struct FileSelectParams *ED_fileselect_get_params(struct SpaceFile *sfile); short ED_fileselect_set_params(struct SpaceFile *sfile); @@ -90,13 +89,13 @@ void ED_fileselect_reset_params(struct SpaceFile *sfile); void ED_fileselect_init_layout(struct SpaceFile *sfile, struct ARegion *ar); -FileLayout* ED_fileselect_get_layout(struct SpaceFile *sfile, struct ARegion *ar); +FileLayout *ED_fileselect_get_layout(struct SpaceFile *sfile, struct ARegion *ar); -int ED_fileselect_layout_numfiles(FileLayout* layout, struct ARegion *ar); -int ED_fileselect_layout_offset(FileLayout* layout, int x, int y); -FileSelection ED_fileselect_layout_offset_rect(FileLayout* layout, const struct rcti* rect); +int ED_fileselect_layout_numfiles(FileLayout *layout, struct ARegion *ar); +int ED_fileselect_layout_offset(FileLayout *layout, int x, int y); +FileSelection ED_fileselect_layout_offset_rect(FileLayout *layout, const struct rcti *rect); -void ED_fileselect_layout_tilepos(FileLayout* layout, int tile, int *x, int *y); +void ED_fileselect_layout_tilepos(FileLayout *layout, int tile, int *x, int *y); void ED_operatormacros_file(void); diff --git a/source/blender/editors/include/ED_fluidsim.h b/source/blender/editors/include/ED_fluidsim.h index 1a0c90978e6..4790dc5e03d 100644 --- a/source/blender/editors/include/ED_fluidsim.h +++ b/source/blender/editors/include/ED_fluidsim.h @@ -37,12 +37,12 @@ struct FluidsimSettings; /* allocates and initializes fluidsim data */ -struct FluidsimSettings* fluidsimSettingsNew(struct Object *srcob); +struct FluidsimSettings *fluidsimSettingsNew(struct Object *srcob); /* frees internal data itself */ -void fluidsimSettingsFree(struct FluidsimSettings* sb); +void fluidsimSettingsFree(struct FluidsimSettings *sb); /* duplicate internal data */ -struct FluidsimSettings* fluidsimSettingsCopy(struct FluidsimSettings* sb); +struct FluidsimSettings *fluidsimSettingsCopy(struct FluidsimSettings *sb); #endif /* __ED_FLUIDSIM_H__ */ diff --git a/source/blender/editors/include/ED_gpencil.h b/source/blender/editors/include/ED_gpencil.h index 213fbda5aa7..bd3e4371a79 100644 --- a/source/blender/editors/include/ED_gpencil.h +++ b/source/blender/editors/include/ED_gpencil.h @@ -54,8 +54,8 @@ struct wmKeyConfig; * Used as part of the 'stroke cache' used during drawing of new strokes */ typedef struct tGPspoint { - int x, y; /* x and y coordinates of cursor (in relative to area) */ - float pressure; /* pressure of tablet at this point */ + int x, y; /* x and y coordinates of cursor (in relative to area) */ + float pressure; /* pressure of tablet at this point */ } tGPspoint; diff --git a/source/blender/editors/include/ED_keyframes_draw.h b/source/blender/editors/include/ED_keyframes_draw.h index 7f68325e5ee..cd64427de78 100644 --- a/source/blender/editors/include/ED_keyframes_draw.h +++ b/source/blender/editors/include/ED_keyframes_draw.h @@ -50,16 +50,16 @@ struct DLRBT_Tree; /* Keyframe Column Struct */ typedef struct ActKeyColumn { - /* ListBase linkage */ + /* ListBase linkage */ struct ActKeyColumn *next, *prev; - /* sorting-tree linkage */ - struct ActKeyColumn *left, *right; /* 'children' of this node, less than and greater than it (respectively) */ - struct ActKeyColumn *parent; /* parent of this node in the tree */ - char tree_col; /* DLRB_BLACK or DLRB_RED */ + /* sorting-tree linkage */ + struct ActKeyColumn *left, *right; /* 'children' of this node, less than and greater than it (respectively) */ + struct ActKeyColumn *parent; /* parent of this node in the tree */ + char tree_col; /* DLRB_BLACK or DLRB_RED */ - /* keyframe info */ - char key_type; /* eBezTripe_KeyframeType */ + /* keyframe info */ + char key_type; /* eBezTripe_KeyframeType */ short sel; float cfra; @@ -70,15 +70,15 @@ typedef struct ActKeyColumn { /* 'Long Keyframe' Struct */ typedef struct ActKeyBlock { - /* ListBase linkage */ + /* ListBase linkage */ struct ActKeyBlock *next, *prev; - /* sorting-tree linkage */ - struct ActKeyBlock *left, *right; /* 'children' of this node, less than and greater than it (respectively) */ - struct ActKeyBlock *parent; /* parent of this node in the tree */ - char tree_col; /* DLRB_BLACK or DLRB_RED */ + /* sorting-tree linkage */ + struct ActKeyBlock *left, *right; /* 'children' of this node, less than and greater than it (respectively) */ + struct ActKeyBlock *parent; /* parent of this node in the tree */ + char tree_col; /* DLRB_BLACK or DLRB_RED */ - /* key-block info */ + /* key-block info */ char sel; short handle_type; float val; @@ -93,11 +93,11 @@ typedef struct ActKeyBlock { /* options for keyframe shape drawing */ typedef enum eKeyframeShapeDrawOpts { - /* only the border */ - KEYFRAME_SHAPE_FRAME = 0, - /* only the inside filling */ + /* only the border */ + KEYFRAME_SHAPE_FRAME = 0, + /* only the inside filling */ KEYFRAME_SHAPE_INSIDE, - /* the whole thing */ + /* the whole thing */ KEYFRAME_SHAPE_BOTH } eKeyframeShapeDrawOpts; diff --git a/source/blender/editors/include/ED_keyframes_edit.h b/source/blender/editors/include/ED_keyframes_edit.h index 7ba37b49f85..bdb70696742 100644 --- a/source/blender/editors/include/ED_keyframes_edit.h +++ b/source/blender/editors/include/ED_keyframes_edit.h @@ -43,15 +43,15 @@ struct Scene; /* --------- BezTriple Selection ------------- */ -#define BEZ_SEL(bezt) { (bezt)->f1 |= SELECT; (bezt)->f2 |= SELECT; (bezt)->f3 |= SELECT; } -#define BEZ_DESEL(bezt) { (bezt)->f1 &= ~SELECT; (bezt)->f2 &= ~SELECT; (bezt)->f3 &= ~SELECT; } -#define BEZ_INVSEL(bezt) { (bezt)->f1 ^= SELECT; (bezt)->f2 ^= SELECT; (bezt)->f3 ^= SELECT; } +#define BEZ_SEL(bezt) { (bezt)->f1 |= SELECT; (bezt)->f2 |= SELECT; (bezt)->f3 |= SELECT; } +#define BEZ_DESEL(bezt) { (bezt)->f1 &= ~SELECT; (bezt)->f2 &= ~SELECT; (bezt)->f3 &= ~SELECT; } +#define BEZ_INVSEL(bezt) { (bezt)->f1 ^= SELECT; (bezt)->f2 ^= SELECT; (bezt)->f3 ^= SELECT; } /* --------- Tool Flags ------------ */ /* bezt validation */ typedef enum eEditKeyframes_Validate { - BEZT_OK_FRAME = 1, + BEZT_OK_FRAME = 1, BEZT_OK_FRAMERANGE, BEZT_OK_SELECTED, BEZT_OK_VALUE, @@ -63,19 +63,19 @@ typedef enum eEditKeyframes_Validate { /* select modes */ typedef enum eEditKeyframes_Select { - /* SELECT_SUBTRACT for all, followed by SELECT_ADD for some */ - SELECT_REPLACE = (1<<0), - /* add ok keyframes to selection */ - SELECT_ADD = (1<<1), - /* remove ok keyframes from selection */ - SELECT_SUBTRACT = (1<<2), - /* flip ok status of keyframes based on key status */ - SELECT_INVERT = (1<<3) + /* SELECT_SUBTRACT for all, followed by SELECT_ADD for some */ + SELECT_REPLACE = (1 << 0), + /* add ok keyframes to selection */ + SELECT_ADD = (1 << 1), + /* remove ok keyframes from selection */ + SELECT_SUBTRACT = (1 << 2), + /* flip ok status of keyframes based on key status */ + SELECT_INVERT = (1 << 3) } eEditKeyframes_Select; /* "selection map" building modes */ typedef enum eEditKeyframes_SelMap { - SELMAP_MORE = 0, + SELMAP_MORE = 0, SELMAP_LESS } eEditKeyframes_SelMap; @@ -104,92 +104,92 @@ typedef enum eEditKeyframes_Mirror { /* --- Generic Properties for Keyframe Edit Tools ----- */ typedef struct KeyframeEditData { - /* generic properties/data access */ - ListBase list; /* temp list for storing custom list of data to check */ - struct Scene *scene; /* pointer to current scene - many tools need access to cfra/etc. */ - void *data; /* pointer to custom data - usually 'Object' but also 'rectf', but could be other types too */ - float f1, f2; /* storage of times/values as 'decimals' */ - int i1, i2; /* storage of times/values/flags as 'whole' numbers */ - - /* current iteration data */ - struct FCurve *fcu; /* F-Curve that is being iterated over */ - int curIndex; /* index of current keyframe being iterated over */ - - /* flags */ - short curflags; /* current flags for the keyframe we're reached in the iteration process */ - short iterflags; /* settings for iteration process */ // XXX: unused... + /* generic properties/data access */ + ListBase list; /* temp list for storing custom list of data to check */ + struct Scene *scene; /* pointer to current scene - many tools need access to cfra/etc. */ + void *data; /* pointer to custom data - usually 'Object' but also 'rectf', but could be other types too */ + float f1, f2; /* storage of times/values as 'decimals' */ + int i1, i2; /* storage of times/values/flags as 'whole' numbers */ + + /* current iteration data */ + struct FCurve *fcu; /* F-Curve that is being iterated over */ + int curIndex; /* index of current keyframe being iterated over */ + + /* flags */ + short curflags; /* current flags for the keyframe we're reached in the iteration process */ + short iterflags; /* settings for iteration process */ // XXX: unused... } KeyframeEditData; /* ------- Function Pointer Typedefs ---------------- */ - /* callback function that refreshes the F-Curve after use */ +/* callback function that refreshes the F-Curve after use */ typedef void (*FcuEditFunc)(struct FCurve *fcu); - /* callback function that operates on the given BezTriple */ +/* callback function that operates on the given BezTriple */ typedef short (*KeyframeEditFunc)(KeyframeEditData *ked, struct BezTriple *bezt); /* ---------- Defines for 'OK' polls ----------------- */ /* which verts of a keyframe is active (after polling) */ typedef enum eKeyframeVertOk { - /* 'key' itself is ok */ - KEYFRAME_OK_KEY = (1<<0), - /* 'handle 1' is ok */ - KEYFRAME_OK_H1 = (1<<1), - /* 'handle 2' is ok */ - KEYFRAME_OK_H2 = (1<<2), - /* all flags */ - KEYFRAME_OK_ALL = (KEYFRAME_OK_KEY|KEYFRAME_OK_H1|KEYFRAME_OK_H2) + /* 'key' itself is ok */ + KEYFRAME_OK_KEY = (1 << 0), + /* 'handle 1' is ok */ + KEYFRAME_OK_H1 = (1 << 1), + /* 'handle 2' is ok */ + KEYFRAME_OK_H2 = (1 << 2), + /* all flags */ + KEYFRAME_OK_ALL = (KEYFRAME_OK_KEY | KEYFRAME_OK_H1 | KEYFRAME_OK_H2) } eKeyframeVertOk; /* Flags for use during iteration */ typedef enum eKeyframeIterFlags { - /* consider handles in addition to key itself */ - KEYFRAME_ITER_INCL_HANDLES = (1<<0), + /* consider handles in addition to key itself */ + KEYFRAME_ITER_INCL_HANDLES = (1 << 0), } eKeyframeIterFlags; /* ------- Custom Data Type Defines ------------------ */ /* Custom data for remapping one range to another in a fixed way */ typedef struct KeyframeEditCD_Remap { - float oldMin, oldMax; /* old range */ - float newMin, newMax; /* new range */ + float oldMin, oldMax; /* old range */ + float newMin, newMax; /* new range */ } KeyframeEditCD_Remap; /* Paste options */ typedef enum eKeyPasteOffset { - /* paste keys starting at current frame */ + /* paste keys starting at current frame */ KEYFRAME_PASTE_OFFSET_CFRA_START, - /* paste keys ending at current frame */ + /* paste keys ending at current frame */ KEYFRAME_PASTE_OFFSET_CFRA_END, - /* paste keys relative to the current frame when copying */ + /* paste keys relative to the current frame when copying */ KEYFRAME_PASTE_OFFSET_CFRA_RELATIVE, - /* paste keys from original time */ + /* paste keys from original time */ KEYFRAME_PASTE_OFFSET_NONE } eKeyPasteOffset; typedef enum eKeyMergeMode { - /* overlay existing with new keys */ + /* overlay existing with new keys */ KEYFRAME_PASTE_MERGE_MIX, - /* replace entire fcurve */ + /* replace entire fcurve */ KEYFRAME_PASTE_MERGE_OVER, - /* overwrite keys in pasted range */ + /* overwrite keys in pasted range */ KEYFRAME_PASTE_MERGE_OVER_RANGE, - /* overwrite keys in pasted range (use all keyframe start & end for range) */ + /* overwrite keys in pasted range (use all keyframe start & end for range) */ KEYFRAME_PASTE_MERGE_OVER_RANGE_ALL } eKeyMergeMode; /* ---------------- Looping API --------------------- */ /* functions for looping over keyframes */ - /* function for working with F-Curve data only (i.e. when filters have been chosen to explicitly use this) */ +/* function for working with F-Curve data only (i.e. when filters have been chosen to explicitly use this) */ short ANIM_fcurve_keyframes_loop(KeyframeEditData *ked, struct FCurve *fcu, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb); - /* function for working with any type (i.e. one of the known types) of animation channel - * - filterflag is bDopeSheet->flag (DOPESHEET_FILTERFLAG) - */ +/* function for working with any type (i.e. one of the known types) of animation channel + * - filterflag is bDopeSheet->flag (DOPESHEET_FILTERFLAG) + */ short ANIM_animchannel_keyframes_loop(KeyframeEditData *ked, struct bDopeSheet *ads, struct bAnimListElem *ale, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb); - /* same as above, except bAnimListElem wrapper is not needed... - * - keytype is eAnim_KeyType - */ +/* same as above, except bAnimListElem wrapper is not needed... + * - keytype is eAnim_KeyType + */ short ANIM_animchanneldata_keyframes_loop(KeyframeEditData *ked, struct bDopeSheet *ads, void *data, int keytype, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb); /* functions for making sure all keyframes are in good order */ @@ -250,7 +250,7 @@ void sample_fcurve(struct FCurve *fcu); void free_anim_copybuf(void); short copy_animedit_keys(struct bAnimContext *ac, ListBase *anim_data); short paste_animedit_keys(struct bAnimContext *ac, ListBase *anim_data, - const eKeyPasteOffset offset_mode, const eKeyMergeMode merge_mode); + const eKeyPasteOffset offset_mode, const eKeyMergeMode merge_mode); /* ************************************************ */ diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index 490a8830d3a..be5ad5b0c70 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -80,15 +80,15 @@ struct FCurve *verify_fcurve(struct bAction *act, const char group[], const char /* -------- */ /* Lesser Keyframing API call: - * Use this when validation of necessary animation data isn't necessary as it already - * exists, and there is a beztriple that can be directly copied into the array. + * Use this when validation of necessary animation data isn't necessary as it already + * exists, and there is a beztriple that can be directly copied into the array. */ int insert_bezt_fcurve(struct FCurve *fcu, struct BezTriple *bezt, short flag); /* Main Keyframing API call: - * Use this when validation of necessary animation data isn't necessary as it - * already exists. It will insert a keyframe using the current value being keyframed. - * Returns the index at which a keyframe was added (or -1 if failed) + * Use this when validation of necessary animation data isn't necessary as it + * already exists. It will insert a keyframe using the current value being keyframed. + * Returns the index at which a keyframe was added (or -1 if failed) */ int insert_vert_fcurve(struct FCurve *fcu, float x, float y, short flag); @@ -109,7 +109,7 @@ short insert_keyframe_direct(struct ReportList *reports, struct PointerRNA ptr, short insert_keyframe(struct ReportList *reports, struct ID *id, struct bAction *act, const char group[], const char rna_path[], int array_index, float cfra, short flag); /* Main Keyframing API call: - * Use this to delete keyframe on current frame for relevant channel. Will perform checks just in case. + * Use this to delete keyframe on current frame for relevant channel. Will perform checks just in case. */ short delete_keyframe(struct ReportList *reports, struct ID *id, struct bAction *act, const char group[], const char rna_path[], int array_index, float cfra, short flag); @@ -132,26 +132,26 @@ typedef struct KeyingSetInfo { struct KeyingSetInfo *next, *prev; /* info */ - /* identifier used for class name, which KeyingSet instances reference as "Typeinfo Name" */ + /* identifier used for class name, which KeyingSet instances reference as "Typeinfo Name" */ char idname[64]; - /* identifier so that user can hook this up to a KeyingSet (used as label). */ + /* identifier so that user can hook this up to a KeyingSet (used as label). */ char name[64]; - /* short help/description. */ + /* short help/description. */ char description[240]; /* RNA_DYN_DESCR_MAX */ - /* keying settings */ + /* keying settings */ short keyingflag; /* polling callbacks */ - /* callback for polling the context for whether the right data is available */ + /* callback for polling the context for whether the right data is available */ cbKeyingSet_Poll poll; /* generate callbacks */ - /* iterator to use to go through collections of data in context - * - this callback is separate from the 'adding' stage, allowing - * BuiltIn KeyingSets to be manually specified to use - */ + /* iterator to use to go through collections of data in context + * - this callback is separate from the 'adding' stage, allowing + * BuiltIn KeyingSets to be manually specified to use + */ cbKeyingSet_Iterator iter; - /* generator to use to add properties based on the data found by iterator */ + /* generator to use to add properties based on the data found by iterator */ cbKeyingSet_Generate generate; /* RNA integration */ @@ -172,9 +172,9 @@ typedef enum eModifyKey_Modes { /* return codes for errors (with Relative KeyingSets) */ typedef enum eModifyKey_Returns { - /* context info was invalid for using the Keying Set */ + /* context info was invalid for using the Keying Set */ MODIFYKEY_INVALID_CONTEXT = -1, - /* there isn't any typeinfo for generating paths from context */ + /* there isn't any typeinfo for generating paths from context */ MODIFYKEY_MISSING_TYPEINFO = -2, } eModifyKey_Returns; @@ -220,7 +220,7 @@ short ANIM_keyingset_context_ok_poll(struct bContext *C, struct KeyingSet *ks); /* Flags for use by driver creation calls */ typedef enum eCreateDriverFlags { - CREATEDRIVER_WITH_DEFAULT_DVAR = (1<<0), /* create drivers with a default variable for nicer UI */ + CREATEDRIVER_WITH_DEFAULT_DVAR = (1 << 0), /* create drivers with a default variable for nicer UI */ } eCreateDriverFlags; /* -------- */ @@ -236,22 +236,22 @@ struct FCurve *verify_driver_fcurve(struct ID *id, const char rna_path[], const short ANIM_driver_can_paste(void); /* Main Driver Management API calls: - * Add a new driver for the specified property on the given ID block + * Add a new driver for the specified property on the given ID block */ short ANIM_add_driver(struct ReportList *reports, struct ID *id, const char rna_path[], int array_index, short flag, int type); /* Main Driver Management API calls: - * Remove the driver for the specified property on the given ID block (if available) + * Remove the driver for the specified property on the given ID block (if available) */ short ANIM_remove_driver(struct ReportList *reports, struct ID *id, const char rna_path[], int array_index, short flag); /* Main Driver Management API calls: - * Make a copy of the driver for the specified property on the given ID block + * Make a copy of the driver for the specified property on the given ID block */ short ANIM_copy_driver(struct ReportList *reports, struct ID *id, const char rna_path[], int array_index, short flag); /* Main Driver Management API calls: - * Add a new driver for the specified property on the given ID block or replace an existing one + * Add a new driver for the specified property on the given ID block or replace an existing one * with the driver + driver-curve data from the buffer */ short ANIM_paste_driver(struct ReportList *reports, struct ID *id, const char rna_path[], int array_index, short flag); @@ -259,21 +259,21 @@ short ANIM_paste_driver(struct ReportList *reports, struct ID *id, const char rn /* ************ Auto-Keyframing ********************** */ /* Notes: * - All the defines for this (User-Pref settings and Per-Scene settings) - * are defined in DNA_userdef_types.h + * are defined in DNA_userdef_types.h * - Scene settings take presidence over those for userprefs, with old files - * inheriting userpref settings for the scene settings + * inheriting userpref settings for the scene settings * - "On/Off + Mode" are stored per Scene, but "settings" are currently stored - * as userprefs + * as userprefs */ /* Auto-Keying macros for use by various tools */ - /* check if auto-keyframing is enabled (per scene takes presidence) */ -#define IS_AUTOKEY_ON(scene) ((scene) ? (scene->toolsettings->autokey_mode & AUTOKEY_ON) : (U.autokey_mode & AUTOKEY_ON)) - /* check the mode for auto-keyframing (per scene takes presidence) */ -#define IS_AUTOKEY_MODE(scene, mode) ((scene) ? (scene->toolsettings->autokey_mode == AUTOKEY_MODE_##mode) : (U.autokey_mode == AUTOKEY_MODE_##mode)) - /* check if a flag is set for auto-keyframing (per scene takes presidence) */ +/* check if auto-keyframing is enabled (per scene takes presidence) */ +#define IS_AUTOKEY_ON(scene) ((scene) ? (scene->toolsettings->autokey_mode & AUTOKEY_ON) : (U.autokey_mode & AUTOKEY_ON)) +/* check the mode for auto-keyframing (per scene takes presidence) */ +#define IS_AUTOKEY_MODE(scene, mode) ((scene) ? (scene->toolsettings->autokey_mode == AUTOKEY_MODE_##mode) : (U.autokey_mode == AUTOKEY_MODE_##mode)) +/* check if a flag is set for auto-keyframing (per scene takes presidence) */ #define IS_AUTOKEY_FLAG(scene, flag) \ - ((scene)? \ + ((scene) ? \ ((scene->toolsettings->autokey_flag & AUTOKEY_FLAG_##flag) || (U.autokey_flag & AUTOKEY_FLAG_##flag)) \ : \ (U.autokey_flag & AUTOKEY_FLAG_##flag)) @@ -291,7 +291,7 @@ short fcurve_frame_has_keyframe(struct FCurve *fcu, float frame, short filter); /* Main Keyframe Checking API call: * Checks whether a keyframe exists for the given ID-block one the given frame. * - It is recommended to call this method over the other keyframe-checkers directly, - * in case some detail of the implementation changes... + * in case some detail of the implementation changes... * - frame: the value of this is quite often result of BKE_scene_frame_get() */ short id_frame_has_keyframe(struct ID *id, float frame, short filter); @@ -302,14 +302,14 @@ short id_frame_has_keyframe(struct ID *id, float frame, short filter); * (for v3d->keyflags) */ typedef enum eAnimFilterFlags { - /* general */ - ANIMFILTER_KEYS_LOCAL = (1<<0), /* only include locally available anim data */ - ANIMFILTER_KEYS_MUTED = (1<<1), /* include muted elements */ - ANIMFILTER_KEYS_ACTIVE = (1<<2), /* only include active-subelements */ - - /* object specific */ - ANIMFILTER_KEYS_NOMAT = (1<<9), /* don't include material keyframes */ - ANIMFILTER_KEYS_NOSKEY = (1<<10), /* don't include shape keys (for geometry) */ + /* general */ + ANIMFILTER_KEYS_LOCAL = (1 << 0), /* only include locally available anim data */ + ANIMFILTER_KEYS_MUTED = (1 << 1), /* include muted elements */ + ANIMFILTER_KEYS_ACTIVE = (1 << 2), /* only include active-subelements */ + + /* object specific */ + ANIMFILTER_KEYS_NOMAT = (1 << 9), /* don't include material keyframes */ + ANIMFILTER_KEYS_NOSKEY = (1 << 10), /* don't include shape keys (for geometry) */ } eAnimFilterFlags; /* utility funcs for auto keyframe */ diff --git a/source/blender/editors/include/ED_markers.h b/source/blender/editors/include/ED_markers.h index c0b5ba6ecf8..cb065646f0a 100644 --- a/source/blender/editors/include/ED_markers.h +++ b/source/blender/editors/include/ED_markers.h @@ -42,8 +42,8 @@ struct TimeMarker; /* flags for drawing markers */ enum { - DRAW_MARKERS_LINES = (1<<0), - DRAW_MARKERS_LOCAL = (1<<1) + DRAW_MARKERS_LINES = (1 << 0), + DRAW_MARKERS_LOCAL = (1 << 1) }; void draw_markers_time(const struct bContext *C, int flag); @@ -78,4 +78,3 @@ void ED_marker_keymap_animedit_conflictfree(struct wmKeyMap *keymap); void debug_markers_print_list(struct ListBase *markers); #endif /* __ED_MARKERS_H__ */ - diff --git a/source/blender/editors/include/ED_numinput.h b/source/blender/editors/include/ED_numinput.h index d51ece58e92..411df88fb28 100644 --- a/source/blender/editors/include/ED_numinput.h +++ b/source/blender/editors/include/ED_numinput.h @@ -48,11 +48,11 @@ typedef struct NumInput { } NumInput; /* NUMINPUT FLAGS */ -#define NUM_NULL_ONE 2 -#define NUM_NO_NEGATIVE 4 -#define NUM_NO_ZERO 8 -#define NUM_NO_FRACTION 16 -#define NUM_AFFECT_ALL 32 +#define NUM_NULL_ONE 2 +#define NUM_NO_NEGATIVE 4 +#define NUM_NO_ZERO 8 +#define NUM_NO_FRACTION 16 +#define NUM_AFFECT_ALL 32 /*********************** NumInput ********************************/ diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index 85e68ba7ab4..429dcb88c78 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -90,21 +90,21 @@ void ED_object_parent_clear(struct bContext *C, int type); /* generic editmode keys like pet * do_pet - * 0: No - * 1: Object - * 2: Edit - * 3: Edit with connected + * 0: No + * 1: Object + * 2: Edit + * 3: Edit with connected * */ void ED_object_generic_keymap(struct wmKeyConfig *keyconf, struct wmKeyMap *keymap, int do_pet); - /* send your own notifier for select! */ +/* send your own notifier for select! */ void ED_base_object_select(struct Base *base, short mode); - /* includes notifier */ +/* includes notifier */ void ED_base_object_activate(struct bContext *C, struct Base *base); void ED_base_object_free_and_unlink(struct Main *bmain, struct Scene *scene, struct Base *base); - /* single object duplicate, if dupflag==0, fully linked, else it uses the flags given */ +/* single object duplicate, if dupflag==0, fully linked, else it uses the flags given */ struct Base *ED_object_add_duplicate(struct Main *bmain, struct Scene *scene, struct Base *base, int dupflag); void ED_object_parent(struct Object *ob, struct Object *parent, int type, const char *substr); @@ -112,11 +112,11 @@ void ED_object_parent(struct Object *ob, struct Object *parent, int type, const void ED_object_toggle_modes(struct bContext *C, int mode); /* bitflags for enter/exit editmode */ -#define EM_FREEDATA 1 -#define EM_FREEUNDO 2 -#define EM_WAITCURSOR 4 -#define EM_DO_UNDO 8 -#define EM_IGNORE_LAYER 16 +#define EM_FREEDATA 1 +#define EM_FREEUNDO 2 +#define EM_WAITCURSOR 4 +#define EM_DO_UNDO 8 +#define EM_IGNORE_LAYER 16 void ED_object_exit_editmode(struct bContext *C, int flag); void ED_object_enter_editmode(struct bContext *C, int flag); @@ -128,10 +128,10 @@ float ED_object_new_primitive_matrix(struct bContext *C, struct Object *editob, void ED_object_add_generic_props(struct wmOperatorType *ot, int do_editmode); int ED_object_add_generic_invoke(struct bContext *C, struct wmOperator *op, struct wmEvent *event); int ED_object_add_generic_get_opts(struct bContext *C, struct wmOperator *op, - float *loc, float *rot, int *enter_editmode, unsigned int *layer, int *is_view_aligned); + float *loc, float *rot, int *enter_editmode, unsigned int *layer, int *is_view_aligned); struct Object *ED_object_add_type(struct bContext *C, int type, float *loc, - float *rot, int enter_editmode, unsigned int layer); + float *rot, int enter_editmode, unsigned int layer); void ED_object_single_users(struct Main *bmain, struct Scene *scene, int full); void ED_object_single_user(struct Scene *scene, struct Object *ob); @@ -161,7 +161,7 @@ void ED_setflagsLatt(struct Object *obedit, int flag); /* object_modifier.c */ enum { - MODIFIER_APPLY_DATA=1, + MODIFIER_APPLY_DATA = 1, MODIFIER_APPLY_SHAPE }; diff --git a/source/blender/editors/include/ED_render.h b/source/blender/editors/include/ED_render.h index 5392ef86ba7..7891315be9f 100644 --- a/source/blender/editors/include/ED_render.h +++ b/source/blender/editors/include/ED_render.h @@ -57,16 +57,16 @@ typedef struct RenderInfo { int pr_rectx; int pr_recty; short curtile, tottile, status; - rcti disprect; /* storage for view3d preview rect */ - unsigned int* rect; - struct Render *re; /* persistent render */ + rcti disprect; /* storage for view3d preview rect */ + unsigned int *rect; + struct Render *re; /* persistent render */ } RenderInfo; /* ri->status */ -#define PR_DBASE 1 -#define PR_DISPRECT 2 -#define PR_PROJECTED 4 -#define PR_ROTATED 8 +#define PR_DBASE 1 +#define PR_DISPRECT 2 +#define PR_PROJECTED 4 +#define PR_ROTATED 8 /* Render the preview * @@ -76,9 +76,9 @@ typedef struct RenderInfo { * - PR_NODE_RENDER: preview is rendered for node editor */ -#define PR_BUTS_RENDER 0 -#define PR_ICON_RENDER 1 -#define PR_NODE_RENDER 2 +#define PR_BUTS_RENDER 0 +#define PR_ICON_RENDER 1 +#define PR_NODE_RENDER 2 void ED_preview_init_dbase(void); void ED_preview_free_dbase(void); diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index f62befdaa31..2fc72f7e8da 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -50,135 +50,135 @@ struct uiBlock; struct rcti; /* regions */ -void ED_region_do_listen(struct ARegion *ar, struct wmNotifier *note); -void ED_region_do_draw(struct bContext *C, struct ARegion *ar); -void ED_region_exit(struct bContext *C, struct ARegion *ar); -void ED_region_pixelspace(struct ARegion *ar); -void ED_region_set(const struct bContext *C, struct ARegion *ar); -void ED_region_init(struct bContext *C, struct ARegion *ar); -void ED_region_tag_redraw(struct ARegion *ar); -void ED_region_tag_redraw_partial(struct ARegion *ar, struct rcti *rct); -void ED_region_tag_redraw_overlay(struct ARegion *ar); -void ED_region_panels_init(struct wmWindowManager *wm, struct ARegion *ar); -void ED_region_panels(const struct bContext *C, struct ARegion *ar, int vertical, const char *context, int contextnr); -void ED_region_header_init(struct ARegion *ar); -void ED_region_header(const struct bContext *C, struct ARegion *ar); -void ED_region_toggle_hidden(struct bContext *C, struct ARegion *ar); -void region_scissor_winrct(struct ARegion *ar, struct rcti *winrct); -void ED_region_info_draw(struct ARegion *ar, const char *text, int block, float alpha); -void ED_region_grid_draw(struct ARegion *ar, float zoomx, float zoomy); +void ED_region_do_listen(struct ARegion *ar, struct wmNotifier *note); +void ED_region_do_draw(struct bContext *C, struct ARegion *ar); +void ED_region_exit(struct bContext *C, struct ARegion *ar); +void ED_region_pixelspace(struct ARegion *ar); +void ED_region_set(const struct bContext *C, struct ARegion *ar); +void ED_region_init(struct bContext *C, struct ARegion *ar); +void ED_region_tag_redraw(struct ARegion *ar); +void ED_region_tag_redraw_partial(struct ARegion *ar, struct rcti *rct); +void ED_region_tag_redraw_overlay(struct ARegion *ar); +void ED_region_panels_init(struct wmWindowManager *wm, struct ARegion *ar); +void ED_region_panels(const struct bContext *C, struct ARegion *ar, int vertical, const char *context, int contextnr); +void ED_region_header_init(struct ARegion *ar); +void ED_region_header(const struct bContext *C, struct ARegion *ar); +void ED_region_toggle_hidden(struct bContext *C, struct ARegion *ar); +void region_scissor_winrct(struct ARegion *ar, struct rcti *winrct); +void ED_region_info_draw(struct ARegion *ar, const char *text, int block, float alpha); +void ED_region_grid_draw(struct ARegion *ar, float zoomx, float zoomy); /* spaces */ -void ED_spacetypes_init(void); -void ED_spacetypes_keymap(struct wmKeyConfig *keyconf); -int ED_area_header_switchbutton(const struct bContext *C, struct uiBlock *block, int yco); -int ED_area_header_standardbuttons(const struct bContext *C, struct uiBlock *block, int yco); -void ED_area_overdraw(struct bContext *C); -void ED_area_overdraw_flush(struct ScrArea *sa, struct ARegion *ar); +void ED_spacetypes_init(void); +void ED_spacetypes_keymap(struct wmKeyConfig *keyconf); +int ED_area_header_switchbutton(const struct bContext *C, struct uiBlock *block, int yco); +int ED_area_header_standardbuttons(const struct bContext *C, struct uiBlock *block, int yco); +void ED_area_overdraw(struct bContext *C); +void ED_area_overdraw_flush(struct ScrArea *sa, struct ARegion *ar); /* areas */ -void ED_area_initialize(struct wmWindowManager *wm, struct wmWindow *win, struct ScrArea *sa); -void ED_area_exit(struct bContext *C, struct ScrArea *sa); -int ED_screen_area_active(const struct bContext *C); -void ED_area_do_listen(ScrArea *sa, struct wmNotifier *note); -void ED_area_tag_redraw(ScrArea *sa); -void ED_area_tag_redraw_regiontype(ScrArea *sa, int type); -void ED_area_tag_refresh(ScrArea *sa); -void ED_area_do_refresh(struct bContext *C, ScrArea *sa); -void ED_area_headerprint(ScrArea *sa, const char *str); -void ED_area_newspace(struct bContext *C, ScrArea *sa, int type); -void ED_area_prevspace(struct bContext *C, ScrArea *sa); -void ED_area_swapspace(struct bContext *C, ScrArea *sa1, ScrArea *sa2); -int ED_area_headersize(void); +void ED_area_initialize(struct wmWindowManager *wm, struct wmWindow *win, struct ScrArea *sa); +void ED_area_exit(struct bContext *C, struct ScrArea *sa); +int ED_screen_area_active(const struct bContext *C); +void ED_area_do_listen(ScrArea *sa, struct wmNotifier *note); +void ED_area_tag_redraw(ScrArea *sa); +void ED_area_tag_redraw_regiontype(ScrArea *sa, int type); +void ED_area_tag_refresh(ScrArea *sa); +void ED_area_do_refresh(struct bContext *C, ScrArea *sa); +void ED_area_headerprint(ScrArea *sa, const char *str); +void ED_area_newspace(struct bContext *C, ScrArea *sa, int type); +void ED_area_prevspace(struct bContext *C, ScrArea *sa); +void ED_area_swapspace(struct bContext *C, ScrArea *sa1, ScrArea *sa2); +int ED_area_headersize(void); /* screens */ -void ED_screens_initialize(struct wmWindowManager *wm); -void ED_screen_draw(struct wmWindow *win); -void ED_screen_refresh(struct wmWindowManager *wm, struct wmWindow *win); -void ED_screen_do_listen(struct bContext *C, struct wmNotifier *note); +void ED_screens_initialize(struct wmWindowManager *wm); +void ED_screen_draw(struct wmWindow *win); +void ED_screen_refresh(struct wmWindowManager *wm, struct wmWindow *win); +void ED_screen_do_listen(struct bContext *C, struct wmNotifier *note); bScreen *ED_screen_duplicate(struct wmWindow *win, struct bScreen *sc); bScreen *ED_screen_add(struct wmWindow *win, struct Scene *scene, const char *name); -void ED_screen_set(struct bContext *C, struct bScreen *sc); -void ED_screen_delete(struct bContext *C, struct bScreen *sc); -void ED_screen_set_scene(struct bContext *C, struct bScreen *screen, struct Scene *scene); -void ED_screen_delete_scene(struct bContext *C, struct Scene *scene); -void ED_screen_set_subwinactive(struct bContext *C, struct wmEvent *event); -void ED_screen_exit(struct bContext *C, struct wmWindow *window, struct bScreen *screen); -void ED_screen_animation_timer(struct bContext *C, int redraws, int refresh, int sync, int enable); -void ED_screen_animation_timer_update(struct bScreen *screen, int redraws, int refresh); +void ED_screen_set(struct bContext *C, struct bScreen *sc); +void ED_screen_delete(struct bContext *C, struct bScreen *sc); +void ED_screen_set_scene(struct bContext *C, struct bScreen *screen, struct Scene *scene); +void ED_screen_delete_scene(struct bContext *C, struct Scene *scene); +void ED_screen_set_subwinactive(struct bContext *C, struct wmEvent *event); +void ED_screen_exit(struct bContext *C, struct wmWindow *window, struct bScreen *screen); +void ED_screen_animation_timer(struct bContext *C, int redraws, int refresh, int sync, int enable); +void ED_screen_animation_timer_update(struct bScreen *screen, int redraws, int refresh); ScrArea *ED_screen_full_newspace(struct bContext *C, ScrArea *sa, int type); -void ED_screen_full_prevspace(struct bContext *C, ScrArea *sa); -void ED_screen_full_restore(struct bContext *C, ScrArea *sa); +void ED_screen_full_prevspace(struct bContext *C, ScrArea *sa); +void ED_screen_full_restore(struct bContext *C, ScrArea *sa); struct ScrArea *ED_screen_full_toggle(struct bContext *C, struct wmWindow *win, struct ScrArea *sa); /* anim */ -void ED_update_for_newframe(struct Main *bmain, struct Scene *scene, struct bScreen *screen, int mute); +void ED_update_for_newframe(struct Main *bmain, struct Scene *scene, struct bScreen *screen, int mute); -void ED_refresh_viewport_fps(struct bContext *C); +void ED_refresh_viewport_fps(struct bContext *C); int ED_screen_animation_play(struct bContext *C, int sync, int mode); /* screen keymaps */ -void ED_operatortypes_screen(void); -void ED_keymap_screen(struct wmKeyConfig *keyconf); +void ED_operatortypes_screen(void); +void ED_keymap_screen(struct wmKeyConfig *keyconf); /* operators; context poll callbacks */ -int ED_operator_screenactive(struct bContext *C); -int ED_operator_screen_mainwinactive(struct bContext *C); -int ED_operator_areaactive(struct bContext *C); -int ED_operator_regionactive(struct bContext *C); - -int ED_operator_scene_editable(struct bContext *C); -int ED_operator_objectmode(struct bContext *C); - -int ED_operator_view3d_active(struct bContext *C); -int ED_operator_region_view3d_active(struct bContext *C); -int ED_operator_animview_active(struct bContext *C); -int ED_operator_timeline_active(struct bContext *C); -int ED_operator_outliner_active(struct bContext *C); -int ED_operator_outliner_active_no_editobject(struct bContext *C); -int ED_operator_file_active(struct bContext *C); -int ED_operator_action_active(struct bContext *C); -int ED_operator_buttons_active(struct bContext *C); -int ED_operator_node_active(struct bContext *C); -int ED_operator_graphedit_active(struct bContext *C); -int ED_operator_sequencer_active(struct bContext *C); -int ED_operator_image_active(struct bContext *C); -int ED_operator_nla_active(struct bContext *C); -int ED_operator_logic_active(struct bContext *C); -int ED_operator_info_active(struct bContext *C); -int ED_operator_console_active(struct bContext *C); - - -int ED_operator_object_active(struct bContext *C); -int ED_operator_object_active_editable(struct bContext *C); -int ED_operator_object_active_editable_mesh(struct bContext *C); -int ED_operator_object_active_editable_font(struct bContext *C); -int ED_operator_editmesh(struct bContext *C); -int ED_operator_editmesh_view3d(struct bContext *C); -int ED_operator_editmesh_region_view3d(struct bContext *C); -int ED_operator_editarmature(struct bContext *C); -int ED_operator_editcurve(struct bContext *C); -int ED_operator_editcurve_3d(struct bContext *C); -int ED_operator_editsurf(struct bContext *C); -int ED_operator_editsurfcurve(struct bContext *C); -int ED_operator_editsurfcurve_region_view3d(struct bContext *C); -int ED_operator_editfont(struct bContext *C); -int ED_operator_editlattice(struct bContext *C); -int ED_operator_editmball(struct bContext *C); -int ED_operator_uvedit(struct bContext *C); -int ED_operator_uvmap(struct bContext *C); -int ED_operator_posemode(struct bContext *C); +int ED_operator_screenactive(struct bContext *C); +int ED_operator_screen_mainwinactive(struct bContext *C); +int ED_operator_areaactive(struct bContext *C); +int ED_operator_regionactive(struct bContext *C); + +int ED_operator_scene_editable(struct bContext *C); +int ED_operator_objectmode(struct bContext *C); + +int ED_operator_view3d_active(struct bContext *C); +int ED_operator_region_view3d_active(struct bContext *C); +int ED_operator_animview_active(struct bContext *C); +int ED_operator_timeline_active(struct bContext *C); +int ED_operator_outliner_active(struct bContext *C); +int ED_operator_outliner_active_no_editobject(struct bContext *C); +int ED_operator_file_active(struct bContext *C); +int ED_operator_action_active(struct bContext *C); +int ED_operator_buttons_active(struct bContext *C); +int ED_operator_node_active(struct bContext *C); +int ED_operator_graphedit_active(struct bContext *C); +int ED_operator_sequencer_active(struct bContext *C); +int ED_operator_image_active(struct bContext *C); +int ED_operator_nla_active(struct bContext *C); +int ED_operator_logic_active(struct bContext *C); +int ED_operator_info_active(struct bContext *C); +int ED_operator_console_active(struct bContext *C); + + +int ED_operator_object_active(struct bContext *C); +int ED_operator_object_active_editable(struct bContext *C); +int ED_operator_object_active_editable_mesh(struct bContext *C); +int ED_operator_object_active_editable_font(struct bContext *C); +int ED_operator_editmesh(struct bContext *C); +int ED_operator_editmesh_view3d(struct bContext *C); +int ED_operator_editmesh_region_view3d(struct bContext *C); +int ED_operator_editarmature(struct bContext *C); +int ED_operator_editcurve(struct bContext *C); +int ED_operator_editcurve_3d(struct bContext *C); +int ED_operator_editsurf(struct bContext *C); +int ED_operator_editsurfcurve(struct bContext *C); +int ED_operator_editsurfcurve_region_view3d(struct bContext *C); +int ED_operator_editfont(struct bContext *C); +int ED_operator_editlattice(struct bContext *C); +int ED_operator_editmball(struct bContext *C); +int ED_operator_uvedit(struct bContext *C); +int ED_operator_uvmap(struct bContext *C); +int ED_operator_posemode(struct bContext *C); /* default keymaps, bitflags */ -#define ED_KEYMAP_UI 1 -#define ED_KEYMAP_VIEW2D 2 -#define ED_KEYMAP_MARKERS 4 -#define ED_KEYMAP_ANIMATION 8 -#define ED_KEYMAP_FRAMES 16 -#define ED_KEYMAP_GPENCIL 32 -#define ED_KEYMAP_HEADER 64 +#define ED_KEYMAP_UI 1 +#define ED_KEYMAP_VIEW2D 2 +#define ED_KEYMAP_MARKERS 4 +#define ED_KEYMAP_ANIMATION 8 +#define ED_KEYMAP_FRAMES 16 +#define ED_KEYMAP_GPENCIL 32 +#define ED_KEYMAP_HEADER 64 #endif /* __ED_SCREEN_H__ */ diff --git a/source/blender/editors/include/ED_screen_types.h b/source/blender/editors/include/ED_screen_types.h index 6f7d0c55b9a..c53dca47da9 100644 --- a/source/blender/editors/include/ED_screen_types.h +++ b/source/blender/editors/include/ED_screen_types.h @@ -35,27 +35,27 @@ /* for animplayer */ typedef struct ScreenAnimData { - ARegion *ar; /* do not read from this, only for comparing if region exists */ + ARegion *ar; /* do not read from this, only for comparing if region exists */ short redraws; short refresh; - short flag; /* flags for playback */ - int sfra; /* frame that playback was started from */ - int nextfra; /* next frame to go to (when ANIMPLAY_FLAG_USE_NEXT_FRAME is set) */ - double last_duration; /* used for frame dropping */ + short flag; /* flags for playback */ + int sfra; /* frame that playback was started from */ + int nextfra; /* next frame to go to (when ANIMPLAY_FLAG_USE_NEXT_FRAME is set) */ + double last_duration; /* used for frame dropping */ } ScreenAnimData; /* for animplayer */ enum { - /* user-setting - frame range is played backwards */ - ANIMPLAY_FLAG_REVERSE = (1<<0), - /* temporary - playback just jumped to the start/end */ - ANIMPLAY_FLAG_JUMPED = (1<<1), - /* drop frames as needed to maintain framerate */ - ANIMPLAY_FLAG_SYNC = (1<<2), - /* don't drop frames (and ignore SCE_FRAME_DROP flag) */ - ANIMPLAY_FLAG_NO_SYNC = (1<<3), - /* use nextfra at next timer update */ - ANIMPLAY_FLAG_USE_NEXT_FRAME = (1<<4) + /* user-setting - frame range is played backwards */ + ANIMPLAY_FLAG_REVERSE = (1 << 0), + /* temporary - playback just jumped to the start/end */ + ANIMPLAY_FLAG_JUMPED = (1 << 1), + /* drop frames as needed to maintain framerate */ + ANIMPLAY_FLAG_SYNC = (1 << 2), + /* don't drop frames (and ignore SCE_FRAME_DROP flag) */ + ANIMPLAY_FLAG_NO_SYNC = (1 << 3), + /* use nextfra at next timer update */ + ANIMPLAY_FLAG_USE_NEXT_FRAME = (1 << 4) }; /* ----------------------------------------------------- */ @@ -76,10 +76,10 @@ typedef struct ScreenFrameRateInfo { /* Enum for Action Zone Edges. Which edge of area is action zone. */ typedef enum { - AE_RIGHT_TO_TOPLEFT, /* Region located on the left, _right_ edge is action zone. Region minimised to the top left */ - AE_LEFT_TO_TOPRIGHT, /* Region located on the right, _left_ edge is action zone. Region minimised to the top right */ - AE_TOP_TO_BOTTOMRIGHT, /* Region located at the bottom, _top_ edge is action zone. Region minimised to the bottom right */ - AE_BOTTOM_TO_TOPLEFT /* Region located at the top, _bottom_edge is action zone. Region minimised to the top left */ + AE_RIGHT_TO_TOPLEFT, /* Region located on the left, _right_ edge is action zone. Region minimised to the top left */ + AE_LEFT_TO_TOPRIGHT, /* Region located on the right, _left_ edge is action zone. Region minimised to the top right */ + AE_TOP_TO_BOTTOMRIGHT, /* Region located at the bottom, _top_ edge is action zone. Region minimised to the bottom right */ + AE_BOTTOM_TO_TOPLEFT /* Region located at the top, _bottom_edge is action zone. Region minimised to the top left */ } AZEdge; /* for editing areas/regions */ @@ -98,7 +98,7 @@ typedef struct AZone { } AZone; /* actionzone type */ -#define AZONE_AREA 1 -#define AZONE_REGION 2 +#define AZONE_AREA 1 +#define AZONE_REGION 2 #endif /* __ED_SCREEN_TYPES_H__ */ diff --git a/source/blender/editors/include/ED_sequencer.h b/source/blender/editors/include/ED_sequencer.h index abeb00c301f..f20ebe81189 100644 --- a/source/blender/editors/include/ED_sequencer.h +++ b/source/blender/editors/include/ED_sequencer.h @@ -27,6 +27,6 @@ #ifndef __ED_SEQUENCER_H__ #define __ED_SEQUENCER_H__ -#define SEQ_ZOOM_FAC(szoom) ((szoom) > 0.0f)? (szoom) : ((szoom) == 0.0f)? (1.0f) : (-1.0f/(szoom)) +#define SEQ_ZOOM_FAC(szoom) ((szoom) > 0.0f) ? (szoom) : ((szoom) == 0.0f) ? (1.0f) : (-1.0f / (szoom)) #endif /* __ED_SEQUENCER_H__ */ diff --git a/source/blender/editors/include/ED_space_api.h b/source/blender/editors/include/ED_space_api.h index 8023eef8370..c8521cb194a 100644 --- a/source/blender/editors/include/ED_space_api.h +++ b/source/blender/editors/include/ED_space_api.h @@ -62,13 +62,13 @@ void ED_spacetype_clip(void); void ED_file_init(void); void ED_file_exit(void); -#define REGION_DRAW_POST_VIEW 0 -#define REGION_DRAW_POST_PIXEL 1 -#define REGION_DRAW_PRE_VIEW 2 +#define REGION_DRAW_POST_VIEW 0 +#define REGION_DRAW_POST_PIXEL 1 +#define REGION_DRAW_PRE_VIEW 2 void *ED_region_draw_cb_activate(struct ARegionType *, - void (*draw)(const struct bContext *, struct ARegion *, void *), - void *custumdata, int type); + void (*draw)(const struct bContext *, struct ARegion *, void *), + void *custumdata, int type); void ED_region_draw_cb_draw(const struct bContext *, struct ARegion *, int); void ED_region_draw_cb_exit(struct ARegionType *, void *); void *ED_region_draw_cb_customdata(void *handle); diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h index f6dee351c29..30d49748626 100644 --- a/source/blender/editors/include/ED_transform.h +++ b/source/blender/editors/include/ED_transform.h @@ -85,16 +85,16 @@ enum { } TfmMode; /* TRANSFORM CONTEXTS */ -#define CTX_NONE 0 -#define CTX_TEXTURE 1 -#define CTX_EDGE 2 -#define CTX_NO_PET 4 -#define CTX_TWEAK 8 -#define CTX_NO_MIRROR 16 -#define CTX_AUTOCONFIRM 32 -#define CTX_BMESH 64 -#define CTX_NDOF 128 -#define CTX_MOVIECLIP 256 +#define CTX_NONE 0 +#define CTX_TEXTURE 1 +#define CTX_EDGE 2 +#define CTX_NO_PET 4 +#define CTX_TWEAK 8 +#define CTX_NO_MIRROR 16 +#define CTX_AUTOCONFIRM 32 +#define CTX_BMESH 64 +#define CTX_NDOF 128 +#define CTX_MOVIECLIP 256 /* Standalone call to get the transformation center corresponding to the current situation * returns 1 if successful, 0 otherwise (usually means there's no selection) @@ -124,7 +124,7 @@ void BIF_selectTransformOrientationValue(struct bContext *C, int orientation); void ED_getTransformOrientationMatrix(const struct bContext *C, float orientation_mat[][3], int activeOnly); struct EnumPropertyItem *BIF_enumTransformOrientation(struct bContext *C); -const char * BIF_menustringTransformOrientation(const struct bContext *C, const char *title); /* the returned value was allocated and needs to be freed after use */ +const char *BIF_menustringTransformOrientation(const struct bContext *C, const char *title); /* the returned value was allocated and needs to be freed after use */ int BIF_countTransformOrientation(const struct bContext *C); void BIF_TransformSetUndo(const char *str); @@ -133,15 +133,15 @@ void BIF_selectOrientation(void); /* to be able to add operator properties to other operators */ -#define P_MIRROR (1 << 0) -#define P_PROPORTIONAL (1 << 1) -#define P_AXIS (1 << 2) -#define P_SNAP (1 << 3) -#define P_GEO_SNAP (P_SNAP|(1 << 4)) -#define P_ALIGN_SNAP (P_GEO_SNAP|(1 << 5)) -#define P_CONSTRAINT (1 << 6) -#define P_OPTIONS (1 << 7) -#define P_CORRECT_UV (1 << 8) +#define P_MIRROR (1 << 0) +#define P_PROPORTIONAL (1 << 1) +#define P_AXIS (1 << 2) +#define P_SNAP (1 << 3) +#define P_GEO_SNAP (P_SNAP | (1 << 4)) +#define P_ALIGN_SNAP (P_GEO_SNAP | (1 << 5)) +#define P_CONSTRAINT (1 << 6) +#define P_OPTIONS (1 << 7) +#define P_CORRECT_UV (1 << 8) void Transform_Properties(struct wmOperatorType *ot, int flags); @@ -153,8 +153,7 @@ void BIF_draw_manipulator(const struct bContext *C); /* Snapping */ -typedef struct DepthPeel -{ +typedef struct DepthPeel { struct DepthPeel *next, *prev; float depth; diff --git a/source/blender/editors/include/ED_types.h b/source/blender/editors/include/ED_types.h index c4104472a82..5908dbf3a1d 100644 --- a/source/blender/editors/include/ED_types.h +++ b/source/blender/editors/include/ED_types.h @@ -35,8 +35,8 @@ /* old blender defines... should be depricated? */ #define DESELECT 0 -#define SELECT 1 -#define ACTIVE 2 +#define SELECT 1 +#define ACTIVE 2 /* proposal = put scene pointers on function calls? */ // #define BASACT (scene->basact) @@ -45,4 +45,3 @@ #endif /* __ED_TYPES_H__ */ - diff --git a/source/blender/editors/include/ED_util.h b/source/blender/editors/include/ED_util.h index 9bde252e776..e10f049d0bc 100644 --- a/source/blender/editors/include/ED_util.h +++ b/source/blender/editors/include/ED_util.h @@ -43,39 +43,39 @@ struct Mesh; /* ed_util.c */ -void ED_editors_init (struct bContext *C); -void ED_editors_exit (struct bContext *C); +void ED_editors_init(struct bContext *C); +void ED_editors_exit(struct bContext *C); /* ************** Undo ************************ */ /* undo.c */ -void ED_undo_push (struct bContext *C, const char *str); -void ED_undo_push_op (struct bContext *C, struct wmOperator *op); -void ED_undo_pop_op (struct bContext *C, struct wmOperator *op); -void ED_undo_pop (struct bContext *C); -void ED_undo_redo (struct bContext *C); -void ED_OT_undo (struct wmOperatorType *ot); -void ED_OT_undo_push (struct wmOperatorType *ot); -void ED_OT_redo (struct wmOperatorType *ot); -void ED_OT_undo_history (struct wmOperatorType *ot); - -int ED_undo_operator_repeat(struct bContext *C, struct wmOperator *op); - /* convenience since UI callbacks use this mostly*/ -void ED_undo_operator_repeat_cb(struct bContext *C, void *arg_op, void *arg_unused); -void ED_undo_operator_repeat_cb_evt(struct bContext *C, void *arg_op, int arg_unused); - -int ED_undo_valid (const struct bContext *C, const char *undoname); +void ED_undo_push(struct bContext *C, const char *str); +void ED_undo_push_op(struct bContext *C, struct wmOperator *op); +void ED_undo_pop_op(struct bContext *C, struct wmOperator *op); +void ED_undo_pop(struct bContext *C); +void ED_undo_redo(struct bContext *C); +void ED_OT_undo(struct wmOperatorType *ot); +void ED_OT_undo_push(struct wmOperatorType *ot); +void ED_OT_redo(struct wmOperatorType *ot); +void ED_OT_undo_history(struct wmOperatorType *ot); + +int ED_undo_operator_repeat(struct bContext *C, struct wmOperator *op); +/* convenience since UI callbacks use this mostly*/ +void ED_undo_operator_repeat_cb(struct bContext *C, void *arg_op, void *arg_unused); +void ED_undo_operator_repeat_cb_evt(struct bContext *C, void *arg_op, int arg_unused); + +int ED_undo_valid(const struct bContext *C, const char *undoname); /* undo_editmode.c */ void undo_editmode_push(struct bContext *C, const char *name, - void * (*getdata)(struct bContext *C), - void (*freedata)(void *), - void (*to_editmode)(void *, void *, void *), - void *(*from_editmode)(void *, void *), - int (*validate_undo)(void *, void *)); - - -void undo_editmode_clear (void); + void * (*getdata)(struct bContext *C), + void (*freedata)(void *), + void (*to_editmode)(void *, void *, void *), + void *(*from_editmode)(void *, void *), + int (*validate_undo)(void *, void *)); + + +void undo_editmode_clear(void); /* crazyspace.c */ float *crazyspace_get_mapped_editverts(struct Scene *scene, struct Object *obedit); diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index e3759ef5fde..f9f59c9bdd9 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -245,7 +245,7 @@ void drawcircball(int mode, const float cent[3], float rad, float tmat[][4]); void view3d_validate_backbuf(struct ViewContext *vc); struct ImBuf *view3d_read_backbuf(struct ViewContext *vc, short xmin, short ymin, short xmax, short ymax); unsigned int view3d_sample_backbuf_rect(struct ViewContext *vc, const int mval[2], int size, unsigned int min, unsigned int max, int *dist, short strict, - void *handle, unsigned int (*indextest)(void *handle, unsigned int index)); + void *handle, unsigned int (*indextest)(void *handle, unsigned int index)); unsigned int view3d_sample_backbuf(struct ViewContext *vc, int x, int y); /* draws and does a 4x4 sample */ @@ -282,7 +282,7 @@ int ED_view3d_scene_layer_set(int lay, const int *values, int *active); int ED_view3d_context_activate(struct bContext *C); void ED_view3d_draw_offscreen(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, - int winx, int winy, float viewmat[][4], float winmat[][4], int draw_background); + int winx, int winy, float viewmat[][4], float winmat[][4], int draw_background); struct ImBuf *ED_view3d_draw_offscreen_imbuf(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, int sizex, int sizey, unsigned int flag, int draw_background, char err_out[256]); struct ImBuf *ED_view3d_draw_offscreen_imbuf_simple(struct Scene *scene, struct Object *camera, int width, int height, unsigned int flag, int drawtype, int draw_background, char err_out[256]); diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index d262c650e1c..c0f9d6dd5cd 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -80,96 +80,96 @@ typedef struct uiLayout uiLayout; /* Defines */ /* names */ -#define UI_MAX_DRAW_STR 400 -#define UI_MAX_NAME_STR 128 +#define UI_MAX_DRAW_STR 400 +#define UI_MAX_NAME_STR 128 /* uiBlock->dt */ -#define UI_EMBOSS 0 /* use widget style for drawing */ -#define UI_EMBOSSN 1 /* Nothing, only icon and/or text */ -#define UI_EMBOSSP 2 /* Pulldown menu style */ -#define UI_EMBOSST 3 /* Table */ +#define UI_EMBOSS 0 /* use widget style for drawing */ +#define UI_EMBOSSN 1 /* Nothing, only icon and/or text */ +#define UI_EMBOSSP 2 /* Pulldown menu style */ +#define UI_EMBOSST 3 /* Table */ /* uiBlock->direction */ -#define UI_DIRECTION (UI_TOP|UI_DOWN|UI_LEFT|UI_RIGHT) -#define UI_TOP 1 -#define UI_DOWN 2 -#define UI_LEFT 4 -#define UI_RIGHT 8 +#define UI_DIRECTION (UI_TOP | UI_DOWN | UI_LEFT | UI_RIGHT) +#define UI_TOP 1 +#define UI_DOWN 2 +#define UI_LEFT 4 +#define UI_RIGHT 8 -#define UI_CENTER 16 -#define UI_SHIFT_FLIPPED 32 +#define UI_CENTER 16 +#define UI_SHIFT_FLIPPED 32 /* uiBlock->autofill (not yet used) */ // #define UI_BLOCK_COLLUMNS 1 // #define UI_BLOCK_ROWS 2 /* uiBlock->flag (controls) */ -#define UI_BLOCK_LOOP 1 -#define UI_BLOCK_REDRAW 2 -#define UI_BLOCK_RET_1 4 /* XXX 2.5 not implemented */ -#define UI_BLOCK_NUMSELECT 8 +#define UI_BLOCK_LOOP 1 +#define UI_BLOCK_REDRAW 2 +#define UI_BLOCK_RET_1 4 /* XXX 2.5 not implemented */ +#define UI_BLOCK_NUMSELECT 8 /*#define UI_BLOCK_ENTER_OK 16*/ /*UNUSED*/ -#define UI_BLOCK_CLIPBOTTOM 32 -#define UI_BLOCK_CLIPTOP 64 -#define UI_BLOCK_MOVEMOUSE_QUIT 128 -#define UI_BLOCK_KEEP_OPEN 256 -#define UI_BLOCK_POPUP 512 -#define UI_BLOCK_OUT_1 1024 -#define UI_BLOCK_NO_FLIP 2048 -#define UI_BLOCK_POPUP_MEMORY 4096 -#define UI_BLOCK_CLIP_EVENTS 8192 /* stop handling mouse events */ +#define UI_BLOCK_CLIPBOTTOM 32 +#define UI_BLOCK_CLIPTOP 64 +#define UI_BLOCK_MOVEMOUSE_QUIT 128 +#define UI_BLOCK_KEEP_OPEN 256 +#define UI_BLOCK_POPUP 512 +#define UI_BLOCK_OUT_1 1024 +#define UI_BLOCK_NO_FLIP 2048 +#define UI_BLOCK_POPUP_MEMORY 4096 +#define UI_BLOCK_CLIP_EVENTS 8192 /* stop handling mouse events */ /* uiPopupBlockHandle->menuretval */ -#define UI_RETURN_CANCEL 1 /* cancel all menus cascading */ +#define UI_RETURN_CANCEL 1 /* cancel all menus cascading */ #define UI_RETURN_OK 2 /* choice made */ #define UI_RETURN_OUT 4 /* left the menu */ #define UI_RETURN_UPDATE 8 /* update the button that opened */ #define UI_RETURN_POPUP_OK 16 /* popup is ok to be handled */ - /* block->flag bits 12-15 are identical to but->flag bits */ +/* block->flag bits 12-15 are identical to but->flag bits */ /* panel controls */ -#define UI_PNL_SOLID 2 -#define UI_PNL_CLOSE 32 -#define UI_PNL_SCALE 512 +#define UI_PNL_SOLID 2 +#define UI_PNL_CLOSE 32 +#define UI_PNL_SCALE 512 /* warning the first 6 flags are internal */ /* but->flag */ -#define UI_TEXT_LEFT 64 -#define UI_ICON_LEFT 128 -#define UI_ICON_SUBMENU 256 -#define UI_ICON_PREVIEW 512 - -#define UI_TEXT_RIGHT 1024 -#define UI_BUT_NODE_LINK 2048 -#define UI_BUT_NODE_ACTIVE 4096 -#define UI_FLAG_UNUSED 8192 - - /* button align flag, for drawing groups together */ -#define UI_BUT_ALIGN (UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_LEFT|UI_BUT_ALIGN_RIGHT|UI_BUT_ALIGN_DOWN) -#define UI_BUT_ALIGN_TOP (1<<14) -#define UI_BUT_ALIGN_LEFT (1<<15) -#define UI_BUT_ALIGN_RIGHT (1<<16) -#define UI_BUT_ALIGN_DOWN (1<<17) - -#define UI_BUT_DISABLED (1<<18) -#define UI_BUT_COLOR_LOCK (1<<19) -#define UI_BUT_ANIMATED (1<<20) -#define UI_BUT_ANIMATED_KEY (1<<21) -#define UI_BUT_DRIVEN (1<<22) -#define UI_BUT_REDALERT (1<<23) -#define UI_BUT_INACTIVE (1<<24) -#define UI_BUT_LAST_ACTIVE (1<<25) -#define UI_BUT_UNDO (1<<26) -#define UI_BUT_IMMEDIATE (1<<27) -#define UI_BUT_NO_TOOLTIP (1<<28) -#define UI_BUT_NO_UTF8 (1<<29) - -#define UI_BUT_VEC_SIZE_LOCK (1<<30) /* used to flag if color hsv-circle should keep luminance */ -#define UI_BUT_COLOR_CUBIC (1<<31) /* cubic saturation for the color wheel */ - -#define UI_PANEL_WIDTH 340 -#define UI_COMPACT_PANEL_WIDTH 160 +#define UI_TEXT_LEFT 64 +#define UI_ICON_LEFT 128 +#define UI_ICON_SUBMENU 256 +#define UI_ICON_PREVIEW 512 + +#define UI_TEXT_RIGHT 1024 +#define UI_BUT_NODE_LINK 2048 +#define UI_BUT_NODE_ACTIVE 4096 +#define UI_FLAG_UNUSED 8192 + +/* button align flag, for drawing groups together */ +#define UI_BUT_ALIGN (UI_BUT_ALIGN_TOP | UI_BUT_ALIGN_LEFT | UI_BUT_ALIGN_RIGHT | UI_BUT_ALIGN_DOWN) +#define UI_BUT_ALIGN_TOP (1 << 14) +#define UI_BUT_ALIGN_LEFT (1 << 15) +#define UI_BUT_ALIGN_RIGHT (1 << 16) +#define UI_BUT_ALIGN_DOWN (1 << 17) + +#define UI_BUT_DISABLED (1 << 18) +#define UI_BUT_COLOR_LOCK (1 << 19) +#define UI_BUT_ANIMATED (1 << 20) +#define UI_BUT_ANIMATED_KEY (1 << 21) +#define UI_BUT_DRIVEN (1 << 22) +#define UI_BUT_REDALERT (1 << 23) +#define UI_BUT_INACTIVE (1 << 24) +#define UI_BUT_LAST_ACTIVE (1 << 25) +#define UI_BUT_UNDO (1 << 26) +#define UI_BUT_IMMEDIATE (1 << 27) +#define UI_BUT_NO_TOOLTIP (1 << 28) +#define UI_BUT_NO_UTF8 (1 << 29) + +#define UI_BUT_VEC_SIZE_LOCK (1 << 30) /* used to flag if color hsv-circle should keep luminance */ +#define UI_BUT_COLOR_CUBIC (1 << 31) /* cubic saturation for the color wheel */ + +#define UI_PANEL_WIDTH 340 +#define UI_COMPACT_PANEL_WIDTH 160 /* scale fixed button widths by this to account for DPI * 8.4852 == sqrtf(72.0f)) */ @@ -185,79 +185,79 @@ typedef struct uiLayout uiLayout; * - bit 9-15: button type (now 6 bits, 64 types) * */ -#define CHA 32 -#define SHO 64 -#define INT 96 -#define FLO 128 +#define CHA 32 +#define SHO 64 +#define INT 96 +#define FLO 128 /*#define FUN 192*/ /*UNUSED*/ -#define BIT 256 - -#define BUTPOIN (128+64+32) - -#define BUT (1<<9) -#define ROW (2<<9) -#define TOG (3<<9) -#define SLI (4<<9) -#define NUM (5<<9) -#define TEX (6<<9) -#define TOG3 (7<<9) -#define TOGR (8<<9) -#define TOGN (9<<9) -#define LABEL (10<<9) -#define MENU (11<<9) -#define ICONROW (12<<9) -#define ICONTOG (13<<9) -#define NUMSLI (14<<9) -#define COL (15<<9) -#define IDPOIN (16<<9) -#define HSVSLI (17<<9) -#define SCROLL (18<<9) -#define BLOCK (19<<9) -#define BUTM (20<<9) -#define SEPR (21<<9) -#define LINK (22<<9) -#define INLINK (23<<9) -#define KEYEVT (24<<9) -#define ICONTEXTROW (25<<9) -#define HSVCUBE (26<<9) -#define PULLDOWN (27<<9) -#define ROUNDBOX (28<<9) -#define CHARTAB (29<<9) -#define BUT_COLORBAND (30<<9) -#define BUT_NORMAL (31<<9) -#define BUT_CURVE (32<<9) -#define BUT_TOGDUAL (33<<9) -#define ICONTOGN (34<<9) -#define FTPREVIEW (35<<9) -#define NUMABS (36<<9) -#define TOGBUT (37<<9) -#define OPTION (38<<9) -#define OPTIONN (39<<9) -#define TRACKPREVIEW (40<<9) - /* buttons with value >= SEARCH_MENU don't get undo pushes */ -#define SEARCH_MENU (41<<9) -#define BUT_EXTRA (42<<9) -#define HSVCIRCLE (43<<9) -#define LISTBOX (44<<9) -#define LISTROW (45<<9) -#define HOTKEYEVT (46<<9) -#define BUT_IMAGE (47<<9) -#define HISTOGRAM (48<<9) -#define WAVEFORM (49<<9) -#define VECTORSCOPE (50<<9) -#define PROGRESSBAR (51<<9) - -#define BUTTYPE (63<<9) +#define BIT 256 + +#define BUTPOIN (128 + 64 + 32) + +#define BUT (1 << 9) +#define ROW (2 << 9) +#define TOG (3 << 9) +#define SLI (4 << 9) +#define NUM (5 << 9) +#define TEX (6 << 9) +#define TOG3 (7 << 9) +#define TOGR (8 << 9) +#define TOGN (9 << 9) +#define LABEL (10 << 9) +#define MENU (11 << 9) +#define ICONROW (12 << 9) +#define ICONTOG (13 << 9) +#define NUMSLI (14 << 9) +#define COL (15 << 9) +#define IDPOIN (16 << 9) +#define HSVSLI (17 << 9) +#define SCROLL (18 << 9) +#define BLOCK (19 << 9) +#define BUTM (20 << 9) +#define SEPR (21 << 9) +#define LINK (22 << 9) +#define INLINK (23 << 9) +#define KEYEVT (24 << 9) +#define ICONTEXTROW (25 << 9) +#define HSVCUBE (26 << 9) +#define PULLDOWN (27 << 9) +#define ROUNDBOX (28 << 9) +#define CHARTAB (29 << 9) +#define BUT_COLORBAND (30 << 9) +#define BUT_NORMAL (31 << 9) +#define BUT_CURVE (32 << 9) +#define BUT_TOGDUAL (33 << 9) +#define ICONTOGN (34 << 9) +#define FTPREVIEW (35 << 9) +#define NUMABS (36 << 9) +#define TOGBUT (37 << 9) +#define OPTION (38 << 9) +#define OPTIONN (39 << 9) +#define TRACKPREVIEW (40 << 9) +/* buttons with value >= SEARCH_MENU don't get undo pushes */ +#define SEARCH_MENU (41 << 9) +#define BUT_EXTRA (42 << 9) +#define HSVCIRCLE (43 << 9) +#define LISTBOX (44 << 9) +#define LISTROW (45 << 9) +#define HOTKEYEVT (46 << 9) +#define BUT_IMAGE (47 << 9) +#define HISTOGRAM (48 << 9) +#define WAVEFORM (49 << 9) +#define VECTORSCOPE (50 << 9) +#define PROGRESSBAR (51 << 9) + +#define BUTTYPE (63 << 9) /* gradient types, for color picker HSVCUBE etc */ -#define UI_GRAD_SV 0 -#define UI_GRAD_HV 1 -#define UI_GRAD_HS 2 -#define UI_GRAD_H 3 -#define UI_GRAD_S 4 -#define UI_GRAD_V 5 +#define UI_GRAD_SV 0 +#define UI_GRAD_HV 1 +#define UI_GRAD_HS 2 +#define UI_GRAD_H 3 +#define UI_GRAD_S 4 +#define UI_GRAD_V 5 -#define UI_GRAD_V_ALT 9 +#define UI_GRAD_V_ALT 9 /* Drawing * @@ -275,9 +275,9 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadeLeft, float shadeRight); /* state for scrolldrawing */ -#define UI_SCROLL_PRESSED 1 -#define UI_SCROLL_ARROWS 2 -#define UI_SCROLL_NO_OUTLINE 4 +#define UI_SCROLL_PRESSED 1 +#define UI_SCROLL_ARROWS 2 +#define UI_SCROLL_NO_OUTLINE 4 void uiWidgetScrollDraw(struct uiWidgetColors *wcol, struct rcti *rect, struct rcti *slider, int state); /* Callbacks @@ -324,18 +324,18 @@ struct uiLayout *uiPupMenuLayout(uiPopupMenu *head); void uiPupMenuOkee(struct bContext *C, const char *opname, const char *str, ...) #ifdef __GNUC__ -__attribute__ ((format (printf, 3, 4))) +__attribute__ ((format(printf, 3, 4))) #endif ; void uiPupMenuSaveOver(struct bContext *C, struct wmOperator *op, const char *filename); void uiPupMenuNotice(struct bContext *C, const char *str, ...) #ifdef __GNUC__ -__attribute__ ((format (printf, 2, 3))) +__attribute__ ((format(printf, 2, 3))) #endif ; void uiPupMenuError(struct bContext *C, const char *str, ...) #ifdef __GNUC__ -__attribute__ ((format (printf, 2, 3))) +__attribute__ ((format(printf, 2, 3))) #endif ; void uiPupMenuReports(struct bContext *C, struct ReportList *reports); @@ -346,7 +346,7 @@ void uiPupMenuInvoke(struct bContext *C, const char *idname); /* popup registere * Functions used to create popup blocks. These are like popup menus * but allow using all button types and creating an own layout. */ -typedef uiBlock* (*uiBlockCreateFunc)(struct bContext *C, struct ARegion *ar, void *arg1); +typedef uiBlock * (*uiBlockCreateFunc)(struct bContext *C, struct ARegion *ar, void *arg1); typedef void (*uiBlockCancelFunc)(void *arg1); void uiPupBlock(struct bContext *C, uiBlockCreateFunc func, void *arg); @@ -391,7 +391,7 @@ void uiBlockEndAlign(uiBlock *block); /* block bounds/position calculation */ enum { - UI_BLOCK_BOUNDS=1, + UI_BLOCK_BOUNDS = 1, UI_BLOCK_BOUNDS_TEXT, UI_BLOCK_BOUNDS_POPUP_MOUSE, UI_BLOCK_BOUNDS_POPUP_MENU, @@ -405,30 +405,30 @@ void uiMenuPopupBoundsBlock(uiBlock *block, int addvall, int mx, int my); void uiCenteredBoundsBlock(uiBlock *block, int addval); void uiExplicitBoundsBlock(uiBlock *block, int minx, int miny, int maxx, int maxy); -int uiBlocksGetYMin (struct ListBase *lb); +int uiBlocksGetYMin(struct ListBase *lb); -void uiBlockSetDirection (uiBlock *block, int direction); -void uiBlockFlipOrder (uiBlock *block); -void uiBlockSetFlag (uiBlock *block, int flag); -void uiBlockClearFlag (uiBlock *block, int flag); -void uiBlockSetXOfs (uiBlock *block, int xofs); +void uiBlockSetDirection(uiBlock *block, int direction); +void uiBlockFlipOrder(uiBlock *block); +void uiBlockSetFlag(uiBlock *block, int flag); +void uiBlockClearFlag(uiBlock *block, int flag); +void uiBlockSetXOfs(uiBlock *block, int xofs); -int uiButGetRetVal (uiBut *but); +int uiButGetRetVal(uiBut *but); -void uiButSetDragID(uiBut *but, struct ID *id); -void uiButSetDragRNA(uiBut *but, struct PointerRNA *ptr); -void uiButSetDragPath(uiBut *but, const char *path); -void uiButSetDragName(uiBut *but, const char *name); -void uiButSetDragValue(uiBut *but); -void uiButSetDragImage(uiBut *but, const char *path, int icon, struct ImBuf *ima, float scale); +void uiButSetDragID(uiBut *but, struct ID *id); +void uiButSetDragRNA(uiBut *but, struct PointerRNA *ptr); +void uiButSetDragPath(uiBut *but, const char *path); +void uiButSetDragName(uiBut *but, const char *name); +void uiButSetDragValue(uiBut *but); +void uiButSetDragImage(uiBut *but, const char *path, int icon, struct ImBuf *ima, float scale); -int UI_but_active_drop_name(struct bContext *C); +int UI_but_active_drop_name(struct bContext *C); -void uiButSetFlag (uiBut *but, int flag); -void uiButClearFlag (uiBut *but, int flag); +void uiButSetFlag(uiBut *but, int flag); +void uiButClearFlag(uiBut *but, int flag); /* special button case, only draw it when used actively, for outliner etc */ -int uiButActiveOnly (const struct bContext *C, uiBlock *block, uiBut *but); +int uiButActiveOnly(const struct bContext *C, uiBlock *block, uiBut *but); /* Buttons @@ -442,12 +442,12 @@ int uiButActiveOnly (const struct bContext *C, uiBlock *block, uiBut *but); * - O: operator */ uiBut *uiDefBut(uiBlock *block, - int type, int retval, const char *str, - int x1, int y1, - short x2, short y2, - void *poin, - float min, float max, - float a1, float a2, const char *tip); + int type, int retval, const char *str, + int x1, int y1, + short x2, short y2, + void *poin, + float min, float max, + float a1, float a2, const char *tip); uiBut *uiDefButF(uiBlock *block, int type, int retval, const char *str, int x1, int y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip); uiBut *uiDefButBitF(uiBlock *block, int type, int bit, int retval, const char *str, int x1, int y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip); uiBut *uiDefButI(uiBlock *block, int type, int retval, const char *str, int x1, int y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip); @@ -463,12 +463,12 @@ uiBut *uiDefButO_ptr(uiBlock *block, int type, struct wmOperatorType *ot, int op uiBut *uiDefButTextO(uiBlock *block, int type, const char *opname, int opcontext, const char *str, int x1, int y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip); uiBut *uiDefIconBut(uiBlock *block, - int type, int retval, int icon, - int x1, int y1, - short x2, short y2, - void *poin, - float min, float max, - float a1, float a2, const char *tip); + int type, int retval, int icon, + int x1, int y1, + short x2, short y2, + void *poin, + float min, float max, + float a1, float a2, const char *tip); uiBut *uiDefIconButF(uiBlock *block, int type, int retval, int icon, int x1, int y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip); uiBut *uiDefIconButBitF(uiBlock *block, int type, int bit, int retval, int icon, int x1, int y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip); uiBut *uiDefIconButI(uiBlock *block, int type, int retval, int icon, int x1, int y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip); @@ -483,12 +483,12 @@ uiBut *uiDefIconButO(uiBlock *block, int type, const char *opname, int opcontext uiBut *uiDefIconButO_ptr(uiBlock *block, int type, struct wmOperatorType *ot, int opcontext, int icon, int x1, int y1, short x2, short y2, const char *tip); uiBut *uiDefIconTextBut(uiBlock *block, - int type, int retval, int icon, const char *str, - int x1, int y1, - short x2, short y2, - void *poin, - float min, float max, - float a1, float a2, const char *tip); + int type, int retval, int icon, const char *str, + int x1, int y1, + short x2, short y2, + void *poin, + float min, float max, + float a1, float a2, const char *tip); uiBut *uiDefIconTextButF(uiBlock *block, int type, int retval, int icon, const char *str, int x1, int y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip); uiBut *uiDefIconTextButBitF(uiBlock *block, int type, int bit, int retval, int icon, const char *str, int x1, int y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip); uiBut *uiDefIconTextButI(uiBlock *block, int type, int retval, int icon, const char *str, int x1, int y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip); @@ -519,25 +519,25 @@ int uiButGetUnitType(uiBut *but); * - PickerButtons: buttons like the color picker (for code sharing). * - AutoButR: RNA property button with type automatically defined. */ -#define UI_ID_RENAME 1 -#define UI_ID_BROWSE 2 -#define UI_ID_ADD_NEW 4 -#define UI_ID_OPEN 8 -#define UI_ID_ALONE 16 -#define UI_ID_DELETE 32 -#define UI_ID_LOCAL 64 -#define UI_ID_AUTO_NAME 128 -#define UI_ID_FAKE_USER 256 -#define UI_ID_PIN 512 -#define UI_ID_BROWSE_RENDER 1024 -#define UI_ID_PREVIEWS 2048 -#define UI_ID_FULL (UI_ID_RENAME|UI_ID_BROWSE|UI_ID_ADD_NEW|UI_ID_OPEN|UI_ID_ALONE|UI_ID_DELETE|UI_ID_LOCAL) +#define UI_ID_RENAME 1 +#define UI_ID_BROWSE 2 +#define UI_ID_ADD_NEW 4 +#define UI_ID_OPEN 8 +#define UI_ID_ALONE 16 +#define UI_ID_DELETE 32 +#define UI_ID_LOCAL 64 +#define UI_ID_AUTO_NAME 128 +#define UI_ID_FAKE_USER 256 +#define UI_ID_PIN 512 +#define UI_ID_BROWSE_RENDER 1024 +#define UI_ID_PREVIEWS 2048 +#define UI_ID_FULL (UI_ID_RENAME | UI_ID_BROWSE | UI_ID_ADD_NEW | UI_ID_OPEN | UI_ID_ALONE | UI_ID_DELETE | UI_ID_LOCAL) typedef void (*uiIDPoinFuncFP)(struct bContext *C, const char *str, struct ID **idpp); typedef void (*uiIDPoinFunc)(struct bContext *C, struct ID *id, int event); uiBut *uiDefIDPoinBut(uiBlock *block, uiIDPoinFuncFP func, short blocktype, int retval, const char *str, - int x1, int y1, short x2, short y2, void *idpp, const char *tip); + int x1, int y1, short x2, short y2, void *idpp, const char *tip); int uiIconFromID(struct ID *id); @@ -570,27 +570,27 @@ void uiSetButLink(struct uiBut *but, void **poin, void ***ppoin, short *tot, void uiComposeLinks(uiBlock *block); uiBut *uiFindInlink(uiBlock *block, void *poin); - /* use inside searchfunc to add items */ -int uiSearchItemAdd(uiSearchItems *items, const char *name, void *poin, int iconid); - /* bfunc gets search item *poin as arg2, or if NULL the old string */ -void uiButSetSearchFunc (uiBut *but, uiButSearchFunc sfunc, void *arg1, uiButHandleFunc bfunc, void *active); - /* height in pixels, it's using hardcoded values still */ -int uiSearchBoxhHeight(void); +/* use inside searchfunc to add items */ +int uiSearchItemAdd(uiSearchItems *items, const char *name, void *poin, int iconid); +/* bfunc gets search item *poin as arg2, or if NULL the old string */ +void uiButSetSearchFunc(uiBut *but, uiButSearchFunc sfunc, void *arg1, uiButHandleFunc bfunc, void *active); +/* height in pixels, it's using hardcoded values still */ +int uiSearchBoxhHeight(void); -void uiBlockSetHandleFunc(uiBlock *block, uiBlockHandleFunc func, void *arg); -void uiBlockSetButmFunc (uiBlock *block, uiMenuHandleFunc func, void *arg); -void uiBlockSetFunc (uiBlock *block, uiButHandleFunc func, void *arg1, void *arg2); -void uiBlockSetNFunc (uiBlock *block, uiButHandleFunc func, void *argN, void *arg2); +void uiBlockSetHandleFunc(uiBlock *block, uiBlockHandleFunc func, void *arg); +void uiBlockSetButmFunc(uiBlock *block, uiMenuHandleFunc func, void *arg); +void uiBlockSetFunc(uiBlock *block, uiButHandleFunc func, void *arg1, void *arg2); +void uiBlockSetNFunc(uiBlock *block, uiButHandleFunc func, void *argN, void *arg2); -void uiButSetRenameFunc (uiBut *but, uiButHandleRenameFunc func, void *arg1); -void uiButSetFunc (uiBut *but, uiButHandleFunc func, void *arg1, void *arg2); -void uiButSetNFunc (uiBut *but, uiButHandleNFunc func, void *argN, void *arg2); +void uiButSetRenameFunc(uiBut *but, uiButHandleRenameFunc func, void *arg1); +void uiButSetFunc(uiBut *but, uiButHandleFunc func, void *arg1, void *arg2); +void uiButSetNFunc(uiBut *but, uiButHandleNFunc func, void *argN, void *arg2); -void uiButSetCompleteFunc(uiBut *but, uiButCompleteFunc func, void *arg); +void uiButSetCompleteFunc(uiBut *but, uiButCompleteFunc func, void *arg); -void uiBlockSetDrawExtraFunc(uiBlock *block, void (*func)(const struct bContext *C, void *, void *, void *, struct rcti *rect), void *arg1, void *arg2); +void uiBlockSetDrawExtraFunc(uiBlock *block, void (*func)(const struct bContext *C, void *, void *, void *, struct rcti *rect), void *arg1, void *arg2); -void uiButSetFocusOnEnter (struct wmWindow *win, uiBut *but); +void uiButSetFocusOnEnter(struct wmWindow *win, uiBut *but); /* Autocomplete * @@ -648,31 +648,31 @@ void UI_exit(void); * uiBlockCurLayout. */ /* layout */ -#define UI_LAYOUT_HORIZONTAL 0 -#define UI_LAYOUT_VERTICAL 1 - -#define UI_LAYOUT_PANEL 0 -#define UI_LAYOUT_HEADER 1 -#define UI_LAYOUT_MENU 2 -#define UI_LAYOUT_TOOLBAR 3 - -#define UI_UNIT_X U.widget_unit -#define UI_UNIT_Y U.widget_unit - -#define UI_LAYOUT_ALIGN_EXPAND 0 -#define UI_LAYOUT_ALIGN_LEFT 1 -#define UI_LAYOUT_ALIGN_CENTER 2 -#define UI_LAYOUT_ALIGN_RIGHT 3 - -#define UI_ITEM_O_RETURN_PROPS 1 -#define UI_ITEM_R_EXPAND 2 -#define UI_ITEM_R_SLIDER 4 -#define UI_ITEM_R_TOGGLE 8 -#define UI_ITEM_R_ICON_ONLY 16 -#define UI_ITEM_R_EVENT 32 -#define UI_ITEM_R_FULL_EVENT 64 -#define UI_ITEM_R_NO_BG 128 -#define UI_ITEM_R_IMMEDIATE 256 +#define UI_LAYOUT_HORIZONTAL 0 +#define UI_LAYOUT_VERTICAL 1 + +#define UI_LAYOUT_PANEL 0 +#define UI_LAYOUT_HEADER 1 +#define UI_LAYOUT_MENU 2 +#define UI_LAYOUT_TOOLBAR 3 + +#define UI_UNIT_X U.widget_unit +#define UI_UNIT_Y U.widget_unit + +#define UI_LAYOUT_ALIGN_EXPAND 0 +#define UI_LAYOUT_ALIGN_LEFT 1 +#define UI_LAYOUT_ALIGN_CENTER 2 +#define UI_LAYOUT_ALIGN_RIGHT 3 + +#define UI_ITEM_O_RETURN_PROPS 1 +#define UI_ITEM_R_EXPAND 2 +#define UI_ITEM_R_SLIDER 4 +#define UI_ITEM_R_TOGGLE 8 +#define UI_ITEM_R_ICON_ONLY 16 +#define UI_ITEM_R_EVENT 32 +#define UI_ITEM_R_FULL_EVENT 64 +#define UI_ITEM_R_NO_BG 128 +#define UI_ITEM_R_IMMEDIATE 256 /* uiLayoutOperatorButs flags */ #define UI_LAYOUT_OP_SHOW_TITLE 1 @@ -685,13 +685,13 @@ void UI_exit(void); * 8------4 */ enum { - UI_CNR_TOP_LEFT= 1, - UI_CNR_TOP_RIGHT= 2, - UI_CNR_BOTTOM_RIGHT= 4, - UI_CNR_BOTTOM_LEFT= 8, + UI_CNR_TOP_LEFT = 1, + UI_CNR_TOP_RIGHT = 2, + UI_CNR_BOTTOM_RIGHT = 4, + UI_CNR_BOTTOM_LEFT = 8, /* just for convenience */ - UI_CNR_NONE= 0, - UI_CNR_ALL= (UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT) + UI_CNR_NONE = 0, + UI_CNR_ALL = (UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT) }; /* not apart of the corner flags but mixed in some functions */ @@ -735,7 +735,7 @@ uiLayout *uiLayoutColumn(uiLayout *layout, int align); uiLayout *uiLayoutColumnFlow(uiLayout *layout, int number, int align); uiLayout *uiLayoutBox(uiLayout *layout); uiLayout *uiLayoutListBox(uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop, - struct PointerRNA *actptr, struct PropertyRNA *actprop); + struct PointerRNA *actptr, struct PropertyRNA *actprop); uiLayout *uiLayoutAbsolute(uiLayout *layout, int align); uiLayout *uiLayoutSplit(uiLayout *layout, float percentage, int align); uiLayout *uiLayoutOverlap(uiLayout *layout); @@ -746,15 +746,15 @@ uiBlock *uiLayoutAbsoluteBlock(uiLayout *layout); void uiTemplateHeader(uiLayout *layout, struct bContext *C, int menus); void uiTemplateDopeSheetFilter(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr); void uiTemplateID(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, - const char *newop, const char *openop, const char *unlinkop); + const char *newop, const char *openop, const char *unlinkop); void uiTemplateIDBrowse(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, const char *newop, const char *openop, const char *unlinkop); void uiTemplateIDPreview(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, - const char *newop, const char *openop, const char *unlinkop, int rows, int cols); + const char *newop, const char *openop, const char *unlinkop, int rows, int cols); void uiTemplateAnyID(uiLayout *layout, struct PointerRNA *ptr, const char *propname, - const char *proptypename, const char *text); + const char *proptypename, const char *text); void uiTemplatePathBuilder(uiLayout *layout, struct PointerRNA *ptr, const char *propname, - struct PointerRNA *root_ptr, const char *text); + struct PointerRNA *root_ptr, const char *text); uiLayout *uiTemplateModifier(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr); uiLayout *uiTemplateConstraint(uiLayout *layout, struct PointerRNA *ptr); void uiTemplatePreview(uiLayout *layout, struct ID *id, int show_buttons, struct ID *parent, struct MTex *slot); @@ -835,14 +835,14 @@ void uiIDContextProperty(struct bContext *C, struct PointerRNA *ptr, struct Prop /* Styled text draw */ void uiStyleFontSet(struct uiFontStyle *fs); void uiStyleFontDrawExt(struct uiFontStyle *fs, struct rcti *rect, const char *str, - float *r_xofs, float *r_yofs); + float *r_xofs, float *r_yofs); void uiStyleFontDraw(struct uiFontStyle *fs, struct rcti *rect, const char *str); void uiStyleFontDrawRotated(struct uiFontStyle *fs, struct rcti *rect, const char *str); int UI_GetStringWidth(const char *str); // XXX temp void UI_DrawString(float x, float y, const char *str); // XXX temp void UI_DrawTriIcon(float x, float y, char dir); -uiStyle* UI_GetStyle(void); +uiStyle *UI_GetStyle(void); /* linker workaround ack! */ void UI_template_fix_linking(void); diff --git a/source/blender/editors/include/UI_interface_icons.h b/source/blender/editors/include/UI_interface_icons.h index 2f4c2549cf3..aa94bdec724 100644 --- a/source/blender/editors/include/UI_interface_icons.h +++ b/source/blender/editors/include/UI_interface_icons.h @@ -41,12 +41,12 @@ struct Material; typedef struct IconFile { struct IconFile *next, *prev; - char filename[256]; // FILE_MAXFILE size + char filename[256]; /* FILE_MAXFILE size */ int index; } IconFile; #define ICON_DEFAULT_HEIGHT 16 -#define ICON_DEFAULT_WIDTH 16 +#define ICON_DEFAULT_WIDTH 16 #define ICON_DEFAULT_HEIGHT_SCALE ((int)(UI_UNIT_Y * 0.8f)) #define ICON_DEFAULT_WIDTH_SCALE ((int)(UI_UNIT_X * 0.8f)) diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h index 82c323a3daa..d157db9e993 100644 --- a/source/blender/editors/include/UI_resources.h +++ b/source/blender/editors/include/UI_resources.h @@ -43,7 +43,7 @@ typedef enum { BIFICONID_LAST } BIFIconID; -#define BIFICONID_FIRST (ICON_NONE) +#define BIFICONID_FIRST (ICON_NONE) #undef DEF_ICON #undef DEF_VICO @@ -197,8 +197,8 @@ enum { TH_STITCH_PREVIEW_UNSTITCHABLE, TH_STITCH_PREVIEW_ACTIVE, - TH_MATCH, /* highlight color for search matches */ - TH_SELECT_HIGHLIGHT /* highlight color for selected outliner item */ + TH_MATCH, /* highlight color for search matches */ + TH_SELECT_HIGHLIGHT /* highlight color for selected outliner item */ }; /* XXX WARNING: previous is saved in file, so do not change order! */ @@ -210,59 +210,59 @@ struct PointerRNA; // THE CODERS API FOR THEMES: // sets the color -void UI_ThemeColor(int colorid); +void UI_ThemeColor(int colorid); // sets the color plus alpha -void UI_ThemeColor4(int colorid); +void UI_ThemeColor4(int colorid); // sets color plus offset for shade -void UI_ThemeColorShade(int colorid, int offset); +void UI_ThemeColorShade(int colorid, int offset); // sets color plus offset for alpha -void UI_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset); +void UI_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset); // sets color, which is blend between two theme colors -void UI_ThemeColorBlend(int colorid1, int colorid2, float fac); +void UI_ThemeColorBlend(int colorid1, int colorid2, float fac); // same, with shade offset void UI_ThemeColorBlendShade(int colorid1, int colorid2, float fac, int offset); -void UI_ThemeColorBlendShadeAlpha(int colorid1, int colorid2, float fac, int offset, int alphaoffset); +void UI_ThemeColorBlendShadeAlpha(int colorid1, int colorid2, float fac, int offset, int alphaoffset); // returns one value, not scaled -float UI_GetThemeValuef(int colorid); -int UI_GetThemeValue(int colorid); +float UI_GetThemeValuef(int colorid); +int UI_GetThemeValue(int colorid); // get three color values, scaled to 0.0-1.0 range -void UI_GetThemeColor3fv(int colorid, float *col); +void UI_GetThemeColor3fv(int colorid, float *col); // get the color, range 0.0-1.0, complete with shading offset -void UI_GetThemeColorShade3fv(int colorid, int offset, float *col); +void UI_GetThemeColorShade3fv(int colorid, int offset, float *col); // get the 3 or 4 byte values -void UI_GetThemeColor3ubv(int colorid, unsigned char col[3]); -void UI_GetThemeColor4ubv(int colorid, unsigned char col[4]); +void UI_GetThemeColor3ubv(int colorid, unsigned char col[3]); +void UI_GetThemeColor4ubv(int colorid, unsigned char col[4]); // get a theme color from specified space type -void UI_GetThemeColorType4ubv(int colorid, int spacetype, char col[4]); +void UI_GetThemeColorType4ubv(int colorid, int spacetype, char col[4]); // blends and shades between two color pointers -void UI_ColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], float fac, int offset); +void UI_ColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], float fac, int offset); // shade a 3 byte color (same as UI_GetColorPtrBlendShade3ubv with 0.0 factor) -void UI_GetColorPtrShade3ubv(const unsigned char cp1[3], unsigned char col[3], int offset); +void UI_GetColorPtrShade3ubv(const unsigned char cp1[3], unsigned char col[3], int offset); // get a 3 byte color, blended and shaded between two other char color pointers -void UI_GetColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], unsigned char col[3], float fac, int offset); +void UI_GetColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], unsigned char col[3], float fac, int offset); // clear the openGL ClearColor using the input colorid -void UI_ThemeClearColor(int colorid); +void UI_ThemeClearColor(int colorid); // internal (blender) usage only, for init and set active -void UI_SetTheme(int spacetype, int regionid); +void UI_SetTheme(int spacetype, int regionid); // get current theme struct bTheme *UI_GetTheme(void); /* only for buttons in theme editor! */ -const unsigned char *UI_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, int colorid); +const unsigned char *UI_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, int colorid); void UI_make_axis_color(const unsigned char *src_col, unsigned char *dst_col, const char axis); diff --git a/source/blender/editors/include/UI_view2d.h b/source/blender/editors/include/UI_view2d.h index 436f268d1bf..469388219d6 100644 --- a/source/blender/editors/include/UI_view2d.h +++ b/source/blender/editors/include/UI_view2d.h @@ -35,12 +35,12 @@ #define __UI_VIEW2D_H__ /* ------------------------------------------ */ -/* Settings and Defines: */ +/* Settings and Defines: */ /* ---- General Defines ---- */ /* generic value to use when coordinate lies out of view when converting */ -#define V2D_IS_CLIPPED 12000 +#define V2D_IS_CLIPPED 12000 /* Common View2D view types * NOTE: only define a type here if it completely sets all (+/- a few) of the relevant flags @@ -48,24 +48,24 @@ * than one specific place */ enum { - /* custom view type (region has defined all necessary flags already) */ + /* custom view type (region has defined all necessary flags already) */ V2D_COMMONVIEW_CUSTOM = -1, - /* standard (only use this when setting up a new view, as a sensible base for most settings) */ + /* standard (only use this when setting up a new view, as a sensible base for most settings) */ V2D_COMMONVIEW_STANDARD, - /* listview (i.e. Outliner) */ + /* listview (i.e. Outliner) */ V2D_COMMONVIEW_LIST, - /* stackview (this is basically a list where new items are added at the top) */ + /* stackview (this is basically a list where new items are added at the top) */ V2D_COMMONVIEW_STACK, - /* headers (this is basically the same as listview, but no y-panning) */ + /* headers (this is basically the same as listview, but no y-panning) */ V2D_COMMONVIEW_HEADER, - /* ui region containing panels */ + /* ui region containing panels */ V2D_COMMONVIEW_PANELS_UI } eView2D_CommonViewTypes; /* ---- Defines for Scroller/Grid Arguments ----- */ /* 'dummy' argument to pass when argument is irrelevant */ -#define V2D_ARG_DUMMY -1 +#define V2D_ARG_DUMMY -1 /* Grid units */ enum { @@ -89,31 +89,31 @@ enum { /* flags for grid-lines to draw */ enum { - V2D_HORIZONTAL_LINES = (1<<0), - V2D_VERTICAL_LINES = (1<<1), - V2D_HORIZONTAL_AXIS = (1<<2), - V2D_VERTICAL_AXIS = (1<<3), - V2D_HORIZONTAL_FINELINES = (1<<4), + V2D_HORIZONTAL_LINES = (1 << 0), + V2D_VERTICAL_LINES = (1 << 1), + V2D_HORIZONTAL_AXIS = (1 << 2), + V2D_VERTICAL_AXIS = (1 << 3), + V2D_HORIZONTAL_FINELINES = (1 << 4), - V2D_GRIDLINES_MAJOR = (V2D_VERTICAL_LINES|V2D_VERTICAL_AXIS|V2D_HORIZONTAL_LINES|V2D_HORIZONTAL_AXIS), - V2D_GRIDLINES_ALL = (V2D_GRIDLINES_MAJOR|V2D_HORIZONTAL_FINELINES), + V2D_GRIDLINES_MAJOR = (V2D_VERTICAL_LINES | V2D_VERTICAL_AXIS | V2D_HORIZONTAL_LINES | V2D_HORIZONTAL_AXIS), + V2D_GRIDLINES_ALL = (V2D_GRIDLINES_MAJOR | V2D_HORIZONTAL_FINELINES), } eView2D_Gridlines; /* ------ Defines for Scrollers ----- */ /* scroller area */ -#define V2D_SCROLL_HEIGHT 17 -#define V2D_SCROLL_WIDTH 17 +#define V2D_SCROLL_HEIGHT 17 +#define V2D_SCROLL_WIDTH 17 /* scroller 'handles' hotspot radius for mouse */ -#define V2D_SCROLLER_HANDLE_SIZE 12 +#define V2D_SCROLLER_HANDLE_SIZE 12 /* ------ Define for UI_view2d_sync ----- */ /* means copy it from another v2d */ -#define V2D_LOCK_SET 0 +#define V2D_LOCK_SET 0 /* means copy it to the other v2ds */ -#define V2D_LOCK_COPY 1 +#define V2D_LOCK_COPY 1 /* ------------------------------------------ */ @@ -124,7 +124,7 @@ enum { #define IN_2D_HORIZ_SCROLL(v2d, co) (BLI_in_rcti(&v2d->hor, co[0], co[1])) /* ------------------------------------------ */ -/* Type definitions: */ +/* Type definitions: */ struct View2D; struct View2DGrid; @@ -141,7 +141,7 @@ typedef struct View2DGrid View2DGrid; typedef struct View2DScrollers View2DScrollers; /* ----------------------------------------- */ -/* Prototypes: */ +/* Prototypes: */ /* refresh and validation (of view rects) */ void UI_view2d_region_reinit(struct View2D *v2d, short type, int winx, int winy); diff --git a/source/blender/imbuf/intern/imageprocess.c b/source/blender/imbuf/intern/imageprocess.c index dea941c9716..9717670cfa6 100644 --- a/source/blender/imbuf/intern/imageprocess.c +++ b/source/blender/imbuf/intern/imageprocess.c @@ -50,10 +50,6 @@ #include "IMB_imbuf.h" #include <math.h> -/* This define should be relocated to a global header some where Kent Mein - * I stole it from util.h in the plugins api */ -#define MAX2(x, y) ( (x)>(y) ? (x) : (y) ) - /* Only this one is used liberally here, and in imbuf */ void IMB_convert_rgba_to_abgr(struct ImBuf *ibuf) { diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index 06eefc36723..777fcc2af0c 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -225,10 +225,14 @@ typedef struct PreviewImage { #define ID_BLEND_PATH(_bmain, _id) ((_id)->lib ? (_id)->lib->filepath : (_bmain)->name) #ifdef GS -#undef GS +# undef GS #endif #define GS(a) (*((short *)(a))) +#define ID_NEW(a) if ( (a) && (a)->id.newid ) (a) = (void *)(a)->id.newid +#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++; } + /* id->flag: set frist 8 bits always at zero while reading */ #define LIB_LOCAL 0 #define LIB_EXTERN 1 diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index a40b07a8d01..9ba8fba15fb 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -1326,9 +1326,6 @@ typedef struct Scene { #define V3D_CAMERA_LOCAL(v3d) ((!(v3d)->scenelock && (v3d)->camera) ? (v3d)->camera : NULL) #define V3D_CAMERA_SCENE(scene, v3d) ((!(v3d)->scenelock && (v3d)->camera) ? (v3d)->camera : (scene)->camera) -#define ID_NEW(a) if( (a) && (a)->id.newid ) (a)= (void *)(a)->id.newid -#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 CFRA (scene->r.cfra) #define SUBFRA (scene->r.subframe) #define SFRA (scene->r.sfra) |