[Bf-blender-cvs] [5304756e2da] experimental_gp_weight: Cleanup: Remove old unused functions

Antonio Vazquez noreply at git.blender.org
Wed May 16 16:00:19 CEST 2018


Commit: 5304756e2da4a76c172c3701b0fa47d8d7e57099
Author: Antonio Vazquez
Date:   Wed May 16 16:00:13 2018 +0200
Branches: experimental_gp_weight
https://developer.blender.org/rB5304756e2da4a76c172c3701b0fa47d8d7e57099

Cleanup: Remove old unused functions

These functions were used by old drawing methods, but now they have been replaced with draw manager.

===================================================================

M	source/blender/editors/gpencil/gpencil_utils.c
M	source/blender/editors/include/ED_gpencil.h

===================================================================

diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c
index 2b79d0303c9..837541501d5 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -1183,53 +1183,6 @@ void ED_gpencil_add_defaults(bContext *C)
 
 }
 
-
-/* allocate memory for saving gp object to be sorted by zdepth */
-tGPencilSort *ED_gpencil_allocate_cache(tGPencilSort *cache, int *gp_cache_size, int gp_cache_used)
-{
-	tGPencilSort *p = NULL;
-
-	/* By default a cache is created with one block with a predefined number of free slots,
-	if the size is not enough, the cache is reallocated adding a new block of free slots.
-	This is done in order to keep cache small */
-	if (gp_cache_used + 1 > *gp_cache_size) {
-		if ((*gp_cache_size == 0) || (cache == NULL)) {
-			p = MEM_callocN(sizeof(struct tGPencilSort) * GP_CACHE_BLOCK_SIZE, "tGPencilSort");
-			*gp_cache_size = GP_CACHE_BLOCK_SIZE;
-		}
-		else {
-			*gp_cache_size += GP_CACHE_BLOCK_SIZE;
-			p = MEM_recallocN(cache, sizeof(struct tGPencilSort) * *gp_cache_size);
-		}
-		cache = p;
-	}
-	return cache;
-}
-
-/* add gp object to the temporary cache for sorting */
-void ED_gpencil_add_to_cache(tGPencilSort *cache, RegionView3D *rv3d, Base *base, int *gp_cache_used)
-{
-	tGPencilSort *cache_item = &cache[*gp_cache_used];
-	Object *ob = base->object;
-	
-	/* save object */
-	cache_item->base = base;
-
-	/* calculate zdepth from point of view */
-	float zdepth = 0.0;
-	if (rv3d->is_persp) {
-		zdepth = ED_view3d_calc_zfac(rv3d, ob->loc, NULL);
-	}
-	else {
-		zdepth = -dot_v3v3(rv3d->viewinv[2], ob->loc);
-	}
-	cache_item->zdepth = zdepth;
-
-	/* increase slots used in cache */
-	(*gp_cache_used)++;
-}
-
-
 /* ******************************************************** */
 /* Vertex Groups */
 
diff --git a/source/blender/editors/include/ED_gpencil.h b/source/blender/editors/include/ED_gpencil.h
index 480f8b05df1..e0aa1dd244c 100644
--- a/source/blender/editors/include/ED_gpencil.h
+++ b/source/blender/editors/include/ED_gpencil.h
@@ -200,9 +200,6 @@ void ED_gpencil_add_defaults(struct bContext *C);
 /* set object modes */
 void ED_gpencil_setup_modes(struct bContext *C, struct bGPdata *gpd, int newmode);
 
-struct tGPencilSort *ED_gpencil_allocate_cache(struct tGPencilSort *cache, int *gp_cache_size, int gp_cache_used);
-void ED_gpencil_add_to_cache(struct tGPencilSort *cache, struct RegionView3D *rv3d, struct Base *base, int *gp_cache_used);
-
 void ED_gp_project_stroke_to_plane(struct Object *ob, struct RegionView3D *rv3d, struct bGPDstroke *gps, const float origin[3], const int axis, char type);
 void ED_gp_project_point_to_plane(struct Object *ob, struct RegionView3D *rv3d, const float origin[3], const int axis, char type, struct bGPDspoint *pt);
 void ED_gp_get_drawing_reference(struct View3D *v3d, struct Scene *scene, struct Object *ob, struct bGPDlayer *gpl, char align_flag, float vec[3]);



More information about the Bf-blender-cvs mailing list