MCPcopy Create free account
hub / github.com/baldurk/renderdoc / RevealParameter

Method RevealParameter

qrenderdoc/Windows/APIInspector.cpp:57–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57void APIInspector::RevealParameter(SDObject *param)
58{
59 if(!param)
60 return;
61
62 rdcarray<SDObject *> hierarchy;
63 while(param)
64 {
65 hierarchy.push_back(param);
66 param = param->GetParent();
67 }
68
69 if(hierarchy.back()->type.basetype == SDBasic::Chunk)
70 {
71 SDChunk *chunk = (SDChunk *)hierarchy.back();
72 hierarchy.pop_back();
73
74 int rootIdx = m_Chunks.indexOf(chunk);
75
76 SDObject *current = chunk;
77
78 if(rootIdx >= 0)
79 {
80 RDTreeWidgetItem *parent = ui->apiEvents->topLevelItem(rootIdx);
81
82 while(parent)
83 {
84 ui->apiEvents->expandItem(parent);
85
86 SDObject *next = hierarchy.back();
87 hierarchy.pop_back();
88
89 RDTreeWidgetItem *item = NULL;
90
91 for(size_t i = 0; i < current->NumChildren(); i++)
92 {
93 if(current->GetChild(i) == next)
94 {
95 current = next;
96
97 int idx = (int)i;
98
99 // revealing a parameter that wasn't added, bail out now
100 if(idx >= parent->childCount() || parent->child(idx)->tag().value<void *>() != next)
101 return;
102
103 item = parent->child(idx);
104 break;
105 }
106 }
107
108 parent = item;
109
110 if(hierarchy.empty())
111 break;
112 }
113
114 ui->apiEvents->setSelectedItem(parent);

Callers

nothing calls this directly

Calls 14

topLevelItemMethod · 0.80
expandItemMethod · 0.80
setSelectedItemMethod · 0.80
scrollToItemMethod · 0.80
push_backMethod · 0.45
GetParentMethod · 0.45
backMethod · 0.45
pop_backMethod · 0.45
indexOfMethod · 0.45
GetChildMethod · 0.45
childCountMethod · 0.45
tagMethod · 0.45

Tested by

no test coverage detected