本文整理汇总了C++中nlmisc::IStream::serialEnum方法的典型用法代码示例。如果您正苦于以下问题:C++ IStream::serialEnum方法的具体用法?C++ IStream::serialEnum怎么用?C++ IStream::serialEnum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nlmisc::IStream
的用法示例。
在下文中一共展示了IStream::serialEnum方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: serial
// ***************************************************************************
void CCtrlBase::serial(NLMISC::IStream &f)
{
CViewBase::serial(f);
f.serial(_ContextHelp);
f.serial(_OnContextHelp);
f.serial(_OnContextHelpParams);
f.serial(_ToolTipSpecialParent);
f.serialEnum(_ToolTipParent);
//
THotSpot tmpToolTipParentPosRef = _ToolTipParentPosRef;
THotSpot tmpToolTipPosRef = _ToolTipPosRef;
THotSpot tmpToolTipParentPosRefAlt = _ToolTipParentPosRefAlt;
THotSpot tmpToolTipPosRefAlt = _ToolTipPosRefAlt;
f.serialEnum(tmpToolTipParentPosRef);
f.serialEnum(tmpToolTipPosRef);
f.serialEnum(tmpToolTipParentPosRefAlt);
f.serialEnum(tmpToolTipPosRefAlt);
_ToolTipParentPosRef = tmpToolTipParentPosRef;
_ToolTipPosRef = tmpToolTipPosRef;
_ToolTipParentPosRefAlt = tmpToolTipParentPosRefAlt;
_ToolTipPosRefAlt = tmpToolTipPosRefAlt;
//
nlSerialBitBool(f, _ToolTipInstant);
}
示例2: serial
void CScenario::serial( NLMISC::IStream &f)
{
// _Palette is not backuped because only on client side
// There is no characters connected so _CurrentChars is not need,
// _InstanceMap is set dynamically
if ( f.isReading())
{
_Clean = false;
}
f.serialEnum(_SessionType);
f.serial(_Mode);
f.serial(_InitialActIndex);
if (!f.isReading())
{
CObjectSerializerServer hl(_HighLevel);
f.serial(hl);
CObjectSerializerServer bb(_BasicBricks);
f.serial(bb);
}
else
{
CObjectSerializerServer hl;
f.serial(hl);
CObjectSerializerServer bb;
f.serial(bb);
setHighLevel( hl.getData() ) ; // Set instance Map
delete _BasicBricks;
_BasicBricks = bb.getData();
}
}
示例3: 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());
}
}
示例4:
// ***************************************************************************
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;
}
示例5: serial
// ***************************************************************************
void CInterfaceElement::serial(NLMISC::IStream &f)
{
f.serialPolyPtr(_Parent);
f.serial(_Id);
f.serial(_Active);
f.serial(_InvalidCoords);
f.serial(_XReal, _YReal, _WReal, _HReal);
f.serial(_X, _Y, _W, _H);
f.serialEnum(_PosRef);
f.serialEnum(_ParentPosRef);
_ParentPos.serialPolyPtr(f);
f.serial(_SizeRef);
f.serial(_SizeDivW, _SizeDivH);
_ParentSize.serialPolyPtr(f);
f.serial(_ModulateGlobalColor);
f.serial(_RenderLayer);
f.serial(_AvoidResizeParent);
nlassert(_Links == NULL); // not supported
}
示例6: serial
void CPrimitiveDesc::serial (NLMISC::IStream &s)
{
// Serial the version
sint ver = s.serialVersion (1);
s.xmlPush ("LENGTH");
s.serial (Length[0]);
s.serial (Length[1]);
s.xmlPop ();
s.xmlSerial (Height, "HEIGHT");
s.xmlSerial (Attenuation, "ATTENUATION");
s.xmlPush ("TYPE");
s.serialEnum (Type);
s.xmlPop ();
s.xmlPush ("REACTION");
s.serialEnum (Reaction);
s.xmlPop ();
s.xmlPush ("TRIGGER");
s.serialEnum (Trigger);
s.xmlPop ();
s.xmlSerial (Obstacle, "OBSTACLE");
s.xmlSerial (OcclusionMask, "OCCLUSION_MASK");
s.xmlSerial (CollisionMask, "COLLISION_MASK");
s.xmlSerial (Position, "POSITION");
s.xmlSerial (Orientation, "ORIENTATION");
if (ver>=1)
{
s.xmlSerial (UserData, "USER_DATA");
}
else
{
UserData = 0;
}
}
示例7: serial
void CPSZone::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
{
NL_PS_FUNC(CPSZone_serial)
f.serialVersion(1);
CPSTargetLocatedBindable::serial(f);
f.serialEnum(_CollisionBehaviour);
f.serial(_BounceFactor);
if (f.isReading())
{
for (TTargetCont::iterator it = _Targets.begin(); it != _Targets.end(); ++it)
{
// though this is not a force, this prevent parametric motion
(*it)->addNonIntegrableForceRef();
}
}
}
示例8: if
// ***************************************************************************
void CPointLight::serial(NLMISC::IStream &f)
{
sint ver= f.serialVersion(2);
if(ver>=2)
f.serial(_AddAmbientWithSun);
else
_AddAmbientWithSun= false;
if(ver>=1)
{
f.serialEnum(_Type);
f.serial(_SpotDirection);
f.serial(_SpotAngleBegin);
f.serial(_SpotAngleEnd);
}
else if(f.isReading())
{
_Type= PointLight;
_SpotDirection.set(0,1,0);
_SpotAngleBegin= float(NLMISC::Pi/4);
_SpotAngleEnd= float(NLMISC::Pi/2);
}
f.serial(_Position);
f.serial(_Ambient);
f.serial(_Diffuse);
f.serial(_Specular);
f.serial(_AttenuationBegin);
f.serial(_AttenuationEnd);
// precompute.
if(f.isReading())
{
computeAttenuationFactors();
computeSpotAttenuationFactors();
}
}
示例9: operand
// ***************************************************************************
void CMaterial::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
* ***********************************************/
/*
Version 9:
- Added support for third operand (for Mad operator)
Version 8:
- Serial _TexCoordGenMode
Version 7:
- Lightmap color and Mulx2
Version 6:
- Texture matrix animation
Version 5:
- AlphaTest threshold
Version 4:
- Texture Addressing modes
Version 3:
- LightMaps.
Version 2:
- Shininess.
Version 1:
- texture environement.
Version 0:
- base version.
*/
sint ver= f.serialVersion(9);
// For the version <=1:
nlassert(IDRV_MAT_MAXTEXTURES==4);
f.serialEnum(_ShaderType);
f.serial(_Flags);
f.serialEnum(_SrcBlend);
f.serialEnum(_DstBlend);
f.serialEnum(_ZFunction);
f.serial(_ZBias);
f.serial(_Color);
f.serial(_Emissive, _Ambient, _Diffuse, _Specular);
if(ver>=2)
{
f.serial(_Shininess);
}
if(ver>=5)
{
f.serial(_AlphaTestThreshold);
}
if(ver>=8)
{
f.serial(_TexCoordGenMode);
}
else
_TexCoordGenMode = 0;
for(uint32 i=0;i<IDRV_MAT_MAXTEXTURES;i++)
{
// Serial texture descriptor.
_Textures[i].serialPolyPtr(f);
// Read texture environnement, or setup them.
if(ver>=1)
{
_TexEnvs[i].serial(f, ver >= 9 ? 1 : 0);
}
else
{
// Else setup as default behavior, like before...
if(f.isReading())
_TexEnvs[i].setDefault();
}
}
if(ver>=3)
{
if(ver>=7)
{
uint32 n;
if (f.isReading())
{
f.serial(n);
_LightMaps.resize(n);
}
else
{
n = (uint32)_LightMaps.size();
f.serial(n);
}
for (uint32 i = 0; i < n; ++i)
_LightMaps[i].serial2(f);
f.serial(_LightMapsMulx2);
}
else
{
f.serialCont(_LightMaps);
}
//.........这里部分代码省略.........
示例10: serial
// ***************************************************************************
void CSheetManagerEntry::serial (NLMISC::IStream &s)
{
if (s.isReading())
{
// if (EntitySheet != NULL)
// delete EntitySheet;
CEntitySheet::TType type = CEntitySheet::TypeCount;
s.serialEnum(type);
switch(type)
{
case CEntitySheet::FAUNA:
{
EntitySheet = new CCharacterSheet;
initSheet(EntitySheet, s, type);
}
break;
case CEntitySheet::FLORA:
{
EntitySheet = new CFloraSheet;
initSheet(EntitySheet, s, type);
}
break;
case CEntitySheet::CHAR:
{
EntitySheet = new CPlayerSheet;
initSheet(EntitySheet, s, type);
}
break;
case CEntitySheet::FX:
{
EntitySheet = new CFXSheet;
initSheet(EntitySheet, s, type);
}
break;
case CEntitySheet::BUILDING:
{
EntitySheet = new CBuildingSheet;
initSheet(EntitySheet, s, type);
}
break;
case CEntitySheet::ITEM:
{
EntitySheet = new CItemSheet;
initSheet(EntitySheet, s, type);
}
break;
case CEntitySheet::PLANT:
{
EntitySheet = new CPlantSheet;
initSheet(EntitySheet, s, type);
}
break;
case CEntitySheet::PACT:
{
EntitySheet = new CPactSheet;
initSheet(EntitySheet, s, type);
}
break;
case CEntitySheet::MISSION:
{
EntitySheet = new CMissionSheet;
initSheet(EntitySheet, s, type);
}
break;
case CEntitySheet::MISSION_ICON:
{
EntitySheet = new CMissionIconSheet;
initSheet(EntitySheet, s, type);
}
break;
case CEntitySheet::RACE_STATS:
{
EntitySheet = new CRaceStatsSheet;
initSheet(EntitySheet, s, type);
}
break;
case CEntitySheet::LIGHT_CYCLE:
{
EntitySheet = new CLightCycleSheet;
initSheet(EntitySheet, s, type);
}
break;
case CEntitySheet::WEATHER_SETUP:
{
EntitySheet = new CWeatherSetupSheet;
initSheet(EntitySheet, s, type);
}
break;
case CEntitySheet::CONTINENT:
{
EntitySheet = new CContinentSheet;
initSheet(EntitySheet, s, type);
}
break;
case CEntitySheet::WORLD:
{
EntitySheet = new CWorldSheet;
//.........这里部分代码省略.........
示例11: 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();
}