# HG changeset patch # User John Tsiombikas # Date 1388134703 -7200 # Node ID dae22390c34c9397111f813835963a273d860874 # Parent fe017bde08bc8d8166f810499a6270957f029c3a added anm_set_animation_name diff -r fe017bde08bc -r dae22390c34c example/test.c --- a/example/test.c Fri Dec 27 06:28:43 2013 +0200 +++ b/example/test.c Fri Dec 27 10:58:23 2013 +0200 @@ -252,7 +252,7 @@ glRotatef(cam_theta, 0, 1, 0); if(cur_anim != next_anim) { - float t = (msec - trans_start_tm) / 1000.0; + float t = (msec - trans_start_tm) / 1500.0; if(t >= 1.0) { t = 1.0; diff -r fe017bde08bc -r dae22390c34c src/anim.c --- a/src/anim.c Fri Dec 27 06:28:43 2013 +0200 +++ b/src/anim.c Fri Dec 27 10:58:23 2013 +0200 @@ -39,6 +39,15 @@ free(anim->name); } +void anm_set_animation_name(struct anm_animation *anim, const char *name) +{ + char *newname = malloc(strlen(name) + 1); + if(!newname) return; + + free(anim->name); + anim->name = newname; +} + /* ---- node implementation ----- */ int anm_init_node(struct anm_node *node) diff -r fe017bde08bc -r dae22390c34c src/anim.h --- a/src/anim.h Fri Dec 27 06:28:43 2013 +0200 +++ b/src/anim.h Fri Dec 27 10:58:23 2013 +0200 @@ -65,6 +65,9 @@ int anm_init_animation(struct anm_animation *anim); void anm_destroy_animation(struct anm_animation *anim); +void anm_set_animation_name(struct anm_animation *anim, const char *name); + + /* node constructor and destructor */ int anm_init_node(struct anm_node *node); void anm_destroy_node(struct anm_node *node);