From 4c5502bfd690cad5c02aa6a0be0bd59400ef3407 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 5 May 2012 00:23:55 +0000 Subject: code cleanup: function naming for BLI functions. --- source/blender/blenkernel/intern/blender.c | 4 +-- source/blender/blenkernel/intern/displist.c | 12 +++---- source/blender/blenkernel/intern/editderivedmesh.c | 12 +++---- source/blender/blenkernel/intern/library.c | 6 ++-- source/blender/blenkernel/intern/mesh.c | 12 +++---- source/blender/blenkernel/intern/scene.c | 12 +++---- source/blender/blenlib/BLI_bitmap.h | 2 +- source/blender/blenlib/BLI_boxpack2d.h | 6 ++-- source/blender/blenlib/BLI_bpath.h | 30 ++++++++-------- source/blender/blenlib/BLI_callbacks.h | 8 ++--- source/blender/blenlib/BLI_jitter.h | 2 +- source/blender/blenlib/BLI_scanfill.h | 12 +++---- source/blender/blenlib/BLI_uvproject.h | 12 +++---- source/blender/blenlib/BLI_voxel.h | 10 +++--- source/blender/blenlib/intern/boxpack2d.c | 22 ++++++------ source/blender/blenlib/intern/bpath.c | 42 +++++++++++----------- source/blender/blenlib/intern/callbacks.c | 8 ++--- source/blender/blenlib/intern/jitter.c | 2 +- source/blender/blenlib/intern/scanfill.c | 22 ++++++------ source/blender/blenlib/intern/uvproject.c | 20 +++++------ source/blender/blenlib/intern/voxel.c | 16 ++++----- source/blender/blenloader/intern/writefile.c | 4 +-- source/blender/bmesh/operators/bmo_triangulate.c | 12 +++---- source/blender/editors/mesh/editmesh_knife.c | 12 +++---- source/blender/editors/render/render_opengl.c | 2 +- source/blender/editors/space_info/info_ops.c | 8 ++--- .../blender/editors/uvedit/uvedit_parametrizer.c | 6 ++-- source/blender/editors/uvedit/uvedit_unwrap_ops.c | 20 +++++------ source/blender/modifiers/intern/MOD_uvproject.c | 8 ++--- source/blender/python/intern/bpy.c | 8 ++--- source/blender/python/intern/bpy_app_handlers.c | 2 +- .../blender/python/mathutils/mathutils_geometry.c | 14 ++++---- source/blender/render/intern/source/initrender.c | 4 +-- source/blender/render/intern/source/pipeline.c | 20 +++++------ source/blender/render/intern/source/shadbuf.c | 2 +- .../blender/render/intern/source/volume_precache.c | 10 +++--- source/blender/render/intern/source/volumetric.c | 6 ++-- source/blender/render/intern/source/voxeldata.c | 10 +++--- source/blender/render/intern/source/zbuf.c | 2 +- source/blender/windowmanager/intern/wm_files.c | 8 ++--- source/blender/windowmanager/intern/wm_gesture.c | 12 +++---- source/creator/creator.c | 2 +- 42 files changed, 222 insertions(+), 222 deletions(-) diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 2b741d6d8eb..b0bfd2ee98d 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -110,7 +110,7 @@ void free_blender(void) IMB_exit(); - BLI_cb_finalize(); + BLI_callback_global_finalize(); seq_stripelem_cache_destruct(); IMB_moviecache_destruct(); @@ -173,7 +173,7 @@ static void clean_paths(Main *main) { Scene *scene; - bpath_traverse_main(main, clean_paths_visit_cb, BPATH_TRAVERSE_SKIP_MULTIFILE, NULL); + BLI_bpath_traverse_main(main, clean_paths_visit_cb, BLI_BPATH_TRAVERSE_SKIP_MULTIFILE, NULL); for (scene= main->scene.first; scene; scene= scene->id.next) { BLI_clean(scene->r.pic); diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index de61929aa18..cf7750520a3 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -432,7 +432,7 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal) totvert= 0; nextcol= 0; - BLI_begin_edgefill(&sf_ctx); + BLI_scanfill_begin(&sf_ctx); dl= dispbase->first; while (dl) { @@ -449,18 +449,18 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal) while (a--) { vlast= eve; - eve = BLI_addfillvert(&sf_ctx, f1); + eve = BLI_scanfill_vert_add(&sf_ctx, f1); totvert++; if (vlast==NULL) v1= eve; else { - BLI_addfilledge(&sf_ctx, vlast, eve); + BLI_scanfill_edge_add(&sf_ctx, vlast, eve); } f1+=3; } if (eve!=NULL && v1!=NULL) { - BLI_addfilledge(&sf_ctx, eve, v1); + BLI_scanfill_edge_add(&sf_ctx, eve, v1); } } else if (colnrcol) { @@ -473,7 +473,7 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal) dl= dl->next; } - if (totvert && (tot= BLI_edgefill(&sf_ctx, FALSE))) { // XXX (obedit && obedit->actcol)?(obedit->actcol-1):0)) { + if (totvert && (tot= BLI_scanfill_calc(&sf_ctx, FALSE))) { // XXX (obedit && obedit->actcol)?(obedit->actcol-1):0)) { if (tot) { dlnew= MEM_callocN(sizeof(DispList), "filldisplist"); dlnew->type= DL_INDEX3; @@ -518,7 +518,7 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal) BLI_addhead(to, dlnew); } - BLI_end_edgefill(&sf_ctx); + BLI_scanfill_end(&sf_ctx); if (nextcol) { /* stay at current char but fill polys with next material */ diff --git a/source/blender/blenkernel/intern/editderivedmesh.c b/source/blender/blenkernel/intern/editderivedmesh.c index 8d7ac99e2a3..428dc176e1d 100644 --- a/source/blender/blenkernel/intern/editderivedmesh.c +++ b/source/blender/blenkernel/intern/editderivedmesh.c @@ -196,18 +196,18 @@ static void BMEdit_RecalcTessellation_intern(BMEditMesh *tm) ScanFillFace *efa; int totfilltri; - BLI_begin_edgefill(&sf_ctx); + BLI_scanfill_begin(&sf_ctx); /*scanfill time*/ l = BM_iter_new(&liter, bm, BM_LOOPS_OF_FACE, f); for (j=0; l; l=BM_iter_step(&liter), j++) { /*mark order*/ BM_elem_index_set(l, j); /* set_loop */ - v = BLI_addfillvert(&sf_ctx, l->v->co); + v = BLI_scanfill_vert_add(&sf_ctx, l->v->co); v->tmp.p = l; if (lastv) { - /* e = */ BLI_addfilledge(&sf_ctx, lastv, v); + /* e = */ BLI_scanfill_edge_add(&sf_ctx, lastv, v); } lastv = v; @@ -215,9 +215,9 @@ static void BMEdit_RecalcTessellation_intern(BMEditMesh *tm) } /*complete the loop*/ - BLI_addfilledge(&sf_ctx, firstv, v); + BLI_scanfill_edge_add(&sf_ctx, firstv, v); - totfilltri = BLI_edgefill_ex(&sf_ctx, FALSE, f->no); + totfilltri = BLI_scanfill_calc_ex(&sf_ctx, FALSE, f->no); BLI_array_grow_items(looptris, totfilltri); for (efa = sf_ctx.fillfacebase.first; efa; efa=efa->next) { @@ -235,7 +235,7 @@ static void BMEdit_RecalcTessellation_intern(BMEditMesh *tm) i += 1; } - BLI_end_edgefill(&sf_ctx); + BLI_scanfill_end(&sf_ctx); } } diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 2924ea457a8..14ab8166f0a 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -135,9 +135,9 @@ void BKE_id_lib_local_paths(Main *bmain, Library *lib, ID *id) { char *bpath_user_data[2]= {bmain->name, lib->filepath}; - bpath_traverse_id(bmain, id, - bpath_relocate_visitor, - BPATH_TRAVERSE_SKIP_MULTIFILE, + BLI_bpath_traverse_id(bmain, id, + BLI_bpath_relocate_visitor, + BLI_BPATH_TRAVERSE_SKIP_MULTIFILE, bpath_user_data); } diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 6dd5923a803..4b14c2aec4b 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -2481,24 +2481,24 @@ int mesh_recalcTessellation(CustomData *fdata, ml = mloop + mp->loopstart; - BLI_begin_edgefill(&sf_ctx); + BLI_scanfill_begin(&sf_ctx); firstv = NULL; lastv = NULL; for (j=0; jtotloop; j++, ml++) { - v = BLI_addfillvert(&sf_ctx, mvert[ml->v].co); + v = BLI_scanfill_vert_add(&sf_ctx, mvert[ml->v].co); v->keyindex = mp->loopstart + j; if (lastv) - BLI_addfilledge(&sf_ctx, lastv, v); + BLI_scanfill_edge_add(&sf_ctx, lastv, v); if (!firstv) firstv = v; lastv = v; } - BLI_addfilledge(&sf_ctx, lastv, firstv); + BLI_scanfill_edge_add(&sf_ctx, lastv, firstv); - totfilltri = BLI_edgefill(&sf_ctx, FALSE); + totfilltri = BLI_scanfill_calc(&sf_ctx, FALSE); if (totfilltri) { BLI_array_grow_items(mface_to_poly_map, totfilltri); BLI_array_grow_items(mface, totfilltri); @@ -2531,7 +2531,7 @@ int mesh_recalcTessellation(CustomData *fdata, } } - BLI_end_edgefill(&sf_ctx); + BLI_scanfill_end(&sf_ctx); } } diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index c8f41f26c9b..c66aa375a13 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -1007,7 +1007,7 @@ static void scene_update_tagged_recursive(Main *bmain, Scene *scene, Scene *scen void scene_update_tagged(Main *bmain, Scene *scene) { /* keep this first */ - BLI_exec_cb(bmain, &scene->id, BLI_CB_EVT_SCENE_UPDATE_PRE); + BLI_callback_exec(bmain, &scene->id, BLI_CB_EVT_SCENE_UPDATE_PRE); /* flush recalc flags to dependencies */ DAG_ids_flush_tagged(bmain); @@ -1035,7 +1035,7 @@ void scene_update_tagged(Main *bmain, Scene *scene) BKE_ptcache_quick_cache_all(bmain, scene); /* notify editors and python about recalc */ - BLI_exec_cb(bmain, &scene->id, BLI_CB_EVT_SCENE_UPDATE_POST); + BLI_callback_exec(bmain, &scene->id, BLI_CB_EVT_SCENE_UPDATE_POST); DAG_ids_check_recalc(bmain, scene, FALSE); /* clear recalc flags */ @@ -1049,8 +1049,8 @@ void scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay) Scene *sce_iter; /* keep this first */ - BLI_exec_cb(bmain, &sce->id, BLI_CB_EVT_FRAME_CHANGE_PRE); - BLI_exec_cb(bmain, &sce->id, BLI_CB_EVT_SCENE_UPDATE_PRE); + BLI_callback_exec(bmain, &sce->id, BLI_CB_EVT_FRAME_CHANGE_PRE); + BLI_callback_exec(bmain, &sce->id, BLI_CB_EVT_SCENE_UPDATE_PRE); sound_set_cfra(sce->r.cfra); @@ -1084,8 +1084,8 @@ void scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay) scene_update_tagged_recursive(bmain, sce, sce); /* notify editors and python about recalc */ - BLI_exec_cb(bmain, &sce->id, BLI_CB_EVT_SCENE_UPDATE_POST); - BLI_exec_cb(bmain, &sce->id, BLI_CB_EVT_FRAME_CHANGE_POST); + BLI_callback_exec(bmain, &sce->id, BLI_CB_EVT_SCENE_UPDATE_POST); + BLI_callback_exec(bmain, &sce->id, BLI_CB_EVT_FRAME_CHANGE_POST); DAG_ids_check_recalc(bmain, sce, TRUE); diff --git a/source/blender/blenlib/BLI_bitmap.h b/source/blender/blenlib/BLI_bitmap.h index 2aed71a7d44..f19d6d6f465 100644 --- a/source/blender/blenlib/BLI_bitmap.h +++ b/source/blender/blenlib/BLI_bitmap.h @@ -69,7 +69,7 @@ typedef unsigned int* BLI_bitmap; /* set or clear the value of a single bit at '_index' */ #define BLI_BITMAP_MODIFY(_bitmap, _index, _set) \ do { \ - if(_set) \ + if (_set) \ BLI_BITMAP_SET(_bitmap, _index); \ else \ BLI_BITMAP_CLEAR(_bitmap, _index); \ diff --git a/source/blender/blenlib/BLI_boxpack2d.h b/source/blender/blenlib/BLI_boxpack2d.h index 7f92047b312..77e937d7b6f 100644 --- a/source/blender/blenlib/BLI_boxpack2d.h +++ b/source/blender/blenlib/BLI_boxpack2d.h @@ -34,7 +34,7 @@ /* Box Packer */ -typedef struct boxPack { +typedef struct BoxPack { float x; float y; float w; @@ -44,9 +44,9 @@ typedef struct boxPack { /* Verts this box uses * (BL,TR,TL,BR) / 0,1,2,3 */ struct boxVert *v[4]; -} boxPack; +} BoxPack; -void boxPack2D(boxPack *boxarray, const int len, float *tot_width, float *tot_height); +void BLI_box_pack_2D(BoxPack *boxarray, const int len, float *tot_width, float *tot_height); #endif diff --git a/source/blender/blenlib/BLI_bpath.h b/source/blender/blenlib/BLI_bpath.h index 91252d3beb5..27b373e6eb8 100644 --- a/source/blender/blenlib/BLI_bpath.h +++ b/source/blender/blenlib/BLI_bpath.h @@ -43,25 +43,25 @@ struct ReportList; * path has changed, and in that case, should write the result to pathOut. */ typedef int (*BPathVisitor)(void *userdata, char *path_dst, const char *path_src); /* Executes 'visit' for each path associated with 'id'. */ -void bpath_traverse_id(struct Main *bmain, struct ID *id, BPathVisitor visit_cb, const int flag, void *userdata); -void bpath_traverse_id_list(struct Main *bmain, struct ListBase *lb, BPathVisitor visit_cb, const int flag, void *userdata); -void bpath_traverse_main(struct Main *bmain, BPathVisitor visit_cb, const int flag, void *userdata); -int bpath_relocate_visitor(void *oldbasepath, char *path_dst, const char *path_src); +void BLI_bpath_traverse_id(struct Main *bmain, struct ID *id, BPathVisitor visit_cb, const int flag, void *userdata); +void BLI_bpath_traverse_id_list(struct Main *bmain, struct ListBase *lb, BPathVisitor visit_cb, const int flag, void *userdata); +void BLI_bpath_traverse_main(struct Main *bmain, BPathVisitor visit_cb, const int flag, void *userdata); +int BLI_bpath_relocate_visitor(void *oldbasepath, char *path_dst, const char *path_src); -#define BPATH_TRAVERSE_ABS (1<<0) /* convert paths to absolute */ -#define BPATH_TRAVERSE_SKIP_LIBRARY (1<<2) /* skip library paths */ -#define BPATH_TRAVERSE_SKIP_PACKED (1<<3) /* skip packed data */ -#define BPATH_TRAVERSE_SKIP_MULTIFILE (1<<4) /* skip paths where a single dir is used with an array of files, eg. - * sequence strip images and pointcache. in this case only use the first - * file, this is needed for directory manipulation functions which might - * otherwise modify the same directory multiple times */ +#define BLI_BPATH_TRAVERSE_ABS (1<<0) /* convert paths to absolute */ +#define BLI_BPATH_TRAVERSE_SKIP_LIBRARY (1<<2) /* skip library paths */ +#define BLI_BPATH_TRAVERSE_SKIP_PACKED (1<<3) /* skip packed data */ +#define BLI_BPATH_TRAVERSE_SKIP_MULTIFILE (1<<4) /* skip paths where a single dir is used with an array of files, eg. + * sequence strip images and pointcache. in this case only use the first + * file, this is needed for directory manipulation functions which might + * otherwise modify the same directory multiple times */ /* high level funcs */ /* creates a text file with missing files if there are any */ -void checkMissingFiles(struct Main *bmain, struct ReportList *reports); -void makeFilesRelative(struct Main *bmain, const char *basedir, struct ReportList *reports); -void makeFilesAbsolute(struct Main *bmain, const char *basedir, struct ReportList *reports); -void findMissingFiles(struct Main *bmain, const char *searchpath, struct ReportList *reports); +void BLI_bpath_missing_files_check(struct Main *bmain, struct ReportList *reports); +void BLI_bpath_missing_files_find(struct Main *bmain, const char *searchpath, struct ReportList *reports); +void BLI_bpath_relative_convert(struct Main *bmain, const char *basedir, struct ReportList *reports); +void BLI_bpath_absolute_convert(struct Main *bmain, const char *basedir, struct ReportList *reports); #endif // __BLI_BPATH_H__ diff --git a/source/blender/blenlib/BLI_callbacks.h b/source/blender/blenlib/BLI_callbacks.h index b32a1e272c8..bfc336781aa 100644 --- a/source/blender/blenlib/BLI_callbacks.h +++ b/source/blender/blenlib/BLI_callbacks.h @@ -62,11 +62,11 @@ typedef struct { } bCallbackFuncStore; -void BLI_exec_cb(struct Main *main, struct ID *self, eCbEvent evt); -void BLI_add_cb(bCallbackFuncStore *funcstore, eCbEvent evt); +void BLI_callback_exec(struct Main *main, struct ID *self, eCbEvent evt); +void BLI_callback_add(bCallbackFuncStore *funcstore, eCbEvent evt); -void BLI_cb_init(void); -void BLI_cb_finalize(void); +void BLI_callback_global_init(void); +void BLI_callback_global_finalize(void); /* This is blenlib internal only, unrelated to above */ diff --git a/source/blender/blenlib/BLI_jitter.h b/source/blender/blenlib/BLI_jitter.h index 9aa21a89521..c2a6250c154 100644 --- a/source/blender/blenlib/BLI_jitter.h +++ b/source/blender/blenlib/BLI_jitter.h @@ -32,7 +32,7 @@ * \ingroup bli */ -void BLI_initjit(float *jitarr, int num); +void BLI_jitter_init(float *jitarr, int num); void BLI_jitterate1(float *jit1, float *jit2, int num, float rad1); void BLI_jitterate2(float *jit1, float *jit2, int num, float rad2); diff --git a/source/blender/blenlib/BLI_scanfill.h b/source/blender/blenlib/BLI_scanfill.h index 26bcd50ef3e..081d5ccfb66 100644 --- a/source/blender/blenlib/BLI_scanfill.h +++ b/source/blender/blenlib/BLI_scanfill.h @@ -91,14 +91,14 @@ typedef struct ScanFillFace } ScanFillFace; /* scanfill.c: used in displist only... */ -struct ScanFillVert *BLI_addfillvert(ScanFillContext *sf_ctx, const float vec[3]); -struct ScanFillEdge *BLI_addfilledge(ScanFillContext *sf_ctx, struct ScanFillVert *v1, struct ScanFillVert *v2); +struct ScanFillVert *BLI_scanfill_vert_add(ScanFillContext *sf_ctx, const float vec[3]); +struct ScanFillEdge *BLI_scanfill_edge_add(ScanFillContext *sf_ctx, struct ScanFillVert *v1, struct ScanFillVert *v2); -int BLI_begin_edgefill(ScanFillContext *sf_ctx); -int BLI_edgefill(ScanFillContext *sf_ctx, const short do_quad_tri_speedup); -int BLI_edgefill_ex(ScanFillContext *sf_ctx, const short do_quad_tri_speedup, +int BLI_scanfill_begin(ScanFillContext *sf_ctx); +int BLI_scanfill_calc(ScanFillContext *sf_ctx, const short do_quad_tri_speedup); +int BLI_scanfill_calc_ex(ScanFillContext *sf_ctx, const short do_quad_tri_speedup, const float nor_proj[3]); -void BLI_end_edgefill(ScanFillContext *sf_ctx); +void BLI_scanfill_end(ScanFillContext *sf_ctx); /* These callbacks are needed to make the lib finction properly */ diff --git a/source/blender/blenlib/BLI_uvproject.h b/source/blender/blenlib/BLI_uvproject.h index 5abad87452c..516a9b8b237 100644 --- a/source/blender/blenlib/BLI_uvproject.h +++ b/source/blender/blenlib/BLI_uvproject.h @@ -24,22 +24,22 @@ * \ingroup bli */ -struct UvCameraInfo; +struct ProjCameraInfo; struct Object; /* create uv info from the camera, needs to be freed */ -struct UvCameraInfo *project_camera_info(struct Object *ob, float rotmat[4][4], float winx, float winy); +struct ProjCameraInfo *BLI_uvproject_camera_info(struct Object *ob, float rotmat[4][4], float winx, float winy); /* apply uv from uvinfo (camera) */ -void project_from_camera(float target[2], float source[3], struct UvCameraInfo *uci); +void BLI_uvproject_from_camera(float target[2], float source[3], struct ProjCameraInfo *uci); /* apply uv from perspective matrix */ -void project_from_view(float target[2], float source[3], float persmat[4][4], float rotmat[4][4], float winx, float winy); +void BLI_uvproject_from_view(float target[2], float source[3], float persmat[4][4], float rotmat[4][4], float winx, float winy); /* apply ortho uv's */ -void project_from_view_ortho(float target[2], float source[3], float rotmat[4][4]); +void BLI_uvproject_from_view_ortho(float target[2], float source[3], float rotmat[4][4]); /* so we can adjust scale with keeping the struct private */ -void project_camera_info_scale(struct UvCameraInfo *uci, float scale_x, float scale_y); +void BLI_uvproject_camera_info_scale(struct ProjCameraInfo *uci, float scale_x, float scale_y); #endif diff --git a/source/blender/blenlib/BLI_voxel.h b/source/blender/blenlib/BLI_voxel.h index 4a13810a705..4e9e6f111db 100644 --- a/source/blender/blenlib/BLI_voxel.h +++ b/source/blender/blenlib/BLI_voxel.h @@ -33,12 +33,12 @@ */ /** find the index number of a voxel, given x/y/z integer coords and resolution vector */ -#define V_I(x, y, z, res) ( (z)*(res)[1]*(res)[0] + (y)*(res)[0] + (x) ) +#define BLI_VEXEL_INDEX(x, y, z, res) ((z) * (res)[1] * (res)[0] + (y) * (res)[0] + (x)) /* all input coordinates must be in bounding box 0.0 - 1.0 */ -float voxel_sample_nearest(float *data, const int res[3], const float co[3]); -float voxel_sample_trilinear(float *data, const int res[3], const float co[3]); -float voxel_sample_triquadratic(float *data, const int res[3], const float co[3]); -float voxel_sample_tricubic(float *data, const int res[3], const float co[3], int bspline); +float BLI_voxel_sample_nearest(float *data, const int res[3], const float co[3]); +float BLI_voxel_sample_trilinear(float *data, const int res[3], const float co[3]); +float BLI_voxel_sample_triquadratic(float *data, const int res[3], const float co[3]); +float BLI_voxel_sample_tricubic(float *data, const int res[3], const float co[3], int bspline); #endif /* __BLI_VOXEL_H__ */ diff --git a/source/blender/blenlib/intern/boxpack2d.c b/source/blender/blenlib/intern/boxpack2d.c index 6631e36fc72..f1931d35819 100644 --- a/source/blender/blenlib/intern/boxpack2d.c +++ b/source/blender/blenlib/intern/boxpack2d.c @@ -38,14 +38,14 @@ typedef struct boxVert { float y; short free; - struct boxPack *trb; /* top right box */ - struct boxPack *blb; /* bottom left box */ - struct boxPack *brb; /* bottom right box */ - struct boxPack *tlb; /* top left box */ + struct BoxPack *trb; /* top right box */ + struct BoxPack *blb; /* bottom left box */ + struct BoxPack *brb; /* bottom right box */ + struct BoxPack *tlb; /* top left box */ /* Store last intersecting boxes here * speedup intersection testing */ - struct boxPack *isect_cache[4]; + struct BoxPack *isect_cache[4]; int index; } boxVert; @@ -105,7 +105,7 @@ typedef struct boxVert { /* qsort function - sort largest to smallest */ static int box_areasort(const void *p1, const void *p2) { - const boxPack *b1 = p1, *b2 = p2; + const BoxPack *b1 = p1, *b2 = p2; const float a1 = BOXAREA(b1); const float a2 = BOXAREA(b2); @@ -152,12 +152,12 @@ static int vertex_sort(const void *p1, const void *p2) * len - the number of boxes in the array. * tot_width and tot_height are set so you can normalize the data. * */ -void boxPack2D(boxPack *boxarray, const int len, float *tot_width, float *tot_height) +void BLI_box_pack_2D(BoxPack *boxarray, const int len, float *tot_width, float *tot_height) { boxVert *vert; /* the current vert */ int box_index, verts_pack_len, i, j, k, isect; int quad_flags[4] = {BLF, TRF, TLF, BRF}; /* use for looping */ - boxPack *box, *box_test; /*current box and another for intersection tests*/ + BoxPack *box, *box_test; /*current box and another for intersection tests*/ int *vertex_pack_indices; /*an array of indices used for sorting verts*/ if (!len) { @@ -167,11 +167,11 @@ void boxPack2D(boxPack *boxarray, const int len, float *tot_width, float *tot_he } /* Sort boxes, biggest first */ - qsort(boxarray, len, sizeof(boxPack), box_areasort); + qsort(boxarray, len, sizeof(BoxPack), box_areasort); /* add verts to the boxes, these are only used internally */ - vert = vertarray = MEM_mallocN(len * 4 * sizeof(boxVert), "boxPack Verts"); - vertex_pack_indices = MEM_mallocN(len * 3 * sizeof(int), "boxPack Indices"); + vert = vertarray = MEM_mallocN(len * 4 * sizeof(boxVert), "BoxPack Verts"); + vertex_pack_indices = MEM_mallocN(len * 3 * sizeof(int), "BoxPack Indices"); for (box = boxarray, box_index = 0, i = 0; box_index < len; box_index++, box++) { diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c index 739c4e00cc7..48912eb927a 100644 --- a/source/blender/blenlib/intern/bpath.c +++ b/source/blender/blenlib/intern/bpath.c @@ -92,9 +92,9 @@ static int checkMissingFiles_visit_cb(void *userdata, char *UNUSED(path_dst), co } /* high level function */ -void checkMissingFiles(Main *bmain, ReportList *reports) +void BLI_bpath_missing_files_check(Main *bmain, ReportList *reports) { - bpath_traverse_main(bmain, checkMissingFiles_visit_cb, BPATH_TRAVERSE_ABS, reports); + BLI_bpath_traverse_main(bmain, checkMissingFiles_visit_cb, BLI_BPATH_TRAVERSE_ABS, reports); } typedef struct BPathRemap_Data { @@ -129,7 +129,7 @@ static int makeFilesRelative_visit_cb(void *userdata, char *path_dst, const char } } -void makeFilesRelative(Main *bmain, const char *basedir, ReportList *reports) +void BLI_bpath_relative_convert(Main *bmain, const char *basedir, ReportList *reports) { BPathRemap_Data data = {NULL}; @@ -141,7 +141,7 @@ void makeFilesRelative(Main *bmain, const char *basedir, ReportList *reports) data.basedir = basedir; data.reports = reports; - bpath_traverse_main(bmain, makeFilesRelative_visit_cb, 0, (void *)&data); + BLI_bpath_traverse_main(bmain, makeFilesRelative_visit_cb, 0, (void *)&data); BKE_reportf(reports, data.count_failed ? RPT_WARNING : RPT_INFO, "Total files %d|Changed %d|Failed %d", @@ -171,8 +171,8 @@ static int makeFilesAbsolute_visit_cb(void *userdata, char *path_dst, const char } } -/* similar to makeFilesRelative - keep in sync! */ -void makeFilesAbsolute(Main *bmain, const char *basedir, ReportList *reports) +/* similar to BLI_bpath_relative_convert - keep in sync! */ +void BLI_bpath_absolute_convert(Main *bmain, const char *basedir, ReportList *reports) { BPathRemap_Data data = {NULL}; @@ -184,7 +184,7 @@ void makeFilesAbsolute(Main *bmain, const char *basedir, ReportList *reports) data.basedir = basedir; data.reports = reports; - bpath_traverse_main(bmain, makeFilesAbsolute_visit_cb, 0, (void *)&data); + BLI_bpath_traverse_main(bmain, makeFilesAbsolute_visit_cb, 0, (void *)&data); BKE_reportf(reports, data.count_failed ? RPT_WARNING : RPT_INFO, "Total files %d|Changed %d|Failed %d", @@ -293,14 +293,14 @@ static int findMissingFiles_visit_cb(void *userdata, char *path_dst, const char } } -void findMissingFiles(Main *bmain, const char *searchpath, ReportList *reports) +void BLI_bpath_missing_files_find(Main *bmain, const char *searchpath, ReportList *reports) { struct BPathFind_Data data = {NULL}; data.reports = reports; BLI_split_dir_part(searchpath, data.searchdir, sizeof(data.searchdir)); - bpath_traverse_main(bmain, findMissingFiles_visit_cb, 0, (void *)&data); + BLI_bpath_traverse_main(bmain, findMissingFiles_visit_cb, 0, (void *)&data); } /* Run a visitor on a string, replacing the contents of the string as needed. */ @@ -378,19 +378,19 @@ static int rewrite_path_alloc(char **path, BPathVisitor visit_cb, const char *ab } /* Run visitor function 'visit' on all paths contained in 'id'. */ -void bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int flag, void *bpath_user_data) +void BLI_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int flag, void *bpath_user_data) { Image *ima; - const char *absbase = (flag & BPATH_TRAVERSE_ABS) ? ID_BLEND_PATH(bmain, id) : NULL; + const char *absbase = (flag & BLI_BPATH_TRAVERSE_ABS) ? ID_BLEND_PATH(bmain, id) : NULL; - if ((flag & BPATH_TRAVERSE_SKIP_LIBRARY) && id->lib) { + if ((flag & BLI_BPATH_TRAVERSE_SKIP_LIBRARY) && id->lib) { return; } switch (GS(id->name)) { case ID_IM: ima= (Image *)id; - if (ima->packedfile == NULL || (flag & BPATH_TRAVERSE_SKIP_PACKED) == 0) { + if (ima->packedfile == NULL || (flag & BLI_BPATH_TRAVERSE_SKIP_PACKED) == 0) { if (ELEM3(ima->source, IMA_SRC_FILE, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) { rewrite_path_fixed(ima->name, visit_cb, absbase, bpath_user_data); } @@ -470,7 +470,7 @@ void bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int fla case ID_SO: { bSound *sound= (bSound *)id; - if (sound->packedfile == NULL || (flag & BPATH_TRAVERSE_SKIP_PACKED) == 0) { + if (sound->packedfile == NULL || (flag & BLI_BPATH_TRAVERSE_SKIP_PACKED) == 0) { rewrite_path_fixed(sound->name, visit_cb, absbase, bpath_user_data); } } @@ -483,7 +483,7 @@ void bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int fla case ID_VF: { VFont *vf= (VFont *)id; - if (vf->packedfile == NULL || (flag & BPATH_TRAVERSE_SKIP_PACKED) == 0) { + if (vf->packedfile == NULL || (flag & BLI_BPATH_TRAVERSE_SKIP_PACKED) == 0) { if (strcmp(vf->name, FO_BUILTIN_NAME) != 0) { rewrite_path_fixed(((VFont *)id)->name, visit_cb, absbase, bpath_user_data); } @@ -523,7 +523,7 @@ void bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int fla int len= MEM_allocN_len(se) / sizeof(*se); int i; - if (flag & BPATH_TRAVERSE_SKIP_MULTIFILE) { + if (flag & BLI_BPATH_TRAVERSE_SKIP_MULTIFILE) { /* only operate on one path */ len= MIN2(1, len); } @@ -575,26 +575,26 @@ void bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int fla } } -void bpath_traverse_id_list(Main *bmain, ListBase *lb, BPathVisitor visit_cb, const int flag, void *bpath_user_data) +void BLI_bpath_traverse_id_list(Main *bmain, ListBase *lb, BPathVisitor visit_cb, const int flag, void *bpath_user_data) { ID *id; for (id = lb->first; id; id = id->next) { - bpath_traverse_id(bmain, id, visit_cb, flag, bpath_user_data); + BLI_bpath_traverse_id(bmain, id, visit_cb, flag, bpath_user_data); } } -void bpath_traverse_main(Main *bmain, BPathVisitor visit_cb, const int flag, void *bpath_user_data) +void BLI_bpath_traverse_main(Main *bmain, BPathVisitor visit_cb, const int flag, void *bpath_user_data) { ListBase *lbarray[MAX_LIBARRAY]; int a = set_listbasepointers(bmain, lbarray); while (a--) { - bpath_traverse_id_list(bmain, lbarray[a], visit_cb, flag, bpath_user_data); + BLI_bpath_traverse_id_list(bmain, lbarray[a], visit_cb, flag, bpath_user_data); } } /* Rewrites a relative path to be relative to the main file - unless the path is * absolute, in which case it is not altered. */ -int bpath_relocate_visitor(void *pathbase_v, char *path_dst, const char *path_src) +int BLI_bpath_relocate_visitor(void *pathbase_v, char *path_dst, const char *path_src) { /* be sure there is low chance of the path being too short */ char filepath[(FILE_MAXDIR * 2) + FILE_MAXFILE]; diff --git a/source/blender/blenlib/intern/callbacks.c b/source/blender/blenlib/intern/callbacks.c index 0cb986d9090..876599f7480 100644 --- a/source/blender/blenlib/intern/callbacks.c +++ b/source/blender/blenlib/intern/callbacks.c @@ -28,7 +28,7 @@ static ListBase callback_slots[BLI_CB_EVT_TOT]= {{NULL}}; -void BLI_exec_cb(struct Main *main, struct ID *self, eCbEvent evt) +void BLI_callback_exec(struct Main *main, struct ID *self, eCbEvent evt) { ListBase *lb= &callback_slots[evt]; bCallbackFuncStore *funcstore; @@ -38,19 +38,19 @@ void BLI_exec_cb(struct Main *main, struct ID *self, eCbEvent evt) } } -void BLI_add_cb(bCallbackFuncStore *funcstore, eCbEvent evt) +void BLI_callback_add(bCallbackFuncStore *funcstore, eCbEvent evt) { ListBase *lb= &callback_slots[evt]; BLI_addtail(lb, funcstore); } -void BLI_cb_init(void) +void BLI_callback_global_init(void) { /* do nothing */ } /* call on application exit */ -void BLI_cb_finalize(void) +void BLI_callback_global_finalize(void) { eCbEvent evt; for (evt= 0; evt < BLI_CB_EVT_TOT; evt++) { diff --git a/source/blender/blenlib/intern/jitter.c b/source/blender/blenlib/intern/jitter.c index c7977378f6a..afe31fb1377 100644 --- a/source/blender/blenlib/intern/jitter.c +++ b/source/blender/blenlib/intern/jitter.c @@ -136,7 +136,7 @@ void BLI_jitterate2(float *jit1, float *jit2, int num, float rad2) } -void BLI_initjit(float *jitarr, int num) +void BLI_jitter_init(float *jitarr, int num) { float *jit2, x, rad1, rad2, rad3; int i; diff --git a/source/blender/blenlib/intern/scanfill.c b/source/blender/blenlib/intern/scanfill.c index 25850e14ae7..503de31616a 100644 --- a/source/blender/blenlib/intern/scanfill.c +++ b/source/blender/blenlib/intern/scanfill.c @@ -99,7 +99,7 @@ typedef struct ScanFillVertLink { #define SF_VERT_ZERO_LEN 255 /* Optionally set ScanFillEdge f to this to mark original boundary edges. - * Only needed if there are internal diagonal edges passed to BLI_edgefill. */ + * Only needed if there are internal diagonal edges passed to BLI_scanfill_calc. */ #define SF_EDGE_BOUNDARY 1 #define SF_EDGE_UNKNOWN 2 /* TODO, what is this for exactly? - need to document it! */ @@ -191,7 +191,7 @@ static void mem_element_reset(ScanFillContext *sf_ctx, int keep_first) sf_ctx->melem__offs = 0; } -void BLI_end_edgefill(ScanFillContext *sf_ctx) +void BLI_scanfill_end(ScanFillContext *sf_ctx) { mem_element_reset(sf_ctx, FALSE); @@ -202,7 +202,7 @@ void BLI_end_edgefill(ScanFillContext *sf_ctx) /* **** FILL ROUTINES *************************** */ -ScanFillVert *BLI_addfillvert(ScanFillContext *sf_ctx, const float vec[3]) +ScanFillVert *BLI_scanfill_vert_add(ScanFillContext *sf_ctx, const float vec[3]) { ScanFillVert *eve; @@ -214,7 +214,7 @@ ScanFillVert *BLI_addfillvert(ScanFillContext *sf_ctx, const float vec[3]) return eve; } -ScanFillEdge *BLI_addfilledge(ScanFillContext *sf_ctx, ScanFillVert *v1, ScanFillVert *v2) +ScanFillEdge *BLI_scanfill_edge_add(ScanFillContext *sf_ctx, ScanFillVert *v1, ScanFillVert *v2) { ScanFillEdge *newed; @@ -453,7 +453,7 @@ static void testvertexnearedge(ScanFillContext *sf_ctx) const float dist = dist_to_line_v2(eed->v1->xy, eed->v2->xy, eve->xy); if (dist < SF_EPSILON) { /* new edge */ - ed1 = BLI_addfilledge(sf_ctx, eed->v1, eve); + ed1 = BLI_scanfill_edge_add(sf_ctx, eed->v1, eve); /* printf("fill: vertex near edge %x\n",eve); */ ed1->f = 0; @@ -681,7 +681,7 @@ static int scanfill(ScanFillContext *sf_ctx, PolyFill *pf) /* make new edge, and start over */ /* printf("add new edge %x %x and start again\n",v2,sc1->v1); */ - ed3 = BLI_addfilledge(sf_ctx, v2, sc1->v1); + ed3 = BLI_scanfill_edge_add(sf_ctx, v2, sc1->v1); BLI_remlink(&sf_ctx->filledgebase, ed3); BLI_insertlinkbefore((ListBase *)&(sc->first), ed2, ed3); ed3->v2->f = SF_VERT_UNKNOWN; @@ -709,7 +709,7 @@ static int scanfill(ScanFillContext *sf_ctx, PolyFill *pf) } /* new edge */ - ed3 = BLI_addfilledge(sf_ctx, v1, v3); + ed3 = BLI_scanfill_edge_add(sf_ctx, v1, v3); BLI_remlink(&sf_ctx->filledgebase, ed3); ed3->f = SF_EDGE_UNKNOWN; ed3->v1->h++; @@ -764,19 +764,19 @@ static int scanfill(ScanFillContext *sf_ctx, PolyFill *pf) } -int BLI_begin_edgefill(ScanFillContext *sf_ctx) +int BLI_scanfill_begin(ScanFillContext *sf_ctx) { memset(sf_ctx, 0, sizeof(*sf_ctx)); return 1; } -int BLI_edgefill(ScanFillContext *sf_ctx, const short do_quad_tri_speedup) +int BLI_scanfill_calc(ScanFillContext *sf_ctx, const short do_quad_tri_speedup) { - return BLI_edgefill_ex(sf_ctx, do_quad_tri_speedup, NULL); + return BLI_scanfill_calc_ex(sf_ctx, do_quad_tri_speedup, NULL); } -int BLI_edgefill_ex(ScanFillContext *sf_ctx, const short do_quad_tri_speedup, const float nor_proj[3]) +int BLI_scanfill_calc_ex(ScanFillContext *sf_ctx, const short do_quad_tri_speedup, const float nor_proj[3]) { /* * - fill works with its own lists, so create that first (no faces!) diff --git a/source/blender/blenlib/intern/uvproject.c b/source/blender/blenlib/intern/uvproject.c index 268b4cbe4a3..a630084e79d 100644 --- a/source/blender/blenlib/intern/uvproject.c +++ b/source/blender/blenlib/intern/uvproject.c @@ -32,7 +32,7 @@ #include "BLI_math.h" #include "BLI_uvproject.h" -typedef struct UvCameraInfo { +typedef struct ProjCameraInfo { float camangle; float camsize; float xasp, yasp; @@ -40,9 +40,9 @@ typedef struct UvCameraInfo { float rotmat[4][4]; float caminv[4][4]; short do_persp, do_pano, do_rotmat; -} UvCameraInfo; +} ProjCameraInfo; -void project_from_camera(float target[2], float source[3], UvCameraInfo *uci) +void BLI_uvproject_from_camera(float target[2], float source[3], ProjCameraInfo *uci) { float pv4[4]; @@ -93,7 +93,7 @@ void project_from_camera(float target[2], float source[3], UvCameraInfo *uci) } /* could rv3d->persmat */ -void project_from_view(float target[2], float source[3], float persmat[4][4], float rotmat[4][4], float winx, float winy) +void BLI_uvproject_from_view(float target[2], float source[3], float persmat[4][4], float rotmat[4][4], float winx, float winy) { float pv[3], pv4[4], x = 0.0, y = 0.0; @@ -133,9 +133,9 @@ void project_from_view(float target[2], float source[3], float persmat[4][4], fl /* 'rotmat' can be obedit->obmat when uv project is used. * 'winx' and 'winy' can be from scene->r.xsch/ysch */ -UvCameraInfo *project_camera_info(Object *ob, float(*rotmat)[4], float winx, float winy) +ProjCameraInfo *BLI_uvproject_camera_info(Object *ob, float(*rotmat)[4], float winx, float winy) { - UvCameraInfo uci; + ProjCameraInfo uci; Camera *camera = ob->data; uci.do_pano = (camera->type == CAM_PANO); @@ -149,7 +149,7 @@ UvCameraInfo *project_camera_info(Object *ob, float(*rotmat)[4], float winx, flo normalize_m4(uci.caminv); if (invert_m4(uci.caminv)) { - UvCameraInfo *uci_pt; + ProjCameraInfo *uci_pt; /* normal projection */ if (rotmat) { @@ -174,7 +174,7 @@ UvCameraInfo *project_camera_info(Object *ob, float(*rotmat)[4], float winx, flo uci.shiftx = 0.5f - (camera->shiftx * uci.xasp); uci.shifty = 0.5f - (camera->shifty * uci.yasp); - uci_pt = MEM_mallocN(sizeof(UvCameraInfo), "UvCameraInfo"); + uci_pt = MEM_mallocN(sizeof(ProjCameraInfo), "ProjCameraInfo"); *uci_pt = uci; return uci_pt; } @@ -182,7 +182,7 @@ UvCameraInfo *project_camera_info(Object *ob, float(*rotmat)[4], float winx, flo return NULL; } -void project_from_view_ortho(float target[2], float source[3], float rotmat[4][4]) +void BLI_uvproject_from_view_ortho(float target[2], float source[3], float rotmat[4][4]) { float pv[3]; @@ -193,7 +193,7 @@ void project_from_view_ortho(float target[2], float source[3], float rotmat[4][4 target[1] = pv[2]; } -void project_camera_info_scale(UvCameraInfo *uci, float scale_x, float scale_y) +void BLI_uvproject_camera_info_scale(ProjCameraInfo *uci, float scale_x, float scale_y) { uci->xasp *= scale_x; uci->yasp *= scale_y; diff --git a/source/blender/blenlib/intern/voxel.c b/source/blender/blenlib/intern/voxel.c index 34862c724e1..1fe42384eb6 100644 --- a/source/blender/blenlib/intern/voxel.c +++ b/source/blender/blenlib/intern/voxel.c @@ -37,15 +37,15 @@ BLI_INLINE float D(float *data, const int res[3], int x, int y, int z) { - CLAMP(x, 0, res[0]-1); - CLAMP(y, 0, res[1]-1); - CLAMP(z, 0, res[2]-1); - return data[ V_I(x, y, z, res) ]; + CLAMP(x, 0, res[0] - 1); + CLAMP(y, 0, res[1] - 1); + CLAMP(z, 0, res[2] - 1); + return data[ BLI_VEXEL_INDEX(x, y, z, res) ]; } /* *** nearest neighbor *** */ /* input coordinates must be in bounding box 0.0 - 1.0 */ -float voxel_sample_nearest(float *data, const int res[3], const float co[3]) +float BLI_voxel_sample_nearest(float *data, const int res[3], const float co[3]) { int xi, yi, zi; @@ -70,7 +70,7 @@ BLI_INLINE int _clamp(int a, int b, int c) return (a < b) ? b : ((a > c) ? c : a); } -float voxel_sample_trilinear(float *data, const int res[3], const float co[3]) +float BLI_voxel_sample_trilinear(float *data, const int res[3], const float co[3]) { if (data) { @@ -102,7 +102,7 @@ float voxel_sample_trilinear(float *data, const int res[3], const float co[3]) } -float voxel_sample_triquadratic(float *data, const int res[3], const float co[3]) +float BLI_voxel_sample_triquadratic(float *data, const int res[3], const float co[3]) { if (data) { @@ -132,7 +132,7 @@ float voxel_sample_triquadratic(float *data, const int res[3], const float co[3] return 0.f; } -float voxel_sample_tricubic(float *data, const int res[3], const float co[3], int bspline) +float BLI_voxel_sample_tricubic(float *data, const int res[3], const float co[3], int bspline) { if (data) { diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 14c8d42654c..c741ebbc5bf 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2919,7 +2919,7 @@ int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportL * we should not have any relative paths, but if there * is somehow, an invalid or empty G.main->name it will * print an error, don't try make the absolute in this case. */ - makeFilesAbsolute(mainvar, G.main->name, NULL); + BLI_bpath_absolute_convert(mainvar, G.main->name, NULL); } } } @@ -2928,7 +2928,7 @@ int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportL write_user_block= (BLI_path_cmp(filepath, userfilename) == 0); if (write_flags & G_FILE_RELATIVE_REMAP) - makeFilesRelative(mainvar, filepath, NULL); /* note, making relative to something OTHER then G.main->name */ + BLI_bpath_relative_convert(mainvar, filepath, NULL); /* note, making relative to something OTHER then G.main->name */ /* actual file writing */ err= write_file_handle(mainvar, file, NULL, NULL, write_user_block, write_flags, thumb); diff --git a/source/blender/bmesh/operators/bmo_triangulate.c b/source/blender/bmesh/operators/bmo_triangulate.c index 755dceefdc5..afc60d844db 100644 --- a/source/blender/bmesh/operators/bmo_triangulate.c +++ b/source/blender/bmesh/operators/bmo_triangulate.c @@ -168,30 +168,30 @@ void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op) BLI_smallhash_init(&hash); - BLI_begin_edgefill(&sf_ctx); + BLI_scanfill_begin(&sf_ctx); BMO_ITER (e, &siter, bm, op, "edges", BM_EDGE) { BMO_elem_flag_enable(bm, e, EDGE_MARK); if (!BLI_smallhash_haskey(&hash, (uintptr_t)e->v1)) { - eve = BLI_addfillvert(&sf_ctx, e->v1->co); + eve = BLI_scanfill_vert_add(&sf_ctx, e->v1->co); eve->tmp.p = e->v1; BLI_smallhash_insert(&hash, (uintptr_t)e->v1, eve); } if (!BLI_smallhash_haskey(&hash, (uintptr_t)e->v2)) { - eve = BLI_addfillvert(&sf_ctx, e->v2->co); + eve = BLI_scanfill_vert_add(&sf_ctx, e->v2->co); eve->tmp.p = e->v2; BLI_smallhash_insert(&hash, (uintptr_t)e->v2, eve); } v1 = BLI_smallhash_lookup(&hash, (uintptr_t)e->v1); v2 = BLI_smallhash_lookup(&hash, (uintptr_t)e->v2); - /* eed = */ BLI_addfilledge(&sf_ctx, v1, v2); + /* eed = */ BLI_scanfill_edge_add(&sf_ctx, v1, v2); /* eed->tmp.p = e; */ /* UNUSED */ } - BLI_edgefill(&sf_ctx, FALSE); + BLI_scanfill_calc(&sf_ctx, FALSE); for (efa = sf_ctx.fillfacebase.first; efa; efa = efa->next) { BMFace *f = BM_face_create_quad_tri(bm, @@ -208,7 +208,7 @@ void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op) } } - BLI_end_edgefill(&sf_ctx); + BLI_scanfill_end(&sf_ctx); BLI_smallhash_release(&hash); /* clean up fill */ diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index b215f0ac345..57d7869d3db 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -1877,11 +1877,11 @@ static void knifenet_fill_faces(KnifeTool_OpData *kcd) if (face_nets[i].first) BMO_elem_flag_enable(bm, f, DEL); - BLI_begin_edgefill(&sf_ctx); + BLI_scanfill_begin(&sf_ctx); for (entry = face_nets[i].first; entry; entry = entry->next) { if (!BLI_smallhash_haskey(hash, (intptr_t)entry->kfe->v1)) { - eve = BLI_addfillvert(&sf_ctx, entry->kfe->v1->v->co); + eve = BLI_scanfill_vert_add(&sf_ctx, entry->kfe->v1->v->co); eve->poly_nr = 0; rnd_offset_co(eve->co, rndscale); eve->tmp.p = entry->kfe->v1->v; @@ -1889,7 +1889,7 @@ static void knifenet_fill_faces(KnifeTool_OpData *kcd) } if (!BLI_smallhash_haskey(hash, (intptr_t)entry->kfe->v2)) { - eve = BLI_addfillvert(&sf_ctx, entry->kfe->v2->v->co); + eve = BLI_scanfill_vert_add(&sf_ctx, entry->kfe->v2->v->co); eve->poly_nr = 0; rnd_offset_co(eve->co, rndscale); eve->tmp.p = entry->kfe->v2->v; @@ -1911,7 +1911,7 @@ static void knifenet_fill_faces(KnifeTool_OpData *kcd) if (eve->poly_nr > 1 && lasteve->poly_nr > 1) { ScanFillEdge *eed; - eed = BLI_addfilledge(&sf_ctx, lasteve, eve); + eed = BLI_scanfill_edge_add(&sf_ctx, lasteve, eve); if (entry->kfe->oe) eed->f = SF_EDGE_BOUNDARY; /* mark as original boundary edge */ @@ -1926,7 +1926,7 @@ static void knifenet_fill_faces(KnifeTool_OpData *kcd) } } - BLI_edgefill(&sf_ctx, FALSE); + BLI_scanfill_calc(&sf_ctx, FALSE); for (efa = sf_ctx.fillfacebase.first; efa; efa = efa->next) { BMVert *v1 = efa->v3->tmp.p, *v2 = efa->v2->tmp.p, *v3 = efa->v1->tmp.p; @@ -1959,7 +1959,7 @@ static void knifenet_fill_faces(KnifeTool_OpData *kcd) } } - BLI_end_edgefill(&sf_ctx); + BLI_scanfill_end(&sf_ctx); BLI_smallhash_release(hash); } bm->elem_index_dirty |= BM_FACE; diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index cfc7ba0537f..9f611b52669 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -192,7 +192,7 @@ static void screen_opengl_render_apply(OGLRender *oglrender) float *accum_tmp = MEM_mallocN(sizex * sizey * sizeof(float) * 4, "accum2"); int j; - BLI_initjit(jit_ofs[0], scene->r.osa); + BLI_jitter_init(jit_ofs[0], scene->r.osa); /* first sample buffer, also initializes 'rv3d->persmat' */ ED_view3d_draw_offscreen(scene, v3d, ar, sizex, sizey, NULL, winmat, TRUE); diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c index 4698c734f8e..080f12bf35b 100644 --- a/source/blender/editors/space_info/info_ops.c +++ b/source/blender/editors/space_info/info_ops.c @@ -200,7 +200,7 @@ static int make_paths_relative_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - makeFilesRelative(bmain, bmain->name, op->reports); + BLI_bpath_relative_convert(bmain, bmain->name, op->reports); /* redraw everything so any changed paths register */ WM_main_add_notifier(NC_WINDOW, NULL); @@ -233,7 +233,7 @@ static int make_paths_absolute_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - makeFilesAbsolute(bmain, bmain->name, op->reports); + BLI_bpath_absolute_convert(bmain, bmain->name, op->reports); /* redraw everything so any changed paths register */ WM_main_add_notifier(NC_WINDOW, NULL); @@ -262,7 +262,7 @@ static int report_missing_files_exec(bContext *C, wmOperator *op) Main *bmain = CTX_data_main(C); /* run the missing file check */ - checkMissingFiles(bmain, op->reports); + BLI_bpath_missing_files_check(bmain, op->reports); return OPERATOR_FINISHED; } @@ -287,7 +287,7 @@ static int find_missing_files_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); const char *searchpath = RNA_string_get_alloc(op->ptr, "filepath", NULL, 0); - findMissingFiles(bmain, searchpath, op->reports); + BLI_bpath_missing_files_find(bmain, searchpath, op->reports); MEM_freeN((void *)searchpath); return OPERATOR_FINISHED; diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c index 478643be947..2b93246e797 100644 --- a/source/blender/editors/uvedit/uvedit_parametrizer.c +++ b/source/blender/editors/uvedit/uvedit_parametrizer.c @@ -4356,7 +4356,7 @@ void param_smooth_area(ParamHandle *handle) void param_pack(ParamHandle *handle, float margin) { /* box packing variables */ - boxPack *boxarray, *box; + BoxPack *boxarray, *box; float tot_width, tot_height, scale; PChart *chart; @@ -4373,7 +4373,7 @@ void param_pack(ParamHandle *handle, float margin) param_scale(handle, 1.0f / phandle->aspx, 1.0f / phandle->aspy); /* we may not use all these boxes */ - boxarray = MEM_mallocN(phandle->ncharts * sizeof(boxPack), "boxPack box"); + boxarray = MEM_mallocN(phandle->ncharts * sizeof(BoxPack), "BoxPack box"); for (i = 0; i < phandle->ncharts; i++) { @@ -4424,7 +4424,7 @@ void param_pack(ParamHandle *handle, float margin) } } - boxPack2D(boxarray, phandle->ncharts - unpacked, &tot_width, &tot_height); + BLI_box_pack_2D(boxarray, phandle->ncharts - unpacked, &tot_width, &tot_height); if (tot_height > tot_width) scale = 1.0f / tot_height; diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index b2c7dd59f1d..14c8420a8f5 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -262,13 +262,13 @@ static ParamHandle *construct_param_handle(Scene *scene, BMEditMesh *em, } else { /* ngon - scanfill time! */ - BLI_begin_edgefill(&sf_ctx); + BLI_scanfill_begin(&sf_ctx); firstv = lastv = NULL; BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) { int i; - v = BLI_addfillvert(&sf_ctx, l->v->co); + v = BLI_scanfill_vert_add(&sf_ctx, l->v->co); /* add small random offset */ for (i = 0; i < 3; i++) { @@ -278,7 +278,7 @@ static ParamHandle *construct_param_handle(Scene *scene, BMEditMesh *em, v->tmp.p = l; if (lastv) { - BLI_addfilledge(&sf_ctx, lastv, v); + BLI_scanfill_edge_add(&sf_ctx, lastv, v); } lastv = v; @@ -286,9 +286,9 @@ static ParamHandle *construct_param_handle(Scene *scene, BMEditMesh *em, firstv = v; } - BLI_addfilledge(&sf_ctx, firstv, v); + BLI_scanfill_edge_add(&sf_ctx, firstv, v); - BLI_edgefill_ex(&sf_ctx, TRUE, efa->no); + BLI_scanfill_calc_ex(&sf_ctx, TRUE, efa->no); for (sefa = sf_ctx.fillfacebase.first; sefa; sefa = sefa->next) { ls[0] = sefa->v1->tmp.p; ls[1] = sefa->v2->tmp.p; @@ -306,7 +306,7 @@ static ParamHandle *construct_param_handle(Scene *scene, BMEditMesh *em, param_face_add(handle, key, 3, vkeys, co, uv, pin, select); } - BLI_end_edgefill(&sf_ctx); + BLI_scanfill_end(&sf_ctx); } } @@ -1265,12 +1265,12 @@ static int uv_from_view_exec(bContext *C, wmOperator *op) BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) { luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV); - project_from_view_ortho(luv->uv, l->v->co, rotmat); + BLI_uvproject_from_view_ortho(luv->uv, l->v->co, rotmat); } } } else if (camera) { - struct UvCameraInfo *uci = project_camera_info(v3d->camera, obedit->obmat, scene->r.xsch, scene->r.ysch); + struct ProjCameraInfo *uci = BLI_uvproject_camera_info(v3d->camera, obedit->obmat, scene->r.xsch, scene->r.ysch); if (uci) { BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) { @@ -1279,7 +1279,7 @@ static int uv_from_view_exec(bContext *C, wmOperator *op) BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) { luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV); - project_from_camera(luv->uv, l->v->co, uci); + BLI_uvproject_from_camera(luv->uv, l->v->co, uci); } } @@ -1295,7 +1295,7 @@ static int uv_from_view_exec(bContext *C, wmOperator *op) BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) { luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV); - project_from_view(luv->uv, l->v->co, rv3d->persmat, rotmat, ar->winx, ar->winy); + BLI_uvproject_from_view(luv->uv, l->v->co, rv3d->persmat, rotmat, ar->winx, ar->winy); } } } diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c index af98684c7e3..4f8fd83491f 100644 --- a/source/blender/modifiers/intern/MOD_uvproject.c +++ b/source/blender/modifiers/intern/MOD_uvproject.c @@ -194,8 +194,8 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd, cam = (Camera *)projectors[i].ob->data; if (cam->type == CAM_PANO) { - projectors[i].uci= project_camera_info(projectors[i].ob, NULL, aspx, aspy); - project_camera_info_scale(projectors[i].uci, scax, scay); + projectors[i].uci= BLI_uvproject_camera_info(projectors[i].ob, NULL, aspx, aspy); + BLI_uvproject_camera_info_scale(projectors[i].uci, scax, scay); free_uci= 1; } else { @@ -304,7 +304,7 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd, do { unsigned int lidx= mp->loopstart + fidx; unsigned int vidx= mloop[lidx].v; - project_from_camera(mloop_uv[lidx].uv, coords[vidx], projectors[0].uci); + BLI_uvproject_from_camera(mloop_uv[lidx].uv, coords[vidx], projectors[0].uci); } while (fidx--); } else { @@ -347,7 +347,7 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd, do { unsigned int lidx= mp->loopstart + fidx; unsigned int vidx= mloop[lidx].v; - project_from_camera(mloop_uv[lidx].uv, coords[vidx], best_projector->uci); + BLI_uvproject_from_camera(mloop_uv[lidx].uv, coords[vidx], best_projector->uci); } while (fidx--); } else { diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index 834ca1227b5..4d5c02dad68 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -125,13 +125,13 @@ static PyObject *bpy_blend_paths(PyObject *UNUSED(self), PyObject *args, PyObjec return NULL; } - if (absolute) flag |= BPATH_TRAVERSE_ABS; - if (!packed) flag |= BPATH_TRAVERSE_SKIP_PACKED; - if (local) flag |= BPATH_TRAVERSE_SKIP_LIBRARY; + if (absolute) flag |= BLI_BPATH_TRAVERSE_ABS; + if (!packed) flag |= BLI_BPATH_TRAVERSE_SKIP_PACKED; + if (local) flag |= BLI_BPATH_TRAVERSE_SKIP_LIBRARY; list = PyList_New(0); - bpath_traverse_main(G.main, bpy_blend_paths_visit_cb, flag, (void *)list); + BLI_bpath_traverse_main(G.main, bpy_blend_paths_visit_cb, flag, (void *)list); return list; } diff --git a/source/blender/python/intern/bpy_app_handlers.c b/source/blender/python/intern/bpy_app_handlers.c index 5128cf0b924..bab5a83a6ed 100644 --- a/source/blender/python/intern/bpy_app_handlers.c +++ b/source/blender/python/intern/bpy_app_handlers.c @@ -225,7 +225,7 @@ PyObject *BPY_app_handlers_struct(void) funcstore->func = bpy_app_generic_callback; funcstore->alloc = 0; funcstore->arg = SET_INT_IN_POINTER(pos); - BLI_add_cb(funcstore, pos); + BLI_callback_add(funcstore, pos); } } diff --git a/source/blender/python/mathutils/mathutils_geometry.c b/source/blender/python/mathutils/mathutils_geometry.c index 203da5d1bd2..9e9b96a885b 100644 --- a/source/blender/python/mathutils/mathutils_geometry.c +++ b/source/blender/python/mathutils/mathutils_geometry.c @@ -1150,11 +1150,11 @@ static PyObject *M_Geometry_tessellate_polygon(PyObject *UNUSED(self), PyObject } -static int boxPack_FromPyObject(PyObject *value, boxPack **boxarray) +static int boxPack_FromPyObject(PyObject *value, BoxPack **boxarray) { Py_ssize_t len, i; PyObject *list_item, *item_1, *item_2; - boxPack *box; + BoxPack *box; /* Error checking must already be done */ @@ -1166,7 +1166,7 @@ static int boxPack_FromPyObject(PyObject *value, boxPack **boxarray) len = PyList_GET_SIZE(value); - *boxarray = MEM_mallocN(len * sizeof(boxPack), "boxPack box"); + *boxarray = MEM_mallocN(len * sizeof(BoxPack), "BoxPack box"); for (i = 0; i < len; i++) { @@ -1201,11 +1201,11 @@ static int boxPack_FromPyObject(PyObject *value, boxPack **boxarray) return 0; } -static void boxPack_ToPyObject(PyObject *value, boxPack **boxarray) +static void boxPack_ToPyObject(PyObject *value, BoxPack **boxarray) { Py_ssize_t len, i; PyObject *list_item; - boxPack *box; + BoxPack *box; len = PyList_GET_SIZE(value); @@ -1243,13 +1243,13 @@ static PyObject *M_Geometry_box_pack_2d(PyObject *UNUSED(self), PyObject *boxlis len = PyList_GET_SIZE(boxlist); if (len) { - boxPack *boxarray = NULL; + BoxPack *boxarray = NULL; if (boxPack_FromPyObject(boxlist, &boxarray) == -1) { return NULL; /* exception set */ } /* Non Python function */ - boxPack2D(boxarray, len, &tot_width, &tot_height); + BLI_box_pack_2D(boxarray, len, &tot_width, &tot_height); boxPack_ToPyObject(boxlist, &boxarray); } diff --git a/source/blender/render/intern/source/initrender.c b/source/blender/render/intern/source/initrender.c index 3e82bec7e52..56aadfd63d0 100644 --- a/source/blender/render/intern/source/initrender.c +++ b/source/blender/render/intern/source/initrender.c @@ -94,10 +94,10 @@ static void init_render_jit(Render *re) if (lastjit!=re->r.osa || last_mblur_jit != re->r.mblur_samples) { memset(jit, 0, sizeof(jit)); - BLI_initjit(jit[0], re->r.osa); + BLI_jitter_init(jit[0], re->r.osa); memset(mblur_jit, 0, sizeof(mblur_jit)); - BLI_initjit(mblur_jit[0], re->r.mblur_samples); + BLI_jitter_init(mblur_jit[0], re->r.mblur_samples); } lastjit= re->r.osa; diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 57c39a03c06..9ca2337e27f 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -171,7 +171,7 @@ static void stats_background(void *UNUSED(arg), RenderStats *rs) fprintf(stdout, "Sce: %s Ve:%d Fa:%d La:%d", rs->scenename, rs->totvert, rs->totface, rs->totlamp); } - BLI_exec_cb(G.main, NULL, BLI_CB_EVT_RENDER_STATS); + BLI_callback_exec(G.main, NULL, BLI_CB_EVT_RENDER_STATS); fputc('\n', stdout); fflush(stdout); @@ -2021,7 +2021,7 @@ void RE_BlenderFrame(Render *re, Main *bmain, Scene *scene, SceneRenderLayer *sr if (render_initialize_from_main(re, bmain, scene, srl, camera_override, lay, 0, 0)) { MEM_reset_peak_memory(); - BLI_exec_cb(re->main, (ID *)scene, BLI_CB_EVT_RENDER_PRE); + BLI_callback_exec(re->main, (ID *)scene, BLI_CB_EVT_RENDER_PRE); do_render_all_options(re); @@ -2039,10 +2039,10 @@ void RE_BlenderFrame(Render *re, Main *bmain, Scene *scene, SceneRenderLayer *sr } } - BLI_exec_cb(re->main, (ID *)scene, BLI_CB_EVT_RENDER_POST); /* keep after file save */ + BLI_callback_exec(re->main, (ID *)scene, BLI_CB_EVT_RENDER_POST); /* keep after file save */ } - BLI_exec_cb(re->main, (ID *)scene, G.afbreek ? BLI_CB_EVT_RENDER_CANCEL : BLI_CB_EVT_RENDER_COMPLETE); + BLI_callback_exec(re->main, (ID *)scene, G.afbreek ? BLI_CB_EVT_RENDER_CANCEL : BLI_CB_EVT_RENDER_COMPLETE); /* UGLY WARNING */ G.rendering= 0; @@ -2120,7 +2120,7 @@ static int do_write_image_or_movie(Render *re, Main *bmain, Scene *scene, bMovie BLI_timestr(re->i.lastframetime, name); printf(" Time: %s", name); - BLI_exec_cb(G.main, NULL, BLI_CB_EVT_RENDER_STATS); + BLI_callback_exec(G.main, NULL, BLI_CB_EVT_RENDER_STATS); fputc('\n', stdout); fflush(stdout); /* needed for renderd !! (not anymore... (ton)) */ @@ -2155,7 +2155,7 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_overri if (nf >= 0 && nf >= scene->r.sfra && nf <= scene->r.efra) { scene->r.cfra = re->r.cfra = nf; - BLI_exec_cb(re->main, (ID *)scene, BLI_CB_EVT_RENDER_PRE); + BLI_callback_exec(re->main, (ID *)scene, BLI_CB_EVT_RENDER_PRE); do_render_all_options(re); totrendered++; @@ -2166,7 +2166,7 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_overri } if (G.afbreek == 0) { - BLI_exec_cb(re->main, (ID *)scene, BLI_CB_EVT_RENDER_POST); /* keep after file save */ + BLI_callback_exec(re->main, (ID *)scene, BLI_CB_EVT_RENDER_POST); /* keep after file save */ } } else { @@ -2220,7 +2220,7 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_overri re->r.cfra= scene->r.cfra; /* weak.... */ /* run callbacs before rendering, before the scene is updated */ - BLI_exec_cb(re->main, (ID *)scene, BLI_CB_EVT_RENDER_PRE); + BLI_callback_exec(re->main, (ID *)scene, BLI_CB_EVT_RENDER_PRE); do_render_all_options(re); @@ -2246,7 +2246,7 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_overri } if (G.afbreek==0) { - BLI_exec_cb(re->main, (ID *)scene, BLI_CB_EVT_RENDER_POST); /* keep after file save */ + BLI_callback_exec(re->main, (ID *)scene, BLI_CB_EVT_RENDER_POST); /* keep after file save */ } } } @@ -2262,7 +2262,7 @@ void RE_BlenderAnim(Render *re, Main *bmain, Scene *scene, Object *camera_overri re->flag &= ~R_ANIMATION; - BLI_exec_cb(re->main, (ID *)scene, G.afbreek ? BLI_CB_EVT_RENDER_CANCEL : BLI_CB_EVT_RENDER_COMPLETE); + BLI_callback_exec(re->main, (ID *)scene, G.afbreek ? BLI_CB_EVT_RENDER_CANCEL : BLI_CB_EVT_RENDER_COMPLETE); /* UGLY WARNING */ G.rendering= 0; diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c index 1c572524a70..b3167e15df5 100644 --- a/source/blender/render/intern/source/shadbuf.c +++ b/source/blender/render/intern/source/shadbuf.c @@ -139,7 +139,7 @@ static float *give_jitter_tab(int samp) if (ctab[samp]==0) { ctab[samp]= 1; - BLI_initjit(jit[offset], samp*samp); + BLI_jitter_init(jit[offset], samp*samp); } return jit[offset]; diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c index 69aa6082950..e7c97574629 100644 --- a/source/blender/render/intern/source/volume_precache.c +++ b/source/blender/render/intern/source/volume_precache.c @@ -177,7 +177,7 @@ static float get_avg_surrounds(float *cache, int *res, int xx, int yy, int zz) for (x=-1; x <= 1; x++) { x_ = xx+x; if (x_ >= 0 && x_ <= res[0]-1) { - const int i= V_I(x_, y_, z_, res); + const int i= BLI_VEXEL_INDEX(x_, y_, z_, res); if (cache[i] > 0.0f) { tot += cache[i]; @@ -208,7 +208,7 @@ static void lightcache_filter(VolumePrecache *vp) for (y=0; y < vp->res[1]; y++) { for (x=0; x < vp->res[0]; x++) { /* trigger for outside mesh */ - const int i= V_I(x, y, z, vp->res); + const int i= BLI_VEXEL_INDEX(x, y, z, vp->res); if (vp->data_r[i] < -0.f) vp->data_r[i] = get_avg_surrounds(vp->data_r, vp->res, x, y, z); @@ -240,7 +240,7 @@ static void lightcache_filter2(VolumePrecache *vp) for (y=0; y < vp->res[1]; y++) { for (x=0; x < vp->res[0]; x++) { /* trigger for outside mesh */ - const int i= V_I(x, y, z, vp->res); + const int i= BLI_VEXEL_INDEX(x, y, z, vp->res); if (vp->data_r[i] < -0.f) new_r[i] = get_avg_surrounds(vp->data_r, vp->res, x, y, z); if (vp->data_g[i] < -0.f) @@ -291,7 +291,7 @@ static float total_ss_energy(Render *re, int do_test_break, VolumePrecache *vp) for (z=0; z < res[2]; z++) { for (y=0; y < res[1]; y++) { for (x=0; x < res[0]; x++) { - const int i=V_I(x, y, z, res); + const int i=BLI_VEXEL_INDEX(x, y, z, res); if (vp->data_r[i] > 0.f) energy += vp->data_r[i]; if (vp->data_g[i] > 0.f) energy += vp->data_g[i]; @@ -527,7 +527,7 @@ static void *vol_precache_part(void *data) /* convert from world->camera space for shading */ mul_v3_m4v3(cco, pa->viewmat, co); - i= V_I(x, y, z, res); + i= BLI_VEXEL_INDEX(x, y, z, res); // don't bother if the point is not inside the volume mesh if (!point_inside_obi(tree, obi, cco)) { diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index c51cb2af842..b599da48803 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -234,9 +234,9 @@ static void vol_get_precached_scattering(Render *re, ShadeInput *shi, float scat sample_co[1] = (world_co[1] - bbmin[1]) / dim[1]; sample_co[2] = (world_co[2] - bbmin[2]) / dim[2]; - scatter_col[0] = voxel_sample_triquadratic(vp->data_r, vp->res, sample_co); - scatter_col[1] = voxel_sample_triquadratic(vp->data_g, vp->res, sample_co); - scatter_col[2] = voxel_sample_triquadratic(vp->data_b, vp->res, sample_co); + scatter_col[0] = BLI_voxel_sample_triquadratic(vp->data_r, vp->res, sample_co); + scatter_col[1] = BLI_voxel_sample_triquadratic(vp->data_g, vp->res, sample_co); + scatter_col[2] = BLI_voxel_sample_triquadratic(vp->data_b, vp->res, sample_co); } /* Meta object density, brute force for now diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c index 940f718d4ad..5135061bc5c 100644 --- a/source/blender/render/intern/source/voxeldata.c +++ b/source/blender/render/intern/source/voxeldata.c @@ -184,7 +184,7 @@ static void load_frame_image_sequence(VoxelData *vd, Tex *tex) for (y=0; y < ibuf->y; y++) { for (x=0; x < ibuf->x; x++) { /* currently averaged to monchrome */ - vd->dataset[ V_I(x, y, z, vd->resol) ] = (rf[0] + rf[1] + rf[2])*0.333f; + vd->dataset[ BLI_VEXEL_INDEX(x, y, z, vd->resol) ] = (rf[0] + rf[1] + rf[2]) * 0.333f; rf +=4; } } @@ -423,17 +423,17 @@ int voxeldatatex(struct Tex *tex, const float texvec[3], struct TexResult *texre switch (vd->interp_type) { case TEX_VD_NEARESTNEIGHBOR: - texres->tin = voxel_sample_nearest(vd->dataset, vd->resol, co); + texres->tin = BLI_voxel_sample_nearest(vd->dataset, vd->resol, co); break; case TEX_VD_LINEAR: - texres->tin = voxel_sample_trilinear(vd->dataset, vd->resol, co); + texres->tin = BLI_voxel_sample_trilinear(vd->dataset, vd->resol, co); break; case TEX_VD_QUADRATIC: - texres->tin = voxel_sample_triquadratic(vd->dataset, vd->resol, co); + texres->tin = BLI_voxel_sample_triquadratic(vd->dataset, vd->resol, co); break; case TEX_VD_TRICUBIC_CATROM: case TEX_VD_TRICUBIC_BSPLINE: - texres->tin = voxel_sample_tricubic(vd->dataset, vd->resol, co, (vd->interp_type == TEX_VD_TRICUBIC_BSPLINE)); + texres->tin = BLI_voxel_sample_tricubic(vd->dataset, vd->resol, co, (vd->interp_type == TEX_VD_TRICUBIC_BSPLINE)); break; } diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index b9e69743995..4c3c9889d53 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -3047,7 +3047,7 @@ void RE_zbuf_accumulate_vecblur(NodeBlurData *nbd, int xsize, int ysize, float * /* has to become static, the init-jit calls a random-seed, screwing up texture noise node */ if (firsttime) { firsttime= 0; - BLI_initjit(jit[0], 256); + BLI_jitter_init(jit[0], 256); } memset(newrect, 0, sizeof(float)*xsize*ysize*4); diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index e50fbaa624e..a366810e647 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -361,7 +361,7 @@ void WM_read_file(bContext *C, const char *filepath, ReportList *reports) WM_cursor_wait(1); - BLI_exec_cb(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_PRE); + BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_PRE); /* first try to append data from exotic file formats... */ /* it throws error box when file doesn't exist and returns -1 */ @@ -421,7 +421,7 @@ void WM_read_file(bContext *C, const char *filepath, ReportList *reports) #endif /* important to do before NULL'ing the context */ - BLI_exec_cb(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST); + BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST); if (!G.background) { /* in background mode this makes it hard to load @@ -791,7 +791,7 @@ int WM_write_file(bContext *C, const char *target, int fileflags, ReportList *re ibuf_thumb = blend_file_thumb(CTX_data_scene(C), CTX_wm_screen(C), &thumb); } - BLI_exec_cb(G.main, NULL, BLI_CB_EVT_SAVE_PRE); + BLI_callback_exec(G.main, NULL, BLI_CB_EVT_SAVE_PRE); /* operator now handles overwrite checks */ @@ -826,7 +826,7 @@ int WM_write_file(bContext *C, const char *target, int fileflags, ReportList *re write_history(); } - BLI_exec_cb(G.main, NULL, BLI_CB_EVT_SAVE_POST); + BLI_callback_exec(G.main, NULL, BLI_CB_EVT_SAVE_POST); /* run this function after because the file cant be written before the blend is */ if (ibuf_thumb) { diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c index bfa3645bf57..7f40d2980a6 100644 --- a/source/blender/windowmanager/intern/wm_gesture.c +++ b/source/blender/windowmanager/intern/wm_gesture.c @@ -236,7 +236,7 @@ static void draw_filled_lasso(wmGesture *gt) short *lasso = (short *)gt->customdata; int i; - BLI_begin_edgefill(&sf_ctx); + BLI_scanfill_begin(&sf_ctx); for (i = 0; i < gt->points; i++, lasso += 2) { float co[3]; @@ -244,9 +244,9 @@ static void draw_filled_lasso(wmGesture *gt) co[1] = (float)lasso[1]; co[2] = 0.0f; - v = BLI_addfillvert(&sf_ctx, co); + v = BLI_scanfill_vert_add(&sf_ctx, co); if (lastv) - /* e = */ /* UNUSED */ BLI_addfilledge(&sf_ctx, lastv, v); + /* e = */ /* UNUSED */ BLI_scanfill_edge_add(&sf_ctx, lastv, v); lastv = v; if (firstv == NULL) firstv = v; } @@ -254,8 +254,8 @@ static void draw_filled_lasso(wmGesture *gt) /* highly unlikely this will fail, but could crash if (gt->points == 0) */ if (firstv) { float zvec[3] = {0.0f, 0.0f, 1.0f}; - BLI_addfilledge(&sf_ctx, firstv, v); - BLI_edgefill_ex(&sf_ctx, FALSE, zvec); + BLI_scanfill_edge_add(&sf_ctx, firstv, v); + BLI_scanfill_calc_ex(&sf_ctx, FALSE, zvec); glEnable(GL_BLEND); glColor4f(1.0, 1.0, 1.0, 0.05); @@ -268,7 +268,7 @@ static void draw_filled_lasso(wmGesture *gt) glEnd(); glDisable(GL_BLEND); - BLI_end_edgefill(&sf_ctx); + BLI_scanfill_end(&sf_ctx); } } diff --git a/source/creator/creator.c b/source/creator/creator.c index 8024356c181..4847df1168d 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -1248,7 +1248,7 @@ int main(int argc, const char **argv) IMB_init(); - BLI_cb_init(); + BLI_callback_global_init(); #ifdef WITH_GAMEENGINE syshandle = SYS_GetSystem(); -- cgit v1.2.3