Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 9, 2008, 4:28:42 AM (16 years ago)
Author:
landauf
Message:
  • added more exceptions to handle problems while loading a level or single objects
  • dedicated server runs and clients may join, but there are still some heavy problems
Location:
code/branches/objecthierarchy/src/orxonox/objects/worldentities
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/orxonox/objects/worldentities/Billboard.cc

    r2112 r2161  
    7575            {
    7676                this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->material_, this->colour_, 1);
    77                 this->getNode()->attachObject(this->billboard_.getBillboardSet());
     77                if (this->billboard_.getBillboardSet())
     78                    this->getNode()->attachObject(this->billboard_.getBillboardSet());
    7879                this->billboard_.setVisible(this->isVisible());
    7980            }
     
    9091            {
    9192                this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->material_, this->colour_, 1);
    92                 this->getNode()->attachObject(this->billboard_.getBillboardSet());
     93                if (this->billboard_.getBillboardSet())
     94                    this->getNode()->attachObject(this->billboard_.getBillboardSet());
    9395                this->billboard_.setVisible(this->isVisible());
    9496            }
  • code/branches/objecthierarchy/src/orxonox/objects/worldentities/Camera.cc

    r2073 r2161  
    3838#include <OgreViewport.h>
    3939
     40#include "util/Exception.h"
    4041#include "core/CoreIncludes.h"
    4142#include "core/ConfigValueIncludes.h"
     
    5152        RegisterObject(Camera);
    5253
    53         assert(this->getScene());
    54         assert(this->getScene()->getSceneManager());
     54        if (!this->getScene() || !this->getScene()->getSceneManager())
     55            throw AbortLoadingException("Can't create Camera, no scene or no scene manager given.");
    5556
    5657        this->camera_ = this->getScene()->getSceneManager()->createCamera(getUniqueNumberString());
  • code/branches/objecthierarchy/src/orxonox/objects/worldentities/ParticleEmitter.cc

    r2114 r2161  
    3737
    3838#include "tools/ParticleInterface.h"
     39#include "util/Exception.h"
    3940#include "core/CoreIncludes.h"
    4041#include "core/XMLPort.h"
     
    4950        RegisterObject(ParticleEmitter);
    5051
    51         assert(this->getScene());
    52         assert(this->getScene()->getSceneManager());
     52        if (!this->getScene() || !this->getScene()->getSceneManager())
     53            throw AbortLoadingException("Can't create Camera, no scene or no scene manager given.");
    5354
    5455        this->particles_ = 0;
  • code/branches/objecthierarchy/src/orxonox/objects/worldentities/WorldEntity.cc

    r2112 r2161  
    3636#include "core/XMLPort.h"
    3737#include "util/Convert.h"
     38#include "util/Exception.h"
    3839
    3940#include "objects/Scene.h"
     
    5253        RegisterObject(WorldEntity);
    5354
    54         assert(this->getScene());
    55         assert(this->getScene()->getRootSceneNode());
     55        if (!this->getScene() || !this->getScene()->getRootSceneNode())
     56            throw AbortLoadingException("Can't create WorldEntity, no scene or no root-scenenode given.");
    5657
    5758        this->node_ = this->getScene()->getRootSceneNode()->createChildSceneNode();
  • code/branches/objecthierarchy/src/orxonox/objects/worldentities/pawns/Spectator.cc

    r2155 r2161  
    6262        this->greetingFlare_ = new BillboardSet();
    6363        this->greetingFlare_->setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(1.0, 1.0, 0.8), Vector3(0, 20, 0), 1);
    64         this->getNode()->attachObject(this->greetingFlare_->getBillboardSet());
     64        if (this->greetingFlare_->getBillboardSet())
     65            this->getNode()->attachObject(this->greetingFlare_->getBillboardSet());
    6566        this->greetingFlare_->setVisible(false);
    6667        this->bGreetingFlareVisible_ = false;
     
    7677            if (this->greetingFlare_)
    7778            {
    78                 this->getNode()->detachObject(this->greetingFlare_->getBillboardSet());
     79                if (this->greetingFlare_->getBillboardSet())
     80                    this->getNode()->detachObject(this->greetingFlare_->getBillboardSet());
    7981                delete this->greetingFlare_;
    8082            }
  • code/branches/objecthierarchy/src/orxonox/objects/worldentities/triggers/Trigger.cc

    r2078 r2161  
    6969      this->debugBillboard_.setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(1.0, 0.0, 0.0), 1);
    7070      this->debugBillboard_.setVisible(false);
    71     }
    72 
    73     this->getNode()->attachObject(this->debugBillboard_.getBillboardSet());
     71
     72      if (this->debugBillboard_.getBillboardSet())
     73        this->getNode()->attachObject(this->debugBillboard_.getBillboardSet());
     74    }
     75
    7476    this->setObjectMode(0x0);
    7577  }
     
    310312  void Trigger::setBillboardColour(const ColourValue& colour)
    311313  {
    312     this->debugBillboard_.getBillboardSet()->getBillboard(0)->setColour(colour);
     314    this->debugBillboard_.setColour(colour);
    313315  }
    314316
Note: See TracChangeset for help on using the changeset viewer.