| 493 | } |
| 494 | |
| 495 | GameObject* 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 | |
| 523 | void GameObjectPool::DoFrame()LNOEXCEPT |
| 524 | { |
nothing calls this directly
no test coverage detected