Exemple #1
0
//------------------------------------------------------------------------------
//
gosFX::Card__Specification::Card__Specification(
    Stuff::MemoryStream *stream,
    int gfx_version
):
    Singleton__Specification(gosFX::CardClassID, stream, gfx_version)
{
    Check_Pointer(this);
    Verify(m_class == CardClassID);
    Verify(gos_GetCurrentHeap() == Heap);

    m_halfHeight.Load(stream, gfx_version);
    m_aspectRatio.Load(stream, gfx_version);

    //
    //-------------------------------------------------------------------
    // If we are reading an old version of the card cloud, ignore all the
    // animation on the UV channels
    //-------------------------------------------------------------------
    //
    if (gfx_version < 10)
    {
        m_index.m_ageCurve.SetCurve(0.0f);
        m_index.m_seedCurve.SetCurve(1.0f);
        m_index.m_seeded = false;

        SeededCurveOf<ComplexCurve, LinearCurve,Curve::e_ComplexLinearType> temp;
        temp.Load(stream, gfx_version);
        Stuff::Scalar v = temp.ComputeValue(0.0f, 0.0f);
        m_UOffset.SetCurve(v);

        temp.Load(stream, gfx_version);
        v = temp.ComputeValue(0.0f, 0.0f);
        m_VOffset.SetCurve(v);

        m_USize.Load(stream, gfx_version);
        m_VSize.Load(stream, gfx_version);

        m_animated = false;
    }

    //
    //------------------------------
    // Otherwise, read in the curves
    //------------------------------
    //
    else
    {
        m_index.Load(stream, gfx_version);
        m_UOffset.Load(stream, gfx_version);
        m_VOffset.Load(stream, gfx_version);
        m_USize.Load(stream, gfx_version);
        m_VSize.Load(stream, gfx_version);
        *stream >> m_animated;
    }
    SetWidth();
}
//------------------------------------------------------------------------------
//
gosFX::CardCloud__Specification::CardCloud__Specification(
	std::iostream stream, uint32_t gfx_version)
	: SpinningCloud__Specification(gosFX::CardCloudClassID, stream, gfx_version)
{
	// Check_Pointer(this);
	Check_Object(stream);
	_ASSERT(m_class == CardCloudClassID);
	// _ASSERT(gos_GetCurrentHeap() == Heap);
	m_halfHeight.Load(stream, gfx_version);
	m_aspectRatio.Load(stream, gfx_version);
	//
	//-------------------------------------------------------------------
	// If we are reading an old version of the card cloud, ignore all the
	// animation on the UV channels
	//-------------------------------------------------------------------
	//
	if (gfx_version < 10)
	{
		m_pIndex.m_ageCurve.SetCurve(0.0f);
		m_pIndex.m_seedCurve.SetCurve(1.0f);
		m_pIndex.m_seeded = false;
		SeededCurveOf<ComplexCurve, LinearCurve, Curve::e_ComplexLinearType> temp;
		temp.Load(stream, gfx_version);
		float v = temp.ComputeValue(0.0f, 0.0f);
		m_UOffset.SetCurve(v);
		temp.Load(stream, gfx_version);
		v = temp.ComputeValue(0.0f, 0.0f);
		m_VOffset.SetCurve(v);
		m_USize.Load(stream, gfx_version);
		m_VSize.Load(stream, gfx_version);
		m_animated = false;
	}
	//
	//------------------------------
	// Otherwise, read in the curves
	//------------------------------
	//
	else
	{
		m_pIndex.Load(stream, gfx_version);
		m_UOffset.Load(stream, gfx_version);
		m_VOffset.Load(stream, gfx_version);
		m_USize.Load(stream, gfx_version);
		m_VSize.Load(stream, gfx_version);
		*stream >> m_animated;
	}
	SetWidth();
	m_totalParticleSize = gosFX::CardCloud::ParticleSize;
	m_particleClassSize = sizeof(gosFX::CardCloud::Particle);
}
Exemple #3
0
void
gosFX::Curve::Load(
	Stuff::MemoryStream* stream,
	int32_t gfx_version
)
{
	Check_Object(this);
	switch(m_type)
	{
		case e_ComplexLinearType:
		{
			SeededCurveOf<ComplexCurve, LinearCurve, Curve::e_ComplexLinearType>* SCurve = (SeededCurveOf<ComplexCurve, LinearCurve, Curve::e_ComplexLinearType>*)this;
			SCurve->Load(stream, gfx_version);
		}
		break;
		case e_ComplexComplexType:
		{
			SeededCurveOf<ComplexCurve, ComplexCurve, e_ComplexComplexType>* SCurve = (SeededCurveOf<ComplexCurve, ComplexCurve, e_ComplexComplexType>*)this;
			SCurve->Load(stream, gfx_version);
		}
		break;
		case e_ComplexSplineType:
		{
			SeededCurveOf<ComplexCurve, SplineCurve, e_ComplexSplineType>* SCurve = (SeededCurveOf<ComplexCurve, SplineCurve, e_ComplexSplineType>*)this;
			SCurve->Load(stream, gfx_version);
		}
		break;
		case e_ConstantComplexType:
		{
			SeededCurveOf<ConstantCurve, ComplexCurve, e_ConstantComplexType>* SCurve = (SeededCurveOf<ConstantCurve, ComplexCurve, e_ConstantComplexType>*)this;
			SCurve->Load(stream, gfx_version);
		}
		break;
		case e_ConstantLinearType:
		{
			SeededCurveOf<ConstantCurve, LinearCurve, e_ConstantLinearType>* SCurve = (SeededCurveOf<ConstantCurve, LinearCurve, e_ConstantLinearType>*)this;
			SCurve->Load(stream, gfx_version);
		}
		break;
		case e_ConstantSplineType:
		{
			SeededCurveOf<ConstantCurve, SplineCurve, e_ConstantSplineType>* SCurve = (SeededCurveOf<ConstantCurve, SplineCurve, e_ConstantSplineType>*)this;
			SCurve->Load(stream, gfx_version);
		}
		break;
		case e_SplineLinearType:
		{
			SeededCurveOf<SplineCurve, LinearCurve, e_SplineLinearType>* SCurve = (SeededCurveOf<SplineCurve, LinearCurve, e_SplineLinearType>*)this;
			SCurve->Load(stream, gfx_version);
		}
		break;
		case 	e_SplineSplineType:
		{
			SeededCurveOf<SplineCurve, SplineCurve, e_SplineSplineType>* SCurve = (SeededCurveOf<SplineCurve, SplineCurve, e_SplineSplineType>*)this;
			SCurve->Load(stream, gfx_version);
		}
		break;
		default:
			break;
	}
}
Exemple #4
0
void
gosFX::Curve::ExpensiveComputeRange(
	float* low,
	float* hi
)
{
	Check_Object(this);
	Check_Pointer(low);
	Check_Pointer(hi);
	switch(m_type)
	{
		case e_ConstantType:
		{
			ConstantCurve* SCurve = (ConstantCurve*)this;
			SCurve->ComputeRange(low, hi);
		}
		break;
		case e_LinearType:
		{
			LinearCurve* SCurve = (LinearCurve*)this;
			SCurve->ComputeRange(low, hi);
		}
		break;
		case e_SplineType:
		{
			SplineCurve* SCurve = (SplineCurve*)this;
			SCurve->ComputeRange(low, hi);
		}
		break;
		case e_ComplexType:
		{
			ComplexCurve* SCurve = (ComplexCurve*)this;
			SCurve->ComputeRange(low, hi);
		}
		break;
		case e_ComplexLinearType:
		{
			SeededCurveOf<ComplexCurve, LinearCurve, Curve::e_ComplexLinearType>* SCurve = (SeededCurveOf<ComplexCurve, LinearCurve, Curve::e_ComplexLinearType>*)this;
			SCurve->ComputeRange(low, hi);
		}
		break;
		case e_ComplexComplexType:
		{
			SeededCurveOf<ComplexCurve, ComplexCurve, e_ComplexComplexType>* SCurve = (SeededCurveOf<ComplexCurve, ComplexCurve, e_ComplexComplexType>*)this;
			SCurve->ComputeRange(low, hi);
		}
		break;
		case e_ComplexSplineType:
		{
			SeededCurveOf<ComplexCurve, SplineCurve, e_ComplexSplineType>* SCurve = (SeededCurveOf<ComplexCurve, SplineCurve, e_ComplexSplineType>*)this;
			SCurve->ComputeRange(low, hi);
		}
		break;
		case e_ConstantComplexType:
		{
			SeededCurveOf<ConstantCurve, ComplexCurve, e_ConstantComplexType>* SCurve = (SeededCurveOf<ConstantCurve, ComplexCurve, e_ConstantComplexType>*)this;
			SCurve->ComputeRange(low, hi);
		}
		break;
		case e_ConstantLinearType:
		{
			SeededCurveOf<ConstantCurve, LinearCurve, e_ConstantLinearType>* SCurve = (SeededCurveOf<ConstantCurve, LinearCurve, e_ConstantLinearType>*)this;
			SCurve->ComputeRange(low, hi);
		}
		break;
		case e_ConstantSplineType:
		{
			SeededCurveOf<ConstantCurve, SplineCurve, e_ConstantSplineType>* SCurve = (SeededCurveOf<ConstantCurve, SplineCurve, e_ConstantSplineType>*)this;
			SCurve->ComputeRange(low, hi);
		}
		break;
		case e_SplineLinearType:
		{
			SeededCurveOf<SplineCurve, LinearCurve, e_SplineLinearType>* SCurve = (SeededCurveOf<SplineCurve, LinearCurve, e_SplineLinearType>*)this;
			SCurve->ComputeRange(low, hi);
		}
		break;
		case e_SplineSplineType:
		{
			SeededCurveOf<SplineCurve, SplineCurve, e_SplineSplineType>* SCurve = (SeededCurveOf<SplineCurve, SplineCurve, e_SplineSplineType>*)this;
			SCurve->ComputeRange(low, hi);
		}
		break;
		default:
			break;
	}
}