MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / freeObject

Function freeObject

TheForceEngine/TFE_Jedi/Level/robject.cpp:37–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35 }
36
37 void freeObject(SecObject* obj)
38 {
39 s_freeObjLock = JTRUE;
40 // Free Logics
41 Logic** head = (Logic**)allocator_getHead((Allocator*)obj->logic);
42 while (head)
43 {
44 Logic* logic = *head;
45 if (logic->cleanupFunc)
46 {
47 logic->cleanupFunc(logic);
48 }
49
50 head = (Logic**)allocator_getNext((Allocator*)obj->logic);
51 }
52
53 allocator_free((Allocator*)obj->logic);
54 sector_removeObject(obj);
55 obj_removeFromRefList(obj); // mark as removed in scripting ref list
56 objData_freeToArray(obj);
57
58 s_freeObjLock = JFALSE;
59 }
60
61 void obj3d_setData(SecObject* obj, JediModel* pod)
62 {

Callers 10

sector_removeCorpsesFunction · 0.85
level_loadObjectsFunction · 0.85
generatorTaskFuncFunction · 0.85
updateLogicCleanupFuncFunction · 0.85
deleteLogicAndObjectFunction · 0.85
obj_setEnemyLogicFunction · 0.85
phaseTwo_handleDyingFunction · 0.85
actor_removeRandomCorpseFunction · 0.85
defaultDamageFuncFunction · 0.85
deleteObjectFunction · 0.85

Calls 6

allocator_getHeadFunction · 0.85
allocator_getNextFunction · 0.85
allocator_freeFunction · 0.85
sector_removeObjectFunction · 0.85
obj_removeFromRefListFunction · 0.85
objData_freeToArrayFunction · 0.85

Tested by

no test coverage detected