Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4318 in orxonox.OLD


Ignore:
Timestamp:
May 27, 2005, 12:53:34 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: now changed the orxonox baseobject to object id representation. this is much faster, but needs some care, when defining new classes

Location:
orxonox/trunk/src
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/class_list.h

    r4315 r4318  
    66*/
    77
     8#ifndef _CLASS_LIST_H
     9#define _CLASS_LIST_H
     10
    811
    912//! list of all classes to be loadable in via the ObjectManager
    1013typedef enum classList
    1114{
     15  CL_PARENT,
     16  CL_HELPER_PARENT,
     17  CL_NULL_PARENT,
    1218  CL_CAMERA,
     19  CL_CAMERA_TARGET,
     20
     21  CL_WORLD_ENTITY,
    1322  CL_ENVIRONEMENT,
    1423  CL_NPC,
     
    2433  CL_TEST_GUN,
    2534  CL_WEAPON,
    26   CL_WORLD_ENTITY,
     35  CL_CHARACTER_ATTRIBUTES,
     36
     37  CL_STORY_ENTITY,
     38  CL_CAMPAIGN,
     39  CL_WORLD,
     40  CL_TRACK_MANAGER,
     41  CL_TRACK_NODE,
    2742
    2843  CL_ANIMATION,
     
    3247  CL_ARRAY,
    3348  CL_BASE_OBJECT,
    34   CL_BASE,
     49  CL_CURVE,
     50  CL_VECTOR,
     51  CL_FACTORY,
     52  CL_INI_PARSER,
     53  CL_LIST,
     54  CL_SUBSTRING,
     55  CL_LOAD_PARAM,
     56
     57  CL_OBJECT_MANAGER,
     58  CL_RESOURCE_MANAGER,
     59  CL_GARBAGE_COLLECTOR,
     60  CL_GAME_LOADER,
     61  CL_COMMAND_NODE,
     62
     63  CL_GRAPHICS_ENGINE, 
     64  CL_TEXT_ENGINE,
     65  CL_TEXT,
     66  CL_GLMENU_IMAGE_SCREEN,
     67  CL_LIGHT,
     68  CL_LIGHT_MANAGER,
     69  CL_MATERIAL,
     70  CL_MD2Model,
     71  CL_MODEL,
     72  CL_OBJMODEL,
     73  CL_PROMITIVE_MODEL,
     74 
     75  CL_PARTICLE_EMITTER,
     76  CL_PARTICLE_ENGINE,
     77  CL_PARTICLE_SYSTEM,
     78 
    3579
    3680  CL_NUMBER
    3781};
    3882
    39 /*
    40 animation.o
    41 animation3d.o
    42 animation_player.o
    43 array.o
    44 base_entity.o
    45 base_object.o
    46 benchmark.o
    47 camera.o
    48 campaign.o
    49 character_attributes.o
    50 command_node.o
    51 curve.o
    52 environment.o
    53 factory.o
    54 game_loader.o
    55 garbage_collector.o
    56 glmenu_imagescreen.o
    57 graphics_engine.o
    58 helper_parent.o
    59 ini_parser.o
    60 keynames.o
    61 light.o
    62 list.o
    63 load_param.o
    64 material.o
    65 md2Model.o
    66 model.o
    67 null_parent.o
    68 objModel.o
    69 object_manager.o
    70 orxonox.o
    71 p_node.o
    72 particle_emitter.o
    73 particle_engine.o
    74 particle_system.o
    75 player.o
    76 primitive_model.o
    77 projectile.o
    78 resource_manager.o
    79 satellite.o
    80 skybox.o
    81 skysphere.o
    82 story_entity.o
    83 substring.o
    84 terrain.o
    85 test_bullet.o
    86 test_entity.o
    87 test_gun.o
    88 text_engine.o
    89 texture.o
    90 track_manager.o
    91 track_node.o
    92 vector.o
    93 weapon.o
    94 world.o
    95 world_entity.o
    96 */
     83
     84#endif /* _CLASS_LIST_H */
  • orxonox/trunk/src/glmenu/glmenu_imagescreen.cc

    r4261 r4318  
    8888void GLMenuImageScreen::init ()
    8989{
    90   this->setClassName ("GLMenuImageScreen");
     90  this->setClassID(CL_GLMENU_IMAGE_SCREEN);
    9191
    9292  // Select Our VU Meter Background Texture
  • orxonox/trunk/src/lib/coord/helper_parent.cc

    r3544 r4318  
    3030HelperParent::HelperParent ()
    3131{
    32    this->setClassName ("HelperParent");
     32   this->setClassID(CL_HELPER_PARENT);
    3333}
    3434
  • orxonox/trunk/src/lib/graphics/graphics_engine.cc

    r4245 r4318  
    3434  this->minFPS = 9999;
    3535  this->maxFPS = 0;
    36   this->setClassName ("GraphicsEngine");
     36  this->setClassID(CL_GRAPHICS_ENGINE);
    3737
    3838  this->fullscreen = false;
  • orxonox/trunk/src/lib/graphics/light.cc

    r3809 r4318  
    3434Light::Light(int lightNumber)
    3535{
    36   this->setClassName("Light");
     36  this->setClassID(CL_LIGHT);
    3737  char tmpName[7];
    3838  sprintf(tmpName, "Light%d", lightNumber);
     
    205205LightManager::LightManager ()
    206206{
    207   this->setClassName ("LightManager");
     207  this->setClassID(CL_LIGHT_MANAGER);
    208208
    209209  glEnable (GL_LIGHTING);
  • orxonox/trunk/src/lib/graphics/particles/particle_emitter.cc

    r4176 r4318  
    3030                  float velocity)
    3131{
    32    this->setClassName ("ParticleEmitter");
     32   this->setClassID(CL_PARTICLE_EMITTER);
    3333   this->direction = direction;
    3434   this->setSpread(angle);
  • orxonox/trunk/src/lib/graphics/particles/particle_engine.cc

    r4176 r4318  
    3030ParticleEngine::ParticleEngine ()
    3131{
    32    this->setClassName ("ParticleEngine");
     32   this->setClassID(CL_PARTICLE_ENGINE);
    3333
    3434   this->systemList = new tList<ParticleSystem>;
  • orxonox/trunk/src/lib/graphics/particles/particle_system.cc

    r4176 r4318  
    3434ParticleSystem::ParticleSystem (unsigned int maxCount, PARTICLE_TYPE type)
    3535{
    36    this->setClassName ("ParticleSystem");
     36   this->setClassID(CL_PARTICLE_SYSTEM);
    3737   this->material = NULL;
    3838   this->name = NULL;
  • orxonox/trunk/src/lib/graphics/text_engine.cc

    r3911 r4318  
    5151Text::Text(Font* font, int type)
    5252{
    53   this->setClassName("Text");
     53  this->setClassID(CL_TEXT);
    5454
    5555  // initialize this Text
     
    802802TextEngine::TextEngine ()
    803803{
    804    this->setClassName ("TextEngine");
     804   this->setClassID(CL_TEXT_ENGINE);
    805805   this->enableFonts();
    806806
  • orxonox/trunk/src/lib/lang/base_object.cc

    r4261 r4318  
    4242}
    4343
    44 void BaseObject::setClassName (const char* className)
     44
     45void BaseObject::setClassID (int id)
    4546{
    46   this->className = className;
     47  this->id = id;
    4748}
     49
     50
    4851
    4952bool BaseObject::isA (char* className)
  • orxonox/trunk/src/lib/lang/base_object.h

    r4261 r4318  
    99
    1010#include "stdincl.h"
    11 
     11#include "class_list.h"
    1212
    1313class BaseObject {
     
    1717  virtual ~BaseObject ();
    1818
    19   void setClassName (const char* className);
    20   inline const char* getClassName(void) const { return this->className;};
     19  //void setClassName (const char* className);
     20  void setClassID(int id);
     21
     22  inline const char* getClassName(void) const { return "";};
     23  inline int getClassID(void) const { return this->id; }
    2124  bool isA (char* className);
    2225
     
    2629 private:
    2730  const char* className;
     31  int id;
    2832  bool finalized;
    2933};
  • orxonox/trunk/src/story_entities/world.cc

    r4287 r4318  
    196196void World::constuctorInit(char* name, int worldID)
    197197{
    198   this->setClassName ("World");
     198  this->setClassID(CL_WORLD);
    199199
    200200  //this->worldName = name;
  • orxonox/trunk/src/util/animation/animation_player.cc

    r3868 r4318  
    2828AnimationPlayer::AnimationPlayer ()
    2929{
    30    this->setClassName ("AnimationPlayer");
     30   this->setClassID(CL_ANIMATION_PLAYER);
    3131
    3232   this->animationList = new tList<Animation>();
  • orxonox/trunk/src/util/garbage_collector.cc

    r4311 r4318  
    3838GarbageCollector::GarbageCollector ()
    3939{
    40    this->setClassName ("GarbageCollection");
     40   this->setClassID(CL_GARBAGE_COLLECTOR);
    4141   this->time = 0;
    4242   this->delay = 1.5f; /* clean up all 5.0 seconds */
  • orxonox/trunk/src/util/loading/load_param.h

    r4299 r4318  
    180180  static LoadClassDescription* addClass(const char* className);
    181181  LoadParamDescription* addParam(const char* paramName);
     182 
    182183
    183184  static void printAll(const char* fileName = NULL);
  • orxonox/trunk/src/util/object_manager.cc

    r4313 r4318  
    2929ObjectManager::ObjectManager ()
    3030{
    31   this->setClassName ("ObjectManager");
     31  this->setClassID(CL_OBJECT_MANAGER);
    3232 
    3333  this->managedObjectList = new tList<BaseObject>*[CL_NUMBER];
     34  for(int i = 0; i < CL_NUMBER; ++i)
     35    {
     36      this->managedObjectList[i] = NULL;
     37    }
    3438
    3539  this->garbageCollector = GarbageCollector::getInstance();
     
    9195  for(int i = 0; i < CL_NUMBER; ++i)
    9296    {
    93       if(this->managedObjectList[i] != NULL)
     97      if( this->managedObjectList[i] != NULL)
    9498        PRINT(0)("=   o Class Nr. %i has cached %i object(s)\n", i, this->managedObjectList[i]->getSize());
    9599      else
  • orxonox/trunk/src/util/resource_manager.cc

    r4216 r4318  
    3838ResourceManager::ResourceManager ()
    3939{
    40    this->setClassName ("ResourceManager");
     40   this->setClassID(CL_RESOURCE_MANAGER);
    4141   this->dataDir = NULL;
    4242   this->setDataDir("./");
  • orxonox/trunk/src/util/track/track_manager.cc

    r4262 r4318  
    370370TrackManager::TrackManager(void)
    371371{
    372   this->setClassName("TrackManager");
     372  this->setClassID(CL_TRACK_MANAGER);
     373 
    373374 
    374375  TrackManager::singletonRef = this; // do this because otherwise the TrackNode cannot get The instance of the TrackManager
  • orxonox/trunk/src/util/track/track_node.cc

    r4262 r4318  
    3232TrackNode::TrackNode ()
    3333{
    34   this->setClassName("TrackNode");
     34  this->setClassID(CL_TRACK_NODE);
    3535  this->setName("TrackNode"); /* absolete but still used... */
    3636
  • orxonox/trunk/src/world_entities/camera.cc

    r3966 r4318  
    3333Camera::Camera(void)
    3434{
    35   this->setClassName("Camera");
     35  this->setClassID(CL_CAMERA);
    3636  this->target = new CameraTarget();
    3737
     
    190190CameraTarget::CameraTarget()
    191191{
    192   this->setClassName("CameraTarget");
     192  this->setClassID(CL_CAMERA_TARGET);
    193193  this->setMode(PNODE_MOVEMENT);
    194194}
  • orxonox/trunk/src/world_entities/character_attributes.cc

    r3583 r4318  
    2929CharacterAttributes::CharacterAttributes ()
    3030{
    31    this->setClassName ("CharacterAttributes");
     31   this->setClassID(CL_CHARACTER_ATTRIBUTES);
    3232}
    3333
  • orxonox/trunk/src/world_entities/satellite.cc

    r3750 r4318  
    3131Satellite::Satellite (Vector axis, float speed)
    3232{
    33   this->setClassName ("Satellite");
     33  this->setClassID(CL_SATELLITE);
    3434  this->model = (Model*) ResourceManager::getInstance()->load("cube", RP_LEVEL);
    3535  this->speed = speed;
  • orxonox/trunk/src/world_entities/skybox.cc

    r4261 r4318  
    6262void SkyBox::preInit(void)
    6363{
    64   this->setClassName("SkyBox");
     64  this->setClassID(CL_SKYBOX);
    6565  this->skyModel = NULL;
    6666  this->material = new Material*[6];
  • orxonox/trunk/src/world_entities/terrain.cc

    r4136 r4318  
    7777void Terrain::init(void)
    7878{
    79   this->setClassName ("Terrain");
    80  
     79  this->setClassID(CL_TERRAIN);
    8180  this->objectList = 0;
    8281}
  • orxonox/trunk/src/world_entities/world_entity.cc

    r4261 r4318  
    3030WorldEntity::WorldEntity(const TiXmlElement* root)
    3131{
    32   this->setClassName ("WorldEntity");
     32  this->setClassID(CL_WORLD_ENTITY);
    3333  this->model = NULL;
    3434
Note: See TracChangeset for help on using the changeset viewer.