- 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)
This commit is contained in:
Christoph Oelckers 2008-06-04 17:53:15 +00:00
commit acab6d9b30
22 changed files with 1075 additions and 630 deletions

View file

@ -26,6 +26,7 @@
#include "gi.h"
#include "p_local.h"
#include "p_3dmidtex.h"
#include "r_interpolate.h"
IMPLEMENT_CLASS (DSectorEffect)
@ -41,12 +42,10 @@ void DSectorEffect::Destroy()
if (m_Sector->floordata == this)
{
m_Sector->floordata = NULL;
stopinterpolation (INTERP_SectorFloor, m_Sector);
}
if (m_Sector->ceilingdata == this)
{
m_Sector->ceilingdata = NULL;
stopinterpolation (INTERP_SectorCeiling, m_Sector);
}
if (m_Sector->lightingdata == this)
{
@ -67,7 +66,9 @@ void DSectorEffect::Serialize (FArchive &arc)
arc << m_Sector;
}
IMPLEMENT_CLASS (DMover)
IMPLEMENT_POINTY_CLASS (DMover)
DECLARE_POINTER(interpolation)
END_POINTERS
DMover::DMover ()
{
@ -76,8 +77,32 @@ DMover::DMover ()
DMover::DMover (sector_t *sector)
: DSectorEffect (sector)
{
interpolation = NULL;
}
void DMover::Destroy()
{
StopInterpolation();
Super::Destroy();
}
void DMover::Serialize (FArchive &arc)
{
Super::Serialize (arc);
arc << interpolation;
}
void DMover::StopInterpolation()
{
if (interpolation != NULL)
{
interpolation->DelRef();
interpolation = NULL;
}
}
IMPLEMENT_CLASS (DMovingFloor)
DMovingFloor::DMovingFloor ()
@ -88,7 +113,7 @@ DMovingFloor::DMovingFloor (sector_t *sector)
: DMover (sector)
{
sector->floordata = this;
setinterpolation (INTERP_SectorFloor, sector);
interpolation = sector->SetInterpolation(sector_t::FloorMove, true);
}
IMPLEMENT_CLASS (DMovingCeiling)
@ -101,7 +126,7 @@ DMovingCeiling::DMovingCeiling (sector_t *sector)
: DMover (sector)
{
sector->ceilingdata = this;
setinterpolation (INTERP_SectorCeiling, sector);
interpolation = sector->SetInterpolation(sector_t::CeilingMove, true);
}
bool DMover::MoveAttached(int crush, fixed_t move, int floorOrCeiling, bool resetfailed)