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


C++ FArchive::ReadName方法代码示例

本文整理汇总了C++中FArchive::ReadName方法的典型用法代码示例。如果您正苦于以下问题:C++ FArchive::ReadName方法的具体用法?C++ FArchive::ReadName怎么用?C++ FArchive::ReadName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FArchive的用法示例。


在下文中一共展示了FArchive::ReadName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ReadTexture

int FTextureManager::ReadTexture (FArchive &arc)
{
	int usetype;
	const char *name;

	name = arc.ReadName ();
	if (name != NULL)
	{
		usetype = arc.ReadCount ();
		return GetTexture (name, usetype).GetIndex();
	}
	else return -1;
}
开发者ID:JohnnyonFlame,项目名称:ecwolf,代码行数:13,代码来源:texturemanager.cpp

示例2: SerializeStatistics

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());
	}
}
开发者ID:DaZombieKiller,项目名称:lxDoom,代码行数:40,代码来源:statistics.cpp

示例3: G_SerializeLevel

void G_SerializeLevel (FArchive &arc, bool hubLoad)
{
	int i = level.totaltime;
	
	Renderer->StartSerialize(arc);

	arc << level.flags
		<< level.flags2
		<< level.fadeto
		<< level.found_secrets
		<< level.found_items
		<< level.killed_monsters
		<< level.gravity
		<< level.aircontrol
		<< level.teamdamage
		<< level.maptime
		<< i;

	if (SaveVersion >= 3313)
	{
		arc << level.nextmusic;
	}

	// Hub transitions must keep the current total time
	if (!hubLoad)
		level.totaltime = i;

	if (SaveVersion >= 4507)
	{
		arc << level.skytexture1 << level.skytexture2;
	}
	else
	{
		level.skytexture1 = TexMan.GetTexture(arc.ReadName(), FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_ReturnFirst);
		level.skytexture2 = TexMan.GetTexture(arc.ReadName(), FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_ReturnFirst);
	}
	if (arc.IsLoading())
	{
		sky1texture = level.skytexture1;
		sky2texture = level.skytexture2;
		R_InitSkyMap();
	}

	G_AirControlChanged ();

	BYTE t;

	// Does this level have scrollers?
	if (arc.IsStoring ())
	{
		t = level.Scrolls ? 1 : 0;
		arc << t;
	}
	else
	{
		arc << t;
		if (level.Scrolls)
		{
			delete[] level.Scrolls;
			level.Scrolls = NULL;
		}
		if (t)
		{
			level.Scrolls = new FSectorScrollValues[numsectors];
			memset (level.Scrolls, 0, sizeof(level.Scrolls)*numsectors);
		}
	}

	FBehavior::StaticSerializeModuleStates (arc);
	if (arc.IsLoading()) interpolator.ClearInterpolations();
	P_SerializeThinkers (arc, hubLoad);
	P_SerializeWorld (arc);
	P_SerializePolyobjs (arc);
	P_SerializeSubsectors(arc);
	StatusBar->Serialize (arc);

	if (SaveVersion >= 4222)
	{ // This must be done *after* thinkers are serialized.
		arc << level.DefaultSkybox;
	}

	arc << level.total_monsters << level.total_items << level.total_secrets;

	// Does this level have custom translations?
	FRemapTable *trans;
	WORD w;
	if (arc.IsStoring ())
	{
		for (unsigned int i = 0; i < translationtables[TRANSLATION_LevelScripted].Size(); ++i)
		{
			trans = translationtables[TRANSLATION_LevelScripted][i];
			if (trans != NULL && !trans->IsIdentity())
			{
				w = WORD(i);
				arc << w;
				trans->Serialize(arc);
			}
		}
		w = 0xffff;
		arc << w;
//.........这里部分代码省略.........
开发者ID:Quaker540,项目名称:gzdoom,代码行数:101,代码来源:g_level.cpp


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