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


C++ CExtension::LoadImagesElement方法代码示例

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


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

示例1: CreateBaseFile

ALERROR CExtension::CreateBaseFile (SDesignLoadCtx &Ctx, EGameTypes iGame, CXMLElement *pDesc, CExternalEntityTable *pEntities, CExtension **retpBase, TArray<CXMLElement *> *retEmbedded)

//	CreateBaseFile
//
//	Loads a new extension from the base file.

	{
	ALERROR error;
	int i;

	//	Create an extension object

	CExtension *pExtension = new CExtension;
	pExtension->m_sFilespec = Ctx.sResDb;
	pExtension->m_dwUNID = 0;	//	Base is the only extension with 0 UNID.
	pExtension->m_iGame = iGame;
	pExtension->m_iType = extBase;
	pExtension->m_iLoadState = loadEntities;
	pExtension->m_iFolderType = folderBase;
	pExtension->m_pEntities = pEntities;
	pExtension->m_ModifiedTime = fileGetModifiedTime(Ctx.sResDb);
	pExtension->m_bRegistered = true;
	pExtension->m_bPrivate = true;
	pExtension->m_bAutoInclude = true;
	pExtension->m_bUsesXML = false;
	pExtension->m_bUsesCompatibilityLibrary = false;

	//	Load the apiVersion

	CString sAPIVersion;
	if (pDesc->FindAttribute(API_VERSION_ATTRIB, &sAPIVersion))
		{
		pExtension->m_dwAPIVersion = (DWORD)strToInt(sAPIVersion, 0);
		if (pExtension->m_dwAPIVersion < 12)
			pExtension->m_dwAPIVersion = 0;
		}

	//	If this version is later than what we expect, then we fail.

	if (pExtension->m_dwAPIVersion > API_VERSION)
		{
		pExtension->m_pEntities = NULL;	//	Let our parent clean up
		delete pExtension;
		Ctx.sError = CONSTLIT("Newer version of the Transcendence engine is required.");
		return ERR_FAIL;
		}

	//	We return the base extension

	*retpBase = pExtension;

	//	Set up context

	Ctx.pExtension = pExtension;

	//	Load the Main XML file

	for (i = 0; i < pDesc->GetContentElementCount(); i++)
		{
		CXMLElement *pItem = pDesc->GetContentElement(i);

		//	<Images>

		if (strEquals(pItem->GetTag(), IMAGES_TAG))
			error = pExtension->LoadImagesElement(Ctx, pItem);

		//	<Sounds>

		else if (strEquals(pItem->GetTag(), SOUNDS_TAG))
			error = pExtension->LoadSoundsElement(Ctx, pItem);

		//	<SystemTypes>

		else if (strEquals(pItem->GetTag(), SYSTEM_TYPES_TAG))
			error = pExtension->LoadSystemTypesElement(Ctx, pItem);

		//	<TranscendenceAdventure>

		else if (strEquals(pItem->GetTag(), TRANSCENDENCE_ADVENTURE_TAG)
				|| strEquals(pItem->GetTag(), TRANSCENDENCE_LIBRARY_TAG)
				|| strEquals(pItem->GetTag(), CORE_LIBRARY_TAG))
			{
			//	Return this as an embedded extension

			retEmbedded->Insert(pItem);
			error = NOERROR;
			}

		//	Other types

		else
			error = pExtension->LoadDesignElement(Ctx, pItem);

		//	Check for error

		if (error)
			{
			pExtension->m_pEntities = NULL;	//	Let our parent clean up
			delete pExtension;
			return error;
//.........这里部分代码省略.........
开发者ID:bmer,项目名称:Mammoth,代码行数:101,代码来源:CExtension.cpp


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