diff options
author | Jacques Lucke <mail@jlucke.com> | 2018-10-18 16:43:06 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2018-10-18 16:43:06 +0300 |
commit | 41216d5ad4c722e2ad9f15c968af454fc7566d5e (patch) | |
tree | f68fe3e1dd32a2d651b6678a1783e165ce2e70c8 /source/blender/blenkernel/intern | |
parent | cfdd902d2d5d560262d1218861ad1a4469c5259f (diff) |
Cleanup: Remove more #if 0 blocks
Continuation of https://developer.blender.org/D3802
Reviewers: brecht
Differential Revision: https://developer.blender.org/D3808
Diffstat (limited to 'source/blender/blenkernel/intern')
33 files changed, 9 insertions, 1141 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index b7885e08a60..723d485ea0f 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -2670,11 +2670,6 @@ void BKE_image_signal(Main *bmain, Image *ima, ImageUser *iuser, int signal) ima->name[0] = '\0'; } -#if 0 - /* force reload on first use, but not for multilayer, that makes nodes and buttons in ui drawing fail */ - if (ima->type != IMA_TYPE_MULTILAYER) - BKE_image_free_buffers(ima); -#else /* image buffers for non-sequence multilayer will share buffers with RenderResult, * however sequence multilayer will own buffers. Such logic makes switching from * single multilayer file to sequence completely unstable @@ -2683,7 +2678,6 @@ void BKE_image_signal(Main *bmain, Image *ima, ImageUser *iuser, int signal) * sequences behave stable */ BKE_image_free_buffers(ima); -#endif ima->ok = 1; if (iuser) @@ -4468,15 +4462,6 @@ bool BKE_image_is_dirty(Image *image) void BKE_image_file_format_set(Image *image, int ftype, const ImbFormatOptions *options) { -#if 0 - ImBuf *ibuf = BKE_image_acquire_ibuf(image, NULL, NULL); - if (ibuf) { - ibuf->ftype = ftype; - ibuf->foptions = options; - } - BKE_image_release_ibuf(image, ibuf, NULL); -#endif - BLI_spin_lock(&image_spin); if (image->cache != NULL) { struct MovieCacheIter *iter = IMB_moviecacheIter_new(image->cache); diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 84aa0ed962b..a34ebcd9fde 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -1982,15 +1982,6 @@ bool new_id(ListBase *lb, ID *id, const char *tname) result = check_for_dupid(lb, id, name); strcpy(id->name + 2, name); - /* This was in 2.43 and previous releases - * however all data in blender should be sorted, not just duplicate names - * sorting should not hurt, but noting just incase it alters the way other - * functions work, so sort every time */ -#if 0 - if (result) - id_sort_by_name(lb, id); -#endif - id_sort_by_name(lb, id); return result; diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c index 7938d82eb80..e82e1cf2d6b 100644 --- a/source/blender/blenkernel/intern/library_query.c +++ b/source/blender/blenkernel/intern/library_query.c @@ -1064,14 +1064,8 @@ bool BKE_library_id_can_use_idtype(ID *id_owner, const short id_type_used) return (ELEM(id_type_used, ID_OB, ID_WO, ID_SCE, ID_MC, ID_MA, ID_GR, ID_TXT, ID_LS, ID_MSK, ID_SO, ID_GD, ID_BR, ID_PAL, ID_IM, ID_NT)); case ID_OB: - /* Could be the following, but simpler to just always say 'yes' here. */ -#if 0 - return ELEM(id_type_used, ID_ME, ID_CU, ID_MB, ID_LT, ID_SPK, ID_AR, ID_LA, ID_CA, /* obdata */ - ID_OB, ID_MA, ID_GD, ID_GR, ID_TE, ID_PA, ID_TXT, ID_SO, ID_MC, ID_IM, ID_AC - /* + constraints and modifiers ... */); -#else + /* Could be more specific, but simpler to just always say 'yes' here. */ return true; -#endif case ID_ME: return ELEM(id_type_used, ID_ME, ID_KE, ID_MA, ID_IM); case ID_CU: @@ -1099,12 +1093,8 @@ bool BKE_library_id_can_use_idtype(ID *id_owner, const short id_type_used) case ID_GR: return ELEM(id_type_used, ID_OB, ID_GR); case ID_NT: - /* Could be the following, but node.id has no type restriction... */ -#if 0 - return ELEM(id_type_used, ID_GD /* + node.id types... */); -#else + /* Could be more specific, but node.id has no type restriction... */ return true; -#endif case ID_BR: return ELEM(id_type_used, ID_BR, ID_IM, ID_PC, ID_TE, ID_MA); case ID_PA: diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c index ba5a6a25048..97058467fd9 100644 --- a/source/blender/blenkernel/intern/mask.c +++ b/source/blender/blenkernel/intern/mask.c @@ -1419,34 +1419,6 @@ void BKE_mask_evaluate(Mask *mask, const float ctime, const bool do_newframe) * for now re-evaluate all. eventually this might work differently */ void BKE_mask_update_display(Mask *mask, float ctime) { -#if 0 - MaskLayer *masklay; - - for (masklay = mask->masklayers.first; masklay; masklay = masklay->next) { - MaskSpline *spline; - - for (spline = masklay->splines.first; spline; spline = spline->next) { - if (spline->points_deform) { - int i = 0; - - for (i = 0; i < spline->tot_point; i++) { - MaskSplinePoint *point; - - if (spline->points_deform) { - point = &spline->points_deform[i]; - BKE_mask_point_free(point); - } - } - if (spline->points_deform) { - MEM_freeN(spline->points_deform); - } - - spline->points_deform = NULL; - } - } - } -#endif - BKE_mask_evaluate(mask, ctime, false); } @@ -1657,19 +1629,6 @@ MaskLayerShape *BKE_mask_layer_shape_verify_frame(MaskLayer *masklay, const int BKE_mask_layer_shape_sort(masklay); } -#if 0 - { - MaskLayerShape *masklay_shape; - int i = 0; - for (masklay_shape = masklay->splines_shapes.first; - masklay_shape; - masklay_shape = masklay_shape->next) - { - printf("mask %d, %d\n", i++, masklay_shape->frame); - } - } -#endif - return masklay_shape; } diff --git a/source/blender/blenkernel/intern/mask_rasterize.c b/source/blender/blenkernel/intern/mask_rasterize.c index 2f2b82a00eb..fc1412c1baa 100644 --- a/source/blender/blenkernel/intern/mask_rasterize.c +++ b/source/blender/blenkernel/intern/mask_rasterize.c @@ -749,12 +749,6 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, struct Mask *mas for (j = 0; j < tot_diff_feather_points; j++) { copy_v2_v2(co_feather, diff_feather_points[j]); sf_vert = BLI_scanfill_vert_add(&sf_ctx, co_feather); - - /* no need for these attrs */ -#if 0 - sf_vert->tmp.u = sf_vert_tot; - sf_vert->keyindex = sf_vert_tot + tot_diff_point; /* absolute index of feather vert */ -#endif sf_vert->keyindex = SF_KEYINDEX_TEMP_ID; sf_vert_tot++; } @@ -1206,18 +1200,6 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, struct Mask *mas /* functions that run inside the sampling thread (keep fast!) */ /* --------------------------------------------------------------------- */ -/* 2D ray test */ -#if 0 -static float maskrasterize_layer_z_depth_tri(const float pt[2], - const float v1[3], const float v2[3], const float v3[3]) -{ - float w[3]; - barycentric_weights_v2(v1, v2, v3, pt, w); - return (v1[2] * w[0]) + (v2[2] * w[1]) + (v3[2] * w[2]); -} -#endif - -#if 1 static float maskrasterize_layer_z_depth_quad(const float pt[2], const float v1[3], const float v2[3], const float v3[3], const float v4[3]) { @@ -1226,33 +1208,16 @@ static float maskrasterize_layer_z_depth_quad(const float pt[2], //return (v1[2] * w[0]) + (v2[2] * w[1]) + (v3[2] * w[2]) + (v4[2] * w[3]); return w[2] + w[3]; /* we can make this assumption for small speedup */ } -#endif static float maskrasterize_layer_isect(unsigned int *face, float (*cos)[3], const float dist_orig, const float xy[2]) { /* we always cast from same place only need xy */ if (face[3] == TRI_VERT) { /* --- tri --- */ - -#if 0 - /* not essential but avoids unneeded extra lookups */ - if ((cos[0][2] < dist_orig) || - (cos[1][2] < dist_orig) || - (cos[2][2] < dist_orig)) - { - if (isect_point_tri_v2_cw(xy, cos[face[0]], cos[face[1]], cos[face[2]])) { - /* we know all tris are close for now */ - return maskrasterize_layer_z_depth_tri(xy, cos[face[0]], cos[face[1]], cos[face[2]]); - } - } -#else /* we know all tris are close for now */ - if (1) { - if (isect_point_tri_v2_cw(xy, cos[face[0]], cos[face[1]], cos[face[2]])) { - return 0.0f; - } + if (isect_point_tri_v2_cw(xy, cos[face[0]], cos[face[1]], cos[face[2]])) { + return 0.0f; } -#endif } else { /* --- quad --- */ diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index a46f7bf26dc..d5558f64be8 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -653,14 +653,6 @@ void assign_material_id(Main *bmain, ID *id, Material *ma, short act) if (act > MAXMAT) return; if (act < 1) act = 1; - /* this is needed for Python overrides, - * we just have to take care that the UI can't do this */ -#if 0 - /* prevent crashing when using accidentally */ - BLI_assert(id->lib == NULL); - if (id->lib) return; -#endif - /* test arraylens */ totcolp = give_totcolp_id(id); diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index 5e4f5614370..9b2c2e938d4 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -224,15 +224,7 @@ void BKE_mball_texspace_calc(Object *ob) min[0] = min[1] = min[2] = -1.0f; max[0] = max[1] = max[2] = 1.0f; } -#if 0 - loc[0] = (min[0] + max[0]) / 2.0f; - loc[1] = (min[1] + max[1]) / 2.0f; - loc[2] = (min[2] + max[2]) / 2.0f; - - size[0] = (max[0] - min[0]) / 2.0f; - size[1] = (max[1] - min[1]) / 2.0f; - size[2] = (max[2] - min[2]) / 2.0f; -#endif + BKE_boundbox_init_from_minmax(bb, min, max); bb->flag &= ~BOUNDBOX_DIRTY; diff --git a/source/blender/blenkernel/intern/mball_tessellate.c b/source/blender/blenkernel/intern/mball_tessellate.c index 7e26a0f7713..436f5cc8afd 100644 --- a/source/blender/blenkernel/intern/mball_tessellate.c +++ b/source/blender/blenkernel/intern/mball_tessellate.c @@ -839,27 +839,6 @@ static void vnormal(PROCESS *process, const float point[3], float r_no[3]) r_no[0] = metaball(process, point[0] + delta, point[1], point[2]) - f; r_no[1] = metaball(process, point[0], point[1] + delta, point[2]) - f; r_no[2] = metaball(process, point[0], point[1], point[2] + delta) - f; - -#if 0 - f = normalize_v3(r_no); - - if (0) { - float tvec[3]; - - delta *= 2.0f; - - f = process->function(process, point[0], point[1], point[2]); - - tvec[0] = process->function(process, point[0] + delta, point[1], point[2]) - f; - tvec[1] = process->function(process, point[0], point[1] + delta, point[2]) - f; - tvec[2] = process->function(process, point[0], point[1], point[2] + delta) - f; - - if (normalize_v3(tvec) != 0.0f) { - add_v3_v3(r_no, tvec); - normalize_v3(r_no); - } - } -#endif } #endif /* USE_ACCUM_NORMAL */ diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 81214f3bb9c..8e1ea219ee3 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -503,11 +503,6 @@ void BKE_mesh_init(Mesh *me) me->size[0] = me->size[1] = me->size[2] = 1.0; me->smoothresh = DEG2RADF(30); me->texflag = ME_AUTOSPACE; - - /* disable because its slow on many GPU's, see [#37518] */ -#if 0 - me->flag = ME_TWOSIDED; -#endif me->drawflag = 0; CustomData_reset(&me->vdata); @@ -1253,10 +1248,6 @@ int poly_get_adj_loops_from_vert( vert); if (corner != -1) { -#if 0 /* unused - this loop */ - const MLoop *ml = &mloop[poly->loopstart + corner]; -#endif - /* vertex was found */ r_adj[0] = ME_POLY_LOOP_PREV(mloop, poly, corner)->v; r_adj[1] = ME_POLY_LOOP_NEXT(mloop, poly, corner)->v; diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c b/source/blender/blenkernel/intern/mesh_evaluate.c index f9ced904536..e40336cd4bd 100644 --- a/source/blender/blenkernel/intern/mesh_evaluate.c +++ b/source/blender/blenkernel/intern/mesh_evaluate.c @@ -982,10 +982,6 @@ static void split_loop_nor_single_do(LoopSplitTaskDataCommon *common_data, LoopS const MLoop *ml_curr = data->ml_curr; const MLoop *ml_prev = data->ml_prev; const int ml_curr_index = data->ml_curr_index; -#if 0 /* Not needed for 'single' loop. */ - const int ml_prev_index = data->ml_prev_index; - const int *e2l_prev = data->e2l_prev; -#endif const int mp_index = data->mp_index; /* Simple case (both edges around that vertex are sharp in current polygon), @@ -1036,9 +1032,6 @@ static void split_loop_nor_fan_do(LoopSplitTaskDataCommon *common_data, LoopSpli const float (*polynors)[3] = common_data->polynors; MLoopNorSpace *lnor_space = data->lnor_space; -#if 0 /* Not needed for 'fan' loops. */ - float (*lnor)[3] = data->lnor; -#endif const MLoop *ml_curr = data->ml_curr; const MLoop *ml_prev = data->ml_prev; const int ml_curr_index = data->ml_curr_index; @@ -1423,10 +1416,6 @@ static void loop_split_generator(TaskPool *pool, LoopSplitTaskDataCommon *common data->ml_curr = ml_curr; data->ml_prev = ml_prev; data->ml_curr_index = ml_curr_index; -#if 0 /* Not needed for 'single' loop. */ - data->ml_prev_index = ml_prev_index; - data->e2l_prev = NULL; /* Tag as 'single' task. */ -#endif data->mp_index = mp_index; if (lnors_spacearr) { data->lnor_space = BKE_lnor_space_create(lnors_spacearr); @@ -1441,9 +1430,6 @@ static void loop_split_generator(TaskPool *pool, LoopSplitTaskDataCommon *common * All this due/thanks to link between normals and loop ordering (i.e. winding). */ else { -#if 0 /* Not needed for 'fan' loops. */ - data->lnor = lnors; -#endif data->ml_curr = ml_curr; data->ml_prev = ml_prev; data->ml_curr_index = ml_curr_index; @@ -2165,30 +2151,6 @@ static float mesh_calc_poly_area_centroid( return total_area; } -#if 0 /* slow version of the function below */ -void BKE_mesh_calc_poly_angles( - MPoly *mpoly, MLoop *loopstart, - MVert *mvarray, float angles[]) -{ - MLoop *ml; - MLoop *mloop = &loopstart[-mpoly->loopstart]; - - int j; - for (j = 0, ml = loopstart; j < mpoly->totloop; j++, ml++) { - MLoop *ml_prev = ME_POLY_LOOP_PREV(mloop, mpoly, j); - MLoop *ml_next = ME_POLY_LOOP_NEXT(mloop, mpoly, j); - - float e1[3], e2[3]; - - sub_v3_v3v3(e1, mvarray[ml_next->v].co, mvarray[ml->v].co); - sub_v3_v3v3(e2, mvarray[ml_prev->v].co, mvarray[ml->v].co); - - angles[j] = (float)M_PI - angle_v3v3(e1, e2); - } -} - -#else /* equivalent the function above but avoid multiple subtractions + normalize */ - void BKE_mesh_calc_poly_angles( const MPoly *mpoly, const MLoop *loopstart, const MVert *mvarray, float angles[]) @@ -2213,7 +2175,6 @@ void BKE_mesh_calc_poly_angles( i_next++; } } -#endif void BKE_mesh_poly_edgehash_insert(EdgeHash *ehash, const MPoly *mp, const MLoop *mloop) { diff --git a/source/blender/blenkernel/intern/mesh_validate.c b/source/blender/blenkernel/intern/mesh_validate.c index bfb3b107084..dd9d6fa448a 100644 --- a/source/blender/blenkernel/intern/mesh_validate.c +++ b/source/blender/blenkernel/intern/mesh_validate.c @@ -618,62 +618,6 @@ bool BKE_mesh_validate_arrays( } /* Test same polys. */ -#if 0 - { - bool p1_sub = true, p2_sub = true; - - /* NOTE: This performs a sub-set test. */ - /* XXX This (and the sort of verts list) is better than systematic - * search of all verts of one list into the other if lists have - * a fair amount of elements. - * Not sure however it's worth it in this case? - * But as we also need sorted vert list to check verts multi-used - * (in first pass of checks)... */ - /* XXX If we consider only "equal" polys (i.e. using exactly same set of verts) - * as invalid, better to replace this by a simple memory cmp... */ - while ((p1_nv && p2_nv) && (p1_sub || p2_sub)) { - if (*p1_v < *p2_v) { - if (p1_sub) - p1_sub = false; - p1_nv--; - p1_v++; - } - else if (*p2_v < *p1_v) { - if (p2_sub) - p2_sub = false; - p2_nv--; - p2_v++; - } - else { - /* Equality, both next verts. */ - p1_nv--; - p2_nv--; - p1_v++; - p2_v++; - } - } - if (p1_nv && p1_sub) - p1_sub = false; - else if (p2_nv && p2_sub) - p2_sub = false; - - if (p1_sub && p2_sub) { - PRINT("\tPolys %u and %u use same vertices, considering poly %u as invalid.\n", - prev_sp->index, sp->index, sp->index); - sp->invalid = true; - } - /* XXX In fact, these might be valid? :/ */ - else if (p1_sub) { - PRINT("\t%u is a sub-poly of %u, considering it as invalid.\n", sp->index, prev_sp->index); - sp->invalid = true; - } - else if (p2_sub) { - PRINT("\t%u is a sub-poly of %u, considering it as invalid.\n", prev_sp->index, sp->index); - prev_sp->invalid = true; - prev_sp = sp; /* sp is new reference poly. */ - } - } -#else if ((p1_nv == p2_nv) && (memcmp(p1_v, p2_v, p1_nv * sizeof(*p1_v)) == 0)) { if (do_verbose) { PRINT_ERR("\tPolys %u and %u use same vertices (%d", @@ -687,7 +631,6 @@ bool BKE_mesh_validate_arrays( } sp->invalid = true; } -#endif else { prev_sp = sp; } diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c index d63ac7df3ce..4d70c2a7c94 100644 --- a/source/blender/blenkernel/intern/movieclip.c +++ b/source/blender/blenkernel/intern/movieclip.c @@ -1155,16 +1155,6 @@ bool BKE_movieclip_has_frame(MovieClip *clip, MovieClipUser *user) void BKE_movieclip_get_size(MovieClip *clip, MovieClipUser *user, int *width, int *height) { -#if 0 - /* originally was needed to support image sequences with different image dimensions, - * which might be useful for such things as reconstruction of unordered image sequence, - * or painting/rotoscoping of non-equal-sized images, but this ended up in unneeded - * cache lookups and even unwanted non-proxied files loading when doing mask parenting, - * so let's disable this for now and assume image sequence consists of images with - * equal sizes (sergey) - */ - if (user->framenr == clip->lastframe) { -#endif if (clip->lastsize[0] != 0 && clip->lastsize[1] != 0) { *width = clip->lastsize[0]; *height = clip->lastsize[1]; diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index 2aa3b3f79a3..8f5354a501c 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -2373,19 +2373,6 @@ int mdisp_rot_face_to_crn(struct MVert *UNUSED(mvert), struct MPoly *mpoly, stru * the barycentric coordinates and finally find the closest vertex * should work reliably for convex cases only but better than nothing */ -#if 0 - int minS, i; - float mindist = FLT_MAX; - - for (i = 0; i < mpoly->totloop; i++) { - float len = len_v3v3(NULL, mvert[mloop[mpoly->loopstart + i].v].co); - if (len < mindist) { - mindist = len; - minS = i; - } - } - S = minS; -#endif /* temp not implemented yet and also not working properly in current master. * (was worked around by subdividing once) */ S = 0; diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index b5fbec65d94..8e17d63af3f 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -1642,54 +1642,6 @@ void BKE_node_preview_set_pixel(bNodePreview *preview, const float col[4], int x } } -#if 0 -static void nodeClearPreview(bNode *node) -{ - if (node->preview && node->preview->rect) - memset(node->preview->rect, 0, MEM_allocN_len(node->preview->rect)); -} - -/* use it to enforce clear */ -void ntreeClearPreview(bNodeTree *ntree) -{ - bNode *node; - - if (ntree == NULL) - return; - - for (node = ntree->nodes.first; node; node = node->next) { - if (node->typeinfo->flag & NODE_PREVIEW) - nodeClearPreview(node); - if (node->type == NODE_GROUP) - ntreeClearPreview((bNodeTree *)node->id); - } -} - -/* hack warning! this function is only used for shader previews, and - * since it gets called multiple times per pixel for Ztransp we only - * add the color once. Preview gets cleared before it starts render though */ -void nodeAddToPreview(bNode *node, const float col[4], int x, int y, int do_manage) -{ - bNodePreview *preview = node->preview; - if (preview) { - if (x >= 0 && y >= 0) { - if (x < preview->xsize && y < preview->ysize) { - unsigned char *tar = preview->rect + 4 * ((preview->xsize * y) + x); - - if (do_manage) { - linearrgb_to_srgb_uchar4(tar, col); - } - else { - rgba_float_to_uchar(tar, col); - } - } - //else printf("prv out bound x y %d %d\n", x, y); - } - //else printf("prv out bound x y %d %d\n", x, y); - } -} -#endif - /* ************** Free stuff ********** */ /* goes over entire tree */ diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index fdb2e3a1180..f73e61f56e6 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1976,21 +1976,7 @@ static bool ob_parcurve(Depsgraph *depsgraph, Scene *UNUSED(scene), Object *ob, if (where_on_path(par, ctime, vec, dir, (cu->flag & CU_FOLLOW) ? quat : NULL, &radius, NULL)) { if (cu->flag & CU_FOLLOW) { -#if 0 - float si, q[4]; - vec_to_quat(quat, dir, ob->trackflag, ob->upflag); - - /* the tilt */ - normalize_v3(dir); - q[0] = cosf(0.5 * vec[3]); - si = sinf(0.5 * vec[3]); - q[1] = -si * dir[0]; - q[2] = -si * dir[1]; - q[3] = -si * dir[2]; - mul_qt_qtqt(quat, q, quat); -#else quat_apply_track(quat, ob->trackflag, ob->upflag); -#endif normalize_qt(quat); quat_to_mat4(mat, quat); } diff --git a/source/blender/blenkernel/intern/ocean.c b/source/blender/blenkernel/intern/ocean.c index ab0130019b8..adbe1a7f889 100644 --- a/source/blender/blenkernel/intern/ocean.c +++ b/source/blender/blenkernel/intern/ocean.c @@ -242,14 +242,6 @@ static void init_complex(fftw_complex cmpl, float real, float image) cmpl[1] = image; } -#if 0 /* unused */ -static void add_complex_f(fftw_complex res, fftw_complex cmpl, float f) -{ - res[0] = cmpl[0] + f; - res[1] = cmpl[1]; -} -#endif - static void add_comlex_c(fftw_complex res, fftw_complex cmpl1, fftw_complex cmpl2) { res[0] = cmpl1[0] + cmpl2[0]; @@ -775,15 +767,6 @@ void BKE_ocean_simulate(struct Ocean *o, float t, float scale, float chop_amount if (o->_do_normals) { BLI_task_pool_push(pool, ocean_compute_normal_x, NULL, false, TASK_PRIORITY_HIGH); BLI_task_pool_push(pool, ocean_compute_normal_z, NULL, false, TASK_PRIORITY_HIGH); - -#if 0 - for (i = 0; i < o->_M; ++i) { - for (j = 0; j < o->_N; ++j) { - o->_N_y[i * o->_N + j] = 1.0f / scale; - } - } - (MEM01) -#endif o->_N_y = 1.0f / scale; } @@ -1257,30 +1240,12 @@ void BKE_ocean_simulate_cache(struct OceanCache *och, int frame) cache_filename(string, och->bakepath, och->relbase, frame, CACHE_TYPE_DISPLACE); och->ibufs_disp[f] = IMB_loadiffname(string, 0, NULL); -#if 0 - if (och->ibufs_disp[f] == NULL) - printf("error loading %s\n", string); - else - printf("loaded cache %s\n", string); -#endif cache_filename(string, och->bakepath, och->relbase, frame, CACHE_TYPE_FOAM); och->ibufs_foam[f] = IMB_loadiffname(string, 0, NULL); -#if 0 - if (och->ibufs_foam[f] == NULL) - printf("error loading %s\n", string); - else - printf("loaded cache %s\n", string); -#endif cache_filename(string, och->bakepath, och->relbase, frame, CACHE_TYPE_NORMAL); och->ibufs_norm[f] = IMB_loadiffname(string, 0, NULL); -#if 0 - if (och->ibufs_norm[f] == NULL) - printf("error loading %s\n", string); - else - printf("loaded cache %s\n", string); -#endif } @@ -1355,13 +1320,6 @@ void BKE_ocean_bake(struct Ocean *o, struct OceanCache *och, void (*update_cb)(v * break up the foam where height (Y) is low (wave valley), and X and Z displacement is greatest */ -#if 0 - vec[0] = ocr.disp[0]; - vec[1] = ocr.disp[2]; - hor_stretch = len_v2(vec); - CLAMP(hor_stretch, 0.0, 1.0); -#endif - neg_disp = ocr.disp[1] < 0.0f ? 1.0f + ocr.disp[1] : 1.0f; neg_disp = neg_disp < 0.0f ? 0.0f : neg_disp; @@ -1369,15 +1327,6 @@ void BKE_ocean_bake(struct Ocean *o, struct OceanCache *och, void (*update_cb)(v neg_eplus = ocr.Eplus[2] < 0.0f ? 1.0f + ocr.Eplus[2] : 1.0f; neg_eplus = neg_eplus < 0.0f ? 0.0f : neg_eplus; -#if 0 - if (ocr.disp[1] < 0.0 || r > och->foam_fade) - pr *= och->foam_fade; - - - pr = pr * (1.0 - hor_stretch) * ocr.disp[1]; - pr = pr * neg_disp * neg_eplus; -#endif - if (pr < 1.0f) pr *= pr; diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index 0637fc4f00c..8d7a832671f 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -264,33 +264,6 @@ void packAll(Main *bmain, ReportList *reports, bool verbose) BKE_report(reports, RPT_INFO, "No new files have been packed"); } - -#if 0 - -// attempt to create a function that generates an unique filename -// this will work when all functions in fileops.c understand relative filenames... - -static char *find_new_name(char *name) -{ - char tempname[FILE_MAX]; - char *newname; - size_t len; - - if (fop_exists(name)) { - for (number = 1; number <= 999; number++) { - BLI_snprintf(tempname, sizeof(tempname), "%s.%03d", name, number); - if (!fop_exists(tempname)) { - break; - } - } - } - len = strlen(tempname) + 1; - newname = MEM_mallocN(len, "find_new_name"); - memcpy(newname, tempname, len * sizeof(char)); - return newname; -} -#endif - int writePackedFile( ReportList *reports, const char *ref_file_name, const char *filename, PackedFile *pf, const bool guimode) { diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 7a217f59536..cec27b8f187 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -232,23 +232,6 @@ void psys_set_current_num(Object *ob, int index) } } -#if 0 /* UNUSED */ -Object *psys_find_object(Scene *scene, ParticleSystem *psys) -{ - Base *base; - ParticleSystem *tpsys; - - for (base = scene->base.first; base; base = base->next) { - for (tpsys = base->object->particlesystem.first; psys; psys = psys->next) { - if (tpsys == psys) - return base->object; - } - } - - return NULL; -} -#endif - struct LatticeDeformData *psys_create_lattice_deform_data(ParticleSimulationData *sim) { struct LatticeDeformData *lattice_deform_data = NULL; @@ -2927,22 +2910,6 @@ void psys_get_from_key(ParticleKey *key, float loc[3], float vel[3], float rot[4 if (rot) copy_qt_qt(rot, key->rot); if (time) *time = key->time; } -/*-------changing particle keys from space to another-------*/ -#if 0 -static void key_from_object(Object *ob, ParticleKey *key) -{ - float q[4]; - - add_v3_v3(key->vel, key->co); - - mul_m4_v3(ob->obmat, key->co); - mul_m4_v3(ob->obmat, key->vel); - mat4_to_quat(q, ob->obmat); - - sub_v3_v3v3(key->vel, key->vel, key->co); - mul_qt_qtqt(key->rot, q, key->rot); -} -#endif static void triatomat(float *v1, float *v2, float *v3, float (*uv)[2], float mat[4][4]) { @@ -3850,14 +3817,6 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey * } } - /* correct child ipo timing */ -#if 0 // XXX old animation system - if ((part->flag & PART_ABS_TIME) == 0 && part->ipo) { - calc_ipo(part->ipo, 100.0f * t); - execute_ipo((ID *)part, part->ipo); - } -#endif // XXX old animation system - /* get different child parameters from textures & vgroups */ memset(&ctx, 0, sizeof(ParticleThreadContext)); ctx.sim = *sim; diff --git a/source/blender/blenkernel/intern/particle_child.c b/source/blender/blenkernel/intern/particle_child.c index f21b3a74fea..339c8533e51 100644 --- a/source/blender/blenkernel/intern/particle_child.c +++ b/source/blender/blenkernel/intern/particle_child.c @@ -299,11 +299,6 @@ void psys_apply_child_modifiers(ParticleThreadContext *ctx, struct ListBase *mod int totkeys, k; float max_length; -#if 0 /* TODO for the future: use true particle modifiers that work on the whole curve */ - for (mod = modifiers->first; mod; mod = mod->next) { - mod->apply(keys, totkeys, parent_keys); - } -#else (void)modifiers; (void)mod; @@ -379,7 +374,6 @@ void psys_apply_child_modifiers(ParticleThreadContext *ctx, struct ListBase *mod } } } -#endif } /* ------------------------------------------------------------------------- */ diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 25d86851618..c363d9f29c2 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -4068,9 +4068,7 @@ static void system_step(ParticleSimulationData *sim, float cfra, const bool use_ sim->courant_num = 0.0f; dynamics_step(sim, cfra+dframe+t_frac - 1.f); psys->cfra = cfra+dframe+t_frac - 1.f; -#if 0 - printf("%f,%f,%f,%f\n", cfra+dframe+t_frac - 1.f, t_frac, dt_frac, sim->courant_num); -#endif + if (part->time_flag & PART_TIME_AUTOSF) update_timestep(psys, sim); /* Even without AUTOSF dt_frac may not add up to 1.0 due to float precision. */ diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c index e32a5d0681e..b58a35e9841 100644 --- a/source/blender/blenkernel/intern/pbvh_bmesh.c +++ b/source/blender/blenkernel/intern/pbvh_bmesh.c @@ -413,45 +413,6 @@ static bool pbvh_bmesh_node_limit_ensure(PBVH *bvh, int node_index) /**********************************************************************/ -#if 0 -static int pbvh_bmesh_node_offset_from_elem(PBVH *bvh, BMElem *ele) -{ - switch (ele->head.htype) { - case BM_VERT: - return bvh->cd_vert_node_offset; - default: - BLI_assert(ele->head.htype == BM_FACE); - return bvh->cd_face_node_offset; - } - -} - -static int pbvh_bmesh_node_index_from_elem(PBVH *bvh, void *key) -{ - const int cd_node_offset = pbvh_bmesh_node_offset_from_elem(bvh, key); - const int node_index = BM_ELEM_CD_GET_INT((BMElem *)key, cd_node_offset); - - BLI_assert(node_index != DYNTOPO_NODE_NONE); - BLI_assert(node_index < bvh->totnode); - (void)bvh; - - return node_index; -} - -static PBVHNode *pbvh_bmesh_node_from_elem(PBVH *bvh, void *key) -{ - return &bvh->nodes[pbvh_bmesh_node_index_from_elem(bvh, key)]; -} - -/* typecheck */ -#define pbvh_bmesh_node_index_from_elem(bvh, key) ( \ - CHECK_TYPE_ANY(key, BMFace *, BMVert *), \ - pbvh_bmesh_node_index_from_elem(bvh, key)) -#define pbvh_bmesh_node_from_elem(bvh, key) ( \ - CHECK_TYPE_ANY(key, BMFace *, BMVert *), \ - pbvh_bmesh_node_from_elem(bvh, key)) -#endif - BLI_INLINE int pbvh_bmesh_node_index_from_vert(PBVH *bvh, const BMVert *key) { const int node_index = BM_ELEM_CD_GET_INT((const BMElem *)key, bvh->cd_vert_node_offset); @@ -535,25 +496,6 @@ static BMFace *pbvh_bmesh_face_create( return f; } -/* Return the number of faces in 'node' that use vertex 'v' */ -#if 0 -static int pbvh_bmesh_node_vert_use_count(PBVH *bvh, PBVHNode *node, BMVert *v) -{ - BMFace *f; - int count = 0; - - BM_FACES_OF_VERT_ITER_BEGIN(f, v) { - PBVHNode *f_node = pbvh_bmesh_node_from_face(bvh, f); - if (f_node == node) { - count++; - } - } - BM_FACES_OF_VERT_ITER_END; - - return count; -} -#endif - #define pbvh_bmesh_node_vert_use_count_is_equal(bvh, node, v, n) \ (pbvh_bmesh_node_vert_use_count_at_most(bvh, node, v, (n) + 1) == n) @@ -1255,12 +1197,7 @@ static bool pbvh_bmesh_subdivide_long_edges( /* At the moment edges never get shorter (subdiv will make new edges) * unlike collapse where edges can become longer. */ -#if 0 - if (len_squared_v3v3(v1->co, v2->co) <= eq_ctx->q->limit_len_squared) - continue; -#else BLI_assert(len_squared_v3v3(v1->co, v2->co) > eq_ctx->q->limit_len_squared); -#endif /* Check that the edge's vertices are still in the PBVH. It's * possible that an edge collapse has deleted adjacent faces @@ -1336,25 +1273,12 @@ static void pbvh_bmesh_collapse_edge( /* Get vertices, replace use of v_del with v_conn */ // BM_iter_as_array(NULL, BM_VERTS_OF_FACE, f, (void **)v_tri, 3); BMFace *f = l->f; -#if 0 - BMVert *v_tri[3]; - BM_face_as_array_vert_tri(f, v_tri); - for (int i = 0; i < 3; i++) { - if (v_tri[i] == v_del) { - v_tri[i] = v_conn; - } - } -#endif /* Check if a face using these vertices already exists. If so, * skip adding this face and mark the existing one for * deletion as well. Prevents extraneous "flaps" from being * created. */ -#if 0 - if (UNLIKELY(existing_face = BM_face_exists(v_tri, 3))) -#else if (UNLIKELY(existing_face = bm_face_exists_tri_from_loop_vert(l->next, v_conn))) -#endif { BLI_buffer_append(deleted_faces, BMFace *, existing_face); } @@ -2043,17 +1967,7 @@ void BKE_pbvh_bmesh_node_save_orig(PBVHNode *node) if (BM_elem_flag_test(f, BM_ELEM_HIDDEN)) continue; -#if 0 - BMIter bm_iter; - BMVert *v; - int j = 0; - BM_ITER_ELEM (v, &bm_iter, f, BM_VERTS_OF_FACE) { - node->bm_ortri[i][j] = BM_elem_index_get(v); - j++; - } -#else bm_face_as_array_index_tri(f, node->bm_ortri[i]); -#endif i++; } node->bm_tot_ortri = i; @@ -2276,24 +2190,6 @@ static void pbvh_bmesh_verify(PBVH *bvh) } } -#if 0 - /* check that every vert belongs somewhere */ - /* Slow */ - BM_ITER_MESH (vi, &iter, bvh->bm, BM_VERTS_OF_MESH) { - bool has_unique = false; - for (int i = 0; i < bvh->totnode; i++) { - PBVHNode *n = &bvh->nodes[i]; - if ((n->bm_unique_verts != NULL) && BLI_gset_haskey(n->bm_unique_verts, vi)) - has_unique = true; - } - BLI_assert(has_unique); - vert_count++; - } - - /* if totvert differs from number of verts inside the hash. hash-totvert is checked above */ - BLI_assert(vert_count == bvh->bm->totvert); -#endif - /* Check that node elements are recorded in the top level */ for (int i = 0; i < bvh->totnode; i++) { PBVHNode *n = &bvh->nodes[i]; diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 8f8926545c6..7fc36c423c1 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -3170,19 +3170,6 @@ void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startfra if (startframe && endframe) { *startframe= cache->startframe; *endframe= cache->endframe; - - /* TODO: time handling with object offsets and simulated vs. cached - * particles isn't particularly easy, so for now what you see is what - * you get. In the future point cache could handle the whole particle - * system timing. */ -#if 0 - if ((ob->partype & PARSLOW)==0) { - offset= ob->sf; - - *startframe += (int)(offset+0.5f); - *endframe += (int)(offset+0.5f); - } -#endif } /* verify cached_frames array is up to date */ @@ -3288,12 +3275,6 @@ int BKE_ptcache_id_reset(Scene *scene, PTCacheID *pid, int mode) sbFreeSimulation(pid->calldata); else if (pid->type == PTCACHE_TYPE_PARTICLES) psys_reset(pid->calldata, PSYS_RESET_DEPSGRAPH); -#if 0 - else if (pid->type == PTCACHE_TYPE_SMOKE_DOMAIN) - smokeModifier_reset(pid->calldata); - else if (pid->type == PTCACHE_TYPE_SMOKE_HIGHRES) - smokeModifier_reset_turbulence(pid->calldata); -#endif else if (pid->type == PTCACHE_TYPE_DYNAMICPAINT) dynamicPaint_clearSurface(scene, (DynamicPaintSurface*)pid->calldata); } diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c index 3f9f6f15892..68bc6c407ac 100644 --- a/source/blender/blenkernel/intern/rigidbody.c +++ b/source/blender/blenkernel/intern/rigidbody.c @@ -567,12 +567,6 @@ void BKE_rigidbody_calc_volume(Object *ob, float *r_vol) } break; } - -#if 0 // XXX: not defined yet - case RB_SHAPE_COMPOUND: - volume = 0.0f; - break; -#endif } /* return the volume calculated */ @@ -640,12 +634,6 @@ void BKE_rigidbody_calc_center_of_mass(Object *ob, float r_center[3]) } break; } - -#if 0 // XXX: not defined yet - case RB_SHAPE_COMPOUND: - volume = 0.0f; - break; -#endif } } diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 44406714771..c16adabbc8c 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -1126,12 +1126,6 @@ int BKE_scene_base_iter_next(Depsgraph *depsgraph, SceneBaseIter *iter, } } -#if 0 - if (ob && *ob) { - printf("Scene: '%s', '%s'\n", (*scene)->id.name + 2, (*ob)->id.name + 2); - } -#endif - return iter->phase; } diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index 8820340d6dc..ba2d2ef0d46 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -1767,76 +1767,6 @@ static float check_zone(WipeZone *wipezone, int x, int y, Sequence *seq, float f if (output != output) output = 1; if (wipe->forward) output = 1 - output; break; - /* BOX WIPE IS NOT WORKING YET */ - /* case DO_CROSS_WIPE: */ - /* BOX WIPE IS NOT WORKING YET */ -#if 0 - case DO_BOX_WIPE: - if (!wipe->forward) { - facf0 = 1.0f - facf0; /* Go the other direction */ - } - - width = (int)(wipe->edgeWidth * ((xo + yo) / 2.0)); - hwidth = (float)width / 2.0; - if (angle == 0) angle = 0.000001; - b1 = posy / 2 - (-angle) * posx / 2; - b3 = (yo - posy / 2) - (-angle) * (xo - posx / 2); - b2 = y - (-angle) * x; - - hyp = abs(angle * x + y + (-posy / 2 - angle * posx / 2)) * wipezone->pythangle; - hyp2 = abs(angle * x + y + (-(yo - posy / 2) - angle * (xo - posx / 2))) * wipezone->pythangle; - - temp1 = xo * (1 - facf0 / 2) - xo * facf0 / 2; - temp2 = yo * (1 - facf0 / 2) - yo * facf0 / 2; - pointdist = hypot(temp1, temp2); - - if (b2 < b1 && b2 < b3) { - if (hwidth < pointdist) - output = in_band(hwidth, hyp, 0, 1); - } - else if (b2 > b1 && b2 > b3) { - if (hwidth < pointdist) - output = in_band(hwidth, hyp2, 0, 1); - } - else { - if (hyp < hwidth && hyp2 > hwidth) - output = in_band(hwidth, hyp, 1, 1); - else if (hyp > hwidth && hyp2 < hwidth) - output = in_band(hwidth, hyp2, 1, 1); - else - output = in_band(hwidth, hyp2, 1, 1) * in_band(hwidth, hyp, 1, 1); - } - - if (!wipe->forward) { - facf0 = 1.0f - facf0; /* Go the other direction */ - } - angle = -1 / angle; - b1 = posy / 2 - (-angle) * posx / 2; - b3 = (yo - posy / 2) - (-angle) * (xo - posx / 2); - b2 = y - (-angle) * x; - - hyp = abs(angle * x + y + (-posy / 2 - angle * posx / 2)) * wipezone->pythangle; - hyp2 = abs(angle * x + y + (-(yo - posy / 2) - angle * (xo - posx / 2))) * wipezone->pythangle; - - if (b2 < b1 && b2 < b3) { - if (hwidth < pointdist) - output *= in_band(hwidth, hyp, 0, 1); - } - else if (b2 > b1 && b2 > b3) { - if (hwidth < pointdist) - output *= in_band(hwidth, hyp2, 0, 1); - } - else { - if (hyp < hwidth && hyp2 > hwidth) - output *= in_band(hwidth, hyp, 1, 1); - else if (hyp > hwidth && hyp2 < hwidth) - output *= in_band(hwidth, hyp2, 1, 1); - else - output *= in_band(hwidth, hyp2, 1, 1) * in_band(hwidth, hyp, 1, 1); - } - - break; -#endif case DO_IRIS_WIPE: if (xo > yo) yo = xo; else xo = yo; diff --git a/source/blender/blenkernel/intern/seqmodifier.c b/source/blender/blenkernel/intern/seqmodifier.c index 4a483d439e4..70d24718e5a 100644 --- a/source/blender/blenkernel/intern/seqmodifier.c +++ b/source/blender/blenkernel/intern/seqmodifier.c @@ -212,14 +212,11 @@ static void whiteBalance_apply_threaded(int width, int height, unsigned char *re } copy_v4_v4(result, rgba); -#if 0 - mul_v3_v3(result, multiplier); -#else + /* similar to division without the clipping */ for (int i = 0; i < 3; i++) { result[i] = 1.0f - powf(1.0f - rgba[i], multiplier[i]); } -#endif if (mask_rect_float) { copy_v3_v3(mask, mask_rect_float + pixel_index); diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index e5aa9b4915e..416e0ad59c1 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -120,19 +120,6 @@ ListBase seqbase_clipboard; int seqbase_clipboard_frame; SequencerDrawView sequencer_view3d_cb = NULL; /* NULL in background mode */ -#if 0 /* unused function */ -static void printf_strip(Sequence *seq) -{ - fprintf(stderr, "name: '%s', len:%d, start:%d, (startofs:%d, endofs:%d), " - "(startstill:%d, endstill:%d), machine:%d, (startdisp:%d, enddisp:%d)\n", - seq->name, seq->len, seq->start, seq->startofs, seq->endofs, seq->startstill, seq->endstill, seq->machine, - seq->startdisp, seq->enddisp); - - fprintf(stderr, "\tseq_tx_set_final_left: %d %d\n\n", seq_tx_get_final_left(seq, 0), - seq_tx_get_final_right(seq, 0)); -} -#endif - static void sequencer_state_init(SeqRenderState *state) { state->scene_parents = NULL; @@ -1596,12 +1583,8 @@ static void seq_open_anim_file(Scene *scene, Sequence *seq, bool openfile) } if (sanim->anim) { -#if 0 - seq_anim_add_suffix(scene, sanim->anim, i); -#else /* we already have the suffix */ IMB_suffix_anim(sanim->anim, suffix); -#endif } else { if (openfile) { @@ -3749,14 +3732,6 @@ static ImBuf *seq_render_strip_stack( return NULL; } -#if 0 /* commentind since this breaks keyframing, since it resets the value on draw */ - if (scene->r.cfra != cfra) { - /* XXX for prefetch and overlay offset!..., very bad!!! */ - AnimData *adt = BKE_animdata_from_id(&scene->id); - BKE_animsys_evaluate_animdata(scene, &scene->id, adt, cfra, ADT_RECALC_ANIM); - } -#endif - out = BKE_sequencer_cache_get(context, seq_arr[count - 1], cfra, SEQ_STRIPELEM_IBUF_COMP); if (out) { @@ -4375,16 +4350,6 @@ void BKE_sequence_tx_handle_xlimits(Sequence *seq, int leftflag, int rightflag) if (BKE_sequence_tx_get_final_left(seq, false) >= seq_tx_get_end(seq)) { BKE_sequence_tx_set_final_left(seq, seq_tx_get_end(seq) - 1); } - - /* dosnt work now - TODO */ -#if 0 - if (seq_tx_get_start(seq) >= seq_tx_get_final_right(seq, 0)) { - int ofs; - ofs = seq_tx_get_start(seq) - seq_tx_get_final_right(seq, 0); - seq->start -= ofs; - seq_tx_set_final_left(seq, seq_tx_get_final_left(seq, 0) + ofs); - } -#endif } } @@ -5253,11 +5218,6 @@ Sequence *BKE_sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoad if (sound->playback_handle == NULL) { BKE_libblock_free(bmain, sound); -#if 0 - if (op) - BKE_report(op->reports, RPT_ERROR, "Unsupported audio format"); -#endif - return NULL; } @@ -5265,10 +5225,6 @@ Sequence *BKE_sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoad if (info.specs.channels == AUD_CHANNELS_INVALID) { BKE_libblock_free(bmain, sound); -#if 0 - if (op) - BKE_report(op->reports, RPT_ERROR, "Unsupported audio format"); -#endif return NULL; } diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index f5dd7ef794b..be3a025a96f 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -2608,15 +2608,6 @@ static void step( float gravity[3] = {0.0f, 0.0f, -1.0f}; float gravity_mag; -#if 0 /* UNUSED */ - /* get max velocity and lower the dt value if it is too high */ - size_t size = sds->res[0] * sds->res[1] * sds->res[2]; - float *velX = smoke_get_velocity_x(sds->fluid); - float *velY = smoke_get_velocity_y(sds->fluid); - float *velZ = smoke_get_velocity_z(sds->fluid); - size_t i; -#endif - /* update object state */ invert_m4_m4(sds->imat, ob->obmat); copy_m4_m4(sds->obmat, ob->obmat); @@ -2639,14 +2630,6 @@ static void step( // maximum timestep/"CFL" constraint: dt < 5.0 *dx / maxVel maxVel = (sds->dx * 5.0f); -#if 0 - for (i = 0; i < size; i++) { - float vtemp = (velX[i] * velX[i] + velY[i] * velY[i] + velZ[i] * velZ[i]); - if (vtemp > maxVelMag) - maxVelMag = vtemp; - } -#endif - maxVelMag = sqrtf(maxVelMag) * dt * sds->time_scale; totalSubsteps = (int)((maxVelMag / maxVel) + 1.0f); /* always round up */ totalSubsteps = (totalSubsteps < 1) ? 1 : totalSubsteps; diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index e3bd6f9860f..e4ea839770a 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -972,9 +972,6 @@ static int sb_detect_aabb_collisionCached(float UNUSED(force[3]), struct Object GHashIterator *ihash; float aabbmin[3], aabbmax[3]; int deflected=0; -#if 0 - int a; -#endif if ((sb == NULL) || (sb->scratch ==NULL)) return 0; copy_v3_v3(aabbmin, sb->scratch->aabbmin); @@ -1807,45 +1804,6 @@ static int sb_deflect_face(Object *ob, float *actpos, float *facenormal, float * return(deflected); } -/* hiding this for now .. but the jacobian may pop up on other tasks .. so i'd like to keep it */ -#if 0 -static void dfdx_spring(int ia, int ic, int op, float dir[3], float L, float len, float factor) -{ - float m, delta_ij; - int i, j; - if (L < len) { - for (i=0;i<3;i++) { - for (j=0;j<3;j++) { - delta_ij = (i==j ? (1.0f): (0.0f)); - m=factor*(dir[i]*dir[j] + (1-L/len)*(delta_ij - dir[i]*dir[j])); - EIG_linear_solver_matrix_add(ia+i, op+ic+j, m); - } - } - } - else { - for (i=0;i<3;i++) { - for (j=0;j<3;j++) { - m=factor*dir[i]*dir[j]; - EIG_linear_solver_matrix_add(ia+i, op+ic+j, m); - } - } - } -} - - -static void dfdx_goal(int ia, int ic, int op, float factor) -{ - int i; - for (i=0;i<3;i++) EIG_linear_solver_matrix_add(ia+i, op+ic+i, factor); -} - -static void dfdv_goal(int ia, int ic, float factor) -{ - int i; - for (i=0;i<3;i++) EIG_linear_solver_matrix_add(ia+i, ic+i, factor); -} -#endif /* if 0 */ - static void sb_spring_force(Object *ob, int bpi, BodySpring *bs, float iks, float UNUSED(forcetime)) { SoftBody *sb= ob->soft; /* is supposed to be there */ @@ -1853,25 +1811,15 @@ static void sb_spring_force(Object *ob, int bpi, BodySpring *bs, float iks, floa float dir[3], dvel[3]; float distance, forcefactor, kd, absvel, projvel, kw; -#if 0 /* UNUSED */ - int ia, ic; -#endif + /* prepare depending on which side of the spring we are on */ if (bpi == bs->v1) { bp1 = &sb->bpoint[bs->v1]; bp2 = &sb->bpoint[bs->v2]; -#if 0 /* UNUSED */ - ia =3*bs->v1; - ic =3*bs->v2; -#endif } else if (bpi == bs->v2) { bp1 = &sb->bpoint[bs->v2]; bp2 = &sb->bpoint[bs->v1]; -#if 0 /* UNUSED */ - ia =3*bs->v2; - ic =3*bs->v1; -#endif } else { /* TODO make this debug option */ @@ -2496,13 +2444,6 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float * aabbmin[0]=aabbmin[1]=aabbmin[2] = 1e20f; aabbmax[0]=aabbmax[1]=aabbmax[2] = -1e20f; - /* old one with homogeneous masses */ - /* claim a minimum mass for vertex */ -#if 0 - if (sb->nodemass > 0.009999f) timeovermass = forcetime / sb->nodemass; - else timeovermass = forcetime / 0.009999f; -#endif - for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { /* now we have individual masses */ /* claim a minimum mass for vertex */ @@ -2547,16 +2488,6 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float * /* x(t + dt) = x(t) + v(t~) * dt */ mul_v3_fl(dx, forcetime); - /* the freezer coming sooner or later */ -#if 0 - if ((dot_v3v3(dx, dx)<freezeloc )&&(dot_v3v3(bp->force, bp->force)<freezeforce )) { - bp->frozen /=2; - } - else { - bp->frozen = min_ff(bp->frozen*1.05f, 1.0f); - } - mul_v3_fl(dx, bp->frozen); -#endif /* again some nasty if's to have heun in here too */ if (mode ==1) { copy_v3_v3(bp->prevpos, bp->pos); @@ -2621,81 +2552,6 @@ static void softbody_restore_prev_step(Object *ob) } } -#if 0 -static void softbody_store_step(Object *ob) -{ - SoftBody *sb= ob->soft; /* is supposed to be there*/ - BodyPoint *bp; - int a; - - for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { - copy_v3_v3(bp->prevvec, bp->vec); - copy_v3_v3(bp->prevpos, bp->pos); - } -} - - -/* used by predictors and correctors */ -static void softbody_store_state(Object *ob, float *ppos, float *pvel) -{ - SoftBody *sb= ob->soft; /* is supposed to be there*/ - BodyPoint *bp; - int a; - float *pp=ppos, *pv=pvel; - - for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { - - copy_v3_v3(pv, bp->vec); - pv+=3; - - copy_v3_v3(pp, bp->pos); - pp+=3; - } -} - -/* used by predictors and correctors */ -static void softbody_retrieve_state(Object *ob, float *ppos, float *pvel) -{ - SoftBody *sb= ob->soft; /* is supposed to be there*/ - BodyPoint *bp; - int a; - float *pp=ppos, *pv=pvel; - - for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { - - copy_v3_v3(bp->vec, pv); - pv+=3; - - copy_v3_v3(bp->pos, pp); - pp+=3; - } -} - -/* used by predictors and correctors */ -static void softbody_swap_state(Object *ob, float *ppos, float *pvel) -{ - SoftBody *sb= ob->soft; /* is supposed to be there*/ - BodyPoint *bp; - int a; - float *pp=ppos, *pv=pvel; - float temp[3]; - - for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) { - - copy_v3_v3(temp, bp->vec); - copy_v3_v3(bp->vec, pv); - copy_v3_v3(pv, temp); - pv+=3; - - copy_v3_v3(temp, bp->pos); - copy_v3_v3(bp->pos, pp); - copy_v3_v3(pp, temp); - pp+=3; - } -} -#endif - - /* care for bodypoints taken out of the 'ordinary' solver step * because they are screwed to goal by bolts * they just need to move along with the goal in time diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index f803956d6f6..bba3e97cad7 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -1045,43 +1045,6 @@ static void ccgDM_getFinalEdge(DerivedMesh *dm, int edgeNum, MEdge *med) int gridSideEdges; int gridInternalEdges; - /* code added in bmesh but works correctly without, commenting - campbell */ -#if 0 - int lasti, previ; - i = lastface; - lasti = 0; - while (1) { - previ = i; - if (ccgdm->faceMap[i].startEdge >= edgeNum) { - i -= fabsf(i - lasti) / 2.0f; - } - else if (ccgdm->faceMap[i].startEdge < edgeNum) { - i += fabsf(i - lasti) / 2.0f; - } - else { - break; - } - - if (i < 0) { - i = 0; - break; - } - - if (i > lastface) { - i = lastface; - break; - - } - - if (i == lasti) - break; - - lasti = previ; - } - - i = i > 0 ? i - 1 : i; -#endif - i = 0; while (i < lastface && edgeNum >= ccgdm->faceMap[i + 1].startEdge) { i++; @@ -2555,14 +2518,6 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm, has_edge_cd = ((ccgdm->dm.edgeData.totlayer - (edgeOrigIndex ? 1 : 0)) != 0); -#if 0 - /* this is not in trunk, can gives problems because colors initialize - * as black, just don't do it!, it works fine - campbell */ - if (!CustomData_has_layer(&ccgdm->dm.faceData, CD_MCOL)) - DM_add_tessface_layer(&ccgdm->dm, CD_MCOL, CD_CALLOC, NULL); - mcol = DM_get_tessface_data_layer(&ccgdm->dm, CD_MCOL); -#endif - loopindex = loopindex2 = 0; /* current loop index */ for (index = 0; index < totface; index++) { CCGFace *f = ccgdm->faceMap[index].face; diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index d512c4ac78e..5dc8d6133eb 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -1472,178 +1472,6 @@ static void txt_undo_end(Text *UNUSED(text), TextUndoBuf *utxt) utxt->buf[undo_pos_end] = '\0'; } -/* Call once undo is done. */ -#ifndef NDEBUG - -#endif - -#if 0 /* UNUSED */ -static void dump_buffer(TextUndoBuf *utxt) -{ - int i = 0; - - while (i++ < utxt->undo_pos) printf("%d: %d %c\n", i, utxt->buf[i], utxt->buf[i]); -} - -/* Note: this function is outdated and must be updated if needed for future use */ -void txt_print_undo(Text *text) -{ - int i = 0; - int op; - const char *ops; - int linep, charp; - - dump_buffer(text); - - printf("---< Undo Buffer >---\n"); - - printf("UndoPosition is %d\n", utxt->pos); - - while (i <= utxt->pos) { - op = utxt->buf[i]; - - if (op == UNDO_INSERT_1) { - ops = "Insert ascii "; - } - else if (op == UNDO_INSERT_2) { - ops = "Insert 2 bytes "; - } - else if (op == UNDO_INSERT_3) { - ops = "Insert 3 bytes "; - } - else if (op == UNDO_INSERT_4) { - ops = "Insert unicode "; - } - else if (op == UNDO_BS_1) { - ops = "Backspace for ascii "; - } - else if (op == UNDO_BS_2) { - ops = "Backspace for 2 bytes "; - } - else if (op == UNDO_BS_3) { - ops = "Backspace for 3 bytes "; - } - else if (op == UNDO_BS_4) { - ops = "Backspace for unicode "; - } - else if (op == UNDO_DEL_1) { - ops = "Delete ascii "; - } - else if (op == UNDO_DEL_2) { - ops = "Delete 2 bytes "; - } - else if (op == UNDO_DEL_3) { - ops = "Delete 3 bytes "; - } - else if (op == UNDO_DEL_4) { - ops = "Delete unicode "; - } - else if (op == UNDO_DBLOCK) { - ops = "Delete text block"; - } - else if (op == UNDO_IBLOCK) { - ops = "Insert text block"; - } - else if (op == UNDO_INDENT) { - ops = "Indent "; - } - else if (op == UNDO_UNINDENT) { - ops = "Unindent "; - } - else if (op == UNDO_COMMENT) { - ops = "Comment "; - } - else if (op == UNDO_UNCOMMENT) { - ops = "Uncomment "; - } - else { - ops = "Unknown"; - } - - printf("Op (%o) at %d = %s", op, i, ops); - if (op >= UNDO_INSERT_1 && op <= UNDO_DEL_4) { - i++; - printf(" - Char is "); - switch (op) { - case UNDO_INSERT_1: case UNDO_BS_1: case UNDO_DEL_1: - printf("%c", utxt->buf[i]); - i++; - break; - case UNDO_INSERT_2: case UNDO_BS_2: case UNDO_DEL_2: - printf("%c%c", utxt->buf[i], utxt->buf[i + 1]); - i += 2; - break; - case UNDO_INSERT_3: case UNDO_BS_3: case UNDO_DEL_3: - printf("%c%c%c", utxt->buf[i], utxt->buf[i + 1], utxt->buf[i + 2]); - i += 3; - break; - case UNDO_INSERT_4: case UNDO_BS_4: case UNDO_DEL_4: - { - unsigned int uc; - char c[BLI_UTF8_MAX + 1]; - size_t c_len; - uc = utxt->buf[i]; i++; - uc = uc + (utxt->buf[i] << 8); i++; - uc = uc + (utxt->buf[i] << 16); i++; - uc = uc + (utxt->buf[i] << 24); i++; - c_len = BLI_str_utf8_from_unicode(uc, c); - c[c_len] = '\0'; - puts(c); - break; - } - } - } - else if (op == UNDO_DBLOCK || op == UNDO_IBLOCK) { - i++; - - linep = utxt->buf[i]; i++; - linep = linep + (utxt->buf[i] << 8); i++; - linep = linep + (utxt->buf[i] << 16); i++; - linep = linep + (utxt->buf[i] << 24); i++; - - printf(" (length %d) <", linep); - - while (linep > 0) { - putchar(utxt->buf[i]); - linep--; i++; - } - - linep = utxt->buf[i]; i++; - linep = linep + (utxt->buf[i] << 8); i++; - linep = linep + (utxt->buf[i] << 16); i++; - linep = linep + (utxt->buf[i] << 24); i++; - printf("> (%d)", linep); - } - else if (op == UNDO_INDENT || op == UNDO_UNINDENT) { - i++; - - charp = utxt->buf[i]; i++; - charp = charp + (utxt->buf[i] << 8); i++; - - linep = utxt->buf[i]; i++; - linep = linep + (utxt->buf[i] << 8); i++; - linep = linep + (utxt->buf[i] << 16); i++; - linep = linep + (utxt->buf[i] << 24); i++; - - printf("to <%d, %d> ", linep, charp); - - charp = utxt->buf[i]; i++; - charp = charp + (utxt->buf[i] << 8); i++; - - linep = utxt->buf[i]; i++; - linep = linep + (utxt->buf[i] << 8); i++; - linep = linep + (utxt->buf[i] << 16); i++; - linep = linep + (utxt->buf[i] << 24); i++; - - printf("from <%d, %d>", linep, charp); - } - - printf(" %d\n", i); - i++; - } -} -#endif - static void txt_undo_store_uint16(char *undo_buf, int *undo_pos, unsigned short value) { undo_buf[*undo_pos] = (value) & 0xff; diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c index 3663ccd6513..e2a0837b938 100644 --- a/source/blender/blenkernel/intern/unit.c +++ b/source/blender/blenkernel/intern/unit.c @@ -412,17 +412,6 @@ static size_t unit_as_string(char *str, int len_max, double value, int prec, con while (unit->name_short[j] && (i < len_max)) { str[i++] = unit->name_short[j++]; } -#if 0 - if (pad) { - /* this loop only runs if so many zeros were removed that - * the unit name only used padded chars, - * In that case add padding for the name. */ - - while (i <= len + j && (i < len_max)) { - str[i++] = pad; - } - } -#endif } /* terminate no matter what's done with padding above */ diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 9cdb48998a0..d53cba184ad 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -607,14 +607,6 @@ static AVStream *alloc_video_stream(FFMpegContext *context, RenderData *rd, int } } -#if 0 - /* this options are not set in ffmpeg.c and leads to artifacts with MPEG-4 - * see #33586: Encoding to mpeg4 makes first frame(s) blocky - */ - c->rc_initial_buffer_occupancy = rd->ffcodecdata.rc_buffer_size * 3 / 4; - c->rc_buffer_aggressivity = 1.0; -#endif - /* Deprecated and not doing anything since July 2015, deleted in recent ffmpeg */ //c->me_method = ME_EPZS; @@ -670,14 +662,7 @@ static AVStream *alloc_video_stream(FFMpegContext *context, RenderData *rd, int } } - if ((of->oformat->flags & AVFMT_GLOBALHEADER) -#if 0 - || STREQ(of->oformat->name, "mp4") - || STREQ(of->oformat->name, "mov") - || STREQ(of->oformat->name, "3gp") -#endif - ) - { + if ((of->oformat->flags & AVFMT_GLOBALHEADER)) { PRINT("Using global header\n"); c->flags |= CODEC_FLAG_GLOBAL_HEADER; } @@ -1295,12 +1280,6 @@ static void end_ffmpeg_impl(FFMpegContext *context, int is_autosplit) { PRINT("Closing ffmpeg...\n"); -#if 0 - if (context->audio_stream) { /* SEE UPPER */ - write_audio_frames(context); - } -#endif - #ifdef WITH_AUDASPACE if (is_autosplit == false) { if (context->audio_mixdown_device) { |