On 05.06.2013 08:48, Christian Costa wrote: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]]++;".
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]]--;
+ }
Maybe you could add a test to verify if the comment or the code is correct?