#pragma once

//#ifndef __SPLINE_H
//#define __SPLINE_H

#ifdef __WATCOMC__
#pragma library("misc.lib")
#endif

#ifdef __cplusplus
extern "C" {
#endif
//---------------------------------------------------------------------------//

// Definera max antal interpolerings v„rden.
#define MAXVALUES 32

typedef struct s_ANIM ANIM;
typedef struct s_KEY KEY;

struct s_ANIM
{
	float frames;

	int values;
	float value[MAXVALUES];

	int keys;
  KEY *first;
};

struct s_KEY
{
  KEY *prev,*next;

  float frame;
	float tension,bias,contunity;
	float value[MAXVALUES];
};

ANIM *spline_createanim( int values);
void spline_freeanim( ANIM *anim);
KEY *spline_addkey( ANIM *anim, float frame);
int spline_calcframe( ANIM *anim, float frame);

//---------------------------------------------------------------------------//
#ifdef __cplusplus
}
#endif
//#endif

