diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-05-05 04:23:55 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-05-05 04:23:55 +0400 |
commit | 4c5502bfd690cad5c02aa6a0be0bd59400ef3407 (patch) | |
tree | 6c421d2c324166a682952476e7a1f9aa924c7c51 /source/blender/blenlib | |
parent | 9466af0eabf05bfcb966cac01ee72dca544f7dd1 (diff) |
code cleanup: function naming for BLI functions.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_bitmap.h | 2 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_boxpack2d.h | 6 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_bpath.h | 30 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_callbacks.h | 8 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_jitter.h | 2 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_scanfill.h | 12 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_uvproject.h | 12 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_voxel.h | 10 | ||||
-rw-r--r-- | source/blender/blenlib/intern/boxpack2d.c | 22 | ||||
-rw-r--r-- | source/blender/blenlib/intern/bpath.c | 42 | ||||
-rw-r--r-- | source/blender/blenlib/intern/callbacks.c | 8 | ||||
-rw-r--r-- | source/blender/blenlib/intern/jitter.c | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/scanfill.c | 22 | ||||
-rw-r--r-- | source/blender/blenlib/intern/uvproject.c | 20 | ||||
-rw-r--r-- | source/blender/blenlib/intern/voxel.c | 16 |
15 files changed, 107 insertions, 107 deletions
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) { |