ReadFloat(eArc->GetChild("endAngle"), arc.mEndAngleDegrees);
}
-const TreeNode *Tidx(const TreeNode *node, int index)
+const TreeNode *GetNthChild(const TreeNode *node, uint32_t index)
{
- int i = 0;
+ uint32_t i = 0;
for (TreeNode::ConstIterator it = (*node).CBegin(); it != (*node).CEnd(); ++it, ++i)
{
if (i == index)
void DliLoader::Impl::ParseSceneInternal(Index iScene, const Toolkit::TreeNode* tnScenes,
const Toolkit::TreeNode* tnNodes, LoadParams& params)
{
- auto getSceneRootIdx = [&](Index iScene) {
- auto tn = Tidx(tnScenes, iScene); // now a "scene" object
+ auto getSceneRootIdx = [tnScenes, tnNodes](Index iScene) {
+ auto tn = GetNthChild(tnScenes, iScene); // now a "scene" object
if (!tn)
{
ExceptionFlinger(ASSERT_LOCATION) << iScene << " is out of bounds access into " << SCENES << ".";
" must define a node id.";
}
- tn = Tidx(tn, 0); // now the first element of the array
+ tn = GetNthChild(tn, 0); // now the first element of the array
Index iRootNode;
if (!ReadIndex(tn, iRootNode))
{
ExceptionFlinger(ASSERT_LOCATION) << "Root node index << " << iRootNode << " of scene " << iScene << " is out of bounds.";
}
- tn = Tidx(tnNodes, iRootNode); // now a "node" object
+ tn = GetNthChild(tnNodes, iRootNode); // now a "node" object
if (tn->GetType() != TreeNode::OBJECT)
{
ExceptionFlinger(ASSERT_LOCATION) << "Root node of scene " << iScene << " is of invalid JSON type; object required";
std::vector<IndexProperty> resourceIds;
resourceIds.reserve(4);
- if (auto node = Tidx(nodes, index))
+ if (auto node = GetNthChild(nodes, index))
{
NodeDefinition nodeDef;
nodeDef.mParentIdx = inOutParentStack.empty() ? INVALID_INDEX : inOutParentStack.back();