Exemplo n.º 1
0
void SerializeColor(creg::ISerializer &s, unsigned char **color)
{
	if (s.IsWriting()) {
		char ColorType = 0;
		char ColorId = 0;
		if (!ColorType)
			for (int a = 0; a < teamHandler->ActiveTeams(); ++a)
				if (*color==teamHandler->Team(a)->color) {
					ColorType = 1;
					ColorId = a;
					break;
				}
		s.Serialize(&ColorId,sizeof(ColorId));
		s.Serialize(&ColorType,sizeof(ColorType));
	} else {
		char ColorType;
		char ColorId;
		s.Serialize(&ColorId,sizeof(ColorId));
		s.Serialize(&ColorType,sizeof(ColorType));
		switch (ColorType) {
			case 0:{
				*color = DefaultColor;
				break;
			}
			case 1:{
				*color = teamHandler->Team(ColorId)->color;
				break;
			}
		}
	}
}
Exemplo n.º 2
0
void CPieceProjectile::creg_Serialize(creg::ISerializer& s)
{
	s.Serialize(numCallback, sizeof(int));
	for (int i = 0; i < 8; i++) {
		s.Serialize(oldInfos[i], sizeof(CPieceProjectile::OldInfo));
	}
}
Exemplo n.º 3
0
void SerializeColor(creg::ISerializer &s, unsigned char **color)
{
	if (s.IsWriting()) {
		char ColorType = 0;
		char ColorId = 0;
		if (!ColorType) for (int a=0;a<MAX_TEAMS;a++) 
			if (*color==gs->Team(a)->color) {
				ColorType = 1;
				ColorId = a;
				break;
			}
		s.Serialize(&ColorId,sizeof(ColorId));
		s.Serialize(&ColorType,sizeof(ColorType));
	} else {
		char ColorType;
		char ColorId;
		s.Serialize(&ColorId,sizeof(ColorId));
		s.Serialize(&ColorType,sizeof(ColorType));
		switch (ColorType) {
			case 0:{
				*color = DefaultColor;
				break;
			}
			case 1:{
				*color = gs->Team(ColorId)->color;
				break;
			}
		}
	}
}
Exemplo n.º 4
0
void CStarburstProjectile::creg_Serialize(creg::ISerializer& s)
{
	s.Serialize(numCallback, sizeof(int));
	// NOTE This could be tricky if gs is serialized after losHandler.
	for (int a = 0; a < 5; ++a) {
		s.Serialize(oldInfos[a],sizeof(struct CStarburstProjectile::OldInfo));
	}
}
Exemplo n.º 5
0
void CLosHandler::creg_Serialize(creg::ISerializer& s)
{
	// NOTE This could be tricky if gs is serialized after losHandler.
	for (int a = 0; a < gs->activeAllyTeams; ++a) {
		s.Serialize(losMap[a], losSizeX*losSizeY*2);
		s.Serialize(airLosMap[a], airSizeX*airSizeY*2);
	}
}
static void SerializeString(creg::ISerializer& s, std::string& str)
{
	unsigned short size = (unsigned short)str.length();
	s.Serialize(&size,2);

	if (!s.IsWriting())
		str.resize(size);

	s.Serialize(&str[0], size);
}
Exemplo n.º 7
0
void CStarburstProjectile::creg_Serialize(creg::ISerializer& s)
{
    // NOTE This could be tricky if gs is serialized after losHandler.
    for (int a = 0; a < NUM_TRACER_PARTS; ++a) {
        s.Serialize(&tracerParts[a], sizeof(struct CStarburstProjectile::TracerPart));
    }
}
Exemplo n.º 8
0
void CRadarHandler::creg_Serialize(creg::ISerializer& s)
{
	const int size = xsize*ysize*2;

	// NOTE This could be tricky if gs is serialized after radarHandler.
	for(int a = 0; a < gs->activeAllyTeams; ++a) {
		s.Serialize(radarMaps[a], size);
		if (!circularRadar)
			s.Serialize(airRadarMaps[a], size);
		s.Serialize(sonarMaps[a], size);
		s.Serialize(jammerMaps[a], size);
		s.Serialize(seismicMaps[a], size);
	}
	s.Serialize(commonJammerMap, size);
	s.Serialize(commonSonarJammerMap, size);
}
Exemplo n.º 9
0
void CMuzzleFlame::creg_Serialize(creg::ISerializer& s)
{
	s.Serialize(randSmokeDir, numSmoke*sizeof(float3));
}
Exemplo n.º 10
0
void springLegacyAI::DamageArray::creg_Serialize(creg::ISerializer& s)
{
	s.Serialize(damages, numTypes * sizeof(damages[0]));
}
Exemplo n.º 11
0
void DamageArray::creg_Serialize(creg::ISerializer& s)
{
	s.Serialize(damages, numTypes * sizeof(damages[0]));
}