libanim

changeset 10:b408f3f655e9

fixed an uninitialized mutex
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 10 Mar 2013 18:52:27 +0200
parents 710658962108
children 8eaf462ce992
files example/test.c src/anim.c
diffstat 2 files changed, 5 insertions(+), 3 deletions(-) [+]
line diff
     1.1 --- a/example/test.c	Fri Mar 08 04:54:05 2013 +0200
     1.2 +++ b/example/test.c	Sun Mar 10 18:52:27 2013 +0200
     1.3 @@ -55,7 +55,7 @@
     1.4  void mouse(int bn, int state, int x, int y);
     1.5  void motion(int x, int y);
     1.6  
     1.7 -float cam_theta = 20, cam_phi = 20, cam_dist = 15;
     1.8 +float cam_theta = 200, cam_phi = 20, cam_dist = 15;
     1.9  struct anm_node *root;
    1.10  
    1.11  struct anm_node *nodes[NUM_NODES];
    1.12 @@ -186,7 +186,7 @@
    1.13  
    1.14  	for(i=0; i<NUM_NODES; i++) {
    1.15  		float color[4] = {0, 0, 0, 1};
    1.16 -		mat4_t xform;
    1.17 +		mat4_t xform, xform_transp;
    1.18  
    1.19  		color[0] = parts[i].color.x;
    1.20  		color[1] = parts[i].color.y;
    1.21 @@ -196,9 +196,10 @@
    1.22  		glColor4fv(color);
    1.23  
    1.24  		anm_get_matrix(nodes[i], xform, msec);
    1.25 +		m4_transpose(xform_transp, xform);
    1.26  
    1.27  		glPushMatrix();
    1.28 -		glMultTransposeMatrixf((float*)xform);
    1.29 +		glMultMatrixf((float*)xform_transp);
    1.30  
    1.31  		glScalef(parts[i].sz.x, parts[i].sz.y, parts[i].sz.z);
    1.32  		glutSolidCube(1.0);
     2.1 --- a/src/anim.c	Fri Mar 08 04:54:05 2013 +0200
     2.2 +++ b/src/anim.c	Sun Mar 10 18:52:27 2013 +0200
     2.3 @@ -21,6 +21,7 @@
     2.4  
     2.5  	/* initialize thread-local matrix cache */
     2.6  	pthread_key_create(&node->cache_key, 0);
     2.7 +	pthread_mutex_init(&node->cache_list_lock, 0);
     2.8  
     2.9  	for(i=0; i<ANM_NUM_TRACKS; i++) {
    2.10  		if(anm_init_track(node->tracks + i) == -1) {