Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3214 in orxonox.OLD for orxonox/trunk/src/orxonox.cc


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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)
Note: See TracChangeset for help on using the changeset viewer.