本文整理汇总了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());
}
}
示例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);
}
}
}
示例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();
}
示例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 ();
}
示例5: throw
// ***************************************************************************
void CSkeletonShape::CLod::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
{
(void)f.serialVersion(0);
f.serial(Distance);
f.serialCont(ActiveBones);
}
示例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);
}
}
示例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();
}
示例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;
}
示例9:
// ***************************************************************************
void CTrackSampledCommon::CTimeBlock::serial(NLMISC::IStream &f)
{
(void)f.serialVersion(0);
f.serial(TimeOffset);
f.serial(KeyOffset);
f.serial(Times);
}
示例10:
// ---------------------------------------------------------------------------
void CZoneRegion::SZoneUnit2::serial (NLMISC::IStream &f)
{
/*sint32 version =*/ f.serialVersion (0);
SZoneUnit::serial (f);
f.xmlSerial (DateLow, "LOW");
f.xmlSerial (DateHigh, "HIGH");
}
示例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!");
}
示例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);
}
}
示例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);
}
示例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();
}
}
示例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);
}