Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Oct 11, 2004, 12:53:43 AM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: minor changes - enhanced sc controll, fixed uncontrolled rotation effect, added some debug outputs for testing purposes, reformatted some src files from win style but not all

File:
1 edited

Legend:

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

    r2190 r2551  
    230230void Orxonox::mainLoop()
    231231{
    232         lastframe = SDL_GetTicks();
    233         bQuitOrxonox = false;
     232  lastframe = SDL_GetTicks();
     233  bQuitOrxonox = false;
    234234  // This is where everything is run
    235 printf("Orxonox|Entering main loop\n");
     235  printf("Orxonox|Entering main loop\n");
    236236  while( !bQuitOrxonox)
    237   {
    238         // Network
    239         synchronize();
    240     // Process input
    241     handle_input();
    242     // Process time
    243     time_slice();
    244     // Process collision
    245     collision();
    246     // Draw
    247     display();
    248   }
    249 printf("Orxonox|Exiting the main loop\n");
     237    {
     238      printf("<==");
     239
     240      // Network
     241      synchronize();
     242      // Process input
     243      handle_input();
     244      // Process time
     245      time_slice();
     246      // Process collision
     247      collision();
     248      // Draw
     249      display();
     250
     251      printf(">\n");
     252    }
     253  printf("Orxonox|Exiting the main loop\n");
    250254}
    251255
     
    283287void Orxonox::time_slice ()
    284288{
    285         Uint32 curframe = SDL_GetTicks();
    286         if( !pause)
     289  Uint32 curframe = SDL_GetTicks();
     290  if( !pause)
     291    {
     292      Uint32 dt = curframe - lastframe;
     293     
     294      if(dt > 0)
    287295        {
    288                 world->time_slice (curframe - lastframe);
    289                 world->update ();
    290                 localcamera->time_slice (curframe - lastframe);
     296          float fps = 1000/dt;
     297          printf("%f", fps);
    291298        }
    292         lastframe = curframe;
     299     
     300      world->time_slice (dt);
     301      world->update ();
     302      localcamera->time_slice (dt);
     303    }
     304  lastframe = curframe;
    293305}
    294306
Note: See TracChangeset for help on using the changeset viewer.