MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / getUniqueName

Function getUniqueName

Engine/source/ts/loader/tsShapeLoader.cpp:242–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240}
241
242String getUniqueName(const char* name, NameCmpFunc isNameUnique, const Vector<String>& names, void* arg1=0, void* arg2=0)
243{
244 const S32 MAX_ITERATIONS = 0x10000; // maximum of 4 characters (A-P) will be appended
245
246 String suffix;
247 for (S32 i = 0; i < MAX_ITERATIONS; i++)
248 {
249 // Generate a suffix using the first 16 characters of the alphabet
250 suffix.clear();
251 for (S32 value = i; value != 0; value >>= 4)
252 suffix = suffix + (char)('A' + (value & 0xF));
253
254 String uname = name + suffix;
255 if (isNameUnique(uname, names, arg1, arg2))
256 return uname;
257 }
258 return name;
259}
260
261void TSShapeLoader::recurseSubshape(AppNode* appNode, S32 parentIndex, bool recurseChildren)
262{

Callers 3

recurseSubshapeMethod · 0.70
generateObjectsMethod · 0.70
processNodeLightsFunction · 0.50

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected