本文整理汇总了C++中ModelPtr::SetName方法的典型用法代码示例。如果您正苦于以下问题:C++ ModelPtr::SetName方法的具体用法?C++ ModelPtr::SetName怎么用?C++ ModelPtr::SetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelPtr
的用法示例。
在下文中一共展示了ModelPtr::SetName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetModel
ModelPtr GetModel(const std::string& modelName)
{
std::string name = boost::to_lower_copy(modelName) + ".mod";
auto fileIter = m_modelsByFile.find(name);
if (fileIter != m_modelsByFile.end())
{
return fileIter->second;
}
auto iter = m_models.find(modelName);
if (iter != m_models.end())
{
return iter->second;
}
EQEmu::EQGModelLoader model_loader;
ModelPtr model;
if (model_loader.Load(m_archive, name, model))
{
model->SetName(modelName);
m_models[modelName] = model;
}
return model;
}
示例2: Load
virtual bool Load() override
{
bool loadedSomething = m_archive.Open(GetZoneFile(m_zd));
std::string base_filename = (boost::format("%s\\%s")
% m_zd->GetEQPath()
% m_zd->GetZoneName()).str();
// next we need to try to read an _assets file and load more eqg based data.
std::string assets_file = base_filename + "_assets.txt";
std::error_code ec;
if (sys::exists(assets_file, ec))
{
std::vector<std::string> filenames;
std::ifstream assets(assets_file.c_str());
if (assets.is_open())
{
std::copy(std::istream_iterator<std::string>(assets),
std::istream_iterator<std::string>(),
std::back_inserter(filenames));
for (auto& name : filenames)
{
std::string asset_file = (boost::format("%s\\%s") % m_zd->GetEQPath() % name).str();
EQEmu::PFS::Archive archive;
if (!archive.Open(asset_file))
continue;
std::vector<std::string> models;
if (archive.GetFilenames("mod", models))
{
for (auto& modelName : models)
{
EQEmu::EQGModelLoader model_loader;
ModelPtr model;
model_loader.Load(archive, modelName, model);
if (model)
{
model->SetName(modelName);
m_modelsByFile[modelName] = model;
loadedSomething = true;
}
}
}
}
}
}
return loadedSomething;
}