1 #ifndef R_INTERPOLATE_H
2 #define R_INTERPOLATE_H
3 
4 #include "dobject.h"
5 //==========================================================================
6 //
7 //
8 //
9 //==========================================================================
10 
11 class DInterpolation : public DObject
12 {
13 	friend struct FInterpolator;
14 
15 	DECLARE_ABSTRACT_CLASS(DInterpolation, DObject)
16 	HAS_OBJECT_POINTERS
17 
18 	TObjPtr<DInterpolation> Next;
19 	TObjPtr<DInterpolation> Prev;
20 
21 protected:
22 	int refcount;
23 
24 	DInterpolation();
25 
26 public:
27 	int AddRef();
28 	int DelRef(bool force = false);
29 
30 	virtual void Destroy();
31 	virtual void UpdateInterpolation() = 0;
32 	virtual void Restore() = 0;
33 	virtual void Interpolate(fixed_t smoothratio) = 0;
34 	virtual void Serialize(FArchive &arc);
35 };
36 
37 //==========================================================================
38 //
39 //
40 //
41 //==========================================================================
42 
43 struct FInterpolator
44 {
45 	TObjPtr<DInterpolation> Head;
46 	bool didInterp;
47 	int count;
48 
49 	int CountInterpolations ();
50 
51 public:
FInterpolatorFInterpolator52 	FInterpolator()
53 	{
54 		Head = NULL;
55 		didInterp = false;
56 		count = 0;
57 	}
58 	void UpdateInterpolations();
59 	void AddInterpolation(DInterpolation *);
60 	void RemoveInterpolation(DInterpolation *);
61 	void DoInterpolations(fixed_t smoothratio);
62 	void RestoreInterpolations();
63 	void ClearInterpolations();
64 };
65 
66 extern FInterpolator interpolator;
67 
68 
69 
70 #endif
71 
72