Ejemplo n.º 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();
}
Ejemplo n.º 2
0
//------------------------------------------------------------------------------
//
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);
}