gzdoom-gles/src/r_interpolate.h
Christoph Oelckers acab6d9b30 - While doing the interpolation rewrite I noticed that DScroller and DPolyAction
were doing some things in their destructor that needed to be done in the
  Destroy method.
- Rewrote the interpolation code. Interpolations are no longer some objects
  that are separate from the rest of the engine. Instead, they are owned by
  the thinkers starting them. Also, polyobjects only spawn a single interpolation
  for each polyobject instead of a single one for each vertex.
  Also, different types of interpolation objects are used for different types
  of interpolation so that they can do some additional work if eventually needed.


SVN r1018 (trunk)
2008-06-04 17:53:15 +00:00

66 lines
1.3 KiB
C++

#ifndef R_INTERPOLATE_H
#define R_INTERPOLATE_H
//==========================================================================
//
//
//
//==========================================================================
class DInterpolation : public DObject
{
friend struct FInterpolator;
DECLARE_ABSTRACT_CLASS(DInterpolation, DObject)
DInterpolation *Next;
DInterpolation **Prev;
int refcount;
protected:
DInterpolation();
public:
int AddRef();
int DelRef();
virtual void Destroy();
virtual void UpdateInterpolation() = 0;
virtual void Restore() = 0;
virtual void Interpolate(fixed_t smoothratio) = 0;
virtual void Serialize(FArchive &arc);
};
//==========================================================================
//
//
//
//==========================================================================
struct FInterpolator
{
DInterpolation *Head;
bool didInterp;
int CountInterpolations ();
public:
FInterpolator()
{
Head = NULL;
didInterp = false;
}
void UpdateInterpolations();
void AddInterpolation(DInterpolation *);
void RemoveInterpolation(DInterpolation *);
void DoInterpolations(fixed_t smoothratio);
void RestoreInterpolations();
void ClearInterpolations();
};
extern FInterpolator interpolator;
#endif