Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3214 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Dec 18, 2004, 3:28:01 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: cleaned up orxonox.cc, deleted unused code

Location:
orxonox/trunk/src
Files:
5 edited

Legend:

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

    r3213 r3214  
    3333CommandNode::CommandNode (int ID)
    3434{
    35   this->bound = new List();
     35  this->bound = new tList<WorldEntity>();
    3636  this->aliases = NULL;
    3737  this->netID = ID;
     
    4949  this->bLocalInput = true;
    5050  this->netID = 0;
    51   this->bound = new List();
     51  this->bound = new tList<WorldEntity>();
    5252  this->bEnabled = true;
    5353  this->load_bindings (filename);
  • orxonox/trunk/src/command_node.h

    r3213 r3214  
    4242  int netID;    //!< Unique identifier that is used to determine between remote CommandNodes
    4343  KeyBindings* aliases;
    44   List* bound;  //!< List of WorldEntites that recieve commands from this CommandNode
     44  tList<WorldEntity>* bound;    //!< List of WorldEntites that recieve commands from this CommandNode
    4545  Sint32 coord[2];
    4646 
  • orxonox/trunk/src/list_template.h

    r2816 r3214  
    4646  ~ListTemplate ();
    4747 
    48   int add (T* obj, ADDMODE mode, bool bRef);
     48  int add(T* obj, ADDMODE mode, bool bRef);
    4949  T* get_object();
    50   ListTemplate<T>* get_next ();
    51   ListTemplate<T>* get_previous ();
    52   ListTemplate<T>* get_last ();
    53   ListTemplate<T>* get_first ();
    54   void set_next (ListTemplate<T>* ptr);
    55   void set_prev (ListTemplate<T>* ptr);
     50  ListTemplate<T>* get_next();
     51  ListTemplate<T>* get_previous();
     52  ListTemplate<T>* get_last();
     53  ListTemplate<T>* get_first();
     54  void set_next(ListTemplate<T>* ptr);
     55  void set_prev(ListTemplate<T>* ptr);
    5656  int remove (T* obj, FINDMODE mode);
    5757  int getSize();
     58  void destroy();
    5859};
    5960
     
    297298}
    298299
     300
     301template<class T>
     302void ListTemplate<T>::destroy()
     303{
     304  /* \todo at the moment - doing nothing. should delete everything */
     305}
     306
    299307#endif
    300308
  • orxonox/trunk/src/orxonox.cc

    r3213 r3214  
    7474void Orxonox::get_config_file (int argc, char** argv)
    7575{
    76   /*    char* path;
    77     #ifdef __WIN32__
    78     path = getenv("");
    79     #else
    80     path = getenv("HOME");
    81     #endif
    82    
    83     if( path != NULL) strcpy (configfilename, path);
    84     else strcpy (configfilename, "./");
    85     strcat (configfilename, "/.orxonox.conf");*/
    86  
    8776  strcpy (configfilename, "orxonox.conf");
    8877}
     
    176165}
    177166
     167
    178168/**
    179169   \brief initializes the sound engine
     
    187177}
    188178
     179
    189180/**
    190181   \brief initializes input functions
     
    198189}
    199190
     191
    200192/**
    201193   \brief initializes network system
     
    207199}
    208200
     201
    209202/**
    210203   \brief initializes and loads resource files
     
    215208  return 0;
    216209}
     210
    217211
    218212/**
     
    247241}
    248242
     243
    249244/**
    250245   \brief exits Orxonox
     
    255250}
    256251
    257 /**
    258    \brief this runs all of Orxonox
    259 */
    260 void Orxonox::mainLoop()
    261 {
    262   lastframe = SDL_GetTicks();
    263   bQuitOrxonox = false;
    264   // This is where everything is run
    265   printf("Orxonox|Entering main loop\n");
    266   while( !bQuitOrxonox)
    267     {
    268       // Network
    269       synchronize();
    270       // Process input
    271       handle_input();
    272       // Process time
    273       time_slice();
    274       // Process collision
    275       collision();
    276       // Draw
    277       display();
    278     }
    279   printf("Orxonox|Exiting the main loop\n");
    280 }
     252
    281253
    282254/**
     
    288260  // Handle special events such as reshape, quit, focus changes
    289261}
    290 
    291 /**
    292    \brief synchronize local data with remote data
    293 */
    294 void Orxonox::synchronize ()
    295 {
    296   // Get remote input
    297   // Update synchronizables
    298 }
    299 
    300 /**
    301    \brief run all input processing
    302 */
    303 void Orxonox::handle_input ()
    304 {
    305   // localinput
    306   //localinput->process();
    307   // remoteinput
    308 }
    309 
    310 /**
    311    \brief advance the timeline
    312 */
    313 void Orxonox::time_slice ()
    314 {
    315   Uint32 curframe = SDL_GetTicks();
    316   if( !pause)
    317     {
    318       Uint32 dt = curframe - lastframe;
    319      
    320       if(dt > 0)
    321         {
    322           float fps = 1000/dt;
    323           printf("fps = %f\n", fps);
    324         }
    325      
    326       world->time_slice (dt);
    327       world->update ();
    328       localcamera->time_slice (dt);
    329     }
    330   lastframe = curframe;
    331 }
    332 
    333 /**
    334    \brief compute collision detection
    335 */
    336 void Orxonox::collision ()
    337 {
    338   world->collide ();
    339 }
     262 
    340263
    341264/**
     
    354277}
    355278
    356 /**
    357    \brief render the current frame
    358 */
    359 void Orxonox::display ()
    360 {
    361   // clear buffer
    362   glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
    363   // set camera
    364   localcamera->apply ();
    365   // draw world
    366   world->draw ();
    367   // draw HUD
    368   // flip buffers
    369   SDL_GL_SwapBuffers();
    370 }
    371279
    372280/**
     
    379287}
    380288
     289
    381290/**
    382291   \brief retrieve a pointer to the local CommandNode
     
    388297}
    389298
     299
    390300/**
    391301   \brief retrieve a pointer to the local World
     
    396306  return world;
    397307}
     308
     309
     310
    398311
    399312int main (int argc, char** argv)
  • orxonox/trunk/src/orxonox.h

    r3204 r3214  
    4141 
    4242  // main loop functions
    43   void synchronize ();
    44   void handle_input ();
    45   void time_slice ();
    46   void collision ();
    47   void display ();
     43  //  void synchronize ();
     44  //void handle_input ();
     45  //void time_slice ();
     46  //void collision ();
     47  //void display ();
    4848 
    4949        // subsystem initialization
     
    6969  World* get_world();
    7070 
    71   void mainLoop();
     71  //void mainLoop();
    7272};
    7373
Note: See TracChangeset for help on using the changeset viewer.