本文整理汇总了C++中KeyedArchive::GetArchive方法的典型用法代码示例。如果您正苦于以下问题:C++ KeyedArchive::GetArchive方法的具体用法?C++ KeyedArchive::GetArchive怎么用?C++ KeyedArchive::GetArchive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KeyedArchive
的用法示例。
在下文中一共展示了KeyedArchive::GetArchive方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Deserialize
void LodComponent::Deserialize(KeyedArchive *archive, SceneFileV2 *sceneFile)
{
if(NULL != archive)
{
if(archive->IsKeyExists("lc.flags")) flags = archive->GetUInt32("lc.flags");
if(archive->IsKeyExists("lc.forceDistance")) forceDistance = archive->GetFloat("lc.forceDistance");
if(archive->IsKeyExists("lc.forceDistanceSq")) forceDistanceSq = archive->GetFloat("lc.forceDistanceSq");
if(archive->IsKeyExists("lc.forceLodLayer")) forceLodLayer = archive->GetInt32("lc.forceLodLayer");
KeyedArchive *lodDistArch = archive->GetArchive("lc.loddist");
if(NULL != lodDistArch)
{
for(uint32 i = 0; i < MAX_LOD_LAYERS; ++i)
{
KeyedArchive *lodDistValuesArch = lodDistArch->GetArchive(KeyedArchive::GenKeyFromIndex(i));
if(NULL != lodDistValuesArch)
{
lodLayersArray[i].distance = lodDistValuesArch->GetFloat("ld.distance");
lodLayersArray[i].nearDistance = lodDistValuesArch->GetFloat("ld.neardist");
lodLayersArray[i].farDistance = lodDistValuesArch->GetFloat("ld.fardist");
lodLayersArray[i].nearDistanceSq = lodDistValuesArch->GetFloat("ld.neardistsq");
lodLayersArray[i].farDistanceSq = lodDistValuesArch->GetFloat("ld.fardistsq");
}
}
}
KeyedArchive *lodDataArch = archive->GetArchive("lc.loddata");
if(NULL != lodDataArch)
{
for(uint32 i = 0; i < archive->GetUInt32("lc.loddatacount"); ++i)
{
KeyedArchive *lodDataValuesArch = lodDataArch->GetArchive(KeyedArchive::GenKeyFromIndex(i));
if(NULL != lodDataValuesArch)
{
LodData data;
if(lodDataValuesArch->IsKeyExists("layer")) data.layer = lodDataValuesArch->GetInt32("layer");
if(lodDataValuesArch->IsKeyExists("isdummy")) data.isDummy = lodDataValuesArch->GetBool("isdummy");
KeyedArchive *lodDataIndexesArch = lodDataValuesArch->GetArchive("indexes");
if(NULL != lodDataIndexesArch)
{
for(uint32 j = 0; j < lodDataValuesArch->GetUInt32("indexescount"); ++j)
{
data.indexes.push_back(lodDataIndexesArch->GetInt32(KeyedArchive::GenKeyFromIndex(j)));
}
}
lodLayers.push_back(data);
}
}
}
}
flags |= NEED_UPDATE_AFTER_LOAD;
Component::Deserialize(archive, sceneFile);
}
示例2: Load
void RenderObject::Load(KeyedArchive * archive, SceneFileV2 *sceneFile)
{
if(NULL != archive)
{
if(archive->IsKeyExists("ro.type")) type = archive->GetUInt32("ro.type");
if(archive->IsKeyExists("ro.flags")) flags = archive->GetUInt32("ro.flags");
if(archive->IsKeyExists("ro.debugflags")) debugFlags = archive->GetUInt32("ro.debugflags");
if(archive->IsKeyExists("ro.batchCount"))
{
KeyedArchive *batchesArch = archive->GetArchive("ro.batches");
for(uint32 i = 0; i < archive->GetUInt32("ro.batchCount"); ++i)
{
KeyedArchive *batchArch = batchesArch->GetArchive(KeyedArchive::GenKeyFromIndex(i));
if(NULL != batchArch)
{
RenderBatch *batch = (RenderBatch *) ObjectFactory::Instance()->New(batchArch->GetString("rb.classname"));
if(NULL != batch)
{
batch->Load(batchArch, sceneFile);
AddRenderBatch(batch);
batch->Release();
}
}
}
}
}
AnimatedObject::Load(archive);
}