Re: [PATCH] d3dx9_36: Implement ID3DXSkinInfoImpl_UpdateSkinnedMesh.
On 05.06.2013 08:48, Christian Costa wrote:
bone = &This->bones[bone_num]; + /* Decrement refcounts of vertices previously influenced */ + for (i = 0; i < bone->num_influences; i++) + if (bone->vertices[i] < This->num_vertices) /* Ignore out of range value */ + This->vertices_refcounts[bone->vertices[i]]--; bone->num_influences = num_influences; HeapFree(GetProcessHeap(), 0, bone->vertices); HeapFree(GetProcessHeap(), 0, bone->weights); bone->vertices = new_vertices; bone->weights = new_weights; + /* Increment refcounts of vertices newly influenced */ + for (i = 0; i < bone->num_influences; i++) + { + if (bone->vertices[i] < This->num_vertices) /* Ignore out of range value */ + This->vertices_refcounts[bone->vertices[i]]--; + }
Please have a look at the code style (brackets {} at the for loops?). It should be a bit more consistent. Also I think an increment (as said in the comment) is something like "This->vertices_refcounts[bone->vertices[i]]++;". Maybe you could add a test to verify if the comment or the code is correct? Cheers Rico
2013/6/5 Rico Schüller <kgbricola(a)web.de>
On 05.06.2013 08:48, Christian Costa wrote:
bone = &This->bones[bone_num]; + /* Decrement refcounts of vertices previously influenced */ + for (i = 0; i < bone->num_influences; i++) + if (bone->vertices[i] < This->num_vertices) /* Ignore out of range value */ + This->vertices_refcounts[bone-**>vertices[i]]--; bone->num_influences = num_influences; HeapFree(GetProcessHeap(), 0, bone->vertices); HeapFree(GetProcessHeap(), 0, bone->weights); bone->vertices = new_vertices; bone->weights = new_weights; + /* Increment refcounts of vertices newly influenced */ + for (i = 0; i < bone->num_influences; i++) + { + if (bone->vertices[i] < This->num_vertices) /* Ignore out of range value */ + This->vertices_refcounts[bone-**>vertices[i]]--; + }
Please have a look at the code style (brackets {} at the for loops?). It should be a bit more consistent. Also I think an increment (as said in the comment) is something like "This->vertices_refcounts[** bone->vertices[i]]++;".
Oups! It's the wrong patch. I will send an updated version. Thanks!
Maybe you could add a test to verify if the comment or the code is correct?
Ok. I'll add a basic skinning test. I need one anyway. Vertices skinning is ok but normals one does not look the same as native. Christian
participants (2)
-
Christian Costa -
Rico Schüller