本文整理汇总了C++中nlgeorges::UFormElm::getArraySize方法的典型用法代码示例。如果您正苦于以下问题:C++ UFormElm::getArraySize方法的具体用法?C++ UFormElm::getArraySize怎么用?C++ UFormElm::getArraySize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nlgeorges::UFormElm
的用法示例。
在下文中一共展示了UFormElm::getArraySize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
void CSampleBankManager::init(NLGEORGES::UFormElm *mixerConfig)
{
if (mixerConfig == 0)
return;
NLGEORGES::UFormElm *virtualBanks;
mixerConfig->getNodeByName(&virtualBanks, ".VirtualBanks");
if (virtualBanks == 0)
return;
uint size;
virtualBanks->getArraySize(size);
for (uint i=0; i<size; ++i)
{
NLGEORGES::UFormElm *virtualBank;
virtualBanks->getArrayNode(&virtualBank, i);
if (virtualBank != 0)
{
std::vector<TFilteredBank> vfb;
std::string virtualName;
virtualBank->getValueByName(virtualName, ".VirtualName");
NLGEORGES::UFormElm *realBanks;
virtualBank->getNodeByName(&realBanks, ".FilteredBank");
if (realBanks != 0)
{
uint size2;
realBanks->getArraySize(size2);
for (uint j=0; j<size2; ++j)
{
TFilteredBank fb;
std::string bankName;
NLGEORGES::UFormElm *realBank;
realBank->getArrayNode(&realBank, j);
realBank->getValueByName(bankName, ".SampleBank");
fb.BankName = CStringMapper::map(bankName);
realBank->getValueByName(fb.Filter, ".Filter");
vfb.push_back(fb);
}
}
if (!vfb.empty())
{
TStringId virtualNameId = CStringMapper::map(virtualName);
m_VirtualBanks.insert(std::make_pair(virtualNameId, vfb));
// create the sample bank
CSampleBank *sampleBank = new CSampleBank(virtualNameId, this);
}
}
}
}
示例2: importForm
void CBackgroundSound::importForm(const std::string& filename, NLGEORGES::UFormElm& formRoot)
{
NLGEORGES::UFormElm *psoundType;
std::string dfnName;
// some basic checking.
formRoot.getNodeByName(&psoundType, ".SoundType");
nlassert(psoundType != NULL);
psoundType->getDfnName(dfnName);
nlassert(dfnName == "background_sound.dfn");
// Call the base class
CSound::importForm(filename, formRoot);
// Read the array of sound with there respective filter.
{
_Sounds.clear();
NLGEORGES::UFormElm *psoundList;
formRoot.getNodeByName(&psoundList, ".SoundType.Sounds");
if (psoundList != 0 && psoundList->isArray())
{
uint size;
psoundList->getArraySize(size);
for (uint i=0; i<size; ++i)
{
TSoundInfo sound;
NLGEORGES::UFormElm *psoundItem;
psoundList->getArrayNode(&psoundItem, i);
if (psoundItem != NULL)
{
// Read the sound name.
std::string soundName;
psoundItem->getValueByName(soundName, "Sound");
sound.SoundName = CStringMapper::map(CFile::getFilenameWithoutExtension(soundName));
// Read the environnement flag.
for (uint j=0; j<UAudioMixer::TBackgroundFlags::NB_BACKGROUND_FLAGS; j++)
{
char tmp[200];
sprintf(tmp, "Filter%2.2u", j);
psoundItem->getValueByName(sound.Filter.Flags[j], tmp);
}
}
_Sounds.push_back(sound);
}
}
}
_DurationValid = false;
}
示例3: computeIGBBoxFromContinent
/** Load additionnal ig from a continent (ryzom specific)
* \param parameter a config file that contains the name of the continent containing the zones we are processing
* \param zone2bbox This will be filled with the name of a zone and the bbox of the village it contains
* \param a map of shape
* \param a vector that will be filled with a zone name and the bbox of the village it contains
*/
static void computeIGBBoxFromContinent(NLMISC::CConfigFile ¶meter,
TShapeMap &shapeMap,
TString2LightingBBox &zone2BBox
)
{
try
{
CConfigFile::CVar &continent_name_var = parameter.getVar ("continent_name");
CConfigFile::CVar &level_design_directory = parameter.getVar ("level_design_directory");
CConfigFile::CVar &level_design_world_directory = parameter.getVar ("level_design_world_directory");
CConfigFile::CVar &level_design_dfn_directory = parameter.getVar ("level_design_dfn_directory");
CPath::addSearchPath(level_design_dfn_directory.asString(), true, false);
CPath::addSearchPath(level_design_world_directory.asString(), true, false);
std::string continentName = continent_name_var.asString();
if (CFile::getExtension(continentName).empty())
continentName += ".continent";
// Load the form
NLGEORGES::UFormLoader *loader = NLGEORGES::UFormLoader::createLoader();
//
std::string pathName = level_design_world_directory.asString() + "/" + continentName;
if (pathName.empty())
{
nlwarning("Can't find continent form : %s", continentName.c_str());
return;
}
NLGEORGES::UForm *villageForm;
villageForm = loader->loadForm(pathName.c_str());
if(villageForm != NULL)
{
NLGEORGES::UFormElm &rootItem = villageForm->getRootNode();
// try to get the village list
// Load the village list
NLGEORGES::UFormElm *villagesItem;
if(!(rootItem.getNodeByName (&villagesItem, "Villages") && villagesItem))
{
nlwarning("No villages where found in %s", continentName.c_str());
return;
}
// Get number of village
uint numVillage;
nlverify (villagesItem->getArraySize (numVillage));
// For each village
for(uint k = 0; k < numVillage; ++k)
{
NLGEORGES::UFormElm *currVillage;
if (!(villagesItem->getArrayNode (&currVillage, k) && currVillage))
{
nlwarning("Couldn't get village %d in continent %s", continentName.c_str(), k);
continue;
}
// check that this village is in the dependency zones
NLGEORGES::UFormElm *zoneNameItem;
if (!currVillage->getNodeByName (&zoneNameItem, "Zone") && zoneNameItem)
{
nlwarning("Couldn't get zone item of village %d in continent %s", continentName.c_str(), k);
continue;
}
std::string zoneName;
if (!zoneNameItem->getValue(zoneName))
{
nlwarning("Couldn't get zone name of village %d in continent %s", continentName.c_str(), k);
continue;
}
zoneName = NLMISC::toLower(CFile::getFilenameWithoutExtension(zoneName));
CLightingBBox result;
// ok, it is in the dependant zones
computeBBoxFromVillage(currVillage, continentName, k, shapeMap, result);
if (!result.OccludingBox.IsVoid || result.ReceivingBox.IsVoid)
{
zone2BBox[zoneName] = result;
}
}
}
else
{
nlwarning("Can't load continent form : %s", continentName.c_str());
}
}
catch (NLMISC::EUnknownVar &e)
{
nlinfo(e.what());
}
}