2008-03-21 17:35:49 +00:00
|
|
|
#ifndef R_INTERPOLATE_H
|
|
|
|
#define R_INTERPOLATE_H
|
|
|
|
|
2008-06-04 17:53:15 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-03-21 17:35:49 +00:00
|
|
|
|
2008-05-30 06:56:50 +00:00
|
|
|
class DInterpolation : public DObject
|
2008-03-21 17:35:49 +00:00
|
|
|
{
|
2008-06-04 17:53:15 +00:00
|
|
|
friend struct FInterpolator;
|
|
|
|
|
2008-05-30 06:56:50 +00:00
|
|
|
DECLARE_ABSTRACT_CLASS(DInterpolation, DObject)
|
|
|
|
|
|
|
|
DInterpolation *Next;
|
2008-06-04 17:53:15 +00:00
|
|
|
DInterpolation **Prev;
|
|
|
|
int refcount;
|
2008-05-30 06:56:50 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
DInterpolation();
|
|
|
|
|
|
|
|
public:
|
2008-06-04 17:53:15 +00:00
|
|
|
int AddRef();
|
|
|
|
int DelRef();
|
2008-05-30 06:56:50 +00:00
|
|
|
|
2008-06-03 14:38:42 +00:00
|
|
|
virtual void Destroy();
|
2008-06-04 17:53:15 +00:00
|
|
|
virtual void UpdateInterpolation() = 0;
|
|
|
|
virtual void Restore() = 0;
|
|
|
|
virtual void Interpolate(fixed_t smoothratio) = 0;
|
2008-06-03 14:38:42 +00:00
|
|
|
virtual void Serialize(FArchive &arc);
|
2008-03-21 17:35:49 +00:00
|
|
|
};
|
|
|
|
|
2008-06-04 17:53:15 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2008-05-30 06:56:50 +00:00
|
|
|
|
|
|
|
struct FInterpolator
|
|
|
|
{
|
2008-06-04 17:53:15 +00:00
|
|
|
DInterpolation *Head;
|
|
|
|
bool didInterp;
|
2008-06-11 12:17:45 +00:00
|
|
|
int count;
|
2008-05-30 06:56:50 +00:00
|
|
|
|
|
|
|
int CountInterpolations ();
|
2008-03-21 17:35:49 +00:00
|
|
|
|
2008-05-30 06:56:50 +00:00
|
|
|
public:
|
2008-06-04 17:53:15 +00:00
|
|
|
FInterpolator()
|
|
|
|
{
|
|
|
|
Head = NULL;
|
|
|
|
didInterp = false;
|
2008-06-11 12:17:45 +00:00
|
|
|
count = 0;
|
2008-06-04 17:53:15 +00:00
|
|
|
}
|
2008-05-30 06:56:50 +00:00
|
|
|
void UpdateInterpolations();
|
|
|
|
void AddInterpolation(DInterpolation *);
|
|
|
|
void RemoveInterpolation(DInterpolation *);
|
|
|
|
void DoInterpolations(fixed_t smoothratio);
|
|
|
|
void RestoreInterpolations();
|
2008-06-04 17:53:15 +00:00
|
|
|
void ClearInterpolations();
|
2008-05-30 06:56:50 +00:00
|
|
|
};
|
|
|
|
|
2008-06-04 17:53:15 +00:00
|
|
|
extern FInterpolator interpolator;
|
2008-03-21 17:35:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2008-05-30 06:56:50 +00:00
|
|
|
#endif
|
|
|
|
|