MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / initialize

Method initialize

Engine/source/console/consoleObject.cpp:200–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200void AbstractClassRep::initialize()
201{
202 AssertFatal(!initialized, "Duplicate call to AbstractClassRep::initialize()!");
203 Vector<AbstractClassRep *> dynamicTable(__FILE__, __LINE__);
204
205 AbstractClassRep *walk;
206
207 // Initialize namespace references...
208 for (walk = classLinkList; walk; walk = walk->nextClass)
209 {
210 walk->mNamespace = Con::lookupNamespace(StringTable->insert(walk->getClassName()));
211 walk->mNamespace->mUsage = walk->getDocString();
212 walk->mNamespace->mClassRep = walk;
213 }
214
215 // Initialize field lists... (and perform other console registration).
216 for (walk = classLinkList; walk; walk = walk->nextClass)
217 {
218 // sg_tempFieldList is used as a staging area for field lists
219 // (see addField, addGroup, etc.)
220 sg_tempFieldList.setSize(0);
221
222 walk->init();
223
224 // So if we have things in it, copy it over...
225 if (sg_tempFieldList.size() != 0)
226 walk->mFieldList = sg_tempFieldList;
227
228 // And of course delete it every round.
229 sg_tempFieldList.clear();
230 }
231
232 // Calculate counts and bit sizes for the various NetClasses.
233 for (U32 group = 0; group < NetClassGroupsCount; group++)
234 {
235 U32 groupMask = 1 << group;
236
237 // Specifically, for each NetClass of each NetGroup...
238 for(U32 type = 0; type < NetClassTypesCount; type++)
239 {
240 // Go through all the classes and find matches...
241 for (walk = classLinkList; walk; walk = walk->nextClass)
242 {
243 if(walk->mClassType == type && walk->mClassGroupMask & groupMask)
244 dynamicTable.push_back(walk);
245 }
246
247 // Set the count for this NetGroup and NetClass
248 NetClassCount[group][type] = dynamicTable.size();
249 if(!NetClassCount[group][type])
250 continue; // If no classes matched, skip to next.
251
252 // Sort by type and then by name.
253 dQsort((void *) &dynamicTable[0], dynamicTable.size(), sizeof(AbstractClassRep *), ACRCompare);
254
255 // Allocate storage in the classTable
256 classTable[group][type] = new AbstractClassRep*[NetClassCount[group][type]];
257

Callers

nothing calls this directly

Calls 12

lookupNamespaceFunction · 0.85
dQsortFunction · 0.85
getBinLog2Function · 0.85
getNextPow2Function · 0.85
insertMethod · 0.45
getClassNameMethod · 0.45
getDocStringMethod · 0.45
setSizeMethod · 0.45
initMethod · 0.45
sizeMethod · 0.45
clearMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected