Skip to content
This repository was archived by the owner on Feb 27, 2023. It is now read-only.

Commit

Permalink
Add the skeltrack_joint_list_new function
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquimrocha committed Jun 18, 2012
1 parent 3d8e238 commit 31cc8ad
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions skeltrack/skeltrack-joint.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,18 @@ skeltrack_joint_list_get_joint (SkeltrackJointList list, SkeltrackJointId id)
{
return list[id];
}

/**
* skeltrack_joint_list_new:
*
* Created a new list of #SkeltrackJointsList with its joints as #NULL.
* When it is no longer needed, free it with skeltrack_joint_list_free().
*
* Returns: (transfer full): A newly allocated #SkeltrackJointList
**/
SkeltrackJointList
skeltrack_joint_list_new (void)
{
return (SkeltrackJointList) g_slice_alloc0 (SKELTRACK_JOINT_MAX_JOINTS *
sizeof (SkeltrackJoint *));
}
1 change: 1 addition & 0 deletions skeltrack/skeltrack-joint.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ GType skeltrack_joint_get_type (void);
gpointer skeltrack_joint_copy (SkeltrackJoint *joint);
void skeltrack_joint_free (SkeltrackJoint *joint);
void skeltrack_joint_list_free (SkeltrackJointList list);
SkeltrackJointList skeltrack_joint_list_new (void);
SkeltrackJoint * skeltrack_joint_list_get_joint (SkeltrackJointList list,
SkeltrackJointId id);

Expand Down

0 comments on commit 31cc8ad

Please sign in to comment.