Ejemplo n.º 1
0
void FTextureManager::WriteTexture (FArchive &arc, int picnum)
{
	FTexture *pic;

	if (picnum < 0)
	{
		arc.WriteName(NULL);
		return;
	}
	else if ((size_t)picnum >= Textures.Size())
	{
		pic = Textures[0].Texture;
	}
	else
	{
		pic = Textures[picnum].Texture;
	}

	if(strncmp(pic->Name, FONT_CHAR_NAME, 6) != 0)
		arc.WriteName (pic->Name);
	else
	{
		FString cname;
		cname.Format("%s:%s", static_cast<FFontTexture*>(pic)->SourceFont->GetName(), pic->Name+6);
		arc.WriteName (cname);
	}
	arc.WriteCount (pic->UseType);
}
Ejemplo n.º 2
0
static void SerializeStatistics(FArchive &arc)
{
	FString startlevel;
	int i = LevelData.Size();

	arc << i;

	if (arc.IsLoading()) 
	{
		arc << startlevel;
		StartEpisode = NULL;
		for(unsigned int j=0;j<AllEpisodes.Size();j++)
		{
			if (!AllEpisodes[j].mEpisodeMap.CompareNoCase(startlevel))
			{
				StartEpisode = &AllEpisodes[j];
				break;
			}
		}
		LevelData.Resize(i);
	}
	else
	{
		if (StartEpisode != NULL) startlevel = StartEpisode->mEpisodeMap;
		arc << startlevel;
	}
	for(int j = 0; j < i; j++)
	{
		OneLevel &l = LevelData[j];

		arc << l.totalkills 
			<< l.killcount  
			<< l.totalsecrets
			<< l.secretcount
			<< l.leveltime;

		if (arc.IsStoring()) arc.WriteName(l.levelname);
		else strcpy(l.levelname, arc.ReadName());
	}
}