Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9707 in orxonox.OLD for branches


Ignore:
Timestamp:
Aug 25, 2006, 9:58:58 PM (18 years ago)
Author:
bensch
Message:

some more WorldEntities adapted

Location:
branches/new_class_id/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/util/fast_factory.h

    r9703 r9707  
    3838 * static FastFactory*         fastFactory;
    3939 */
    40 #define CREATE_FAST_FACTORY_STATIC(CLASS_NAME, CLASS_ID) \
    41   FastFactory* CLASS_NAME::fastFactory = tFastFactory<CLASS_NAME>::getFastFactory(CLASS_ID, #CLASS_NAME)
     40#define CREATE_FAST_FACTORY_STATIC(CLASS_NAME) \
     41  FastFactory* CLASS_NAME::fastFactory = tFastFactory<CLASS_NAME>::getFastFactory(CLASS_NAME::classID(), #CLASS_NAME)
    4242
    4343//! A struct, that holds Lists of Objects of a certain type.
  • branches/new_class_id/src/world_entities/effects/billboard.cc

    r9406 r9707  
    2626
    2727
    28 
     28#include "class_id.h"
    2929CREATE_FACTORY(Billboard, CL_BILLBOARD);
    30 
     30NewObjectListDefinitionID(Billboard, CL_BILLBOARD);
    3131
    3232/**
     
    5757void Billboard::init()
    5858{
    59   this->setClassID(CL_BILLBOARD, "Billboard");
     59  this->registerObject(this, Billboard::_objectList);
    6060  this->setName("Billboard");
    6161
     
    124124  glDisable(GL_LIGHTING);
    125125  glDisable(GL_FOG);
    126  
     126
    127127  glPushMatrix();
    128128
     
    130130  //glTranslatef(0,0,0);
    131131  this->material->select();
    132  
     132
    133133  const PNode* camera = State::getCameraNode();  //!< @todo MUST be different
    134134  Vector cameraPos = camera->getAbsCoor();
     
    141141  h.normalize();
    142142  v.normalize();
    143  
     143
    144144  v *= sizeX;
    145145  h *= sizeY;
     
    165165             this->getAbsCoor().z - h.z + v.z);
    166166  glEnd();
    167  
    168  
     167
     168
    169169  glPopMatrix();
    170  
     170
    171171  glPopAttrib();
    172172}
  • branches/new_class_id/src/world_entities/effects/billboard.h

    r8255 r9707  
    1313class Billboard : public WorldEntity
    1414{
     15  NewObjectListDeclaration(Billboard);
    1516  public:
    1617    Billboard(const TiXmlElement* root = NULL);
  • branches/new_class_id/src/world_entities/effects/explosion.cc

    r9406 r9707  
    2121
    2222#include "state.h"
    23 #include "class_list.h"
    2423
    2524#include "box_emitter.h"
     
    2827
    2928
    30 
    31 CREATE_FAST_FACTORY_STATIC(Explosion, CL_EXPLOSION);
    32 
     29#include "class_id.h"
     30CREATE_FAST_FACTORY_STATIC(Explosion);
     31NewObjectListDefinitionID(Explosion, CL_EXPLOSION);
    3332
    3433/**
     
    3736Explosion::Explosion ()
    3837{
    39   this->setClassID(CL_EXPLOSION, "Explosion");
     38  this->registerObject(this, Explosion::_objectList);
    4039  this->toList(OM_DEAD_TICK);
    4140
     
    5958
    6059  /* this is normaly done by World.cc by deleting the ParticleEngine */
    61   if (Explosion::explosionParticles != NULL && ClassList::getList(CL_EXPLOSION)->size() <= 1)
     60  if (Explosion::explosionParticles != NULL && Explosion::objectList().size() <= 1)
    6261     Explosion::explosionParticles = NULL;
    6362}
  • branches/new_class_id/src/world_entities/effects/explosion.h

    r7125 r9707  
    1515class Explosion : public WorldEntity
    1616{
     17  NewObjectListDeclaration(Explosion);
    1718  public:
    1819    static void explode (PNode* position, const Vector& size);
  • branches/new_class_id/src/world_entities/npcs/ground_turret.cc

    r9656 r9707  
    2828
    2929#include "effects/explosion.h"
     30
    3031
    3132CREATE_FACTORY(GroundTurret, CL_GROUND_TURRET);
  • branches/new_class_id/src/world_entities/npcs/npc_test.cc

    r9235 r9707  
    3030#include "effects/explosion.h"
    3131
     32#include "class_id.h"
    3233CREATE_FACTORY(NPC2, CL_NPC_TEST2);
    33 
     34NewObjectListDefinitionID(NPC2, CL_NPC_TEST2);
    3435
    3536NPC2::NPC2(const TiXmlElement* root)
    3637  : NPC(NULL)
    3738{
    38   this->setClassID(CL_NPC_TEST2, "NPC2");
     39  this->registerObject(this, NPC2::_objectList);
    3940
    4041  if ((float)rand()/RAND_MAX > .5f)
  • branches/new_class_id/src/world_entities/npcs/npc_test.h

    r9235 r9707  
    99
    1010class NPC2 : public NPC {
     11  NewObjectListDeclaration(NPC2);
    1112
    1213 public:
Note: See TracChangeset for help on using the changeset viewer.