本文整理汇总了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;
//.........这里部分代码省略.........