libanim
diff src/track.c @ 39:529036ffe7a5
backported the fixes from calacirya
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 25 Feb 2013 05:58:09 +0200 |
parents | fad4701f484e |
children | 9cd8afd6fa6d |
line diff
1.1 --- a/src/track.c Sun Sep 23 08:23:15 2012 +0300 1.2 +++ b/src/track.c Mon Feb 25 05:58:09 2013 +0200 1.3 @@ -67,6 +67,27 @@ 1.4 free(track); 1.5 } 1.6 1.7 +void anm_copy_track(struct anm_track *dest, struct anm_track *src) 1.8 +{ 1.9 + free(dest->name); 1.10 + if(dest->keys) { 1.11 + dynarr_free(dest->keys); 1.12 + } 1.13 + 1.14 + if(src->name) { 1.15 + dest->name = malloc(strlen(src->name) + 1); 1.16 + strcpy(dest->name, src->name); 1.17 + } 1.18 + 1.19 + dest->count = src->count; 1.20 + dest->keys = dynarr_alloc(src->count, sizeof *dest->keys); 1.21 + memcpy(dest->keys, src->keys, src->count * sizeof *dest->keys); 1.22 + 1.23 + dest->def_val = src->def_val; 1.24 + dest->interp = src->interp; 1.25 + dest->extrap = src->extrap; 1.26 +} 1.27 + 1.28 int anm_set_track_name(struct anm_track *track, const char *name) 1.29 { 1.30 char *tmp;