Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 7, 2008, 9:20:42 AM (16 years ago)
Author:
rgrieder
Message:
  • added some comments and COUTs
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ogre/src/orxonox/Orxonox.cc

    r1243 r1244  
    3737
    3838//****** STD *******
    39 //#include <iostream>
    40 //#include <exception>
    4139#include <deque>
    4240
    4341//****** OGRE ******
    44 //#include <OgreException.h>
    4542#include <OgreFrameListener.h>
    4643#include <OgreOverlay.h>
     
    159156
    160157  /**
    161    * create a new instance of Orxonox
     158   * Create a new instance of Orxonox. Avoid doing any actual work here.
    162159   */
    163160  Orxonox::Orxonox()
     
    177174
    178175  /**
    179    * destruct Orxonox
     176   * Destruct Orxonox.
    180177   */
    181178  Orxonox::~Orxonox()
     
    208205
    209206  /**
    210    * @return singleton object
     207   * @return singleton reference
    211208   */
    212209  Orxonox* Orxonox::getSingleton()
     
    248245      return false;
    249246
     247    COUT(3) << "*** Orxonox: Mode is " << mode << "." << std::endl;
    250248    if (mode == "client")
    251249      mode_ = CLIENT;
     
    260258
    261259    // for playable server, client and standalone, the startup
    262     // procedure until the GUI is the identical
     260    // procedure until the GUI is identical
    263261
    264262    TclBind::getInstance().setDataPath(dataPath);
     
    284282      return false;
    285283
    286     // Calls the InputHandler which sets up the input devices.
     284    // Calls the InputManager which sets up the input devices.
    287285    // The render window width and height are used to set up the mouse movement.
    288286    if (!InputManager::initialise(ogre_->getWindowHandle(),
     
    290288      return false;
    291289
    292     // TODO: Spread this so that this call onyl initialises things needed for the GUI
    293     ogre_->initialiseResources();
     290    // TODO: Spread this so that this call only initialises things needed for the GUI
     291    if (!ogre_->initialiseResources())
     292      return false;
    294293
    295294    // TOOD: load the GUI here
     
    298297    // TODO: run GUI here
    299298
    300     // The following lines depend very much on the GUI, so they're probably misplaced here..
     299    // The following lines depend very much on the GUI output, so they're probably misplaced here..
    301300
    302301    InputManager::setInputState(InputManager::IS_NONE);
     
    325324  }
    326325
     326  /**
     327   * Loads everything in the scene except for the actual objects.
     328   * This includes HUD, Console..
     329   */
    327330  bool Orxonox::loadPlayground()
    328331  {
     
    338341
    339342    // Load the HUD
     343    COUT(3) << "*** Orxonox: Loading HUD..." << std::endl;
    340344    Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2");
    341345    orxonoxHUD_ = new HUD();
     
    344348    hudOverlay->show();
    345349
     350    COUT(3) << "*** Orxonox: Loading Console..." << std::endl;
    346351    InputBuffer* ib = dynamic_cast<InputBuffer*>(InputManager::getKeyHandler("buffer"));
    347352    /*
     
    365370  }
    366371
     372  /**
     373   * Level loading method for server mode.
     374   */
    367375  bool Orxonox::serverLoad()
    368376  {
    369     COUT(2) << "initialising server" << std::endl;
     377    COUT(2) << "Loading level in server mode" << std::endl;
    370378
    371379    server_g = new network::Server();
     
    379387  }
    380388
     389  /**
     390   * Level loading method for client mode.
     391   */
    381392  bool Orxonox::clientLoad()
    382393  {
    383     COUT(2) << "initialising client" << std::endl;\
     394    COUT(2) << "Loading level in client mode" << std::endl;\
    384395
    385396    if (serverIp_.compare("") == 0)
     
    394405  }
    395406
     407  /**
     408   * Level loading method for standalone mode.
     409   */
    396410  bool Orxonox::standaloneLoad()
    397411  {
    398     COUT(2) << "initialising standalone mode" << std::endl;
     412    COUT(2) << "Loading level in standalone mode" << std::endl;
    399413
    400414    if (!loadScene())
     
    404418  }
    405419
     420  /**
     421   * Helper method to load a level.
     422   */
    406423  bool Orxonox::loadScene()
    407424  {
     
    447464    timer_->reset();
    448465
     466    COUT(3) << "*** Orxonox: Starting the main loop." << std::endl;
    449467          while (!bAbort_)
    450468          {
     
    534552  }
    535553
     554  /**
     555   * Static function that shows the console in game mode.
     556   */
    536557  void Orxonox::activateConsole()
    537558  {
     559    // currently, the console shows itself when feeded with input.
    538560    InputManager::setInputState(InputManager::IS_CONSOLE);
    539561  }
Note: See TracChangeset for help on using the changeset viewer.