Code cleanup: use bools where possible

This commit is contained in:
2014-02-03 18:55:59 +11:00
parent a948ae2c51
commit d900f5be55
170 changed files with 526 additions and 510 deletions
+2 -2
View File
@@ -345,7 +345,7 @@ SceneParams BlenderSync::get_scene_params(BL::Scene b_scene, bool background)
BL::RenderSettings r = b_scene.render();
SceneParams params;
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
int shadingsystem = RNA_boolean_get(&cscene, "shading_system");
const bool shadingsystem = RNA_boolean_get(&cscene, "shading_system");
if(shadingsystem == 0)
params.shadingsystem = SceneParams::SVM;
@@ -494,7 +494,7 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine b_engine, BL::Use
params.progressive = true;
/* shading system - scene level needs full refresh */
int shadingsystem = RNA_boolean_get(&cscene, "shading_system");
const bool shadingsystem = RNA_boolean_get(&cscene, "shading_system");
if(shadingsystem == 0)
params.shadingsystem = SessionParams::SVM;
+1 -1
View File
@@ -235,7 +235,7 @@ typedef enum {
/**
* Test whether this is an avi-format.
*/
int AVI_is_avi(const char *name);
bool AVI_is_avi(const char *name);
/**
+2 -2
View File
@@ -206,7 +206,7 @@ void AVI_set_debug(int mode)
AVI_DEBUG = mode;
}
int AVI_is_avi(char *name)
bool AVI_is_avi(char *name)
{
FILE *fp;
int ret;
@@ -230,7 +230,7 @@ int AVI_is_avi(char *name)
}
#endif
int AVI_is_avi(const char *name)
bool AVI_is_avi(const char *name)
{
int temp, fcca, j;
AviMovie movie = {NULL};
+2 -2
View File
@@ -147,7 +147,7 @@ typedef int (*DMSetMaterial)(int mat_nr, void *attribs);
typedef int (*DMCompareDrawOptions)(void *userData, int cur_index, int next_index);
typedef void (*DMSetDrawInterpOptions)(void *userData, int index, float t);
typedef DMDrawOption (*DMSetDrawOptions)(void *userData, int index);
typedef DMDrawOption (*DMSetDrawOptionsTex)(struct MTFace *tface, int has_vcol, int matnr);
typedef DMDrawOption (*DMSetDrawOptionsTex)(struct MTFace *tface, const bool has_vcol, int matnr);
typedef enum DMDrawFlag {
DM_DRAW_USE_COLORS = 1,
@@ -673,7 +673,7 @@ DerivedMesh *editbmesh_get_derived_cage_and_final(struct Scene *scene, struct Ob
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);
bool 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);
+1 -1
View File
@@ -103,7 +103,7 @@ short action_get_item_transforms(struct bAction *act, struct Object *ob, struct
void calc_action_range(const struct bAction *act, float *start, float *end, short incl_modifiers);
/* Does action have any motion data at all? */
short action_has_motion(const struct bAction *act);
bool action_has_motion(const struct bAction *act);
/* Action Groups API ----------------- */
+1 -1
View File
@@ -82,7 +82,7 @@ void BKE_curve_texspace_get(struct Curve *cu, float r_loc[3], float r_rot[3], fl
bool BKE_curve_minmax(struct Curve *cu, bool use_radius, float min[3], float max[3]);
bool BKE_curve_center_median(struct Curve *cu, float cent[3]);
bool BKE_curve_center_bounds(struct Curve *cu, float cent[3]);
void BKE_curve_translate(struct Curve *cu, float offset[3], int do_keys);
void BKE_curve_translate(struct Curve *cu, float offset[3], const bool do_keys);
void BKE_curve_material_index_remove(struct Curve *cu, int index);
void BKE_curve_material_index_clear(struct Curve *cu);
+2 -2
View File
@@ -106,8 +106,8 @@ void DAG_scene_free(struct Scene *sce);
* not cause any updates but is used by external render engines to detect if for
* example a datablock was removed. */
void DAG_scene_update_flags(struct Main *bmain, struct Scene *sce, unsigned int lay, const short do_time);
void DAG_on_visible_update(struct Main *bmain, const short do_time);
void DAG_scene_update_flags(struct Main *bmain, struct Scene *sce, unsigned int lay, const bool do_time);
void DAG_on_visible_update(struct Main *bmain, const bool do_time);
void DAG_id_tag_update(struct ID *id, short flag);
void DAG_id_tag_update_ex(struct Main *bmain, struct ID *id, short flag);
+4 -4
View File
@@ -228,16 +228,16 @@ int binarysearch_bezt_index(struct BezTriple array[], float frame, int arraylen,
/* get the time extents for F-Curve */
bool calc_fcurve_range(struct FCurve *fcu, float *min, float *max,
const short do_sel_only, const short do_min_length);
const bool do_sel_only, const bool do_min_length);
/* get the bounding-box extents for F-Curve */
short calc_fcurve_bounds(struct FCurve *fcu, float *xmin, float *xmax, float *ymin, float *ymax,
const short do_sel_only, const short include_handles);
bool calc_fcurve_bounds(struct FCurve *fcu, float *xmin, float *xmax, float *ymin, float *ymax,
const bool do_sel_only, const bool include_handles);
/* .............. */
/* Are keyframes on F-Curve of any use (to final result, and to show in editors)? */
short fcurve_are_keyframes_usable(struct FCurve *fcu);
bool fcurve_are_keyframes_usable(struct FCurve *fcu);
/* Can keyframes be added to F-Curve? */
bool fcurve_is_keyframable(struct FCurve *fcu);
+1 -1
View File
@@ -73,7 +73,7 @@ typedef struct Global {
short winpos, displaymode; /* used to be in Render */
/* to indicate render is busy, prevent renderwindow events etc */
short is_rendering;
bool is_rendering;
/* debug value, can be set from the UI and python, used for testing nonstandard features */
short debug_value;
+4 -4
View File
@@ -140,7 +140,7 @@ enum {
#define IMA_CHAN_FLAG_ALPHA 4
/* checks whether there's an image buffer for given image and user */
int BKE_image_has_ibuf(struct Image *ima, struct ImageUser *iuser);
bool BKE_image_has_ibuf(struct Image *ima, struct ImageUser *iuser);
/* same as above, but can be used to retrieve images being rendered in
* a thread safe way, always call both acquire and release */
@@ -181,7 +181,7 @@ void BKE_image_assign_ibuf(struct Image *ima, struct ImBuf *ibuf);
/* called on frame change or before render */
void BKE_image_user_frame_calc(struct ImageUser *iuser, int cfra, int fieldnr);
void BKE_image_user_check_frame_calc(struct ImageUser *iuser, int cfra, int fieldnr);
int BKE_image_user_frame_get(const struct ImageUser *iuser, int cfra, int fieldnr, short *r_is_in_range);
int BKE_image_user_frame_get(const struct ImageUser *iuser, int cfra, int fieldnr, bool *r_is_in_range);
void BKE_image_user_file_path(struct ImageUser *iuser, struct Image *ima, char *path);
void BKE_image_update_frame(const struct Main *bmain, int cfra);
@@ -216,10 +216,10 @@ struct Image *BKE_image_copy(struct Main *bmain, struct Image *ima);
void BKE_image_merge(struct Image *dest, struct Image *source);
/* scale the image */
int BKE_image_scale(struct Image *image, int width, int height);
bool BKE_image_scale(struct Image *image, int width, int height);
/* check if texture has alpha (depth=32) */
int BKE_image_has_alpha(struct Image *image);
bool BKE_image_has_alpha(struct Image *image);
void BKE_image_get_size(struct Image *image, struct ImageUser *iuser, int *width, int *height);
void BKE_image_get_size_fl(struct Image *image, struct ImageUser *iuser, float size[2]);
+1 -1
View File
@@ -69,7 +69,7 @@ struct KeyBlock *BKE_keyblock_from_object(struct Object *ob);
struct KeyBlock *BKE_keyblock_from_object_reference(struct Object *ob);
struct KeyBlock *BKE_keyblock_add(struct Key *key, const char *name);
struct KeyBlock *BKE_keyblock_add_ctime(struct Key *key, const char *name, const short do_force);
struct KeyBlock *BKE_keyblock_add_ctime(struct Key *key, const char *name, const bool do_force);
struct KeyBlock *BKE_keyblock_from_key(struct Key *key, int index);
struct KeyBlock *BKE_keyblock_find_name(struct Key *key, const char name[]);
void BKE_keyblock_copy_settings(struct KeyBlock *kb_dst, const struct KeyBlock *kb_src);
+1 -1
View File
@@ -85,7 +85,7 @@ struct BPoint *BKE_lattice_active_point_get(struct Lattice *lt);
void BKE_lattice_minmax(struct Lattice *lt, float min[3], float max[3]);
void BKE_lattice_center_median(struct Lattice *lt, float cent[3]);
void BKE_lattice_center_bounds(struct Lattice *lt, float cent[3]);
void BKE_lattice_translate(struct Lattice *lt, float offset[3], int do_keys);
void BKE_lattice_translate(struct Lattice *lt, float offset[3], bool do_keys);
int BKE_lattice_index_from_uvw(struct Lattice *lt, const int u, const int v, const int w);
void BKE_lattice_index_to_uvw(struct Lattice *lt, const int index, int *r_u, int *r_v, int *r_w);
+7 -7
View File
@@ -87,7 +87,7 @@ float BKE_mask_spline_project_co(struct MaskSpline *spline, struct MaskSplinePoi
float start_u, const float co[2], const eMaskSign sign);
/* point */
int BKE_mask_point_has_handle(struct MaskSplinePoint *point);
bool BKE_mask_point_has_handle(struct MaskSplinePoint *point);
void BKE_mask_point_handle(struct MaskSplinePoint *point, float handle[2]);
void BKE_mask_point_set_handle(struct MaskSplinePoint *point, float loc[2], bool keep_direction,
float orig_handle[2], float orig_vec[3][3]);
@@ -100,8 +100,8 @@ float BKE_mask_point_weight(struct MaskSpline *spline, struct MaskSplinePoint *p
struct MaskSplinePointUW *BKE_mask_point_sort_uw(struct MaskSplinePoint *point, struct MaskSplinePointUW *uw);
void BKE_mask_point_add_uw(struct MaskSplinePoint *point, float u, float w);
void BKE_mask_point_select_set(struct MaskSplinePoint *point, const short do_select);
void BKE_mask_point_select_set_handle(struct MaskSplinePoint *point, const short do_select);
void BKE_mask_point_select_set(struct MaskSplinePoint *point, const bool do_select);
void BKE_mask_point_select_set_handle(struct MaskSplinePoint *point, const bool do_select);
/* general */
struct Mask *BKE_mask_new(struct Main *bmain, const char *name);
@@ -131,7 +131,7 @@ void BKE_mask_calc_handle_adjacent_interp(struct MaskSpline *spline, struct Mask
void BKE_mask_calc_tangent_polyline(struct MaskSpline *spline, struct MaskSplinePoint *point, float t[2]);
void BKE_mask_calc_handle_point(struct MaskSpline *spline, struct MaskSplinePoint *point);
void BKE_mask_calc_handle_point_auto(struct MaskSpline *spline, struct MaskSplinePoint *point,
const short do_recalc_length);
const bool do_recalc_length);
void BKE_mask_get_handle_point_adjacent(struct MaskSpline *spline, struct MaskSplinePoint *point,
struct MaskSplinePoint **r_point_prev, struct MaskSplinePoint **r_point_next);
void BKE_mask_layer_calc_handles(struct MaskLayer *masklay);
@@ -199,7 +199,7 @@ float (*BKE_mask_spline_differentiate_with_resolution(struct MaskSpline *spline,
void BKE_mask_spline_feather_collapse_inner_loops(struct MaskSpline *spline, float (*feather_points)[2], const unsigned int tot_feather_point);
float (*BKE_mask_spline_differentiate(struct MaskSpline *spline, int width, int height, unsigned int *tot_diff_point))[2];
float (*BKE_mask_spline_feather_differentiated_points_with_resolution(struct MaskSpline *spline, unsigned int *tot_feather_point,
const unsigned int resol, const int do_feather_isect))[2];
const unsigned int resol, const bool do_feather_isect))[2];
/* *** mask point functions which involve evaluation *** */
float (*BKE_mask_spline_feather_points(struct MaskSpline *spline, int *tot_feather_point))[2];
@@ -220,8 +220,8 @@ MaskRasterHandle *BKE_maskrasterize_handle_new(void);
void BKE_maskrasterize_handle_free(MaskRasterHandle *mr_handle);
void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, struct Mask *mask,
const int width, const int height,
const short do_aspect_correct, const short do_mask_aa,
const short do_feather);
const bool do_aspect_correct, const bool do_mask_aa,
const bool do_feather);
float BKE_maskrasterize_handle_sample(MaskRasterHandle *mr_handle, const float xy[2]);
void BKE_maskrasterize_buffer(MaskRasterHandle *mr_handle,
+5 -5
View File
@@ -55,7 +55,7 @@ void BKE_movieclip_get_size(struct MovieClip *clip, struct MovieClipUser *user,
void BKE_movieclip_get_size_fl(struct MovieClip *clip, struct MovieClipUser *user, float size[2]);
int BKE_movieclip_get_duration(struct MovieClip *clip);
void BKE_movieclip_get_aspect(struct MovieClip *clip, float *aspx, float *aspy);
int BKE_movieclip_has_frame(struct MovieClip *clip, struct MovieClipUser *user);
bool BKE_movieclip_has_frame(struct MovieClip *clip, struct MovieClipUser *user);
void BKE_movieclip_user_set_frame(struct MovieClipUser *user, int framenr);
void BKE_movieclip_update_scopes(struct MovieClip *clip, struct MovieClipUser *user, struct MovieClipScopes *scopes);
@@ -63,10 +63,10 @@ void BKE_movieclip_update_scopes(struct MovieClip *clip, struct MovieClipUser *u
void BKE_movieclip_get_cache_segments(struct MovieClip *clip, struct MovieClipUser *user, int *totseg_r, int **points_r);
void BKE_movieclip_build_proxy_frame(struct MovieClip *clip, int clip_flag, struct MovieDistortion *distortion,
int cfra, int *build_sizes, int build_count, int undistorted);
int cfra, int *build_sizes, int build_count, bool undistorted);
void BKE_movieclip_build_proxy_frame_for_ibuf(struct MovieClip *clip, struct ImBuf *ibuf, struct MovieDistortion *distortion,
int cfra, int *build_sizes, int build_count, int undistorted);
int cfra, int *build_sizes, int build_count, bool undistorted);
float BKE_movieclip_remap_scene_to_clip_frame(struct MovieClip *clip, float framenr);
float BKE_movieclip_remap_clip_to_scene_frame(struct MovieClip *clip, float framenr);
@@ -74,8 +74,8 @@ float BKE_movieclip_remap_clip_to_scene_frame(struct MovieClip *clip, float fram
void BKE_movieclip_filename_for_frame(struct MovieClip *clip, struct MovieClipUser *user, char *name);
struct ImBuf *BKE_movieclip_anim_ibuf_for_frame(struct MovieClip *clip, struct MovieClipUser *user);
int BKE_movieclip_has_cached_frame(struct MovieClip *clip, struct MovieClipUser *user);
int BKE_movieclip_put_frame_if_possible(struct MovieClip *clip, struct MovieClipUser *user, struct ImBuf *ibuf);
bool BKE_movieclip_has_cached_frame(struct MovieClip *clip, struct MovieClipUser *user);
bool BKE_movieclip_put_frame_if_possible(struct MovieClip *clip, struct MovieClipUser *user, struct ImBuf *ibuf);
/* cacheing flags */
#define MOVIECLIP_CACHE_SKIP (1 << 0)
+2 -2
View File
@@ -59,7 +59,7 @@ struct NlaStrip *add_nla_soundstrip(struct Scene *scene, struct Speaker *spk);
/* ----------------------------- */
/* API */
short BKE_nlastrips_has_space(ListBase *strips, float start, float end);
bool BKE_nlastrips_has_space(ListBase *strips, float start, float end);
void BKE_nlastrips_sort_strips(ListBase *strips);
short BKE_nlastrips_add_strip(ListBase *strips, struct NlaStrip *strip);
@@ -78,7 +78,7 @@ void BKE_nlatrack_set_active(ListBase *tracks, struct NlaTrack *nlt);
void BKE_nlatrack_solo_toggle(struct AnimData *adt, struct NlaTrack *nlt);
short BKE_nlatrack_has_space(struct NlaTrack *nlt, float start, float end);
bool BKE_nlatrack_has_space(struct NlaTrack *nlt, float start, float end);
void BKE_nlatrack_sort_strips(struct NlaTrack *nlt);
short BKE_nlatrack_add_strip(struct NlaTrack *nlt, struct NlaStrip *strip);
+1 -1
View File
@@ -554,7 +554,7 @@ void BKE_node_preview_clear_tree(struct bNodeTree *ntree);
void BKE_node_preview_sync_tree(struct bNodeTree *to_ntree, struct bNodeTree *from_ntree);
void BKE_node_preview_merge_tree(struct bNodeTree *to_ntree, struct bNodeTree *from_ntree, bool remove_old);
void BKE_node_preview_set_pixel(struct bNodePreview *preview, const float col[4], int x, int y, int do_manage);
void BKE_node_preview_set_pixel(struct bNodePreview *preview, const float col[4], int x, int y, bool do_manage);
/* ************** NODE TYPE ACCESS *************** */
+1 -1
View File
@@ -174,7 +174,7 @@ int BKE_object_obdata_texspace_get(struct Object *ob, short **r_texflag, float *
int BKE_object_insert_ptcache(struct Object *ob);
// void object_delete_ptcache(struct Object *ob, int index);
struct KeyBlock *BKE_object_insert_shape_key(struct Scene *scene, struct Object *ob, const char *name, int from_mix);
struct KeyBlock *BKE_object_insert_shape_key(struct Scene *scene, struct Object *ob, const char *name, const bool from_mix);
bool BKE_object_is_child_recursive(struct Object *ob_parent, struct Object *ob_child);
bool BKE_object_is_animated(struct Scene *scene, struct Object *ob);
+1 -1
View File
@@ -140,7 +140,7 @@ typedef struct SculptSession {
/* PBVH acceleration structure */
struct PBVH *pbvh;
int show_diffuse_color;
bool show_diffuse_color;
/* Paiting on deformed mesh */
int modifiers_active; /* object is deformed with some modifiers */
+5 -5
View File
@@ -53,7 +53,7 @@ typedef struct {
/* Callbacks */
/* returns 1 if the search should continue from this node, 0 otherwise */
typedef int (*BKE_pbvh_SearchCallback)(PBVHNode *node, void *data);
typedef bool (*BKE_pbvh_SearchCallback)(PBVHNode *node, void *data);
typedef void (*BKE_pbvh_HitCallback)(PBVHNode *node, void *data);
typedef void (*BKE_pbvh_HitOccludedCallback)(PBVHNode *node, void *data, float *tmin);
@@ -174,9 +174,9 @@ void BKE_pbvh_node_get_original_BB(PBVHNode *node, float bb_min[3], float bb_max
float BKE_pbvh_node_get_tmin(PBVHNode *node);
/* test if AABB is at least partially inside the planes' volume */
int BKE_pbvh_node_planes_contain_AABB(PBVHNode *node, void *data);
bool BKE_pbvh_node_planes_contain_AABB(PBVHNode *node, void *data);
/* test if AABB is at least partially outside the planes' volume */
int BKE_pbvh_node_planes_exclude_AABB(PBVHNode *node, void *data);
bool BKE_pbvh_node_planes_exclude_AABB(PBVHNode *node, void *data);
struct GSet *BKE_pbvh_bmesh_node_unique_verts(PBVHNode *node);
struct GSet *BKE_pbvh_bmesh_node_other_verts(PBVHNode *node);
@@ -203,7 +203,7 @@ void BKE_pbvh_node_layer_disp_free(PBVHNode *node);
/* vertex deformer */
float (*BKE_pbvh_get_vertCos(struct PBVH *pbvh))[3];
void BKE_pbvh_apply_vertCos(struct PBVH *pbvh, float (*vertCos)[3]);
int BKE_pbvh_isDeformed(struct PBVH *pbvh);
bool BKE_pbvh_isDeformed(struct PBVH *pbvh);
/* Vertex Iterator */
@@ -330,6 +330,6 @@ void BKE_pbvh_gather_proxies(PBVH *pbvh, PBVHNode ***nodes, int *totnode);
//void BKE_pbvh_node_BB_reset(PBVHNode *node);
//void BKE_pbvh_node_BB_expand(PBVHNode *node, float co[3]);
void pbvh_show_diffuse_color_set(PBVH *bvh, int show_diffuse_color);
void pbvh_show_diffuse_color_set(PBVH *bvh, bool show_diffuse_color);
#endif /* __BKE_PBVH_H__ */
+4 -4
View File
@@ -119,7 +119,7 @@ void BKE_scene_update_tagged(struct EvaluationContext *eval_ctx, struct Main *bm
void BKE_scene_update_for_newframe(struct EvaluationContext *eval_ctx, struct Main *bmain, struct Scene *sce, unsigned int lay);
struct SceneRenderLayer *BKE_scene_add_render_layer(struct Scene *sce, const char *name);
int BKE_scene_remove_render_layer(struct Main *main, struct Scene *scene, struct SceneRenderLayer *srl);
bool BKE_scene_remove_render_layer(struct Main *main, struct Scene *scene, struct SceneRenderLayer *srl);
/* render profile */
int get_render_subsurf_level(struct RenderData *r, int level);
@@ -127,11 +127,11 @@ int get_render_child_particle_number(struct RenderData *r, int num);
int get_render_shadow_samples(struct RenderData *r, int samples);
float get_render_aosss_error(struct RenderData *r, float error);
int BKE_scene_use_new_shading_nodes(struct Scene *scene);
bool BKE_scene_use_new_shading_nodes(struct Scene *scene);
void BKE_scene_disable_color_management(struct Scene *scene);
int BKE_scene_check_color_management_enabled(const struct Scene *scene);
int BKE_scene_check_rigidbody_active(const struct Scene *scene);
bool BKE_scene_check_color_management_enabled(const struct Scene *scene);
bool BKE_scene_check_rigidbody_active(const struct Scene *scene);
int BKE_scene_num_threads(const struct Scene *scene);
int BKE_render_num_threads(const struct RenderData *r);
+1 -1
View File
@@ -220,7 +220,7 @@ void BKE_sequence_free(struct Scene *scene, struct Sequence *seq);
const char *BKE_sequence_give_name(struct Sequence *seq);
void BKE_sequence_calc(struct Scene *scene, struct Sequence *seq);
void BKE_sequence_calc_disp(struct Scene *scene, struct Sequence *seq);
void BKE_sequence_reload_new_file(struct Scene *scene, struct Sequence *seq, int lock_range);
void BKE_sequence_reload_new_file(struct Scene *scene, struct Sequence *seq, const bool lock_range);
int BKE_sequencer_evaluate_frame(struct Scene *scene, int cfra);
struct StripElem *BKE_sequencer_give_stripelem(struct Sequence *seq, int cfra);
+8 -8
View File
@@ -62,7 +62,7 @@ char *txt_to_buf (struct Text *text);
void txt_clean_text (struct Text *text);
void txt_order_cursors (struct Text *text, const bool reverse);
int txt_find_string (struct Text *text, const char *findstr, int wrap, int match_case);
int txt_has_sel (struct Text *text);
bool txt_has_sel (struct Text *text);
int txt_get_span (struct TextLine *from, struct TextLine *to);
int txt_utf8_offset_to_index(const char *str, int offset);
int txt_utf8_index_to_offset(const char *str, int index);
@@ -112,13 +112,13 @@ void txt_print_undo (struct Text *text);
#endif
/* utility functions, could be moved somewhere more generic but are python/text related */
int text_check_bracket(const char ch);
int text_check_delim(const char ch);
int text_check_digit(const char ch);
int text_check_identifier(const char ch);
int text_check_identifier_nodigit(const char ch);
int text_check_whitespace(const char ch);
int text_find_identifier_start(const char *str, int i);
int text_check_bracket(const char ch);
bool text_check_delim(const char ch);
bool text_check_digit(const char ch);
bool text_check_identifier(const char ch);
bool text_check_identifier_nodigit(const char ch);
bool text_check_whitespace(const char ch);
int text_find_identifier_start(const char *str, int i);
/* defined in bpy_interface.c */
extern int text_check_identifier_unicode(const unsigned int ch);
+1 -1
View File
@@ -64,7 +64,7 @@ void BKE_texture_free(struct Tex *t);
void init_colorband(struct ColorBand *coba, bool rangetype);
struct ColorBand *add_colorband(bool rangetype);
int do_colorband(const struct ColorBand *coba, float in, float out[4]);
bool do_colorband(const struct ColorBand *coba, float in, float out[4]);
void colorband_table_RGBA(struct ColorBand *coba, float **array, int *size);
struct CBData *colorband_element_add(struct ColorBand *coba, float position);
int colorband_element_remove(struct ColorBand *coba, int index);
+1 -1
View File
@@ -209,7 +209,7 @@ void BKE_tracking_disable_channels(struct ImBuf *ibuf, bool disable_red, bool di
/* **** 2D tracking **** */
struct MovieTrackingContext *BKE_tracking_context_new(struct MovieClip *clip, struct MovieClipUser *user,
short backwards, short sequence);
const bool backwards, const bool sequence);
void BKE_tracking_context_free(struct MovieTrackingContext *context);
void BKE_tracking_context_sync(struct MovieTrackingContext *context);
void BKE_tracking_context_sync_user(const struct MovieTrackingContext *context, struct MovieClipUser *user);
+1 -1
View File
@@ -34,7 +34,7 @@ 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) */
size_t bUnit_AsString(char *str, int len_max, double value, int prec, int system, int type, int split, bool pad);
size_t bUnit_AsString(char *str, int len_max, double value, int prec, int system, int type, bool split, bool 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);
+1 -1
View File
@@ -78,7 +78,7 @@ 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);
void BKE_ffmpeg_codec_settings_verify(struct RenderData *rd);
int BKE_ffmpeg_alpha_channel_is_supported(struct RenderData *rd);
bool BKE_ffmpeg_alpha_channel_is_supported(struct RenderData *rd);
struct IDProperty *BKE_ffmpeg_property_add(struct RenderData *Rd, const char *type, int opt_index, int parent_index);
int BKE_ffmpeg_property_add_string(struct RenderData *rd, const char *type, const char *str);
@@ -1444,9 +1444,9 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
const bool do_final_wmcol = (scene->toolsettings->weights_preview == WP_WPREVIEW_FINAL) && do_wmcol;
#endif
const bool do_final_wmcol = FALSE;
int do_init_wmcol = ((dataMask & CD_MASK_PREVIEW_MCOL) && (ob->mode & OB_MODE_WEIGHT_PAINT) && !do_final_wmcol);
const bool do_init_wmcol = ((dataMask & CD_MASK_PREVIEW_MCOL) && (ob->mode & OB_MODE_WEIGHT_PAINT) && !do_final_wmcol);
/* XXX Same as above... For now, only weights preview in WPaint mode. */
const int do_mod_wmcol = do_init_wmcol;
const bool do_mod_wmcol = do_init_wmcol;
VirtualModifierData virtualModifierData;
@@ -1938,7 +1938,7 @@ float (*editbmesh_get_vertex_cos(BMEditMesh *em, int *numVerts_r))[3]
return cos;
}
int editbmesh_modifier_is_enabled(Scene *scene, ModifierData *md, DerivedMesh *dm)
bool editbmesh_modifier_is_enabled(Scene *scene, ModifierData *md, DerivedMesh *dm)
{
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
int required_mode = eModifierMode_Realtime | eModifierMode_Editmode;
@@ -1965,9 +1965,9 @@ static void editbmesh_calc_modifiers(Scene *scene, Object *ob, BMEditMesh *em, D
int required_mode = eModifierMode_Realtime | eModifierMode_Editmode;
int draw_flag = dm_drawflag_calc(scene->toolsettings);
// const int do_mod_mcol = true; // (ob->mode == OB_MODE_OBJECT);
// const bool do_mod_mcol = true; // (ob->mode == OB_MODE_OBJECT);
#if 0 /* XXX Will re-enable this when we have global mod stack options. */
const int do_final_wmcol = (scene->toolsettings->weights_preview == WP_WPREVIEW_FINAL) && do_wmcol;
const bool do_final_wmcol = (scene->toolsettings->weights_preview == WP_WPREVIEW_FINAL) && do_wmcol;
#endif
const bool do_final_wmcol = FALSE;
const bool do_init_wmcol = ((((Mesh *)ob->data)->drawflag & ME_DRAWEIGHT) && !do_final_wmcol);
@@ -2697,7 +2697,8 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
{
float *verts[4], *tex_coords[4];
const int nr_verts = mface[f].v4 != 0 ? 4 : 3;
int i, is_degenerate;
bool is_degenerate;
int i;
verts[0] = mvert[mface[f].v1].co; verts[1] = mvert[mface[f].v2].co; verts[2] = mvert[mface[f].v3].co;
tex_coords[0] = mtface[f].uv[0]; tex_coords[1] = mtface[f].uv[1]; tex_coords[2] = mtface[f].uv[2];
@@ -2725,7 +2726,7 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm)
/* verify the winding is consistent */
if (is_degenerate == 0) {
float prev_edge[2];
int is_signed = 0;
bool is_signed = 0;
sub_v2_v2v2(prev_edge, tex_coords[0], tex_coords[3]);
i = 0;
+1 -1
View File
@@ -1007,7 +1007,7 @@ void BKE_pose_remove_group(Object *ob)
/* ************** F-Curve Utilities for Actions ****************** */
/* Check if the given action has any keyframes */
short action_has_motion(const bAction *act)
bool action_has_motion(const bAction *act)
{
FCurve *fcu;
@@ -1020,7 +1020,7 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, const ColorManagedViewSettings *
int savedlines, saveline;
float rgba[4], ycc[3], luma;
int ycc_mode = -1;
const short is_float = (ibuf->rect_float != NULL);
const bool is_float = (ibuf->rect_float != NULL);
void *cache_handle = NULL;
struct ColormanageProcessor *cm_processor = NULL;
+2 -2
View File
@@ -2524,7 +2524,7 @@ void BKE_curve_bevelList_make(Object *ob, ListBase *nurbs, bool for_render)
struct BevelSort *sortdata, *sd, *sd1;
int a, b, nr, poly, resolu = 0, len = 0;
int do_tilt, do_radius, do_weight;
int is_editmode = 0;
bool is_editmode = false;
ListBase *bev;
/* this function needs an object, because of tflag and upflag */
@@ -4092,7 +4092,7 @@ bool BKE_curve_center_bounds(Curve *cu, float cent[3])
return false;
}
void BKE_curve_translate(Curve *cu, float offset[3], int do_keys)
void BKE_curve_translate(Curve *cu, float offset[3], const bool do_keys)
{
ListBase *nurb_lb = BKE_curve_nurbs_get(cu);
Nurb *nu;
+1 -1
View File
@@ -557,7 +557,7 @@ void defgroup_unique_name(bDeformGroup *dg, Object *ob)
BLI_uniquename_cb(defgroup_unique_check, &data, DATA_("Group"), '.', dg->name, sizeof(dg->name));
}
static int is_char_sep(const char c)
static bool is_char_sep(const char c)
{
return ELEM4(c, '.', ' ', '-', '_');
}
+5 -5
View File
@@ -1988,7 +1988,7 @@ static void dag_object_time_update_flags(Main *bmain, Scene *scene, Object *ob)
}
/* recursively update objects in groups, each group is done at most once */
static void dag_group_update_flags(Main *bmain, Scene *scene, Group *group, const short do_time)
static void dag_group_update_flags(Main *bmain, Scene *scene, Group *group, const bool do_time)
{
GroupObject *go;
@@ -2007,7 +2007,7 @@ static void dag_group_update_flags(Main *bmain, Scene *scene, Group *group, cons
/* flag all objects that need recalc, for changes in time for example */
/* do_time: make this optional because undo resets objects to their animated locations without this */
void DAG_scene_update_flags(Main *bmain, Scene *scene, unsigned int lay, const short do_time)
void DAG_scene_update_flags(Main *bmain, Scene *scene, unsigned int lay, const bool do_time)
{
Base *base;
Object *ob;
@@ -2160,7 +2160,7 @@ static void dag_group_on_visible_update(Group *group)
}
}
void DAG_on_visible_update(Main *bmain, const short do_time)
void DAG_on_visible_update(Main *bmain, const bool do_time)
{
ListBase listbase;
DagSceneLayer *dsl;
@@ -2228,7 +2228,7 @@ void DAG_on_visible_update(Main *bmain, const short do_time)
static void dag_id_flush_update__isDependentTexture(void *userData, Object *UNUSED(ob), ID **idpoin)
{
struct { ID *id; int is_dependent; } *data = userData;
struct { ID *id; bool is_dependent; } *data = userData;
if (*idpoin && GS((*idpoin)->name) == ID_TE) {
if (data->id == (*idpoin))
@@ -2286,7 +2286,7 @@ static void dag_id_flush_update(Main *bmain, Scene *sce, ID *id)
/* set flags based on textures - can influence depgraph via modifiers */
if (idtype == ID_TE) {
for (obt = bmain->object.first; obt; obt = obt->id.next) {
struct { ID *id; int is_dependent; } data;
struct { ID *id; bool is_dependent; } data;
data.id = id;
data.is_dependent = 0;
@@ -1461,7 +1461,7 @@ static void dynamicPaint_setInitialColor(Scene *scene, DynamicPaintSurface *surf
PaintPoint *pPoint = (PaintPoint *)sData->type_data;
DerivedMesh *dm = surface->canvas->dm;
int i;
bool scene_color_manage = BKE_scene_check_color_management_enabled(scene);
const bool scene_color_manage = BKE_scene_check_color_management_enabled(scene);
if (surface->type != MOD_DPAINT_SURFACE_T_PAINT)
return;
+6 -6
View File
@@ -433,7 +433,7 @@ int binarysearch_bezt_index(BezTriple array[], float frame, int arraylen, bool *
/* helper for calc_fcurve_* functions -> find first and last BezTriple to be used */
static short get_fcurve_end_keyframes(FCurve *fcu, BezTriple **first, BezTriple **last,
const short do_sel_only)
const bool do_sel_only)
{
short found = FALSE;
@@ -482,12 +482,12 @@ static short get_fcurve_end_keyframes(FCurve *fcu, BezTriple **first, BezTriple
/* Calculate the extents of F-Curve's data */
short calc_fcurve_bounds(FCurve *fcu, float *xmin, float *xmax, float *ymin, float *ymax,
const short do_sel_only, const short include_handles)
bool calc_fcurve_bounds(FCurve *fcu, float *xmin, float *xmax, float *ymin, float *ymax,
const bool do_sel_only, const bool include_handles)
{
float xminv = 999999999.0f, xmaxv = -999999999.0f;
float yminv = 999999999.0f, ymaxv = -999999999.0f;
short foundvert = FALSE;
bool foundvert = false;
unsigned int i;
if (fcu->totvert) {
@@ -578,7 +578,7 @@ short calc_fcurve_bounds(FCurve *fcu, float *xmin, float *xmax, float *ymin, flo
/* Calculate the extents of F-Curve's keyframes */
bool calc_fcurve_range(FCurve *fcu, float *start, float *end,
const short do_sel_only, const short do_min_length)
const bool do_sel_only, const bool do_min_length)
{
float min = 999999999.0f, max = -999999999.0f;
short foundvert = FALSE;
@@ -631,7 +631,7 @@ bool calc_fcurve_range(FCurve *fcu, float *start, float *end,
* Usability of keyframes refers to whether they should be displayed,
* and also whether they will have any influence on the final result.
*/
short fcurve_are_keyframes_usable(FCurve *fcu)
bool fcurve_are_keyframes_usable(FCurve *fcu)
{
/* F-Curve must exist */
if (fcu == NULL)
+1 -1
View File
@@ -211,7 +211,7 @@ VFont *BKE_vfont_load(Main *bmain, const char *name)
VFont *vfont = NULL;
PackedFile *pf;
PackedFile *temp_pf = NULL;
int is_builtin;
bool is_builtin;
if (STREQ(name, FO_BUILTIN_NAME)) {
BLI_strncpy(filename, name, sizeof(filename));
+6 -6
View File
@@ -561,7 +561,7 @@ void BKE_image_merge(Image *dest, Image *source)
}
/* note, we could be clever and scale all imbuf's but since some are mipmaps its not so simple */
int BKE_image_scale(Image *image, int width, int height)
bool BKE_image_scale(Image *image, int width, int height)
{
ImBuf *ibuf;
void *lock;
@@ -1264,7 +1264,7 @@ char BKE_imtype_from_arg(const char *imtype_arg)
else return R_IMF_IMTYPE_INVALID;
}
static int do_add_image_extension(char *string, const char imtype, const ImageFormatData *im_format)
static bool do_add_image_extension(char *string, const char imtype, const ImageFormatData *im_format)
{
const char *extension = NULL;
const char *extension_test;
@@ -3149,7 +3149,7 @@ void BKE_image_release_ibuf(Image *ima, ImBuf *ibuf, void *lock)
}
/* checks whether there's an image buffer for given image and user */
int BKE_image_has_ibuf(Image *ima, ImageUser *iuser)
bool BKE_image_has_ibuf(Image *ima, ImageUser *iuser)
{
ImBuf *ibuf;
@@ -3284,7 +3284,7 @@ void BKE_image_pool_release_ibuf(Image *ima, ImBuf *ibuf, ImagePool *pool)
}
}
int BKE_image_user_frame_get(const ImageUser *iuser, int cfra, int fieldnr, short *r_is_in_range)
int BKE_image_user_frame_get(const ImageUser *iuser, int cfra, int fieldnr, bool *r_is_in_range)
{
const int len = (iuser->fie_ima * iuser->frames) / 2;
@@ -3346,7 +3346,7 @@ int BKE_image_user_frame_get(const ImageUser *iuser, int cfra, int fieldnr, shor
void BKE_image_user_frame_calc(ImageUser *iuser, int cfra, int fieldnr)
{
if (iuser) {
short is_in_range;
bool is_in_range;
const int framenr = BKE_image_user_frame_get(iuser, cfra, fieldnr, &is_in_range);
if (is_in_range) {
@@ -3404,7 +3404,7 @@ void BKE_image_user_file_path(ImageUser *iuser, Image *ima, char *filepath)
BLI_path_abs(filepath, ID_BLEND_PATH(G.main, &ima->id));
}
int BKE_image_has_alpha(struct Image *image)
bool BKE_image_has_alpha(struct Image *image)
{
ImBuf *ibuf;
void *lock;
+1 -1
View File
@@ -1558,7 +1558,7 @@ KeyBlock *BKE_keyblock_add(Key *key, const char *name)
* \param name Optional name for the new keyblock.
* \param do_force always use ctime even for relative keys.
*/
KeyBlock *BKE_keyblock_add_ctime(Key *key, const char *name, const short do_force)
KeyBlock *BKE_keyblock_add_ctime(Key *key, const char *name, const bool do_force)
{
KeyBlock *kb = BKE_keyblock_add(key, name);
+3 -3
View File
@@ -620,7 +620,7 @@ static int calc_curve_deform(Object *par, float co[3],
Curve *cu = par->data;
float fac, loc[4], dir[3], new_quat[4], radius;
short index;
const int is_neg_axis = (axis > 2);
const bool is_neg_axis = (axis > 2);
/* to be sure, mostly after file load */
if (par->curve_cache->path == NULL) {
@@ -711,7 +711,7 @@ void curve_deform_verts(Object *cuOb, Object *target, DerivedMesh *dm, float (*v
int a;
CurveDeform cd;
int use_vgroups;
const int is_neg_axis = (defaxis > 2);
const bool is_neg_axis = (defaxis > 2);
if (cuOb->type != OB_CURVE)
return;
@@ -1147,7 +1147,7 @@ void BKE_lattice_center_bounds(Lattice *lt, float cent[3])
mid_v3_v3v3(cent, min, max);
}
void BKE_lattice_translate(Lattice *lt, float offset[3], int do_keys)
void BKE_lattice_translate(Lattice *lt, float offset[3], bool do_keys)
{
int i, numVerts;
+4 -4
View File
@@ -434,7 +434,7 @@ float BKE_mask_spline_project_co(MaskSpline *spline, MaskSplinePoint *point,
/* point */
int BKE_mask_point_has_handle(MaskSplinePoint *point)
bool BKE_mask_point_has_handle(MaskSplinePoint *point)
{
BezTriple *bezt = &point->bezt;
@@ -671,7 +671,7 @@ void BKE_mask_point_add_uw(MaskSplinePoint *point, float u, float w)
BKE_mask_point_sort_uw(point, &point->uw[point->tot_uw - 1]);
}
void BKE_mask_point_select_set(MaskSplinePoint *point, const short do_select)
void BKE_mask_point_select_set(MaskSplinePoint *point, const bool do_select)
{
int i;
@@ -692,7 +692,7 @@ void BKE_mask_point_select_set(MaskSplinePoint *point, const short do_select)
}
}
void BKE_mask_point_select_set_handle(MaskSplinePoint *point, const short do_select)
void BKE_mask_point_select_set_handle(MaskSplinePoint *point, const bool do_select)
{
if (do_select) {
MASKPOINT_SEL_HANDLE(point);
@@ -1298,7 +1298,7 @@ void BKE_mask_calc_handle_adjacent_interp(MaskSpline *spline, MaskSplinePoint *p
* Useful for giving sane defaults.
*/
void BKE_mask_calc_handle_point_auto(MaskSpline *spline, MaskSplinePoint *point,
const short do_recalc_length)
const bool do_recalc_length)
{
MaskSplinePoint *point_prev, *point_next;
const char h_back[2] = {point->bezt.h1, point->bezt.h2};
@@ -505,7 +505,7 @@ void BKE_mask_spline_feather_collapse_inner_loops(MaskSpline *spline, float (*fe
static float (*mask_spline_feather_differentiated_points_with_resolution__even(MaskSpline *spline,
unsigned int *tot_feather_point,
const unsigned int resol,
const int do_feather_isect
const bool do_feather_isect
))[2]
{
MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline);
@@ -578,7 +578,7 @@ static float (*mask_spline_feather_differentiated_points_with_resolution__even(M
static float (*mask_spline_feather_differentiated_points_with_resolution__double(MaskSpline *spline,
unsigned int *tot_feather_point,
const unsigned int resol,
const int do_feather_isect
const bool do_feather_isect
))[2]
{
MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline);
@@ -715,7 +715,7 @@ static float (*mask_spline_feather_differentiated_points_with_resolution__double
float (*BKE_mask_spline_feather_differentiated_points_with_resolution(MaskSpline *spline,
unsigned int *tot_feather_point,
const unsigned int resol,
const int do_feather_isect
const bool do_feather_isect
))[2]
{
switch (spline->offset_mode) {
@@ -192,7 +192,7 @@ typedef struct MaskRasterSplineInfo {
unsigned int vertex_total_cap_head;
unsigned int vertex_total_cap_tail;
unsigned int is_cyclic;
bool is_cyclic;
} MaskRasterSplineInfo;
/**
@@ -256,7 +256,7 @@ void BKE_maskrasterize_handle_free(MaskRasterHandle *mr_handle)
static void maskrasterize_spline_differentiate_point_outset(float (*diff_feather_points)[2], float (*diff_points)[2],
const unsigned int tot_diff_point, const float ofs,
const short do_test)
const bool do_test)
{
unsigned int k_prev = tot_diff_point - 2;
unsigned int k_curr = tot_diff_point - 1;
@@ -558,8 +558,8 @@ static void layer_bucket_init(MaskRasterLayer *layer, const float pixel_size)
void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, struct Mask *mask,
const int width, const int height,
const short do_aspect_correct, const short do_mask_aa,
const short do_feather)
const bool do_aspect_correct, const bool do_mask_aa,
const bool do_feather)
{
const rctf default_bounds = {0.0f, 1.0f, 0.0f, 1.0f};
const float pixel_size = 1.0f / (float)min_ii(width, height);
@@ -613,8 +613,8 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, struct Mask *mas
BLI_scanfill_begin_arena(&sf_ctx, sf_arena);
for (spline = masklay->splines.first; spline; spline = spline->next) {
const unsigned int is_cyclic = (spline->flag & MASK_SPLINE_CYCLIC) != 0;
const unsigned int is_fill = (spline->flag & MASK_SPLINE_NOFILL) == 0;
const bool is_cyclic = (spline->flag & MASK_SPLINE_CYCLIC) != 0;
const bool is_fill = (spline->flag & MASK_SPLINE_NOFILL) == 0;
float (*diff_points)[2];
unsigned int tot_diff_point;
+9 -9
View File
@@ -176,7 +176,7 @@ static void get_sequence_fname(MovieClip *clip, int framenr, char *name)
}
/* supposed to work with sequences only */
static void get_proxy_fname(MovieClip *clip, int proxy_render_size, int undistorted, int framenr, char *name)
static void get_proxy_fname(MovieClip *clip, int proxy_render_size, bool undistorted, int framenr, char *name)
{
int size = rendersize_to_number(proxy_render_size);
char dir[FILE_MAX], clipdir[FILE_MAX], clipfile[FILE_MAX];
@@ -482,7 +482,7 @@ static ImBuf *get_imbuf_cache(MovieClip *clip, MovieClipUser *user, int flag)
return NULL;
}
static int has_imbuf_cache(MovieClip *clip, MovieClipUser *user, int flag)
static bool has_imbuf_cache(MovieClip *clip, MovieClipUser *user, int flag)
{
if (clip->cache) {
MovieClipImBufCacheKey key;
@@ -1046,7 +1046,7 @@ ImBuf *BKE_movieclip_get_stable_ibuf(MovieClip *clip, MovieClipUser *user, float
}
int BKE_movieclip_has_frame(MovieClip *clip, MovieClipUser *user)
bool BKE_movieclip_has_frame(MovieClip *clip, MovieClipUser *user)
{
ImBuf *ibuf = BKE_movieclip_get_ibuf(clip, user);
@@ -1290,7 +1290,7 @@ void BKE_movieclip_update_scopes(MovieClip *clip, MovieClipUser *user, MovieClip
scopes->ok = TRUE;
}
static void movieclip_build_proxy_ibuf(MovieClip *clip, ImBuf *ibuf, int cfra, int proxy_render_size, int undistorted, bool threaded)
static void movieclip_build_proxy_ibuf(MovieClip *clip, ImBuf *ibuf, int cfra, int proxy_render_size, bool undistorted, bool threaded)
{
char name[FILE_MAX];
int quality, rectx, recty;
@@ -1335,7 +1335,7 @@ static void movieclip_build_proxy_ibuf(MovieClip *clip, ImBuf *ibuf, int cfra, i
* (meaning scaling shall be threaded)
*/
void BKE_movieclip_build_proxy_frame(MovieClip *clip, int clip_flag, struct MovieDistortion *distortion,
int cfra, int *build_sizes, int build_count, int undistorted)
int cfra, int *build_sizes, int build_count, bool undistorted)
{
ImBuf *ibuf;
MovieClipUser user;
@@ -1370,7 +1370,7 @@ void BKE_movieclip_build_proxy_frame(MovieClip *clip, int clip_flag, struct Movi
* (different threads handles different frames, no threading within frame is needed)
*/
void BKE_movieclip_build_proxy_frame_for_ibuf(MovieClip *clip, ImBuf *ibuf, struct MovieDistortion *distortion,
int cfra, int *build_sizes, int build_count, int undistorted)
int cfra, int *build_sizes, int build_count, bool undistorted)
{
if (!build_count)
return;
@@ -1508,9 +1508,9 @@ ImBuf *BKE_movieclip_anim_ibuf_for_frame(MovieClip *clip, MovieClipUser *user)
return ibuf;
}
int BKE_movieclip_has_cached_frame(MovieClip *clip, MovieClipUser *user)
bool BKE_movieclip_has_cached_frame(MovieClip *clip, MovieClipUser *user)
{
int has_frame = FALSE;
bool has_frame = false;
BLI_lock_thread(LOCK_MOVIECLIP);
has_frame = has_imbuf_cache(clip, user, clip->flag);
@@ -1519,7 +1519,7 @@ int BKE_movieclip_has_cached_frame(MovieClip *clip, MovieClipUser *user)
return has_frame;
}
int BKE_movieclip_put_frame_if_possible(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf)
bool BKE_movieclip_put_frame_if_possible(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf)
{
bool result;
+3 -3
View File
@@ -899,7 +899,7 @@ static void multires_subdivide(MultiresModifierData *mmd, Object *ob, int totlvl
CCGKey highGridKey, lowGridKey;
CCGSubSurf *ss;
int i, numGrids, highGridSize;
int has_mask = CustomData_has_layer(&me->ldata, CD_GRID_PAINT_MASK);
const bool has_mask = CustomData_has_layer(&me->ldata, CD_GRID_PAINT_MASK);
/* create subsurf DM from original mesh at high level */
cddm = CDDM_from_mesh(me);
@@ -1170,7 +1170,7 @@ void multires_modifier_update_mdisps(struct DerivedMesh *dm)
CCGKey highGridKey, lowGridKey;
CCGSubSurf *ss;
int i, j, numGrids, highGridSize, lowGridSize;
int has_mask = CustomData_has_layer(&me->ldata, CD_GRID_PAINT_MASK);
const bool has_mask = CustomData_has_layer(&me->ldata, CD_GRID_PAINT_MASK);
/* create subsurf DM from original mesh at high level */
if (ob->derivedDeform) cddm = CDDM_copy(ob->derivedDeform);
@@ -1233,7 +1233,7 @@ void multires_modifier_update_mdisps(struct DerivedMesh *dm)
}
else {
DerivedMesh *cddm, *subdm;
int has_mask = CustomData_has_layer(&me->ldata, CD_GRID_PAINT_MASK);
const bool has_mask = CustomData_has_layer(&me->ldata, CD_GRID_PAINT_MASK);
if (ob->derivedDeform) cddm = CDDM_copy(ob->derivedDeform);
else cddm = CDDM_from_mesh(me);
+2 -2
View File
@@ -548,7 +548,7 @@ float BKE_nla_tweakedit_remap(AnimData *adt, float cframe, short mode)
/* (these functions are used for NLA-Tracks and also for nested/meta-strips) */
/* Check if there is any space in the given list to add the given strip */
short BKE_nlastrips_has_space(ListBase *strips, float start, float end)
bool BKE_nlastrips_has_space(ListBase *strips, float start, float end)
{
NlaStrip *strip;
@@ -967,7 +967,7 @@ void BKE_nlatrack_set_active(ListBase *tracks, NlaTrack *nlt_a)
}
/* Check if there is any space in the given track to add a strip of the given length */
short BKE_nlatrack_has_space(NlaTrack *nlt, float start, float end)
bool BKE_nlatrack_has_space(NlaTrack *nlt, float start, float end)
{
/* sanity checks
* - track must exist
+1 -1
View File
@@ -1478,7 +1478,7 @@ void BKE_node_preview_merge_tree(bNodeTree *to_ntree, bNodeTree *from_ntree, boo
/* hack warning! this function is only used for shader previews, and
* since it gets called multiple times per pixel for Ztransp we only
* add the color once. Preview gets cleared before it starts render though */
void BKE_node_preview_set_pixel(bNodePreview *preview, const float col[4], int x, int y, int do_manage)
void BKE_node_preview_set_pixel(bNodePreview *preview, const float col[4], int x, int y, bool do_manage)
{
if (preview) {
if (x >= 0 && y >= 0) {
+4 -4
View File
@@ -3224,7 +3224,7 @@ void object_delete_ptcache(Object *ob, int index)
/* shape key utility function */
/************************* Mesh ************************/
static KeyBlock *insert_meshkey(Scene *scene, Object *ob, const char *name, int from_mix)
static KeyBlock *insert_meshkey(Scene *scene, Object *ob, const char *name, const bool from_mix)
{
Mesh *me = ob->data;
Key *key = me->key;
@@ -3256,7 +3256,7 @@ static KeyBlock *insert_meshkey(Scene *scene, Object *ob, const char *name, int
return kb;
}
/************************* Lattice ************************/
static KeyBlock *insert_lattkey(Scene *scene, Object *ob, const char *name, int from_mix)
static KeyBlock *insert_lattkey(Scene *scene, Object *ob, const char *name, const bool from_mix)
{
Lattice *lt = ob->data;
Key *key = lt->key;
@@ -3294,7 +3294,7 @@ static KeyBlock *insert_lattkey(Scene *scene, Object *ob, const char *name, int
return kb;
}
/************************* Curve ************************/
static KeyBlock *insert_curvekey(Scene *scene, Object *ob, const char *name, int from_mix)
static KeyBlock *insert_curvekey(Scene *scene, Object *ob, const char *name, const bool from_mix)
{
Curve *cu = ob->data;
Key *key = cu->key;
@@ -3334,7 +3334,7 @@ static KeyBlock *insert_curvekey(Scene *scene, Object *ob, const char *name, int
return kb;
}
KeyBlock *BKE_object_insert_shape_key(Scene *scene, Object *ob, const char *name, int from_mix)
KeyBlock *BKE_object_insert_shape_key(Scene *scene, Object *ob, const char *name, const bool from_mix)
{
switch (ob->type) {
case OB_MESH:
@@ -838,7 +838,7 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem
float (*obmat)[4];
int a, b, hair = 0;
int totpart, totchild, totgroup = 0 /*, pa_num */;
int dupli_type_hack = !BKE_scene_use_new_shading_nodes(scene);
const bool dupli_type_hack = !BKE_scene_use_new_shading_nodes(scene);
int no_draw_flag = PARS_UNEXIST;
+19 -18
View File
@@ -880,12 +880,12 @@ static void BKE_pbvh_search_callback_occluded(PBVH *bvh,
}
}
static int update_search_cb(PBVHNode *node, void *data_v)
static bool update_search_cb(PBVHNode *node, void *data_v)
{
int flag = GET_INT_FROM_POINTER(data_v);
if (node->flag & PBVH_Leaf)
return (node->flag & flag);
return (node->flag & flag) != 0;
return 1;
}
@@ -1362,7 +1362,7 @@ typedef struct {
int original;
} RaycastData;
static int ray_aabb_intersect(PBVHNode *node, void *data_v)
static bool ray_aabb_intersect(PBVHNode *node, void *data_v)
{
RaycastData *rcd = data_v;
float bb_min[3], bb_max[3];
@@ -1387,11 +1387,11 @@ void BKE_pbvh_raycast(PBVH *bvh, BKE_pbvh_HitOccludedCallback cb, void *data,
BKE_pbvh_search_callback_occluded(bvh, ray_aabb_intersect, &rcd, cb, data);
}
int ray_face_intersection(const float ray_start[3],
const float ray_normal[3],
const float *t0, const float *t1,
const float *t2, const float *t3,
float *fdist)
bool ray_face_intersection(const float ray_start[3],
const float ray_normal[3],
const float t0[3], const float t1[3],
const float t2[3], const float t3[3],
float *fdist)
{
float dist;
@@ -1406,14 +1406,15 @@ int ray_face_intersection(const float ray_start[3],
}
}
static int pbvh_faces_node_raycast(PBVH *bvh, const PBVHNode *node,
float (*origco)[3],
const float ray_start[3],
const float ray_normal[3], float *dist)
static bool pbvh_faces_node_raycast(PBVH *bvh, const PBVHNode *node,
float (*origco)[3],
const float ray_start[3],
const float ray_normal[3], float *dist)
{
const MVert *vert = bvh->verts;
const int *faces = node->prim_indices;
int i, hit = 0, totface = node->totprim;
int i, totface = node->totprim;
bool hit = false;
for (i = 0; i < totface; ++i) {
const MFace *f = bvh->faces + faces[i];
@@ -1501,7 +1502,7 @@ int BKE_pbvh_node_raycast(PBVH *bvh, PBVHNode *node, float (*origco)[3], int use
const float ray_start[3], const float ray_normal[3],
float *dist)
{
int hit = 0;
bool hit = false;
if (node->flag & PBVH_FullyHidden)
return 0;
@@ -1641,7 +1642,7 @@ static PlaneAABBIsect test_planes_aabb(const float bb_min[3],
return ret;
}
int BKE_pbvh_node_planes_contain_AABB(PBVHNode *node, void *data)
bool BKE_pbvh_node_planes_contain_AABB(PBVHNode *node, void *data)
{
float bb_min[3], bb_max[3];
@@ -1649,7 +1650,7 @@ int BKE_pbvh_node_planes_contain_AABB(PBVHNode *node, void *data)
return test_planes_aabb(bb_min, bb_max, data) != ISECT_OUTSIDE;
}
int BKE_pbvh_node_planes_exclude_AABB(PBVHNode *node, void *data)
bool BKE_pbvh_node_planes_exclude_AABB(PBVHNode *node, void *data)
{
float bb_min[3], bb_max[3];
@@ -1788,7 +1789,7 @@ void BKE_pbvh_apply_vertCos(PBVH *pbvh, float (*vertCos)[3])
}
}
int BKE_pbvh_isDeformed(PBVH *pbvh)
bool BKE_pbvh_isDeformed(PBVH *pbvh)
{
return pbvh->deformed;
}
@@ -1911,7 +1912,7 @@ void pbvh_vertex_iter_init(PBVH *bvh, PBVHNode *node,
vi->vmask = CustomData_get_layer(bvh->vdata, CD_PAINT_MASK);
}
void pbvh_show_diffuse_color_set(PBVH *bvh, int show_diffuse_color)
void pbvh_show_diffuse_color_set(PBVH *bvh, bool show_diffuse_color)
{
bvh->show_diffuse_color = show_diffuse_color;
}
@@ -154,9 +154,9 @@ struct PBVH {
#endif
/* flag are verts/faces deformed */
int deformed;
bool deformed;
int show_diffuse_color;
bool show_diffuse_color;
/* Dynamic topology */
BMesh *bm;
@@ -175,9 +175,9 @@ void BB_expand_with_bb(BB *bb, BB *bb2);
void BBC_update_centroid(BBC *bbc);
int BB_widest_axis(const BB *bb);
void pbvh_grow_nodes(PBVH *bvh, int totnode);
int ray_face_intersection(const float ray_start[3], const float ray_normal[3],
const float *t0, const float *t1, const float *t2,
const float *t3, float *fdist);
bool ray_face_intersection(const float ray_start[3], const float ray_normal[3],
const float *t0, const float *t1, const float *t2,
const float *t3, float *fdist);
void pbvh_update_BB_redraw(PBVH *bvh, PBVHNode **nodes, int totnode, int flag);
/* pbvh_bmesh.c */
+5 -5
View File
@@ -744,7 +744,7 @@ void BKE_scene_unlink(Main *bmain, Scene *sce, Scene *newsce)
int BKE_scene_base_iter_next(EvaluationContext *eval_ctx, SceneBaseIter *iter,
Scene **scene, int val, Base **base, Object **ob)
{
int run_again = 1;
bool run_again = true;
/* init */
if (val == 0) {
@@ -1671,7 +1671,7 @@ SceneRenderLayer *BKE_scene_add_render_layer(Scene *sce, const char *name)
return srl;
}
int BKE_scene_remove_render_layer(Main *bmain, Scene *scene, SceneRenderLayer *srl)
bool BKE_scene_remove_render_layer(Main *bmain, Scene *scene, SceneRenderLayer *srl)
{
const int act = BLI_findindex(&scene->r.layers, srl);
Scene *sce;
@@ -1766,7 +1766,7 @@ Base *_setlooper_base_step(Scene **sce_iter, Base *base)
return NULL;
}
int BKE_scene_use_new_shading_nodes(Scene *scene)
bool BKE_scene_use_new_shading_nodes(Scene *scene)
{
RenderEngineType *type = RE_engines_find(scene->r.engine);
return (type && type->flag & RE_USE_SHADING_NODES);
@@ -1810,12 +1810,12 @@ void BKE_scene_disable_color_management(Scene *scene)
}
}
int BKE_scene_check_color_management_enabled(const Scene *scene)
bool BKE_scene_check_color_management_enabled(const Scene *scene)
{
return strcmp(scene->display_settings.display_device, "None") != 0;
}
int BKE_scene_check_rigidbody_active(const Scene *scene)
bool BKE_scene_check_rigidbody_active(const Scene *scene)
{
return scene && scene->rigidbody_world && scene->rigidbody_world->group && !(scene->rigidbody_world->flag & RBW_FLAG_MUTED);
}
+11 -11
View File
@@ -176,7 +176,7 @@ static void seq_free_strip(Strip *strip)
}
/* only give option to skip cache locally (static func) */
static void BKE_sequence_free_ex(Scene *scene, Sequence *seq, const int do_cache)
static void BKE_sequence_free_ex(Scene *scene, Sequence *seq, const bool do_cache)
{
if (seq->strip)
seq_free_strip(seq->strip);
@@ -752,7 +752,7 @@ void BKE_sequence_calc(Scene *scene, Sequence *seq)
}
/* note: caller should run BKE_sequence_calc(scene, seq) after */
void BKE_sequence_reload_new_file(Scene *scene, Sequence *seq, int lock_range)
void BKE_sequence_reload_new_file(Scene *scene, Sequence *seq, const bool lock_range)
{
char str[FILE_MAX];
int prev_startdisp = 0, prev_enddisp = 0;
@@ -1925,7 +1925,7 @@ int BKE_sequencer_input_have_to_preprocess(const SeqRenderData *UNUSED(context),
}
static ImBuf *input_preprocess(const SeqRenderData *context, Sequence *seq, float cfra, ImBuf *ibuf,
int is_proxy_image, int is_preprocessed)
const bool is_proxy_image, const bool is_preprocessed)
{
Scene *scene = context->scene;
float mul;
@@ -2457,11 +2457,11 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context, Sequence *seq
* -jahka
*/
const short is_rendering = G.is_rendering;
const short is_background = G.background;
const int do_seq_gl = is_rendering ?
0 /* (context->scene->r.seq_flag & R_SEQ_GL_REND) */ :
(context->scene->r.seq_flag & R_SEQ_GL_PREV);
const bool is_rendering = G.is_rendering;
const bool is_background = G.background;
const bool do_seq_gl = is_rendering ?
0 /* (context->scene->r.seq_flag & R_SEQ_GL_REND) */ :
(context->scene->r.seq_flag & R_SEQ_GL_PREV) != 0;
int do_seq;
// int have_seq = FALSE; /* UNUSED */
int have_comp = FALSE;
@@ -2756,12 +2756,12 @@ static ImBuf *do_render_strip_uncached(const SeqRenderData *context, Sequence *s
static ImBuf *seq_render_strip(const SeqRenderData *context, Sequence *seq, float cfra)
{
ImBuf *ibuf = NULL;
int use_preprocess = FALSE;
int is_proxy_image = FALSE;
bool use_preprocess = false;
bool is_proxy_image = false;
float nr = give_stripelem_index(seq, cfra);
/* all effects are handled similarly with the exception of speed effect */
int type = (seq->type & SEQ_TYPE_EFFECT && seq->type != SEQ_TYPE_SPEED) ? SEQ_TYPE_EFFECT : seq->type;
int is_preprocessed = !ELEM3(type, SEQ_TYPE_IMAGE, SEQ_TYPE_MOVIE, SEQ_TYPE_SCENE);
bool is_preprocessed = !ELEM3(type, SEQ_TYPE_IMAGE, SEQ_TYPE_MOVIE, SEQ_TYPE_SCENE);
ibuf = BKE_sequencer_cache_get(context, seq, cfra, SEQ_STRIPELEM_IBUF);
@@ -51,11 +51,11 @@
#include "BKE_lattice.h"
#include "BKE_deform.h"
#include "BKE_mesh.h"
#include "BKE_subsurf.h"
#include "BKE_mesh.h"
#include "BKE_editmesh.h"
#include "BLI_strict_flags.h"
/* for timing... */
#if 0
# include "PIL_time.h"
@@ -281,7 +281,6 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc, bool for
int i;
/* Options about projection direction */
const char use_normal = calc->smd->shrinkOpts;
const float proj_limit_squared = calc->smd->projLimit * calc->smd->projLimit;
float proj_axis[3] = {0.0f, 0.0f, 0.0f};
@@ -300,7 +299,7 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc, bool for
/* If the user doesn't allows to project in any direction of projection axis
* then theres nothing todo. */
if ((use_normal & (MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR | MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR)) == 0)
if ((calc->smd->shrinkOpts & (MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR | MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR)) == 0)
return;
@@ -370,7 +369,7 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc, bool for
hit.dist = 10000.0f; /* TODO: we should use FLT_MAX here, but sweepsphere code isn't prepared for that */
/* Project over positive direction of axis */
if (use_normal & MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR) {
if (calc->smd->shrinkOpts & MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR) {
if (auxData.tree) {
BKE_shrinkwrap_project_normal(0, tmp_co, tmp_no,
@@ -384,7 +383,7 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc, bool for
}
/* Project over negative direction of axis */
if (use_normal & MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR) {
if (calc->smd->shrinkOpts & MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR) {
float inv_no[3];
negate_v3_v3(inv_no, tmp_no);
+8 -8
View File
@@ -1230,7 +1230,7 @@ void txt_order_cursors(Text *text, const bool reverse)
}
}
int txt_has_sel(Text *text)
bool txt_has_sel(Text *text)
{
return ((text->curl != text->sell) || (text->curc != text->selc));
}
@@ -3010,7 +3010,7 @@ int text_check_bracket(const char ch)
}
/* TODO, have a function for operators - http://docs.python.org/py3k/reference/lexical_analysis.html#operators */
int text_check_delim(const char ch)
bool text_check_delim(const char ch)
{
int a;
char delims[] = "():\"\' ~!%^&*-+=[]{};/<>|.#\t,@";
@@ -3022,14 +3022,14 @@ int text_check_delim(const char ch)
return 0;
}
int text_check_digit(const char ch)
bool text_check_digit(const char ch)
{
if (ch < '0') return 0;
if (ch <= '9') return 1;
return 0;
}
int text_check_identifier(const char ch)
bool text_check_identifier(const char ch)
{
if (ch < '0') return 0;
if (ch <= '9') return 1;
@@ -3040,7 +3040,7 @@ int text_check_identifier(const char ch)
return 0;
}
int text_check_identifier_nodigit(const char ch)
bool text_check_identifier_nodigit(const char ch)
{
if (ch <= '9') return 0;
if (ch < 'A') return 0;
@@ -3051,18 +3051,18 @@ int text_check_identifier_nodigit(const char ch)
}
#ifndef WITH_PYTHON
int text_check_identifier_unicode(const unsigned int ch)
bool text_check_identifier_unicode(const unsigned int ch)
{
return (ch < 255 && text_check_identifier((char)ch));
}
int text_check_identifier_nodigit_unicode(const unsigned int ch)
bool text_check_identifier_nodigit_unicode(const unsigned int ch)
{
return (ch < 255 && text_check_identifier_nodigit((char)ch));
}
#endif /* WITH_PYTHON */
int text_check_whitespace(const char ch)
bool text_check_whitespace(const char ch)
{
if (ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n')
return 1;
+1 -1
View File
@@ -253,7 +253,7 @@ ColorBand *add_colorband(bool rangetype)
/* ------------------------------------------------------------------------- */
int do_colorband(const ColorBand *coba, float in, float out[4])
bool do_colorband(const ColorBand *coba, float in, float out[4])
{
const CBData *cbd1, *cbd2, *cbd0, *cbd3;
float fac, mfac, t[4];
@@ -94,7 +94,8 @@ static void track_context_free(void *customdata)
* for thread-safe tracking, allowing clip modifications during
* tracking.
*/
MovieTrackingContext *BKE_tracking_context_new(MovieClip *clip, MovieClipUser *user, short backwards, short sequence)
MovieTrackingContext *BKE_tracking_context_new(MovieClip *clip, MovieClipUser *user,
const bool backwards, const bool sequence)
{
MovieTrackingContext *context = MEM_callocN(sizeof(MovieTrackingContext), "trackingContext");
MovieTracking *tracking = &clip->tracking;
+1 -1
View File
@@ -423,7 +423,7 @@ static size_t unit_as_string(char *str, int len_max, double value, int prec, bUn
/* Used for drawing number buttons, try keep fast.
* Return the length of the generated string.
*/
size_t bUnit_AsString(char *str, int len_max, double value, int prec, int system, int type, int split, bool pad)
size_t bUnit_AsString(char *str, int len_max, double value, int prec, int system, int type, bool split, bool pad)
{
bUnitCollection *usys = unit_get_system(system, type);
@@ -1596,7 +1596,7 @@ void BKE_ffmpeg_codec_settings_verify(RenderData *rd)
ffmpeg_set_expert_options(rd);
}
int BKE_ffmpeg_alpha_channel_is_supported(RenderData *rd)
bool BKE_ffmpeg_alpha_channel_is_supported(RenderData *rd)
{
int codec = rd->ffcodecdata.codec;
+2 -2
View File
@@ -138,7 +138,7 @@ void BLI_removeArc(BGraph *graph, BArc *arc);
void BLI_flagNodes(BGraph *graph, int flag);
void BLI_flagArcs(BGraph *graph, int flag);
int BLI_hasAdjacencyList(BGraph *rg);
bool BLI_hasAdjacencyList(BGraph *rg);
void BLI_buildAdjacencyList(BGraph *rg);
void BLI_rebuildAdjacencyListForNode(BGraph *rg, BNode *node);
void BLI_freeAdjacencyList(BGraph *rg);
@@ -159,7 +159,7 @@ BNode *BLI_FindNodeByPosition(BGraph *graph, const float p[3], const float limit
BArc *BLI_findConnectedArc(BGraph *graph, BArc *arc, BNode *v);
int BLI_isGraphCyclic(BGraph *graph);
bool BLI_isGraphCyclic(BGraph *graph);
/*------------ Symmetry handling ------------*/
void BLI_markdownSymmetry(BGraph *graph, BNode *root_node, float limit);
+5 -5
View File
@@ -164,7 +164,7 @@ void BLI_freeAdjacencyList(BGraph *graph)
}
}
int BLI_hasAdjacencyList(BGraph *graph)
bool BLI_hasAdjacencyList(BGraph *graph)
{
BNode *node;
@@ -317,9 +317,9 @@ void BLI_ReflagSubgraph(BGraph *graph, int old_subgraph, int new_subgraph)
/*************************************** CYCLE DETECTION ***********************************************/
static int detectCycle(BNode *node, BArc *src_arc)
static bool detectCycle(BNode *node, BArc *src_arc)
{
int value = 0;
bool value = false;
if (node->flag == 0) {
int i;
@@ -343,10 +343,10 @@ static int detectCycle(BNode *node, BArc *src_arc)
return value;
}
int BLI_isGraphCyclic(BGraph *graph)
bool BLI_isGraphCyclic(BGraph *graph)
{
BNode *node;
int value = 0;
bool value = false;
/* NEED TO CHECK IF ADJACENCY LIST EXIST */
+1 -1
View File
@@ -39,7 +39,7 @@ typedef struct ProjCameraInfo {
float shiftx, shifty;
float rotmat[4][4];
float caminv[4][4];
short do_persp, do_pano, do_rotmat;
bool do_persp, do_pano, do_rotmat;
} ProjCameraInfo;
void BLI_uvproject_from_camera(float target[2], float source[3], ProjCameraInfo *uci)
+3 -3
View File
@@ -8703,11 +8703,11 @@ static int object_in_any_scene(Main *mainvar, Object *ob)
return 0;
}
static void give_base_to_objects(Main *mainvar, Scene *sce, Library *lib, const short idcode, const short is_link, const short active_lay)
static void give_base_to_objects(Main *mainvar, Scene *sce, Library *lib, const short idcode, const bool is_link, const short active_lay)
{
Object *ob;
Base *base;
const short is_group_append = (is_link==FALSE && idcode==ID_GR);
const bool is_group_append = (is_link == false && idcode == ID_GR);
/* give all objects which are LIB_INDIRECT a base, or for a group when *lib has been set */
for (ob = mainvar->object.first; ob; ob = ob->id.next) {
@@ -9015,7 +9015,7 @@ static void library_append_end(const bContext *C, Main *mainl, FileData **fd, in
/* give a base to loose objects. If group append, do it for objects too */
if (scene) {
const short is_link = (flag & FILE_LINK) != 0;
const bool is_link = (flag & FILE_LINK) != 0;
if (idcode == ID_SCE) {
/* don't instance anything when linking in scenes, assume the scene its self instances the data */
}
+2 -2
View File
@@ -3418,7 +3418,7 @@ static int write_file_handle(Main *mainvar, int handle, MemFile *compare, MemFil
/* do reverse file history: .blend1 -> .blend2, .blend -> .blend1 */
/* return: success(0), failure(1) */
static int do_history(const char *name, ReportList *reports)
static bool do_history(const char *name, ReportList *reports)
{
char tempname1[FILE_MAX], tempname2[FILE_MAX];
int hisnr= U.versions;
@@ -3524,7 +3524,7 @@ int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportL
/* file save to temporary file was successful */
/* now do reverse file history (move .blend1 -> .blend2, .blend -> .blend1) */
if (write_flags & G_FILE_HISTORY) {
int err_hist = do_history(filepath, reports);
const bool err_hist = do_history(filepath, reports);
if (err_hist) {
BKE_report(reports, RPT_ERROR, "Version backup failed (file saved with @)");
return 0;
+2 -2
View File
@@ -3004,7 +3004,7 @@ static BevVert *bevel_vert_construct(BMesh *bm, BevelParams *bp, BMVert *v)
}
/* Face f has at least one beveled vertex. Rebuild f */
static int bev_rebuild_polygon(BMesh *bm, BevelParams *bp, BMFace *f)
static bool bev_rebuild_polygon(BMesh *bm, BevelParams *bp, BMFace *f)
{
BMIter liter;
BMLoop *l, *lprev;
@@ -3013,7 +3013,7 @@ static int bev_rebuild_polygon(BMesh *bm, BevelParams *bp, BMFace *f)
EdgeHalf *e, *eprev;
VMesh *vm;
int i, k;
int do_rebuild = FALSE;
bool do_rebuild = false;
BMVert *bmv;
BMVert **vv = NULL;
BMVert **vv_fix = NULL;
@@ -859,7 +859,7 @@ static void rearrange_animchannel_flatten_islands(ListBase *islands, ListBase *s
/* ............................. */
/* performing rearranging of channels using islands */
static short rearrange_animchannel_islands(ListBase *list, AnimChanRearrangeFp rearrange_func, short mode, short type)
static bool rearrange_animchannel_islands(ListBase *list, AnimChanRearrangeFp rearrange_func, short mode, short type)
{
ListBase islands = {NULL, NULL};
Link *channel, *chanNext = NULL;
@@ -1027,7 +1027,7 @@ static void join_groups_action_temp(bAction *act)
static void rearrange_action_channels(bAnimContext *ac, bAction *act, short mode)
{
bActionGroup tgrp;
short do_channels;
bool do_channels;
/* get rearranging function */
AnimChanRearrangeFp rearrange_func = rearrange_get_mode_func(mode);
+4 -2
View File
@@ -502,7 +502,8 @@ static int add_driver_button_exec(bContext *C, wmOperator *op)
PointerRNA ptr = {{NULL}};
PropertyRNA *prop = NULL;
short success = 0;
int index, all = RNA_boolean_get(op->ptr, "all");
int index;
const bool all = RNA_boolean_get(op->ptr, "all");
/* try to create driver using property retrieved from UI */
uiContextActiveProperty(C, &ptr, &prop, &index);
@@ -556,7 +557,8 @@ static int remove_driver_button_exec(bContext *C, wmOperator *op)
PointerRNA ptr = {{NULL}};
PropertyRNA *prop = NULL;
short success = 0;
int index, all = RNA_boolean_get(op->ptr, "all");
int index;
const bool all = RNA_boolean_get(op->ptr, "all");
/* try to find driver using property retrieved from UI */
uiContextActiveProperty(C, &ptr, &prop, &index);
@@ -513,7 +513,7 @@ static void set_touched_actkeyblock(ActKeyBlock *ab)
/* --------- */
/* Checks if ActKeyBlock should exist... */
short actkeyblock_is_valid(ActKeyBlock *ab, DLRBT_Tree *keys)
bool actkeyblock_is_valid(ActKeyBlock *ab, DLRBT_Tree *keys)
{
ActKeyColumn *ak;
short startCurves, endCurves, totCurves;
@@ -73,7 +73,7 @@
* Not recommended to be used many times successively. For that
* there is delete_fcurve_keys().
*/
void delete_fcurve_key(FCurve *fcu, int index, short do_recalc)
void delete_fcurve_key(FCurve *fcu, int index, bool do_recalc)
{
/* sanity check */
if (fcu == NULL)
@@ -1649,7 +1649,8 @@ static int insert_key_button_exec(bContext *C, wmOperator *op)
char *path;
float cfra = (float)CFRA;
short success = 0;
int a, index, length, all = RNA_boolean_get(op->ptr, "all");
int a, index, length;
const bool all = RNA_boolean_get(op->ptr, "all");
short flag = 0;
/* flags for inserting keyframes */
@@ -1740,7 +1741,8 @@ static int delete_key_button_exec(bContext *C, wmOperator *op)
char *path;
float cfra = (float)CFRA; // XXX for now, don't bother about all the yucky offset crap
short success = 0;
int a, index, length, all = RNA_boolean_get(op->ptr, "all");
int a, index, length;
const bool all = RNA_boolean_get(op->ptr, "all");
/* try to insert keyframe using property retrieved from UI */
uiContextActiveProperty(C, &ptr, &prop, &index);
@@ -1809,7 +1811,8 @@ static int clear_key_button_exec(bContext *C, wmOperator *op)
PropertyRNA *prop = NULL;
char *path;
short success = 0;
int a, index, length, all = RNA_boolean_get(op->ptr, "all");
int a, index, length;
const bool all = RNA_boolean_get(op->ptr, "all");
/* try to insert keyframe using property retrieved from UI */
uiContextActiveProperty(C, &ptr, &prop, &index);
@@ -1898,7 +1901,7 @@ int autokeyframe_cfra_can_key(Scene *scene, ID *id)
/* --------------- API/Per-Datablock Handling ------------------- */
/* Checks if some F-Curve has a keyframe for a given frame */
short fcurve_frame_has_keyframe(FCurve *fcu, float frame, short filter)
bool fcurve_frame_has_keyframe(FCurve *fcu, float frame, short filter)
{
/* quick sanity check */
if (ELEM(NULL, fcu, fcu->bezt))
@@ -296,7 +296,7 @@ static int add_keyingset_button_exec(bContext *C, wmOperator *op)
char *path = NULL;
short success = 0;
int index = 0, pflag = 0;
int all = RNA_boolean_get(op->ptr, "all");
const bool all = RNA_boolean_get(op->ptr, "all");
/* verify the Keying Set to use:
* - use the active one for now (more control over this can be added later)
@@ -527,7 +527,7 @@ static int armature_extrude_exec(bContext *C, wmOperator *op)
bArmature *arm;
EditBone *newbone, *ebone, *flipbone, *first = NULL;
int a, totbone = 0, do_extrude;
int forked = RNA_boolean_get(op->ptr, "forked");
bool forked = RNA_boolean_get(op->ptr, "forked");
obedit = CTX_data_edit_object(C);
arm = obedit->data;
@@ -973,7 +973,7 @@ static int armature_select_hierarchy_exec(bContext *C, wmOperator *op)
bArmature *arm;
EditBone *curbone, *pabone, *chbone;
int direction = RNA_enum_get(op->ptr, "direction");
int add_to_sel = RNA_boolean_get(op->ptr, "extend");
const bool add_to_sel = RNA_boolean_get(op->ptr, "extend");
ob = obedit;
arm = (bArmature *)ob->data;
@@ -1147,7 +1147,7 @@ static int sk_addStrokeSnapPoint(bContext *C, SK_Sketch *sketch, SK_Stroke *stk,
return point_added;
}
static void sk_addStrokePoint(bContext *C, SK_Sketch *sketch, SK_Stroke *stk, SK_DrawData *dd, short snap)
static void sk_addStrokePoint(bContext *C, SK_Sketch *sketch, SK_Stroke *stk, SK_DrawData *dd, const bool snap)
{
ToolSettings *ts = CTX_data_tool_settings(C);
int point_added = 0;
@@ -1165,7 +1165,7 @@ static void sk_addStrokePoint(bContext *C, SK_Sketch *sketch, SK_Stroke *stk, SK
}
}
static void sk_getStrokePoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, SK_Stroke *stk, SK_DrawData *dd, short snap)
static void sk_getStrokePoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, SK_Stroke *stk, SK_DrawData *dd, const bool snap)
{
int point_added = 0;
@@ -2180,7 +2180,7 @@ static void sk_start_draw_gesture(SK_Sketch *sketch)
sketch->gesture = sk_createStroke();
}
static int sk_draw_stroke(bContext *C, SK_Sketch *sketch, SK_Stroke *stk, SK_DrawData *dd, short snap)
static int sk_draw_stroke(bContext *C, SK_Sketch *sketch, SK_Stroke *stk, SK_DrawData *dd, bool snap)
{
if (sk_stroke_filtermval(dd)) {
sk_addStrokePoint(C, sketch, stk, dd, snap);
@@ -2383,7 +2383,7 @@ static void sketch_draw_stroke_cancel(bContext *C, wmOperator *op)
static int sketch_draw_stroke(bContext *C, wmOperator *op, const wmEvent *event)
{
short snap = RNA_boolean_get(op->ptr, "snap");
const bool snap = RNA_boolean_get(op->ptr, "snap");
SK_DrawData *dd;
SK_Sketch *sketch = contextSketch(C, 1);
@@ -2408,7 +2408,7 @@ static void sketch_draw_gesture_cancel(bContext *C, wmOperator *op)
static int sketch_draw_gesture(bContext *C, wmOperator *op, const wmEvent *event)
{
short snap = RNA_boolean_get(op->ptr, "snap");
const bool snap = RNA_boolean_get(op->ptr, "snap");
SK_DrawData *dd;
SK_Sketch *sketch = contextSketch(C, 1); /* create just to be sure */
sk_cancelStroke(sketch);
@@ -2426,7 +2426,7 @@ static int sketch_draw_gesture(bContext *C, wmOperator *op, const wmEvent *event
static int sketch_draw_modal(bContext *C, wmOperator *op, const wmEvent *event, short gesture, SK_Stroke *stk)
{
short snap = RNA_boolean_get(op->ptr, "snap");
bool snap = RNA_boolean_get(op->ptr, "snap");
SK_DrawData *dd = op->customdata;
SK_Sketch *sketch = contextSketch(C, 1); /* create just to be sure */
int retval = OPERATOR_RUNNING_MODAL;
@@ -2434,7 +2434,7 @@ static int sketch_draw_modal(bContext *C, wmOperator *op, const wmEvent *event,
switch (event->type) {
case LEFTCTRLKEY:
case RIGHTCTRLKEY:
snap = event->ctrl;
snap = event->ctrl != 0;
RNA_boolean_set(op->ptr, "snap", snap);
break;
case MOUSEMOVE:
@@ -2496,7 +2496,7 @@ static int sketch_draw_gesture_modal(bContext *C, wmOperator *op, const wmEvent
static int sketch_draw_preview(bContext *C, wmOperator *op, const wmEvent *event)
{
short snap = RNA_boolean_get(op->ptr, "snap");
const bool snap = RNA_boolean_get(op->ptr, "snap");
SK_Sketch *sketch = contextSketch(C, 0);
if (sketch) {
@@ -526,8 +526,8 @@ static int pose_select_hierarchy_exec(bContext *C, wmOperator *op)
bArmature *arm = ob->data;
Bone *curbone, *pabone, *chbone;
int direction = RNA_enum_get(op->ptr, "direction");
int add_to_sel = RNA_boolean_get(op->ptr, "extend");
int found = 0;
const bool add_to_sel = RNA_boolean_get(op->ptr, "extend");
bool found = false;
CTX_DATA_BEGIN (C, bPoseChannel *, pchan, visible_pose_bones)
{
@@ -298,7 +298,7 @@ static void set_pose_keys(Object *ob)
*
* > returns: whether the bone that we pasted to if we succeeded
*/
static bPoseChannel *pose_bone_do_paste(Object *ob, bPoseChannel *chan, short selOnly, short flip)
static bPoseChannel *pose_bone_do_paste(Object *ob, bPoseChannel *chan, const bool selOnly, const bool flip)
{
bPoseChannel *pchan;
char name[MAXBONENAME];
@@ -459,8 +459,8 @@ static int pose_paste_exec(bContext *C, wmOperator *op)
Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C));
Scene *scene = CTX_data_scene(C);
bPoseChannel *chan;
int flip = RNA_boolean_get(op->ptr, "flipped");
int selOnly = RNA_boolean_get(op->ptr, "selected_mask");
const bool flip = RNA_boolean_get(op->ptr, "flipped");
bool selOnly = RNA_boolean_get(op->ptr, "selected_mask");
/* get KeyingSet to use */
KeyingSet *ks = ANIM_get_keyingset_for_autokeying(scene, ANIM_KS_WHOLE_CHARACTER_ID);
+2 -1
View File
@@ -3019,7 +3019,8 @@ static int hide_exec(bContext *C, wmOperator *op)
Nurb *nu;
BPoint *bp;
BezTriple *bezt;
int a, sel, invert = RNA_boolean_get(op->ptr, "unselected");
int a, sel;
const bool invert = RNA_boolean_get(op->ptr, "unselected");
for (nu = editnurb->first; nu; nu = nu->next) {
if (nu->type == CU_BEZIER) {
+1 -1
View File
@@ -631,7 +631,7 @@ static void txt_add_object(bContext *C, TextLine *firstline, int totline, const
WM_event_add_notifier(C, NC_OBJECT | NA_ADDED, obedit);
}
void ED_text_to_object(bContext *C, Text *text, int split_lines)
void ED_text_to_object(bContext *C, Text *text, const bool split_lines)
{
RegionView3D *rv3d = CTX_wm_region_view3d(C);
TextLine *line;
@@ -1655,12 +1655,12 @@ static int gp_convert_layer_exec(bContext *C, wmOperator *op)
static bool gp_convert_draw_check_prop(PointerRNA *ptr, PropertyRNA *prop)
{
const char *prop_id = RNA_property_identifier(prop);
int link_strokes = RNA_boolean_get(ptr, "use_link_strokes");
const bool link_strokes = RNA_boolean_get(ptr, "use_link_strokes");
int timing_mode = RNA_enum_get(ptr, "timing_mode");
bool realtime = RNA_boolean_get(ptr, "use_realtime");
float gap_duration = RNA_float_get(ptr, "gap_duration");
float gap_randomness = RNA_float_get(ptr, "gap_randomness");
int valid_timing = RNA_boolean_get(ptr, "use_timing_data");
const bool valid_timing = RNA_boolean_get(ptr, "use_timing_data");
/* Always show those props */
if (strcmp(prop_id, "type") == 0 ||
+1 -1
View File
@@ -78,7 +78,7 @@ 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, const bool split_lines);
bool ED_curve_select_nth(struct Curve *cu, int nth);
@@ -154,6 +154,6 @@ short compare_ak_cfraPtr(void *node, void *data);
short compare_ab_cfraPtr(void *node, void *data);
/* Checks if ActKeyBlock can be used (i.e. drawn/used to detect "holds") */
short actkeyblock_is_valid(ActKeyBlock *ab, struct DLRBT_Tree *keys);
bool actkeyblock_is_valid(ActKeyBlock *ab, struct DLRBT_Tree *keys);
#endif /* __ED_KEYFRAMES_DRAW_H__ */
@@ -236,7 +236,7 @@ void bezt_remap_times(KeyframeEditData *ked, struct BezTriple *bezt);
/* ************************************************ */
/* Destructive Editing API (keyframes_general.c) */
void delete_fcurve_key(struct FCurve *fcu, int index, short do_recalc);
void delete_fcurve_key(struct FCurve *fcu, int index, bool do_recalc);
bool delete_fcurve_keys(struct FCurve *fcu);
void clear_fcurve_keys(struct FCurve *fcu);
void duplicate_fcurve_keys(struct FCurve *fcu);
@@ -297,7 +297,7 @@ int autokeyframe_cfra_can_key(struct Scene *scene, struct ID *id);
/* Lesser Keyframe Checking API call:
* - Used for the buttons to check for keyframes...
*/
short fcurve_frame_has_keyframe(struct FCurve *fcu, float frame, short filter);
bool 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.
+2 -2
View File
@@ -60,7 +60,7 @@ void ED_mask_draw_region(struct Mask *mask, struct ARegion *ar,
const char draw_flag, const char draw_type, const char overlay_mode,
const int width_i, const int height_i,
const float aspx, const float aspy,
const short do_scale_applied, const short do_draw_cb,
const bool do_scale_applied, const bool do_draw_cb,
float stabmat[4][4],
const struct bContext *C);
@@ -76,7 +76,7 @@ short ED_masklayer_frames_looper(struct MaskLayer *masklay, struct Scene *scene,
short (*masklay_shape_cb)(struct MaskLayerShape *, struct Scene *));
void ED_masklayer_make_cfra_list(struct MaskLayer *masklay, ListBase *elems, short onlysel);
short ED_masklayer_frame_select_check(struct MaskLayer *masklay);
bool ED_masklayer_frame_select_check(struct MaskLayer *masklay);
void ED_masklayer_frame_select_set(struct MaskLayer *masklay, short mode);
void ED_masklayer_frames_select_border(struct MaskLayer *masklay, float min, float max, short select_mode);
void ED_mask_select_frames(struct MaskLayer *masklay, short select_mode);
+3 -3
View File
@@ -91,9 +91,9 @@ void ED_node_link_insert(struct ScrArea *sa);
/* node_edit.c */
void ED_node_set_tree_type(struct SpaceNode *snode, struct bNodeTreeType *typeinfo);
int ED_node_is_compositor(struct SpaceNode *snode);
int ED_node_is_shader(struct SpaceNode *snode);
int ED_node_is_texture(struct SpaceNode *snode);
bool ED_node_is_compositor(struct SpaceNode *snode);
bool ED_node_is_shader(struct SpaceNode *snode);
bool ED_node_is_texture(struct SpaceNode *snode);
void ED_node_shader_default(const struct bContext *C, struct ID *id);
void ED_node_composit_default(const struct bContext *C, struct Scene *scene);
@@ -34,11 +34,11 @@ struct SpaceSeq;
void ED_sequencer_select_sequence_single(struct Scene *scene, struct Sequence *seq, bool deselect_all);
void ED_sequencer_deselect_all(struct Scene *scene);
int ED_space_sequencer_maskedit_mask_poll(struct bContext *C);
int ED_space_sequencer_check_show_maskedit(struct SpaceSeq *sseq, struct Scene *scene);
int ED_space_sequencer_maskedit_poll(struct bContext *C);
int ED_space_sequencer_maskedit_mask_poll(struct bContext *C);
bool ED_space_sequencer_check_show_maskedit(struct SpaceSeq *sseq, struct Scene *scene);
int ED_space_sequencer_maskedit_poll(struct bContext *C);
int ED_space_sequencer_check_show_imbuf(struct SpaceSeq *sseq);
bool ED_space_sequencer_check_show_imbuf(struct SpaceSeq *sseq);
void ED_operatormacros_sequencer(void);
+1 -1
View File
@@ -1749,7 +1749,7 @@ void ui_convert_to_unit_alt_name(uiBut *but, char *str, size_t maxlen)
static void ui_get_but_string_unit(uiBut *but, char *str, int len_max, double value, bool pad, int float_precision)
{
UnitSettings *unit = but->block->unit;
int do_split = unit->flag & USER_UNIT_OPT_SPLIT;
int do_split = (unit->flag & USER_UNIT_OPT_SPLIT) != 0;
int unit_type = uiButGetUnitType(but);
int precision;
@@ -185,7 +185,8 @@ static int reset_default_button_exec(bContext *C, wmOperator *op)
{
PointerRNA ptr;
PropertyRNA *prop;
int index, all = RNA_boolean_get(op->ptr, "all");
int index;
const bool all = RNA_boolean_get(op->ptr, "all");
/* try to reset the nominated setting to its default value */
uiContextActiveProperty(C, &ptr, &prop, &index);
@@ -333,7 +334,8 @@ static int copy_to_selected_button_exec(bContext *C, wmOperator *op)
PointerRNA ptr, lptr, idptr;
PropertyRNA *prop, *lprop;
int success = 0;
int index, all = RNA_boolean_get(op->ptr, "all");
int index;
const bool all = RNA_boolean_get(op->ptr, "all");
/* try to reset the nominated setting to its default value */
uiContextActiveProperty(C, &ptr, &prop, &index);
@@ -303,8 +303,8 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
break;
case UI_ID_ALONE:
if (id) {
const int do_scene_obj = (GS(id->name) == ID_OB) &&
(template->ptr.type == &RNA_SceneObjects);
const bool do_scene_obj = (GS(id->name) == ID_OB) &&
(template->ptr.type == &RNA_SceneObjects);
/* make copy */
if (do_scene_obj) {
@@ -743,8 +743,8 @@ static void VIEW2D_OT_zoom_in(wmOperatorType *ot)
static int view_zoomout_exec(bContext *C, wmOperator *op)
{
ScrArea *sa = CTX_wm_area(C);
short do_zoom_x = true;
short do_zoom_y = true;
bool do_zoom_x = true;
bool do_zoom_y = true;
/* check that there's an active region, as View2D data resides there */
if (!view_zoom_poll(C))
+5 -5
View File
@@ -408,9 +408,9 @@ static int add_vertex_extrude(const bContext *C, Mask *mask, MaskLayer *masklay,
int point_index;
float tangent_point[2];
float tangent_co[2];
int do_cyclic_correct = FALSE;
int do_recalc_src = FALSE; /* when extruding from endpoints only */
int do_prev; /* use prev point rather then next?? */
bool do_cyclic_correct = false;
bool do_recalc_src = false; /* when extruding from endpoints only */
bool do_prev; /* use prev point rather then next?? */
if (!masklay) {
return FALSE;
@@ -584,8 +584,8 @@ static int add_vertex_exec(bContext *C, wmOperator *op)
MaskSpline *spline = masklay->act_spline;
MaskSplinePoint *point = masklay->act_point;
int is_sta = (point == spline->points);
int is_end = (point == &spline->points[spline->tot_point - 1]);
const bool is_sta = (point == spline->points);
const bool is_end = (point == &spline->points[spline->tot_point - 1]);
/* then check are we overlapping the mouse */
if ((is_sta || is_end) && equals_v2v2(co, point->bezt.vec[1])) {
+11 -11
View File
@@ -56,7 +56,7 @@
#include "mask_intern.h" /* own include */
static void mask_spline_color_get(MaskLayer *masklay, MaskSpline *spline, const int is_sel,
static void mask_spline_color_get(MaskLayer *masklay, MaskSpline *spline, const bool is_sel,
unsigned char r_rgb[4])
{
if (is_sel) {
@@ -76,7 +76,7 @@ static void mask_spline_color_get(MaskLayer *masklay, MaskSpline *spline, const
r_rgb[3] = 255;
}
static void mask_spline_feather_color_get(MaskLayer *UNUSED(masklay), MaskSpline *UNUSED(spline), const int is_sel,
static void mask_spline_feather_color_get(MaskLayer *UNUSED(masklay), MaskSpline *UNUSED(spline), const bool is_sel,
unsigned char r_rgb[4])
{
if (is_sel) {
@@ -136,7 +136,7 @@ static void mask_point_undistort_pos(SpaceClip *sc, float r_co[2], const float c
static void draw_spline_points(const bContext *C, MaskLayer *masklay, MaskSpline *spline,
const char UNUSED(draw_flag), const char draw_type)
{
const int is_spline_sel = (spline->flag & SELECT) && (masklay->restrictflag & MASK_RESTRICT_SELECT) == 0;
const bool is_spline_sel = (spline->flag & SELECT) && (masklay->restrictflag & MASK_RESTRICT_SELECT) == 0;
unsigned char rgb_spline[4];
MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline);
SpaceClip *sc = CTX_wm_space_clip(C);
@@ -212,7 +212,7 @@ static void draw_spline_points(const bContext *C, MaskLayer *masklay, MaskSpline
float handle[2];
float vert[2];
int has_handle = BKE_mask_point_has_handle(point);
const bool has_handle = BKE_mask_point_has_handle(point);
copy_v2_v2(vert, bezt->vec[1]);
BKE_mask_point_handle(point_deform, handle);
@@ -295,7 +295,7 @@ static void mask_color_active_tint(unsigned char r_rgb[4], const unsigned char r
}
static void mask_draw_curve_type(const bContext *C, MaskSpline *spline, float (*orig_points)[2], int tot_point,
const short is_feather, const short is_smooth, const short is_active,
const bool is_feather, const bool is_smooth, const bool is_active,
const unsigned char rgb_spline[4], const char draw_type)
{
const int draw_method = (spline->flag & MASK_SPLINE_CYCLIC) ? GL_LINE_LOOP : GL_LINE_STRIP;
@@ -407,7 +407,7 @@ static void mask_draw_curve_type(const bContext *C, MaskSpline *spline, float (*
static void draw_spline_curve(const bContext *C, MaskLayer *masklay, MaskSpline *spline,
const char draw_flag, const char draw_type,
const short is_active,
const bool is_active,
int width, int height)
{
const unsigned int resol = max_ii(BKE_mask_spline_feather_resolution(spline, width, height),
@@ -415,9 +415,9 @@ static void draw_spline_curve(const bContext *C, MaskLayer *masklay, MaskSpline
unsigned char rgb_tmp[4];
const short is_spline_sel = (spline->flag & SELECT) && (masklay->restrictflag & MASK_RESTRICT_SELECT) == 0;
const short is_smooth = (draw_flag & MASK_DRAWFLAG_SMOOTH);
const short is_fill = (spline->flag & MASK_SPLINE_NOFILL) == 0;
const bool is_spline_sel = (spline->flag & SELECT) && (masklay->restrictflag & MASK_RESTRICT_SELECT) == 0;
const bool is_smooth = (draw_flag & MASK_DRAWFLAG_SMOOTH) != 0;
const bool is_fill = (spline->flag & MASK_SPLINE_NOFILL) == 0;
unsigned int tot_diff_point;
float (*diff_points)[2];
@@ -489,7 +489,7 @@ static void draw_masklays(const bContext *C, Mask *mask, const char draw_flag, c
for (masklay = mask->masklayers.first, i = 0; masklay; masklay = masklay->next, i++) {
MaskSpline *spline;
const short is_active = (i == mask->masklay_act);
const bool is_active = (i == mask->masklay_act);
if (masklay->restrictflag & MASK_RESTRICT_VIEW) {
continue;
@@ -623,7 +623,7 @@ void ED_mask_draw_region(Mask *mask, ARegion *ar,
const char draw_flag, const char draw_type, const char overlay_mode,
const int width_i, const int height_i, /* convert directly into aspect corrected vars */
const float aspx, const float aspy,
const short do_scale_applied, const short do_draw_cb,
const bool do_scale_applied, const bool do_draw_cb,
float stabmat[4][4], /* optional - only used by clip */
const bContext *C /* optional - only used when do_post_draw is set or called from clip editor */
)
@@ -110,7 +110,7 @@ void ED_masklayer_make_cfra_list(MaskLayer *masklay, ListBase *elems, short only
/* Selection Tools */
/* check if one of the frames in this layer is selected */
short ED_masklayer_frame_select_check(MaskLayer *masklay)
bool ED_masklayer_frame_select_check(MaskLayer *masklay)
{
MaskLayerShape *masklay_shape;
+1 -1
View File
@@ -73,7 +73,7 @@ bool ED_mask_feather_find_nearest(
struct MaskSplinePoint *ED_mask_point_find_nearest(
const struct bContext *C, struct Mask *mask, const float normal_co[2], const float threshold,
struct MaskLayer **masklay_r, struct MaskSpline **spline_r, int *is_handle_r,
struct MaskLayer **masklay_r, struct MaskSpline **spline_r, bool *is_handle_r,
float *score);
void MASK_OT_layer_move(struct wmOperatorType *ot);
+4 -3
View File
@@ -60,7 +60,7 @@
/******************** utility functions *********************/
MaskSplinePoint *ED_mask_point_find_nearest(const bContext *C, Mask *mask, const float normal_co[2], const float threshold,
MaskLayer **masklay_r, MaskSpline **spline_r, int *is_handle_r,
MaskLayer **masklay_r, MaskSpline **spline_r, bool *is_handle_r,
float *score)
{
ScrArea *sa = CTX_wm_area(C);
@@ -471,8 +471,9 @@ static void *slide_point_customdata(bContext *C, wmOperator *op, const wmEvent *
MaskSpline *spline, *cv_spline, *feather_spline;
MaskSplinePoint *point, *cv_point, *feather_point;
MaskSplinePointUW *uw = NULL;
int is_handle = FALSE, width, height, action = SLIDE_ACTION_NONE;
int slide_feather = RNA_boolean_get(op->ptr, "slide_feather");
int width, height, action = SLIDE_ACTION_NONE;
bool is_handle = false;
const bool slide_feather = RNA_boolean_get(op->ptr, "slide_feather");
float co[2], cv_score, feather_score;
const float threshold = 19;
+2 -2
View File
@@ -256,7 +256,7 @@ static int select_exec(bContext *C, wmOperator *op)
bool deselect = RNA_boolean_get(op->ptr, "deselect");
bool toggle = RNA_boolean_get(op->ptr, "toggle");
int is_handle = 0;
bool is_handle = 0;
const float threshold = 19;
RNA_float_get_array(op->ptr, "location", co);
@@ -703,7 +703,7 @@ static int mask_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmE
float co[2];
int do_select = !RNA_boolean_get(op->ptr, "deselect");
int is_handle = 0;
bool is_handle = false;
const float threshold = 19;
bool changed = false;
+2 -2
View File
@@ -4950,7 +4950,7 @@ static int edbm_mark_freestyle_edge_exec(bContext *C, wmOperator *op)
BMEdge *eed;
BMIter iter;
FreestyleEdge *fed;
int clear = RNA_boolean_get(op->ptr, "clear");
const bool clear = RNA_boolean_get(op->ptr, "clear");
if (em == NULL)
return OPERATOR_FINISHED;
@@ -5012,7 +5012,7 @@ static int edbm_mark_freestyle_face_exec(bContext *C, wmOperator *op)
BMFace *efa;
BMIter iter;
FreestyleFace *ffa;
int clear = RNA_boolean_get(op->ptr, "clear");
const bool clear = RNA_boolean_get(op->ptr, "clear");
if (em == NULL) return OPERATOR_FINISHED;
+2 -2
View File
@@ -2092,7 +2092,7 @@ static int duplicate_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
int linked = RNA_boolean_get(op->ptr, "linked");
const bool linked = RNA_boolean_get(op->ptr, "linked");
int dupflag = (linked) ? 0 : U.dupflag;
BKE_main_id_clear_newpoins(bmain);
@@ -2161,7 +2161,7 @@ static int add_named_exec(bContext *C, wmOperator *op)
Scene *scene = CTX_data_scene(C);
Base *basen, *base;
Object *ob;
int linked = RNA_boolean_get(op->ptr, "linked");
const bool linked = RNA_boolean_get(op->ptr, "linked");
int dupflag = (linked) ? 0 : U.dupflag;
char name[MAX_ID_NAME - 2];
+1 -1
View File
@@ -770,7 +770,7 @@ static int objects_bake_render_modal(bContext *C, wmOperator *UNUSED(op), const
return OPERATOR_PASS_THROUGH;
}
static int is_multires_bake(Scene *scene)
static bool is_multires_bake(Scene *scene)
{
if (ELEM4(scene->r.bake_mode, RE_BAKE_NORMALS, RE_BAKE_DISPLACEMENT, RE_BAKE_DERIVATIVE, RE_BAKE_AO))
return scene->r.bake_flag & R_BAKE_MULTIRES;
@@ -1613,7 +1613,7 @@ static short get_new_constraint_target(bContext *C, int con_type, Object **tar_o
}
/* used by add constraint operators to add the constraint required */
static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase *list, int type, short setTarget)
static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase *list, int type, const bool setTarget)
{
Main *bmain = CTX_data_main(C);
bPoseChannel *pchan;
@@ -1907,7 +1907,7 @@ static int pose_ik_add_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED
static int pose_ik_add_exec(bContext *C, wmOperator *op)
{
Object *ob = CTX_data_active_object(C);
int with_targets = RNA_boolean_get(op->ptr, "with_targets");
const bool with_targets = RNA_boolean_get(op->ptr, "with_targets");
/* add the constraint - all necessary checks should have been done by the invoke() callback already... */
return constraint_add_exec(C, op, ob, get_active_constraints(ob), CONSTRAINT_TYPE_KINEMATIC, with_targets);
+1 -1
View File
@@ -1610,7 +1610,7 @@ static int object_mode_set_exec(bContext *C, wmOperator *op)
Object *ob = CTX_data_active_object(C);
ObjectMode mode = RNA_enum_get(op->ptr, "mode");
ObjectMode restore_mode = (ob) ? ob->mode : OB_MODE_OBJECT;
int toggle = RNA_boolean_get(op->ptr, "toggle");
const bool toggle = RNA_boolean_get(op->ptr, "toggle");
if (!ob || !object_mode_compat_test(ob, mode))
return OPERATOR_PASS_THROUGH;
@@ -1289,7 +1289,7 @@ static int multires_external_save_exec(bContext *C, wmOperator *op)
Object *ob = ED_object_active_context(C);
Mesh *me = (ob) ? ob->data : op->customdata;
char path[FILE_MAX];
int relative = RNA_boolean_get(op->ptr, "relative_path");
const bool relative = RNA_boolean_get(op->ptr, "relative_path");
if (!me)
return OPERATOR_CANCELLED;
@@ -2097,7 +2097,7 @@ static int ocean_bake_exec(bContext *C, wmOperator *op)
OceanCache *och;
struct Ocean *ocean;
int f, cfra, i = 0;
int free = RNA_boolean_get(op->ptr, "free");
const bool free = RNA_boolean_get(op->ptr, "free");
wmJob *wm_job;
OceanBakeJob *oj;

Some files were not shown because too many files have changed in this diff Show More