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/GraphicsEngine.cc

    r1243 r1244  
    7070    this->renderWindow_ = 0;
    7171    this->setConfigValues();
    72     COUT(4) << "*** GraphicsEngine: Constructed" << std::endl;
     72    CCOUT(4) << "Constructed" << std::endl;
    7373  }
    7474
     
    8787  void GraphicsEngine::destroy()
    8888  {
    89     COUT(4) << "*** GraphicsEngine: Destroying objects..." << std::endl;
     89    COUT(4) << "Destroying objects..." << std::endl;
    9090    Ogre::WindowEventUtilities::removeWindowEventListener(this->renderWindow_, this);
    9191    if (this->root_)
     
    101101      delete Ogre::LogManager::getSingletonPtr();
    102102    }
    103     COUT(4) << "*** GraphicsEngine: Destroying objects done" << std::endl;
     103    COUT(4) << "Destroying objects done" << std::endl;
    104104  }
    105105
     
    118118  bool GraphicsEngine::setup(std::string& dataPath)
    119119  {
     120    CCOUT(3) << "Setting up..." << std::endl;
    120121    // temporary overwrite of dataPath, change ini file for permanent change
    121122    if (dataPath != "")
     
    139140    else
    140141      logger = Ogre::LogManager::getSingletonPtr();
    141     COUT(4) << "*** GraphicsEngine: Ogre LogManager created/assigned" << std::endl;
     142    CCOUT(4) << "Ogre LogManager created/assigned" << std::endl;
    142143
    143144    // create our own log that we can listen to
     
    153154
    154155    // Root will detect that we've already created a Log
    155     COUT(4) << "*** GraphicsEngine: Creating Ogre Root..." << std::endl;
     156    CCOUT(4) << "Creating Ogre Root..." << std::endl;
    156157    root_ = new Ogre::Root(plugin_filename);
    157     COUT(4) << "*** GraphicsEngine: Creating Ogre Root done" << std::endl;
     158    CCOUT(4) << "Creating Ogre Root done" << std::endl;
    158159
    159160    // specify where Ogre has to look for resources. This call doesn't parse anything yet!
    160161    declareRessourceLocations();
    161162
     163    CCOUT(3) << "Set up done." << std::endl;
    162164    return true;
    163165  }
     
    165167  void GraphicsEngine::declareRessourceLocations()
    166168  {
     169    CCOUT(4) << "Declaring Resources" << std::endl;
    167170    //TODO: Specify layout of data file and maybe use xml-loader
    168171    //TODO: Work with ressource groups (should be generated by a special loader)
     
    194197  bool GraphicsEngine::loadRenderer()
    195198  {
     199    CCOUT(4) << "Configuring Renderer" << std::endl;
    196200    if (!root_->restoreConfig() && !root_->showConfigDialog())
    197201      return false;
    198202
     203    CCOUT(4) << "Creating render window" << std::endl;
    199204    this->renderWindow_ = root_->initialise(true, "OrxonoxV2");
    200205    if (!root_->isInitialised())
    201       return false;
     206    {
     207      CCOUT(2) << "Error: Creating Ogre root object failed" << std::endl;
     208      return false;
     209    }
    202210    Ogre::WindowEventUtilities::addWindowEventListener(this->renderWindow_, this);
    203211    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
     
    205213  }
    206214
    207   void GraphicsEngine::initialiseResources()
    208   {
     215  bool GraphicsEngine::initialiseResources()
     216  {
     217    CCOUT(4) << "Initialising resources" << std::endl;
    209218    //TODO: Do NOT load all the groups, why are we doing that? And do we really do that? initialise != load...
    210     Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
     219    try
     220    {
     221      Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
     222    }
     223    catch (Ogre::Exception e)
     224    {
     225      CCOUT(2) << "Error: There was an Error when initialising the resources." << std::endl;
     226      CCOUT(2) << "ErrorMessage: " << e.getFullDescription() << std::endl;
     227      return false;
     228    }
     229    return true;
    211230  }
    212231
     
    216235  bool GraphicsEngine::createNewScene()
    217236  {
     237    CCOUT(4) << "Creating new SceneManager" << std::endl;
    218238    if (scene_)
    219       return false;
     239    {
     240      CCOUT(2) << "SceneManager already exists! Skipping." << std::endl;
     241      return false;
     242    }
    220243    scene_ = root_->createSceneManager(Ogre::ST_GENERIC, "Default SceneManager");
    221     COUT(3) << "Info: Created SceneManager: " << scene_ << std::endl;
     244    CCOUT(3) << "Created SceneManager: " << scene_ << std::endl;
    222245    return true;
    223246  }
Note: See TracChangeset for help on using the changeset viewer.