2008-03-21 17:35:49 +00:00
|
|
|
#ifndef R_INTERPOLATE_H
|
|
|
|
#define R_INTERPOLATE_H
|
|
|
|
|
2011-07-05 10:02:38 +00:00
|
|
|
#include "dobject.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)
|
2016-01-21 10:36:37 +00:00
|
|
|
HAS_OBJECT_POINTERS
|
2008-05-30 06:56:50 +00:00
|
|
|
|
2016-01-21 10:36:37 +00:00
|
|
|
TObjPtr<DInterpolation> Next;
|
|
|
|
TObjPtr<DInterpolation> Prev;
|
2008-06-04 17:53:15 +00:00
|
|
|
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
|
|
|
|
{
|
2016-01-21 10:36:37 +00:00
|
|
|
TObjPtr<DInterpolation> Head;
|
2008-06-04 17:53:15 +00:00
|
|
|
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
|
|
|
|
|