MCPcopy Create free account
hub / github.com/9chu/LuaSTGPlus / freeObject

Method freeObject

LuaSTGPlus/GameObjectPool.cpp:495–521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

493}
494
495GameObject* GameObjectPool::freeObject(GameObject* p)LNOEXCEPT
496{
497 GameObject* pRet = p->pObjectNext;
498
499 // �Ӷ��������Ƴ�
500 LIST_REMOVE(p, Object);
501
502 // ����Ⱦ�����Ƴ�
503 LIST_REMOVE(p, Render);
504
505 // ����ײ�����Ƴ�
506 LIST_REMOVE(p, Collision);
507
508 // ɾ��lua�������Ԫ��
509 GETOBJTABLE; // ot
510 lua_pushnil(L); // ot nil
511 lua_rawseti(L, -2, p->id + 1); // ot
512 lua_pop(L, 1);
513
514 // �ͷ����õ���Դ
515 p->ReleaseResource();
516
517 // ���յ������
518 m_ObjectPool.Free(p->id);
519
520 return pRet;
521}
522
523void GameObjectPool::DoFrame()LNOEXCEPT
524{

Callers

nothing calls this directly

Calls 2

ReleaseResourceMethod · 0.80
FreeMethod · 0.80

Tested by

no test coverage detected