本文整理汇总了C++中nlmisc::IStream::serialPtr方法的典型用法代码示例。如果您正苦于以下问题:C++ IStream::serialPtr方法的具体用法?C++ IStream::serialPtr怎么用?C++ IStream::serialPtr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nlmisc::IStream
的用法示例。
在下文中一共展示了IStream::serialPtr方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
}
示例2: serial
static void serial(T *&obj, NLMISC::IStream &dest) throw(NLMISC::EStream)
{
dest.serialPtr(obj);
/*if (dest.isReading())
{
std::auto_ptr<T> newObj(new T);
newObj->serialPtr(dest);
delete obj;
obj = newObj.release();
}
else
{
obj->serial(dest);
}*/
}
示例3: serial
///==================================================================================================================
void CPSRibbon::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
{
NL_PS_FUNC(CPSRibbon_serial)
// Version 3 : - added brace mode
// - added orientation enum
sint ver = f.serialVersion(3);
if (ver == 1)
{
nlassert(f.isReading());
/// we had CPSParticle::serial(f), but this is not the base class anymore, so we emulate this...
/// version 2 : auto-lod saved
sint ver2 = f.serialVersion(2);
// here is CPSLocatedBindable::serial(f)
sint ver3 = f.serialVersion(4);
f.serialPtr(_Owner);
if (ver3 > 1) f.serialEnum(_LOD);
if (ver3 > 2) f.serial(_Name);
if (ver3 > 3)
{
if (f.isReading())
{
uint32 id;
f.serial(id);
setExternID(id);
}
else
{
f.serial(_ExternID);
}
}
if (ver2 >= 2)
{
bool bDisableAutoLOD;
f.serial(bDisableAutoLOD);
disableAutoLOD(bDisableAutoLOD);
}
uint32 tailNbSegs;
bool colorFading;
bool systemBasisEnabled;
bool drEnabled; // dying ribbons, not supported in this version
CPSColoredParticle::serialColorScheme(f);
CPSSizedParticle::serialSizeScheme(f);
// we dont use the 2d angle anymore...serial a dummy one
{
CDummy2DAngle _Dummy2DAngle;
_Dummy2DAngle.serialAngle2DScheme(f);
}
f.serial(colorFading, systemBasisEnabled);
serialMaterial(f);
f.serial(drEnabled);
f.serial(tailNbSegs);
ITexture *tex = NULL;
f.serialPolyPtr(tex);
_Tex = tex;
if (_Tex != NULL)
{
f.serial(_UFactor, _VFactor) ;
}
// shape serialization
f.serialCont(_Shape);
_NbSegs = tailNbSegs >> 1;
if (_NbSegs < 1) _NbSegs = 2;
setInterpolationMode(Linear);
nlassert(_Owner);
resize(_Owner->getMaxSize());
initDateVect();
resetFromOwner();
}