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


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

本文整理汇总了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);	
}
开发者ID:AzyxWare,项目名称:ryzom,代码行数:28,代码来源:ctrl_base.cpp

示例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();
    }
}
开发者ID:mixxit,项目名称:solinia,代码行数:33,代码来源:scenario.cpp

示例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());
	}
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:33,代码来源:vegetable_shape.cpp

示例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;
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:28,代码来源:vegetable.cpp

示例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
	}
开发者ID:junhuac,项目名称:ryzomcore,代码行数:20,代码来源:interface_element.cpp

示例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;
	}
}
开发者ID:mixxit,项目名称:solinia,代码行数:40,代码来源:primitive_block_pacs.cpp

示例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();
		}
	}
}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:16,代码来源:ps_zone.cpp

示例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();
	}

}
开发者ID:Darkhunter,项目名称:Tranquillien-HCRP-Project-using-NeL,代码行数:40,代码来源:point_light.cpp

示例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);
		}
//.........这里部分代码省略.........
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:101,代码来源:material.cpp

示例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;
//.........这里部分代码省略.........
开发者ID:mixxit,项目名称:solinia,代码行数:101,代码来源:sheet_manager.cpp

示例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();
	}
开发者ID:CCChaos,项目名称:RyzomCore,代码行数:81,代码来源:ps_ribbon.cpp


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