# HG changeset patch # User John Tsiombikas # Date 1388134703 -7200 # Node ID 9758004136f80cb707c544a3d14f1eae23487c0b # Parent 5993f405a1cba55e95e24bc69f3b2632722eb20e added anm_set_animation_name diff -r 5993f405a1cb -r 9758004136f8 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 5993f405a1cb -r 9758004136f8 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 5993f405a1cb -r 9758004136f8 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);