当前位置: 首页>>代码示例>>C++>>正文


C++ IStream::serialVersion方法代码示例

本文整理汇总了C++中nlmisc::IStream::serialVersion方法的典型用法代码示例。如果您正苦于以下问题:C++ IStream::serialVersion方法的具体用法?C++ IStream::serialVersion怎么用?C++ IStream::serialVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nlmisc::IStream的用法示例。


在下文中一共展示了IStream::serialVersion方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if

// ***************************************************************************
void		CVegetableShape::serial(NLMISC::IStream &f)
{
	/*
	Version 1:
		- BestSidedPreComputeLighting
	*/
	sint	ver= f.serialVersion(1);
	f.serialCheck((uint32)'_LEN');
	f.serialCheck((uint32)'GEV_');
	f.serialCheck((uint32)'BATE');
	f.serialCheck((uint32)'__EL');

	f.serial(Lighted);
	f.serial(DoubleSided);
	f.serial(PreComputeLighting);
	f.serial(AlphaBlend);
	f.serialEnum(BendCenterMode);
	f.serial(VB);
	f.serialCont(TriangleIndices);

	if(ver>=1)
		f.serial(BestSidedPreComputeLighting);
	else if(f.isReading())
		BestSidedPreComputeLighting= false;

	// if reading
	if(f.isReading())
	{
		// prepare for instanciation
		InstanceVertices.resize(VB.getNumVertices());
	}
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:33,代码来源:vegetable_shape.cpp

示例2: serial

///======================================================================================
void CPSFace::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
{
	NL_PS_FUNC(CPSFace_IStream )
	f.serialVersion(1);
	CPSQuad::serial(f);
	CPSRotated3DPlaneParticle::serialPlaneBasisScheme(f);

	if (f.isReading())
	{
		uint32 nbConfigurations;
		f.serial(nbConfigurations);
		if (nbConfigurations)
		{
			f.serial(_MinAngularVelocity, _MaxAngularVelocity);
		}
		hintRotateTheSame(nbConfigurations, _MinAngularVelocity, _MaxAngularVelocity);

		init();
	}
	else
	{
		uint32 nbConfigurations = (uint32)_PrecompBasis.size();
		f.serial(nbConfigurations);
		if (nbConfigurations)
		{
			f.serial(_MinAngularVelocity, _MaxAngularVelocity);
		}
	}
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:30,代码来源:ps_face.cpp

示例3: serial

// ***************************************************************************
void CAnimationSet::serial (NLMISC::IStream& f)
{
	// serial not possible if header optimisation enabled
	nlassert(!_AnimHeaderOptimisation);

	// Serial an header
	f.serialCheck ((uint32)'_LEN');
	f.serialCheck ((uint32)'MINA');
	f.serialCheck ((uint32)'TES_');

	// Serial a version
	uint	ver= f.serialVersion (1);

	// Serial the class
	f.serialContPtr (_Animation);
	f.serialContPtr (_SkeletonWeight);
	f.serialCont (_AnimationName);
	f.serialCont (_SkeletonWeightName);
	f.serialCont(_ChannelIdByName);
	f.serialCont(_AnimationIdByName);
	f.serialCont(_SkeletonWeightIdByName);
	if(ver>=1)
		f.serialCont(_ChannelName);
	else
		buildChannelNameFromMap();
}
开发者ID:Darkhunter,项目名称:Tranquillien-HCRP-Project-using-NeL,代码行数:27,代码来源:animation_set.cpp

示例4: serial

// ---------------------------------------------------------------------------
void CZoneRegion::serial (NLMISC::IStream &f)
{
	f.xmlPush ("LAND");

		sint32 version = f.serialVersion (1);
		f.serialCheck ((uint32)'DNAL');

		f.xmlSerial (_MinX, "MIN_X");
		f.xmlSerial (_MinY, "MIN_Y");
		f.xmlSerial (_MaxX, "MAX_X");
		f.xmlSerial (_MaxY, "MAX_Y");

		if (version == 1)
		{
			f.serialCont (_Zones);
		}

		if (version == 0)
		{
			std::vector<SZoneUnit> vZonesTmp;
			f.serialCont (vZonesTmp);
			_Zones.resize (vZonesTmp.size());
			for (uint32 i = 0; i < vZonesTmp.size(); ++i)
				_Zones[i] = vZonesTmp[i];
		}

	f.xmlPop ();
}
开发者ID:mixxit,项目名称:solinia,代码行数:29,代码来源:zone_region.cpp

示例5: throw

// ***************************************************************************
void	CSkeletonShape::CLod::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
{
	(void)f.serialVersion(0);

	f.serial(Distance);
	f.serialCont(ActiveBones);
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:8,代码来源:skeleton_shape.cpp

示例6: serial

//===========================================================
void CSegRemanenceShape::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
{
	// version 2 : added default tracks
	// version 1 : rollup ratio
	// version 0 : base version

	sint ver = f.serialVersion(2);
	f.serial(_NumSlices);
	f.serial(_SliceTime);
	f.serialCont(_Corners);
	f.serial(_Mat);
	f.serial(_BBox);
	f.serial(_TextureShifting);
	f.serialPtr(_AnimatedMat);
	if (f.isReading())
	{
		_GeomTouched = true;
		_MatTouched  = true;
	}
	if (ver >= 1)
	{
		f.serial(_RollUpRatio);
	}
	if (ver >= 2)
	{
		f.serial(_DefaultPos);
		f.serial(_DefaultRotQuat);
		f.serial(_DefaultScale);
	}
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:31,代码来源:seg_remanence_shape.cpp

示例7: serial

//***********************************************************************************************
void CParticleWorkspace::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
{
	f.xmlPush("PARTICLE_WORKSPACE");
	f.serialVersion(0);
	f.xmlSerial(_Name, "NAME");	
	f.xmlPush("PS_LIST");
	uint32 numNodes = (uint32)_Nodes.size();
	// TODO : avoid to store the number of nodes
	f.xmlSerial(numNodes, "NUM_NODES");		
	if (f.isReading())
	{
		for(uint k = 0; k < numNodes; ++k)
		{		
			_Nodes.push_back(new CNode());						
			_Nodes.back()->init(this);
			f.serial(*_Nodes.back());
		}	
	}
	else
	{
		for(uint k = 0; k < numNodes; ++k)
		{
			f.serial(*_Nodes[k]);
		}		
	}
	f.xmlPop();
	f.xmlPop();
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:29,代码来源:particle_workspace.cpp

示例8:

// ***************************************************************************
void	CVegetable::serial(NLMISC::IStream &f)
{
	/*
	Version 1:
		- add BendFrequencyFactor
	Version 0:
		- base version
	*/
	sint	ver= f.serialVersion(1);

	f.serial(ShapeName);
	f.serial(Density);
	f.serial(MaxDensity);
	f.serial(_CosAngleMin, _CosAngleMax, _CosAngleMiddle, _OOCosAngleDist);
	f.serialEnum(_AngleType);
	f.serial(Sxy, Sz);
	f.serial(Rx, Ry, Rz);
	f.serial(BendFactor);
	f.serial(BendPhase);
	f.serial(Color);
	f.serial(DistType);

	if(ver>=1)
		f.serial(BendFrequencyFactor);
	else
		BendFrequencyFactor= 1;
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:28,代码来源:vegetable.cpp

示例9:

// ***************************************************************************
void					CTrackSampledCommon::CTimeBlock::serial(NLMISC::IStream &f)
{
	(void)f.serialVersion(0);

	f.serial(TimeOffset);
	f.serial(KeyOffset);
	f.serial(Times);
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:9,代码来源:track_sampled_common.cpp

示例10:

// ---------------------------------------------------------------------------
void CZoneRegion::SZoneUnit2::serial (NLMISC::IStream &f)
{
	/*sint32 version =*/ f.serialVersion (0);

	SZoneUnit::serial (f);
	f.xmlSerial (DateLow, "LOW");
	f.xmlSerial (DateHigh, "HIGH");
}
开发者ID:mixxit,项目名称:solinia,代码行数:9,代码来源:zone_region.cpp

示例11:

// ***************************************************************************
void			CSkills::serial(NLMISC::IStream &f)
{
    if (ShowDebugInChat) nlinfo("Skill are about to...");
    uint	ver= f.serialVersion(0);
    f.serialCont(_I16Skills);
    f.serialCont(_I16Tallies);
    if (ShowDebugInChat) nlinfo("Skills are in!");
}
开发者ID:rbjarnason,项目名称:Mayans,代码行数:9,代码来源:skills.cpp

示例12: throw

///===========================================================================
void	CParticleSystemShape::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
{
	/* ***********************************************
	 *	WARNING: This Class/Method must be thread-safe (ctor/dtor/serial): no static access for instance
	 *	It can be loaded/called through CAsyncFileManager for instance
	 * ***********************************************/

	sint ver = f.serialVersion(6);
	/// version 6 : added sharing flag
	//NLMISC::CVector8 &buf = _ParticleSystemProto.bufferAsVector();
	//f.serialCont(buf);

	if (f.isReading ())
	{
		std::vector<uint8> buf;
		f.serialCont(buf);
		_ParticleSystemProto.fill(&buf[0], (uint32)buf.size());
	}
	else
	{
		f.serialBufferWithSize ((uint8*)_ParticleSystemProto.buffer(), _ParticleSystemProto.length());
	}

	if (ver > 1)
	{
		// serial default tracks
		for (uint k = 0; k < 4; ++k)
		{
			f.serial(_UserParamDefaultTrack[k]);
		}
	}
	if ( ver > 2)
	{
		f.serial (_DefaultPos);
		f.serial (_DefaultScale);
		f.serial (_DefaultRotQuat);
	}
	if ( ver > 3)
	{
		f.serial(_MaxViewDist);
		f.serial(_DestroyWhenOutOfFrustum);
		f.serial(_DestroyModelWhenOutOfRange);
	}
	if ( ver > 4)
	{
		f.serial(_UsePrecomputedBBox);
		if (_UsePrecomputedBBox)
		{
			f.serial(_PrecomputedBBox);
		}
	}
	if ( ver > 5)
	{
		f.serial(_Sharing);
	}
}
开发者ID:AzyxWare,项目名称:ryzom,代码行数:57,代码来源:particle_system_shape.cpp

示例13:

// ***************************************************************************
void			CAABBox::serial(NLMISC::IStream &f)
{
	/* ***********************************************
	 *	WARNING: This Class/Method must be thread-safe (ctor/dtor/serial): no static access for instance
	 *	It can be loaded/called through CAsyncFileManager for instance
	 * ***********************************************/
	(void)f.serialVersion(0);
	f.serial(Center);
	f.serial(HalfSize);
}
开发者ID:Darkhunter,项目名称:Tranquillien-HCRP-Project-using-NeL,代码行数:11,代码来源:aabbox.cpp

示例14: serial

///=======================================================================================
void CPSFloatCurveFunctor::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
{
	f.serialVersion(1);
	f.serial(_NumSamples, _Smoothing);
	f.serialCont(_CtrlPoints);
	if (f.isReading())
	{
		updateTab();
	}
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:11,代码来源:ps_float.cpp

示例15:

// ***************************************************************************
void			CMaterial::CLightMap::serial2(NLMISC::IStream &f)
{
	sint	ver= f.serialVersion(1);

	f.serial(Factor);
	f.serial(LMCDiffuse);
	if(ver>=1)
		f.serial(LMCAmbient);
	// Serial texture descriptor.
	Texture.serialPolyPtr(f);
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:12,代码来源:material.cpp


注:本文中的nlmisc::IStream::serialVersion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。