diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2012-02-06 23:25:12 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2012-02-06 23:25:12 +0400 |
commit | d1833a2c99a041fab6c624bb2b9e5e22dc654412 (patch) | |
tree | c466188edb6c6a41958f6417c27b75b9a0e7211e /source/blender/blenkernel/BKE_mesh.h | |
parent | 0adcdbc77d2fe356a69dc95b2021428a873c9de7 (diff) |
Ported UvElementMap code to bmesh, still untested but at least compiling.
Next, uv sculpting will be ported.
Also fixed "initializer element is not computable at load time" compile error caused due to bit-shifting a constant past its precision length (1L should be 1LL for 32 positions left shift).
Diffstat (limited to 'source/blender/blenkernel/BKE_mesh.h')
-rw-r--r-- | source/blender/blenkernel/BKE_mesh.h | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index 598b57b0cfe..f34af1a19ac 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -184,19 +184,9 @@ typedef struct UvMapVert { unsigned char tfindex, separate, flag; } UvMapVert; -typedef struct UvElementMap { - /* address UvElements by their vertex */ - struct UvElement **vert; - /* UvElement Store */ - struct UvElement *buf; - /* Total number of UVs in the layer. Useful to know */ - int totalUVs; - /* Number of Islands in the mesh */ - int totalIslands; - /* Stores the starting index in buf where each island begins */ - int *islandIndices; -} UvElementMap; - +/* UvElement stores per uv information so that we can quickly access information for a uv. + * it is actually an improved UvMapVert, including an island and a direct pointer to the face + * to avoid initialising face arrays */ typedef struct UvElement { /* Next UvElement corresponding to same vertex */ struct UvElement *next; @@ -212,6 +202,24 @@ typedef struct UvElement { unsigned short island; } UvElement; + +/* UvElementMap is a container for UvElements of a mesh. It stores some UvElements belonging to the + * same uv island in sequence and the number of uvs per island so it is possible to access all uvs + * belonging to an island directly by iterating through the buffer. + */ +typedef struct UvElementMap { + /* address UvElements by their vertex */ + struct UvElement **vert; + /* UvElement Store */ + struct UvElement *buf; + /* Total number of UVs in the layer. Useful to know */ + int totalUVs; + /* Number of Islands in the mesh */ + int totalIslands; + /* Stores the starting index in buf where each island begins */ + int *islandIndices; +} UvElementMap; + /* invalid island index is max short. If any one has the patience * to make that many islands, he can bite me :p */ #define INVALID_ISLAND 0xFFFF |