[Bf-blender-cvs] [f69163f] soc-2016-uv_tools: Remove PVert* array from PNoFitPolygon

Phil Gosch noreply at git.blender.org
Tue Jul 5 13:02:49 CEST 2016


Commit: f69163f09388429181b4d410513b1ef758bbf1a8
Author: Phil Gosch
Date:   Tue Jul 5 13:02:18 2016 +0200
Branches: soc-2016-uv_tools
https://developer.blender.org/rBf69163f09388429181b4d410513b1ef758bbf1a8

Remove PVert* array from PNoFitPolygon

Vertex positions are saved as a separate array, save memory

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

M	source/blender/editors/uvedit/uvedit_parametrizer.c

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

diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c
index e0a899a..f0d1a36 100644
--- a/source/blender/editors/uvedit/uvedit_parametrizer.c
+++ b/source/blender/editors/uvedit/uvedit_parametrizer.c
@@ -168,7 +168,6 @@ typedef struct PPointUV{
 } PPointUV;
 
 typedef struct PNoFitPolygon {
-	struct PVert **verts;
 	unsigned int nverts;
 	struct PPointUV **final_pos; 
 } PNoFitPolygon;
@@ -4942,8 +4941,6 @@ PNoFitPolygon *p_inner_fit_polygon_create(PConvexHull *item)
 PNoFitPolygon *p_no_fit_polygon_create(PConvexHull *item, PConvexHull *fixed)
 {
 	PNoFitPolygon *nfp = (PNoFitPolygon *)MEM_callocN(sizeof(*nfp), "PNoFitPolygon");
-	/* ToDo SaphireS: Should be possible to get rid of nfp->verts to save memory */
-	nfp->verts = (PVert **)MEM_mallocN(sizeof(PVert *) * nfp->nverts, "PNFPVerts");
 	nfp->nverts = item->nverts + fixed->nverts;
 	PVert **points = (PVert **)MEM_mallocN(sizeof(PVert *) * nfp->nverts, "PNFPPoints");
 	nfp->final_pos = (PPointUV **)MEM_callocN(sizeof(*nfp->final_pos) * nfp->nverts, "PNFPFinalPos");
@@ -5042,7 +5039,6 @@ void p_no_fit_polygon_delete(PNoFitPolygon *nfp)
 			MEM_freeN(nfp->final_pos[i]);
 	}
 	MEM_freeN(nfp->final_pos);
-	MEM_freeN(nfp->verts);
 	MEM_freeN(nfp);
 }




More information about the Bf-blender-cvs mailing list