Mercurial > hg > dmlib
changeset 347:f248defe7484
Cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 16 Oct 2012 00:37:42 +0300 |
parents | 882503ef7ab8 |
children | c3f32de11458 |
files | dmtimeline.c dmtimeline.h dmtimelinew.c |
diffstat | 3 files changed, 16 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/dmtimeline.c Tue Oct 16 00:29:24 2012 +0300 +++ b/dmtimeline.c Tue Oct 16 00:37:42 2012 +0300 @@ -193,7 +193,7 @@ case EFPT_FLOAT: case EFPT_VECTOR: case EFPT_MATRIX: - if ((err = dmLoadTimelinePoints(res, ¶m->vpts, param->type)) != DMERR_OK) + if ((err = dmLoadTimelinePoints(res, ¶m->pts, param->type)) != DMERR_OK) return err; break; @@ -373,7 +373,7 @@ { dmFree(param->name); dmFree(param->vstr); - dmFreeTimelinePoints(&(param->vpts)); + dmFreeTimelinePoints(&(param->pts)); }
--- a/dmtimeline.h Tue Oct 16 00:29:24 2012 +0300 +++ b/dmtimeline.h Tue Oct 16 00:37:42 2012 +0300 @@ -56,8 +56,14 @@ char *name; // Name / description of the parameter int type; // Type (EFPT_*) + DMTimelinePoints pts; char *vstr; - DMTimelinePoints vpts; + + // Current values (interpolated) + int vint; + DMFloat vfloat; + DMVector vvector; + DMMatrix vmatrix; } DMTimelineEventParam;
--- a/dmtimelinew.c Tue Oct 16 00:29:24 2012 +0300 +++ b/dmtimelinew.c Tue Oct 16 00:37:42 2012 +0300 @@ -99,7 +99,7 @@ case EFPT_FLOAT: case EFPT_VECTOR: case EFPT_MATRIX: - if ((err = dmSaveTimelinePoints(res, ¶m->vpts, param->type)) != DMERR_OK) + if ((err = dmSaveTimelinePoints(res, ¶m->pts, param->type)) != DMERR_OK) return err; break; @@ -282,15 +282,15 @@ pdst->type = psrc->type; pdst->vstr = dm_strdup(psrc->vstr); - if (psrc->vpts.points != NULL && psrc->vpts.npoints > 0) + if (psrc->pts.points != NULL && psrc->pts.npoints > 0) { - pdst->vpts.npoints = psrc->vpts.npoints; - pdst->vpts.nallocated = psrc->vpts.nallocated; - pdst->vpts.points = dmMalloc(psrc->vpts.nallocated * sizeof(DMTimelinePoint)); - if (pdst->vpts.points == NULL) + pdst->pts.npoints = psrc->pts.npoints; + pdst->pts.nallocated = psrc->pts.nallocated; + pdst->pts.points = dmMalloc(psrc->pts.nallocated * sizeof(DMTimelinePoint)); + if (pdst->pts.points == NULL) return DMERR_MALLOC; - memcpy(pdst->vpts.points, psrc->vpts.points, pdst->vpts.npoints * sizeof(DMTimelinePoint)); + memcpy(pdst->pts.points, psrc->pts.points, pdst->pts.npoints * sizeof(DMTimelinePoint)); } }