Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4322 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
May 27, 2005, 1:27:02 AM (20 years ago)
Author:
patrick
Message:

now the objectmanagment works smoothly with the garbage collection: shoots (projectiles) are now precached (100 pieces) used from this pool and recyled :)

Location:
orxonox/trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/util/garbage_collector.cc

    r4320 r4322  
    139139          /* then finaly delete reference */
    140140          //delete entity;
    141           ObjectManager::getInstance()->addToDeadList(CL_TEST_BULLET, entity);
     141          ObjectManager::getInstance()->addToDeadList(entity->getClassID(), entity);
    142142        }
    143143      entity = iterator->nextElement();
  • orxonox/trunk/src/util/object_manager.cc

    r4320 r4322  
    4040}
    4141
     42
    4243/**
    4344   \brief the singleton reference to this class
     
    6667
    6768
    68 void ObjectManager::addToDeadList(classList index, BaseObject* object)
     69void ObjectManager::addToDeadList(int index, BaseObject* object)
    6970{
    7071  if( likely(this->managedObjectList[index] != NULL))
     
    7576
    7677
    77 BaseObject* ObjectManager::getFromDeadList(classList index, int number)
     78BaseObject* ObjectManager::getFromDeadList(int index, int number)
    7879{
    7980  if( likely(this->managedObjectList[index] != NULL))
  • orxonox/trunk/src/util/object_manager.h

    r4315 r4322  
    5252 
    5353  void mCache(Projectile);
    54   void addToDeadList(classList index, BaseObject* object);
    55   BaseObject* getFromDeadList(classList index, int number = 1);
     54  void addToDeadList(int index, BaseObject* object);
     55  BaseObject* getFromDeadList(int index, int number = 1);
    5656
    5757  void debug();
  • orxonox/trunk/src/world_entities/projectile.cc

    r3755 r4322  
    3333Projectile::Projectile (Weapon* weapon) : WorldEntity()
    3434{
     35  this->setClassID(CL_PROJECTILE, "Projectile");
    3536  this->weapon = weapon;
    3637  this->flightDirection = NULL;
  • orxonox/trunk/src/world_entities/test_bullet.cc

    r3757 r4322  
    3333TestBullet::TestBullet (Weapon* weapon) : Projectile(weapon)
    3434{
     35  this->setClassID(CL_TEST_BULLET, "TestBullet");
    3536  this->model = (Model*)ResourceManager::getInstance()->load("models/test_projectile.obj", OBJ, RP_LEVEL);
    3637}
Note: See TracChangeset for help on using the changeset viewer.