diff options
Diffstat (limited to 'source/blender/blenkernel/intern/DerivedMesh.c')
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 0fd030be39c..f648a9e297c 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -322,7 +322,7 @@ int DM_release(DerivedMesh *dm) { if (dm->needsFree) { bvhcache_free(&dm->bvhCache); - GPU_drawobject_free( dm ); + GPU_drawobject_free(dm); CustomData_free(&dm->vertData, dm->numVertData); CustomData_free(&dm->edgeData, dm->numEdgeData); CustomData_free(&dm->faceData, dm->numTessFaceData); @@ -371,7 +371,7 @@ void DM_ensure_tessface(DerivedMesh *dm) const int numTessFaces = dm->getNumTessFaces(dm); const int numPolys = dm->getNumPolys(dm); - if ( (numTessFaces == 0) && (numPolys != 0)) { + if ((numTessFaces == 0) && (numPolys != 0)) { dm->recalcTessellation(dm); if (dm->getNumTessFaces(dm) != 0) { @@ -2413,7 +2413,7 @@ static void GetTextureCoordinate(const SMikkTSpaceContext * pContext, float fUV[ } else { const float *orco= pMesh->orco[(&pMesh->mface[face_num].v1)[vert_index]]; - map_to_sphere( &fUV[0], &fUV[1], orco[0], orco[1], orco[2]); + map_to_sphere(&fUV[0], &fUV[1], orco[0], orco[1], orco[2]); } } @@ -2536,11 +2536,11 @@ void DM_add_tangent_layer(DerivedMesh *dm) if (mf->v4) { v4= &mvert[mf->v4]; - normal_quad_v3( fno,v4->co, v3->co, v2->co, v1->co); + normal_quad_v3(fno, v4->co, v3->co, v2->co, v1->co); } else { v4= NULL; - normal_tri_v3( fno,v3->co, v2->co, v1->co); + normal_tri_v3(fno, v3->co, v2->co, v1->co); } if (mtface) { @@ -2551,11 +2551,11 @@ void DM_add_tangent_layer(DerivedMesh *dm) } else { uv1= uv[0]; uv2= uv[1]; uv3= uv[2]; uv4= uv[3]; - map_to_sphere( &uv[0][0], &uv[0][1],orco[mf->v1][0], orco[mf->v1][1], orco[mf->v1][2]); - map_to_sphere( &uv[1][0], &uv[1][1],orco[mf->v2][0], orco[mf->v2][1], orco[mf->v2][2]); - map_to_sphere( &uv[2][0], &uv[2][1],orco[mf->v3][0], orco[mf->v3][1], orco[mf->v3][2]); + map_to_sphere(&uv[0][0], &uv[0][1], orco[mf->v1][0], orco[mf->v1][1], orco[mf->v1][2]); + map_to_sphere(&uv[1][0], &uv[1][1], orco[mf->v2][0], orco[mf->v2][1], orco[mf->v2][2]); + map_to_sphere(&uv[2][0], &uv[2][1], orco[mf->v3][0], orco[mf->v3][1], orco[mf->v3][2]); if (v4) - map_to_sphere( &uv[3][0], &uv[3][1],orco[mf->v4][0], orco[mf->v4][1], orco[mf->v4][2]); + map_to_sphere(&uv[3][0], &uv[3][1], orco[mf->v4][0], orco[mf->v4][1], orco[mf->v4][2]); } tangent_from_uv(uv1, uv2, uv3, v1->co, v2->co, v3->co, fno, tang); @@ -2578,11 +2578,11 @@ void DM_add_tangent_layer(DerivedMesh *dm) len= (mf->v4)? 4 : 3; if (mtface == NULL) { - map_to_sphere( &uv[0][0], &uv[0][1],orco[mf->v1][0], orco[mf->v1][1], orco[mf->v1][2]); - map_to_sphere( &uv[1][0], &uv[1][1],orco[mf->v2][0], orco[mf->v2][1], orco[mf->v2][2]); - map_to_sphere( &uv[2][0], &uv[2][1],orco[mf->v3][0], orco[mf->v3][1], orco[mf->v3][2]); + map_to_sphere(&uv[0][0], &uv[0][1], orco[mf->v1][0], orco[mf->v1][1], orco[mf->v1][2]); + map_to_sphere(&uv[1][0], &uv[1][1], orco[mf->v2][0], orco[mf->v2][1], orco[mf->v2][2]); + map_to_sphere(&uv[2][0], &uv[2][1], orco[mf->v3][0], orco[mf->v3][1], orco[mf->v3][2]); if (len==4) - map_to_sphere( &uv[3][0], &uv[3][1],orco[mf->v4][0], orco[mf->v4][1], orco[mf->v4][2]); + map_to_sphere(&uv[3][0], &uv[3][1], orco[mf->v4][0], orco[mf->v4][1], orco[mf->v4][2]); } mf_vi[0]= mf->v1; @@ -2616,7 +2616,7 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm) int nr_accumulated = 0; int f; - for ( f=0; f < totface; f++ ) { + for (f=0; f < totface; f++ ) { { float * verts[4], * tex_coords[4]; const int nr_verts = mface[f].v4!=0 ? 4 : 3; @@ -2632,7 +2632,7 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm) // discard degenerate faces is_degenerate = 0; if ( equals_v3v3(verts[0], verts[1]) || equals_v3v3(verts[0], verts[2]) || equals_v3v3(verts[1], verts[2]) || - equals_v2v2(tex_coords[0], tex_coords[1]) || equals_v2v2(tex_coords[0], tex_coords[2]) || equals_v2v2(tex_coords[1], tex_coords[2]) ) + equals_v2v2(tex_coords[0], tex_coords[1]) || equals_v2v2(tex_coords[0], tex_coords[2]) || equals_v2v2(tex_coords[1], tex_coords[2])) { is_degenerate = 1; } @@ -2640,7 +2640,7 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm) // verify last vertex as well if this is a quad if (is_degenerate == 0 && nr_verts == 4) { if (equals_v3v3(verts[3], verts[0]) || equals_v3v3(verts[3], verts[1]) || equals_v3v3(verts[3], verts[2]) || - equals_v2v2(tex_coords[3], tex_coords[0]) || equals_v2v2(tex_coords[3], tex_coords[1]) || equals_v2v2(tex_coords[3], tex_coords[2]) ) + equals_v2v2(tex_coords[3], tex_coords[0]) || equals_v2v2(tex_coords[3], tex_coords[1]) || equals_v2v2(tex_coords[3], tex_coords[2])) { is_degenerate = 1; } @@ -2705,7 +2705,7 @@ void DM_calc_auto_bump_scale(DerivedMesh *dm) if (nr_tris_to_pile==1 || nr_tris_to_pile==2) { const int indices[] = {offs+0, offs+1, offs+2, offs+0, offs+2, (offs+3)&0x3 }; int t; - for ( t=0; t<nr_tris_to_pile; t++ ) { + for (t=0; t<nr_tris_to_pile; t++ ) { float f2x_area_uv; float * p0 = verts[indices[t*3+0]]; float * p1 = verts[indices[t*3+1]]; @@ -2786,9 +2786,9 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs, a = attribs->tottface++; attribs->tface[a].array = tfdata->layers[layer].data; - attribs->tface[a].emOffset = tfdata->layers[layer].offset; - attribs->tface[a].glIndex = gattribs->layer[b].glindex; - attribs->tface[a].glTexco = gattribs->layer[b].gltexco; + attribs->tface[a].em_offset = tfdata->layers[layer].offset; + attribs->tface[a].gl_index = gattribs->layer[b].glindex; + attribs->tface[a].gl_texco = gattribs->layer[b].gltexco; } } else { @@ -2802,9 +2802,9 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs, a = attribs->tottface++; attribs->tface[a].array = tfdata->layers[layer].data; - attribs->tface[a].emOffset = tfdata->layers[layer].offset; - attribs->tface[a].glIndex = gattribs->layer[b].glindex; - attribs->tface[a].glTexco = gattribs->layer[b].gltexco; + attribs->tface[a].em_offset = tfdata->layers[layer].offset; + attribs->tface[a].gl_index = gattribs->layer[b].glindex; + attribs->tface[a].gl_texco = gattribs->layer[b].gltexco; } } } @@ -2823,8 +2823,8 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs, a = attribs->totmcol++; attribs->mcol[a].array = tfdata->layers[layer].data; - attribs->mcol[a].emOffset = tfdata->layers[layer].offset; - attribs->mcol[a].glIndex = gattribs->layer[b].glindex; + attribs->mcol[a].em_offset = tfdata->layers[layer].offset; + attribs->mcol[a].gl_index = gattribs->layer[b].glindex; } } else { @@ -2839,8 +2839,8 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs, a = attribs->totmcol++; attribs->mcol[a].array = tfdata->layers[layer].data; - attribs->mcol[a].emOffset = tfdata->layers[layer].offset; - attribs->mcol[a].glIndex = gattribs->layer[b].glindex; + attribs->mcol[a].em_offset = tfdata->layers[layer].offset; + attribs->mcol[a].gl_index = gattribs->layer[b].glindex; } } } @@ -2852,8 +2852,8 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs, attribs->tottang = 1; attribs->tang.array = fdata->layers[layer].data; - attribs->tang.emOffset = fdata->layers[layer].offset; - attribs->tang.glIndex = gattribs->layer[b].glindex; + attribs->tang.em_offset = fdata->layers[layer].offset; + attribs->tang.gl_index = gattribs->layer[b].glindex; } } else if (gattribs->layer[b].type == CD_ORCO) { @@ -2864,9 +2864,9 @@ void DM_vertex_attributes_from_gpu(DerivedMesh *dm, GPUVertexAttribs *gattribs, attribs->totorco = 1; attribs->orco.array = vdata->layers[layer].data; - attribs->orco.emOffset = vdata->layers[layer].offset; - attribs->orco.glIndex = gattribs->layer[b].glindex; - attribs->orco.glTexco = gattribs->layer[b].gltexco; + attribs->orco.em_offset = vdata->layers[layer].offset; + attribs->orco.gl_index = gattribs->layer[b].glindex; + attribs->orco.gl_texco = gattribs->layer[b].gltexco; } } } @@ -2936,7 +2936,7 @@ static void navmesh_drawColored(DerivedMesh *dm) glDisable(GL_LIGHTING); /* if (GPU_buffer_legacy(dm) ) */ { /* TODO - VBO draw code, not high priority - campbell */ - DEBUG_VBO( "Using legacy code. drawNavMeshColored\n" ); + DEBUG_VBO("Using legacy code. drawNavMeshColored\n"); //glShadeModel(GL_SMOOTH); glBegin(glmode = GL_QUADS); for (a = 0; a < dm->numTessFaceData; a++, mface++) { @@ -3117,7 +3117,7 @@ static void dm_debug_info_layers(DynStr *dynstr, DerivedMesh *dm, void *(*getEle CustomData_file_write_info(type, &structname, &structnum); BLI_dynstr_appendf(dynstr, " dict(name='%s', struct='%s', type=%d, ptr='%p', elem=%d, length=%d),\n", - name, structname, type, (void *)pt, size, (int)(MEM_allocN_len(pt) / size)); + name, structname, type, (void *)pt, size, (int)(MEM_allocN_len(pt) / size)); } } } |