Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4286 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
May 25, 2005, 11:59:21 PM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: implemented the objectmanager cache function

Location:
orxonox/trunk/src
Files:
4 edited

Legend:

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

    r4262 r4286  
    3535#include "graphics_engine.h"
    3636#include "resource_manager.h"
     37#include "object_manager.h"
    3738#include "text_engine.h"
    3839#include "factory.h"
     
    5657  this->world = NULL;
    5758  this->localinput = NULL;
     59  this->resourceManager = NULL;
     60  this->objectManager = NULL;
    5861
    5962  this->argc = 0;
     
    7275  delete GraphicsEngine::getInstance(); // deleting the Graphics
    7376  delete ResourceManager::getInstance(); // deletes the Resource Manager
     77  delete ObjectManager::getInstance();
    7478  delete TextEngine::getInstance();
    7579}
     
    225229  TextEngine::getInstance();
    226230
     231  PRINT(3)("initializing ObjectManager\n");
     232  this->objectManager = ObjectManager::getInstance();
     233
    227234  return 0;
    228235}
  • orxonox/trunk/src/orxonox.h

    r4262 r4286  
    1616class GameLoader;
    1717class ResourceManager;
     18class ObjectManager;
    1819
    1920//! Orxonox core singleton class
     
    3233  GameLoader* gameLoader;     //!< The gameLoader
    3334  ResourceManager* resourceManager; //!< The ResourceManager
     35  ObjectManager* objectManager; //!< the object manager of the game
    3436 
    3537  bool bQuitOrxonox;          //!< If Orxonox should Quit
  • orxonox/trunk/src/util/object_manager.cc

    r4285 r4286  
    1717
    1818#include "object_manager.h"
     19#include "list.h"
     20#include "world_entity.h"
    1921
    2022using namespace std;
     
    2628ObjectManager::ObjectManager ()
    2729{
    28    this->setClassName ("ObjectManager");
    29 
    30   this->managedObjectList = new BaseObject*[CL_NUMBER];
     30  this->setClassName ("ObjectManager");
     31 
     32  //this->managedObjectList = new BaseObject*[CL_NUMBER];
     33  this->managedObjectList = new tList<BaseObject>*[CL_NUMBER];
    3134}
    3235
     
    5760
    5861
    59 void ObjectManager::cache(classList index, int number)
     62void ObjectManager::cache(classList index, int number, const BaseObject &copyObject)
    6063{
    61   this->managedObjectList[index] = new BaseObject();
     64  //this->managedObjectList[index] = new BaseObject[number];
     65  this->managedObjectList[index] = new tList<BaseObject>();
     66  for(int i = 0; i < number; ++i)
     67    {
     68      this->managedObjectList[index]->add(new BaseObject(copyObject));
     69    }
    6270}
    6371
  • orxonox/trunk/src/util/object_manager.h

    r4285 r4286  
    4040  virtual ~ObjectManager(void);
    4141 
    42   void cache(classList index, int number);
     42  void cache(classList index, int number, const BaseObject &copyObject);
    4343  void addToDeadList(const char* className, BaseObject* object);
    4444  BaseObject* getFromDeadList(const char* className, int number = 1);
     
    4848  static ObjectManager* singletonRef;
    4949
    50   BaseObject** managedObjectList;
     50  //BaseObject** managedObjectList;
     51  tList<BaseObject>** managedObjectList;
    5152};
    5253
Note: See TracChangeset for help on using the changeset viewer.