Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3225 in orxonox.OLD for orxonox/trunk/src/world.cc


Ignore:
Timestamp:
Dec 20, 2004, 12:23:58 AM (19 years ago)
Author:
patrick
Message:

/orxonox/trunk: unstable - added many comments and now redefinit all function/variable names with underline

File:
1 edited

Legend:

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

    r3222 r3225  
    7272
    7373
    74 /**
    75     \brief initialize the world before use.
    76 */
    7774ErrorMessage World::init()
    7875{
     
    118115      switch(this->debugWorldNr)
    119116        {
     117          /*
     118            this loads the hard-coded debug world. this only for simplicity and will be
     119            removed by a reald world-loader, which interprets a world-file.
     120            if you want to add an own debug world, just add a case DEBUG_WORLD_[nr] and
     121            make whatever you want...
     122           */
    120123        case DEBUG_WORLD_0:
    121124          {
     
    497500      else
    498501        {
    499           /* TO DO: implement check whether this particular free entity
     502          /* \todo: implement check whether this particular free entity
    500503             is out of the game area
    501              TO DO: call function to notify the entity that it left
     504             \todo: call function to notify the entity that it left
    502505             the game area
    503506          */
     
    513516    \param deltaT: the time passed since the last frame in milliseconds
    514517*/
    515 void World::time_slice (Uint32 deltaT)
     518void World::timeSlice (Uint32 deltaT)
    516519{
    517520  //List<WorldEntity> *l;
     
    544547   Camera Placement
    545548*/
    546 void World::calc_camera_pos (Location* loc, Placement* plc)
     549void World::calcCameraPos (Location* loc, Placement* plc)
    547550{
    548551  track[loc->part].map_camera (loc, plc);
     
    560563}
    561564
     565
     566
     567/**
     568   \brief function to put your own debug stuff into it. it can display informations about
     569   the current class/procedure
     570*/
    562571void World::debug()
    563572{
     
    576585
    577586
     587/*
     588  \brief main loop of the world: executing all world relevant function
     589
     590  in this loop we synchronize (if networked), handle input events, give the heart-beat to
     591  all other member-entities of the world (tick to player, enemies etc.), checking for
     592  collisions drawing everything to the screen.
     593*/
    578594void World::mainLoop()
    579595{
     
    582598  while( !this->bQuitOrxonox && !this->bQuitCurrentGame) /* \todo implement pause */
    583599    {
    584       //debug routine
    585       //debug();
    586600      // Network
    587601      synchronize();
     
    594608        }
    595609      // Process time
    596       time_slice();
     610      timeSlice();
    597611      // Process collision
    598612      collision();
     
    616630/**
    617631   \brief run all input processing
    618 */
    619 void World::handle_input ()
     632
     633   the command node is the central input event dispatcher. the node uses the even-queue from
     634   sdl and has its own event-passing-queue.
     635*/
     636void World::handleInput ()
    620637{
    621638  // localinput
    622   CommandNode* cn = Orxonox::getInstance()->get_localinput();
     639  CommandNode* cn = Orxonox::getInstance()->getLocalInput();
    623640  cn->process();
    624641  // remoteinput
     
    627644/**
    628645   \brief advance the timeline
    629 */
    630 void World::time_slice ()
     646
     647   this calculates the time used to process one frame (with all input handling, drawing, etc)
     648   the time is mesured in ms and passed to all world-entities and other classes that need
     649   a heart-beat.
     650*/
     651void World::timeSlice ()
    631652{
    632653  Uint32 currentFrame = SDL_GetTicks();
     
    642663      else
    643664        {
     665          /* the frame-rate is limited to 100 frames per second, all other things are for
     666             nothing.
     667          */
    644668          printf("fps = 1000 - frame rate is adjusted\n");
    645669          SDL_Delay(10);
    646670          dt = 10;
    647671        }
    648      
    649       this->time_slice (dt);
     672      this->timeSlice (dt);
    650673      this->update ();
    651       this->localCamera->time_slice (dt);
     674      this->localCamera->timeSlice(dt);
    652675    }
    653676  this->lastFrame = currentFrame;
     
    665688
    666689/**
    667         \brief render the current frame
     690   \brief render the current frame
     691   
     692   clear all buffers and draw the world
    668693*/
    669694void World::display ()
     
    680705}
    681706
     707/**
     708   \brief give back active camera
     709   
     710   this passes back the actualy active camera
     711   \todo ability to define more than one camera or camera-places
     712*/
    682713Camera* World::getCamera()
    683714{
     
    686717
    687718
     719/**
     720   \brief add and spawn a new entity to this world
     721   \param entity to be added
     722*/
    688723void World::spawn(WorldEntity* entity)
    689724{
     
    707742
    708743
     744/**
     745   \brief add and spawn a new entity to this world
     746   \param entity to be added
     747   \param location where to add
     748*/
    709749void World::spawn(WorldEntity* entity, Location* loc)
    710750{
     
    730770
    731771
     772/**
     773   \brief add and spawn a new entity to this world
     774   \param entity to be added
     775   \param place where to be added
     776*/
    732777void World::spawn(WorldEntity* entity, Placement* plc)
    733778{
     
    747792
    748793
     794/*
     795  \brief commands that the world must catch
     796  \returns false if not used by the world
     797*/
    749798bool World::command(Command* cmd)
    750799{
Note: See TracChangeset for help on using the changeset viewer.