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; } } } }
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)); } }
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; } } } }
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)); } }
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); }
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)); } }
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); }
void CMuzzleFlame::creg_Serialize(creg::ISerializer& s) { s.Serialize(randSmokeDir, numSmoke*sizeof(float3)); }
void springLegacyAI::DamageArray::creg_Serialize(creg::ISerializer& s) { s.Serialize(damages, numTypes * sizeof(damages[0])); }
void DamageArray::creg_Serialize(creg::ISerializer& s) { s.Serialize(damages, numTypes * sizeof(damages[0])); }