Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Bantle <hairbat@yahoo.com>2008-06-01 22:02:29 +0400
committerGeoffrey Bantle <hairbat@yahoo.com>2008-06-01 22:02:29 +0400
commit33321d13d32a960be7e3aa7ee652ad4b23667d97 (patch)
treec8a06f55b6dd1ab9e06342afc01b2f65ef6b01c7 /source/blender/blenkernel/intern/BME_mesh.c
parent07b1608fbe52f729eae39c307060f92948aabf37 (diff)
-> Beginning of Custom Data support for BMesh
Now that new allocator is in place, Custom Data can be effeciently added to BMesh. The plan is to make all data not directly related to topology Custom Data and allow callers to decide precisely what information a mesh should have in order to make the best tradeoff between memory usage/speed. Right now not much to look at, just some structure definitions and commented out code. More to come soon...
Diffstat (limited to 'source/blender/blenkernel/intern/BME_mesh.c')
-rw-r--r--source/blender/blenkernel/intern/BME_mesh.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/BME_mesh.c b/source/blender/blenkernel/intern/BME_mesh.c
index 307047463cf..e12ba2f8c65 100644
--- a/source/blender/blenkernel/intern/BME_mesh.c
+++ b/source/blender/blenkernel/intern/BME_mesh.c
@@ -62,8 +62,7 @@
* Allocates a new BME_Mesh structure
*/
-
-
+//BME_Mesh *BME_make_mesh(int valloc, int ealloc, int lalloc, int palloc, int vdata[BME_CD_NUMTYPES], int edata[BME_CD_NUMTYPES], int ldata[BME_CD_NUMTYPES], int pdata[BME_CD_NUMTYPES])
BME_Mesh *BME_make_mesh(int valloc, int ealloc, int lalloc, int palloc){
/*allocate the structure*/
BME_Mesh *bm = MEM_callocN(sizeof(BME_Mesh),"BMesh");
@@ -72,11 +71,17 @@ BME_Mesh *BME_make_mesh(int valloc, int ealloc, int lalloc, int palloc){
bm->epool = BME_mempool_create(sizeof(BME_Edge), ealloc, ealloc);
bm->ppool = BME_mempool_create(sizeof(BME_Poly), palloc, palloc);
bm->lpool = BME_mempool_create(sizeof(BME_Loop), lalloc, lalloc);
- /*allocate the customdata pools*/
- return bm;
-}
+ /*Setup Custom data structs and layers*/
+ /*
+ BME_CD_Create(bm, &bm->vdata, vdata);
+ BME_CD_Create(bm, &bm->edata, edata);
+ BME_CD_Create(bm, &bm->ldata, ldata);
+ BME_CD_Create(bm, &bm->pdata, pdata);
+ */
+ return bm;
+}
/*
* BME FREE MESH
*
@@ -90,8 +95,12 @@ void BME_free_mesh(BME_Mesh *bm)
BME_mempool_destroy(bm->epool);
BME_mempool_destroy(bm->ppool);
BME_mempool_destroy(bm->lpool);
- /*destroy custom data pools*/
-
+ /*
+ BME_CD_Free(bm, &bm->vdata);
+ BME_CD_Free(bm, &bm->edata);
+ BME_CD_Free(bm, &bm->ldata);
+ BME_CD_Free(bm, &bm->pdata);
+ */
MEM_freeN(bm);
}
@@ -156,6 +165,13 @@ void BME_model_end(BME_Mesh *bm){
}
}
+/*note, this needs to be turned on for debugging only.
+ We need two levels of debugging,
+ 1: Mesh level
+ 2: Euler level
+ Both need to be turned off in production builds (they really slow things down)
+*/
+
/*
* BME VALIDATE MESH
*