Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 17, 2008, 1:25:06 PM (16 years ago)
Author:
rgrieder
Message:
  • bugfix in audiomanager
  • added CCOUT(level): like COUT, but prints "* Classname: " in front
Location:
code/trunk/src/orxonox
Files:
2 edited

Legend:

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

    r1084 r1089  
    7575#include "tools/Timer.h"
    7676#include "hud/HUD.h"
    77 //#include "objects/weapon/BulletManager.h"
    7877
    7978// FIXME: is this really file scope?
     
    140139    this->auMan_ = 0;
    141140    this->inputHandler_ = 0;
    142     //this->root_ = 0;
    143141    // turn on frame smoothing by setting a value different from 0
    144142    this->frameSmoothingTime_ = 0.0f;
     
    153151  {
    154152    // keep in mind: the order of deletion is very important!
    155 //    if (this->bulletMgr_)
    156 //      delete this->bulletMgr_;
    157153    if (this->orxonoxHUD_)
    158154      delete this->orxonoxHUD_;
     
    172168
    173169  /**
    174    * error kills orxonox
    175    */
    176   void Orxonox::abortImmediate(/* some error code */)
    177   {
    178     //TODO: destroy and destruct everything and print nice error msg
     170    @brief Immediately deletes the orxonox object.
     171    Never use if you can help it while rendering!
     172  */
     173  void Orxonox::abortImmediateForce()
     174  {
     175    COUT(1) << "*** Orxonox Error: Orxonox object was unexpectedly destroyed." << std::endl;
    179176    delete this;
    180177  }
     
    185182  void Orxonox::abortRequest()
    186183  {
     184    COUT(3) << "*** Orxonox: Abort requested." << std::endl;
    187185    bAbort_ = true;
    188186  }
     
    225223    ar.checkArgument("data", this->dataPath_, false);
    226224    ar.checkArgument("ip", serverIp_, false);
    227     if(ar.errorHandling()) abortImmediate();
     225    if(ar.errorHandling()) abortImmediateForce();
    228226    if(mode == std::string("client"))
    229227    {
     
    248246    ogre_->setup();
    249247    //root_ = ogre_->getRoot();
    250     if(!ogre_->load(this->dataPath_)) abortImmediate(/* unable to load */);
     248    if(!ogre_->load(this->dataPath_)) abortImmediateForce(/* unable to load */);
    251249
    252250    server_g = new network::Server();
     
    263261    else
    264262      client_g = new network::Client(serverIp_, NETWORK_PORT);
    265     if(!ogre_->load(this->dataPath_)) abortImmediate(/* unable to load */);
     263    if(!ogre_->load(this->dataPath_)) abortImmediateForce(/* unable to load */);
    266264  }
    267265
     
    272270    ogre_->setConfigPath(path);
    273271    ogre_->setup();
    274     //root_ = ogre_->getRoot();
    275     if(!ogre_->load(this->dataPath_)) abortImmediate(/* unable to load */);
     272    if(!ogre_->load(this->dataPath_)) abortImmediateForce(/* unable to load */);
    276273  }
    277274
     
    301298    auMan_ = new audio::AudioManager();
    302299
    303     //bulletMgr_ = new BulletManager();
    304 
    305300    Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2");
    306301    HUD* orxonoxHud;
     
    350345    auMan_ = new audio::AudioManager();
    351346
    352     //bulletMgr_ = new BulletManager();
    353 
    354347    // load this file from config
    355348    Level* startlevel = new Level("levels/sample.oxw");
     
    380373    if (!inputHandler_->initialise(ogre_->getWindowHandle(),
    381374          ogre_->getWindowWidth(), ogre_->getWindowHeight()))
    382       abortImmediate();
     375      abortImmediateForce();
    383376    inputHandler_->setInputMode(IM_INGAME);
    384377  }
     
    414407    if (Ogre::Root::getSingletonPtr() == 0)
    415408    {
    416       COUT(2) << "Error: Could not start rendering. No Ogre root object found" << std::endl;
     409      COUT(2) << "*** Orxonox Error: Could not start rendering. No Ogre root object found" << std::endl;
    417410      return;
    418411    }
  • code/trunk/src/orxonox/Orxonox.h

    r1056 r1089  
    6161      void init(int argc, char **argv, std::string path);
    6262      void start();
    63       // not sure if this should be private
    64       void abortImmediate(/* some error code */);
     63      void abortImmediateForce();
    6564      void abortRequest();
    6665      inline audio::AudioManager* getAudioManagerPointer() { return auMan_; };
Note: See TracChangeset for help on using the changeset viewer.