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

Method erase

Engine/source/ts/tsIntegerSet.cpp:247–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245}
246
247void TSIntegerSet::erase(S32 index)
248{
249 AssertFatal(index<MAX_TS_SET_SIZE,"TSIntegerSet::erase: out of range");
250
251 // shift to erase bit in target word
252 S32 word = index >> 5;
253 U32 lowMask = (1 << (index & 0x1f)) - 1; // bits below the erase point
254
255 bits[word] = ((bits[word] >> 1) & ~lowMask) | (bits[word] & lowMask);
256
257 // shift bits in words after the erase point
258 U32 endWord = (end() >> 5) + 1;
259 if (endWord >= MAX_TS_SET_DWORDS)
260 endWord = MAX_TS_SET_DWORDS-1;
261
262 for (S32 i = (index >> 5) + 1; i <= endWord; i++)
263 {
264 if (bits[i] & 0x1)
265 bits[i-1] |= 0x80000000;
266 bits[i] = bits[i] >> 1;
267 }
268}
269
270TSIntegerSet::TSIntegerSet()
271{

Callers 15

breakShapeMethod · 0.45
SplitSequencePathAndNameFunction · 0.45
addCmd_renameNodeMethod · 0.45
addCmd_removeNodeMethod · 0.45
addCmd_renameSequenceMethod · 0.45
addCmd_removeSequenceMethod · 0.45
addCmd_addTriggerMethod · 0.45
addCmd_removeTriggerMethod · 0.45
addCmd_setMeshSizeMethod · 0.45
addCmd_removeMeshMethod · 0.45

Calls 1

endFunction · 0.85

Tested by

no test coverage detected