Esempio n. 1
0
// ---------------------------------------------------------------------------
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 ();
}
Esempio n. 2
0
//***********************************************************************************************
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();
}
Esempio n. 3
0
// ---------------------------------------------------------------------------
void CZoneRegion::SZoneUnit2::serial (NLMISC::IStream &f)
{
	/*sint32 version =*/ f.serialVersion (0);

	SZoneUnit::serial (f);
	f.xmlSerial (DateLow, "LOW");
	f.xmlSerial (DateHigh, "HIGH");
}
Esempio n. 4
0
// ---------------------------------------------------------------------------
void CZoneRegion::SZoneUnit::serial (NLMISC::IStream &f)
{
	f.xmlSerial (ZoneName, "NAME");
	f.xmlSerial (PosX, "X");
	f.xmlSerial (PosY, "Y");
	f.xmlSerial (Rot, "ROT");
	f.xmlSerial (Flip, "FLIP");

	for (uint32 i = 0; i < 4; ++i)
	{
		f.xmlSerial (SharingMatNames[i], "MAT_NAMES");
		f.xmlSerial (SharingCutEdges[i], "CUR_EDGES");
	}
}
Esempio n. 5
0
void CZoneEdge::serial (NLMISC::IStream& s)
{
	// Serial the version
	/*sint ver =*/ s.serialVersion (0);

	s.xmlPush ("VERTICES");
		s.serialCont (_TheEdge);
	s.xmlPop ();

	s.xmlPush ("VERTICES_ID");
		s.serialCont (_Id);
	s.xmlPop ();

	s.xmlSerial (_Rotation, "ROTATION");

	s.xmlSerial (_OffsetX, _OffsetY, "OFFSET");
}
Esempio n. 6
0
//***********************************************************************************************
void CParticleWorkspace::CNode::serial(NLMISC::IStream &f)
{	
	nlassert(_WS);
	f.xmlPush("PROJECT_FILE");
		sint version = f.serialVersion(2);
		f.xmlSerial(_RelativePath, "RELATIVE_PATH");
		if (version >= 1)
		{
			f.xmlSerial(_TriggerAnim, "TRIGGER_ANIMATION");
		}
		if (version >= 2)
		{			
			f.xmlSerial(_ParentSkelName, "PARENT_SKEL_NAME");
			f.xmlSerial(_ParentBoneName, "PARENT_BONE_NAME");
		}
	f.xmlPop();		
}
Esempio n. 7
0
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;
	}
}