Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3194 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Dec 16, 2004, 5:05:16 PM (20 years ago)
Author:
patrick
Message:

orxonox/trunk/src: state-freeze - redefinig destroy functions, some comments

Location:
orxonox/trunk/src
Files:
6 edited

Legend:

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

    r2816 r3194  
    6262
    6363
     64/**
     65  \brief this resets the command node
     66
     67   deleting all data contained in the command node to fill it up again
     68
     69  \todo coppling to different game-entities
     70  \todo reset/destroy has to be redesigned
     71*/
     72
    6473void CommandNode::reset()
    6574{
    66   this->bound->clear();
     75  this->bound->destroy();
    6776}
    6877
  • orxonox/trunk/src/environment.cc

    r2816 r3194  
    6767void Environment::draw ()
    6868{
    69   printf("Environment::draw()");
    70 
    7169  glMatrixMode(GL_MODELVIEW);
    7270  glLoadIdentity();
     
    7876
    7977  glBegin(GL_TRIANGLES);
    80   glColor3f(1,1,1);
     78  glColor3f(1,0,1);
    8179  glVertex3f(0,0,0.5);
    8280  glVertex3f(-0.5,0,-1);
     
    8987   
    9088  glBegin(GL_QUADS);
    91   glColor3f(0,0,1);
     89  glColor3f(1,0,1);
    9290  glVertex3f(0.5,0.5,-1);
    9391  glVertex3f(0.5,-0.5,-1);
  • orxonox/trunk/src/list.cc

    r2818 r3194  
    7777
    7878
    79 void List::clear()
     79void List::destroy()
    8080{
    8181  printf("List::clear() - clearing all world objects, releasing mem\n");
  • orxonox/trunk/src/list.h

    r2822 r3194  
    2222  void add(WorldEntity* entity);
    2323  void remove(WorldEntity* entity);
    24   void clear();
     24  void destroy();
    2525  WorldEntity* firstElement();
    2626  bool isEmpty();
     
    8080  void add(WorldEntity* entity);
    8181  void remove(WorldEntity* entity);
    82   void clear();
     82  void destroy();
    8383  T* firstElement();
    8484  bool isEmpty();
     
    148148
    149149template<class T>
    150 void tList<T>::clear()
     150void tList<T>::destroy()
    151151{
    152152  printf("tList<T>::clear() - clearing all world objects, releasing mem\n");
  • orxonox/trunk/src/player.cc

    r2969 r3194  
    2626{
    2727
    28   obj = new Object ("reaplow.obj");
     28  this->obj = new Object ("reaplow.obj");
    2929  /*
    3030  objectList = glGenLists(1);
     
    5555
    5656Player::~Player ()
     57{
    5758
    58 {
     59  delete this->obj;
    5960}
    6061
  • orxonox/trunk/src/world.cc

    r3175 r3194  
    7575  this->bQuitCurrentGame = true;
    7676  this->localCamera->setWorld(NULL);
    77   this->entities->clear();
     77  WorldEntity* entity = entities->enumerate(); 
     78  while( entity != NULL )
     79    {
     80      entity->destroy();
     81      entity = entities->nextElement();
     82    }
     83  this->entities->destroy();
    7884  Orxonox::getInstance()->get_localinput()->reset();
    79   this->~World();
    8085}
    8186
     
    114119                this->track[i] = Track( i, (i+1)%this->tracklen, &this->pathnodes[i], &this->pathnodes[(i+1)%this->tracklen]);
    115120              }
    116            
     121            // !\todo old track-system has to be removed
     122
    117123            // create a player
    118124            WorldEntity* myPlayer = new Player();
     
    154160                this->track[i] = Track( i, (i+1)%this->tracklen, &this->pathnodes[i], &this->pathnodes[(i+1)%this->tracklen]);
    155161              }
    156            
     162
    157163            // create a player
    158             //WorldEntity* myPlayer = (WorldEntity*) this->spawn<Player>();
    159164            WorldEntity* myPlayer = new Player();
    160165            this->spawn(myPlayer);
    161             this->localPlayer = myPlayer;
     166            this->localPlayer = myPlayer;           
    162167           
    163168            // bind input
     
    539544      else
    540545        {
    541           printf("fps = 1000 but 0ms!\n");
     546          printf("fps = 1000 - frame rate is adjusted\n");
     547          SDL_Delay(10);
     548          dt = 10;
    542549        }
    543550     
Note: See TracChangeset for help on using the changeset viewer.