diff options
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r-- | source/blender/editors/object/object_bake.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_bake_api.c | 14 | ||||
-rw-r--r-- | source/blender/editors/object/object_modifier.cc | 10 | ||||
-rw-r--r-- | source/blender/editors/object/object_remesh.cc | 10 | ||||
-rw-r--r-- | source/blender/editors/object/object_transform.cc | 5 |
5 files changed, 21 insertions, 20 deletions
diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index 4b6ce69294f..91641de1605 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -461,7 +461,7 @@ static void init_multiresbake_job(bContext *C, MultiresBakeJob *bkj) CTX_DATA_END; } -static void multiresbake_startjob(void *bkv, short *stop, short *do_update, float *progress) +static void multiresbake_startjob(void *bkv, bool *stop, bool *do_update, float *progress) { MultiresBakerJobData *data; MultiresBakeJob *bkj = bkv; diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c index b8e5c4e5522..e69ccf5a50d 100644 --- a/source/blender/editors/object/object_bake_api.c +++ b/source/blender/editors/object/object_bake_api.c @@ -106,7 +106,7 @@ typedef struct BakeAPIRender { /* Progress Callbacks. */ float *progress; - short *do_update; + bool *do_update; /* Operator state. */ ReportList *reports; @@ -150,12 +150,12 @@ static int bake_modal(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) * for exec() when there is no render job * NOTE: this won't check for the escape key being pressed, but doing so isn't thread-safe. */ -static int bake_break(void *UNUSED(rjv)) +static bool bake_break(void *UNUSED(rjv)) { if (G.is_break) { - return 1; + return true; } - return 0; + return false; } static void bake_update_image(ScrArea *area, Image *image) @@ -467,8 +467,8 @@ static bool bake_object_check(const Scene *scene, } for (int i = 0; i < ob->totcol; i++) { - bNodeTree *ntree = NULL; - bNode *node = NULL; + const bNodeTree *ntree = NULL; + const bNode *node = NULL; const int mat_nr = i + 1; Image *image; ED_object_get_active_image(ob, mat_nr, &image, NULL, &node, &ntree); @@ -1854,7 +1854,7 @@ finally: return result; } -static void bake_startjob(void *bkv, short *UNUSED(stop), short *do_update, float *progress) +static void bake_startjob(void *bkv, bool *UNUSED(stop), bool *do_update, float *progress) { BakeAPIRender *bkr = (BakeAPIRender *)bkv; diff --git a/source/blender/editors/object/object_modifier.cc b/source/blender/editors/object/object_modifier.cc index 37fdcf41815..67399717c72 100644 --- a/source/blender/editors/object/object_modifier.cc +++ b/source/blender/editors/object/object_modifier.cc @@ -614,7 +614,7 @@ bool ED_object_modifier_convert_psys_to_mesh(ReportList * /*reports*/, if (k) { medge->v1 = cvert - 1; medge->v2 = cvert; - medge->flag = ME_EDGEDRAW | ME_EDGERENDER | ME_LOOSEEDGE; + medge->flag = ME_EDGEDRAW | ME_LOOSEEDGE; medge++; } else { @@ -633,7 +633,7 @@ bool ED_object_modifier_convert_psys_to_mesh(ReportList * /*reports*/, if (k) { medge->v1 = cvert - 1; medge->v2 = cvert; - medge->flag = ME_EDGEDRAW | ME_EDGERENDER | ME_LOOSEEDGE; + medge->flag = ME_EDGEDRAW | ME_LOOSEEDGE; medge++; } else { @@ -3048,7 +3048,7 @@ static bool ocean_bake_poll(bContext *C) struct OceanBakeJob { /* from wmJob */ struct Object *owner; - short *stop, *do_update; + bool *stop, *do_update; float *progress; int current_frame; struct OceanCache *och; @@ -3087,7 +3087,7 @@ static void oceanbake_update(void *customdata, float progress, int *cancel) *(oj->progress) = progress; } -static void oceanbake_startjob(void *customdata, short *stop, short *do_update, float *progress) +static void oceanbake_startjob(void *customdata, bool *stop, bool *do_update, float *progress) { OceanBakeJob *oj = static_cast<OceanBakeJob *>(customdata); @@ -3100,7 +3100,7 @@ static void oceanbake_startjob(void *customdata, short *stop, short *do_update, BKE_ocean_bake(oj->ocean, oj->och, oceanbake_update, (void *)oj); *do_update = true; - *stop = 0; + *stop = false; } static void oceanbake_endjob(void *customdata) diff --git a/source/blender/editors/object/object_remesh.cc b/source/blender/editors/object/object_remesh.cc index c3764b34469..b9acf5ae27b 100644 --- a/source/blender/editors/object/object_remesh.cc +++ b/source/blender/editors/object/object_remesh.cc @@ -654,7 +654,7 @@ enum eSymmetryAxes { struct QuadriFlowJob { /* from wmJob */ struct Object *owner; - short *stop, *do_update; + bool *stop, *do_update; float *progress; const struct wmOperator *op; @@ -836,7 +836,7 @@ static Mesh *remesh_symmetry_mirror(Object *ob, Mesh *mesh, eSymmetryAxes symmet return mesh_mirror; } -static void quadriflow_start_job(void *customdata, short *stop, short *do_update, float *progress) +static void quadriflow_start_job(void *customdata, bool *stop, bool *do_update, float *progress) { QuadriFlowJob *qj = static_cast<QuadriFlowJob *>(customdata); @@ -884,7 +884,7 @@ static void quadriflow_start_job(void *customdata, short *stop, short *do_update if (new_mesh == nullptr) { *do_update = true; - *stop = 0; + *stop = false; if (qj->success == 1) { /* This is not a user cancellation event. */ qj->success = 0; @@ -917,7 +917,7 @@ static void quadriflow_start_job(void *customdata, short *stop, short *do_update BKE_mesh_batch_cache_dirty_tag(static_cast<Mesh *>(ob->data), BKE_MESH_BATCH_DIRTY_ALL); *do_update = true; - *stop = 0; + *stop = false; } static void quadriflow_end_job(void *customdata) @@ -992,7 +992,7 @@ static int quadriflow_remesh_exec(bContext *C, wmOperator *op) if (op->flag == 0) { /* This is called directly from the exec operator, this operation is now blocking */ job->is_nonblocking_job = false; - short stop = 0, do_update = true; + bool stop = false, do_update = true; float progress; quadriflow_start_job(job, &stop, &do_update, &progress); quadriflow_end_job(job); diff --git a/source/blender/editors/object/object_transform.cc b/source/blender/editors/object/object_transform.cc index 0c2aca8b97b..7d0b62db827 100644 --- a/source/blender/editors/object/object_transform.cc +++ b/source/blender/editors/object/object_transform.cc @@ -7,6 +7,7 @@ #include <cstdlib> #include <cstring> +#include <limits> #include <numeric> #include "DNA_anim_types.h" @@ -1643,8 +1644,8 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) /* done */ } else if (around == V3D_AROUND_CENTER_BOUNDS) { - float3 min; - float3 max; + float3 min(std::numeric_limits<float>::max()); + float3 max(-std::numeric_limits<float>::max()); if (curves.bounds_min_max(min, max)) { cent = math::midpoint(min, max); } |