Changeset 5929 for code/trunk/src/orxonox/graphics
- Timestamp:
- Oct 12, 2009, 8:20:07 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/core5 (added) merged: 5768-5769,5772,5775-5780,5783-5785,5791-5792,5795-5807,5809-5814,5816-5832,5836-5839,5842-5853,5855-5899,5904-5922,5924-5928
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/graphics/CMakeLists.txt
r5781 r5929 1 1 ADD_SOURCE_FILES(ORXONOX_SRC_FILES 2 Backlight.cc3 2 Billboard.cc 4 3 BlinkingBillboard.cc 5 Camera.cc6 4 FadingBillboard.cc 7 5 GlobalShader.cc 8 Light.cc9 6 Model.cc 10 7 ParticleEmitter.cc 11 8 ParticleSpawner.cc 9 COMPILATION_BEGIN GraphicsCompilation.cc 10 Backlight.cc 11 Camera.cc 12 Light.cc 13 COMPILATION_END 12 14 ) -
code/trunk/src/orxonox/graphics/Camera.cc
r5781 r5929 38 38 #include "core/CoreIncludes.h" 39 39 #include "core/ConfigValueIncludes.h" 40 #include "core/GameMode.h" 41 #include "core/GUIManager.h" 40 42 #include "Scene.h" 41 43 #include "CameraManager.h" … … 49 51 RegisterObject(Camera); 50 52 53 if (!GameMode::showsGraphics()) 54 ThrowException(AbortLoading, "Can't create Camera, no graphics."); 51 55 if (!this->getScene()) 52 56 ThrowException(AbortLoading, "Can't create Camera, no scene."); … … 65 69 this->nearClipDistance_ = 1; 66 70 67 this->set ObjectMode(0x0);71 this->setSyncMode(0x0); 68 72 69 73 this->setConfigValues(); … … 75 79 if (this->isInitialized()) 76 80 { 81 if (GUIManager::getInstance().getCamera() == this->camera_) 82 GUIManager::getInstance().setCamera(NULL); 77 83 this->releaseFocus(); 78 84 -
code/trunk/src/orxonox/graphics/FadingBillboard.cc
r5781 r5929 103 103 { 104 104 this->changedirection_ = 1; 105 this->turnonofftimer_.setTimer(this->turnontime_, false, this, createExecutor(createFunctor(&FadingBillboard::stopturnonoff)));105 this->turnonofftimer_.setTimer(this->turnontime_, false, createExecutor(createFunctor(&FadingBillboard::stopturnonoff, this))); 106 106 107 107 if (this->isVisible()) … … 111 111 { 112 112 this->changedirection_ = -1; 113 this->turnonofftimer_.setTimer(this->turnofftime_, false, this, createExecutor(createFunctor(&FadingBillboard::stopturnonoff)));113 this->turnonofftimer_.setTimer(this->turnofftime_, false, createExecutor(createFunctor(&FadingBillboard::stopturnonoff, this))); 114 114 } 115 115 } … … 126 126 this->fadedColour_ = ColourValue::ZERO; 127 127 this->getBillboardSet().setColour(this->fadedColour_); 128 this->turnonofftimer_.setTimer(this->postprocessingtime_, false, this, createExecutor(createFunctor(&FadingBillboard::poststopturnonoff)));128 this->turnonofftimer_.setTimer(this->postprocessingtime_, false, createExecutor(createFunctor(&FadingBillboard::poststopturnonoff, this))); 129 129 } 130 130 this->changedirection_ = 0; -
code/trunk/src/orxonox/graphics/FadingBillboard.h
r5781 r5929 74 74 float turnofftime_; 75 75 float postprocessingtime_; 76 Timer <FadingBillboard>turnonofftimer_;76 Timer turnonofftimer_; 77 77 char changedirection_; 78 78 ColourValue fadedColour_; -
code/trunk/src/orxonox/graphics/ParticleEmitter.cc
r5781 r5929 63 63 { 64 64 this->detachOgreObject(this->particles_->getParticleSystem()); 65 delete this->particles_;65 this->particles_->destroy(); 66 66 } 67 67 } … … 101 101 if (this->particles_) 102 102 { 103 delete this->particles_;103 this->particles_->destroy(); 104 104 this->particles_ = 0; 105 105 } -
code/trunk/src/orxonox/graphics/ParticleSpawner.cc
r5781 r5929 71 71 } 72 72 73 void ParticleSpawner:: processEvent(Event& event)73 void ParticleSpawner::XMLEventPort(Element& xmlelement, XMLPort::Mode mode) 74 74 { 75 SUPER(ParticleSpawner, processEvent, event);75 SUPER(ParticleSpawner, XMLEventPort, xmlelement, mode); 76 76 77 ORXONOX_SET_EVENT(ParticleSpawner, "spawn", spawn, event);77 XMLPortEventState(ParticleSpawner, BaseObject, "spawn", spawn, xmlelement, mode); 78 78 } 79 79 … … 88 88 void ParticleSpawner::startParticleSpawner() 89 89 { 90 if (!this->particles_)91 return;92 93 90 this->setActive(false); 94 91 95 92 if (this->bForceDestroy_ || this->bSuppressStart_) 93 { 94 this->timer_.stopTimer(); 96 95 return; 96 } 97 97 98 this->timer_.setTimer(this->startdelay_, false, this, createExecutor(createFunctor(&ParticleSpawner::fireParticleSpawner)));98 this->timer_.setTimer(this->startdelay_, false, createExecutor(createFunctor(&ParticleSpawner::fireParticleSpawner, this))); 99 99 } 100 100 … … 103 103 this->setActive(true); 104 104 if (this->lifetime_ != 0) 105 this->timer_.setTimer(this->lifetime_, false, this, createExecutor(createFunctor(&ParticleSpawner::stopParticleSpawner)));105 this->timer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&ParticleSpawner::stopParticleSpawner, this))); 106 106 } 107 107 … … 116 116 117 117 if (!this->timer_.isActive() || this->timer_.getRemainingTime() > this->destroydelay_) 118 this->timer_.setTimer(this->destroydelay_, false, this, createExecutor(createFunctor(&ParticleSpawner::destroyParticleSpawner)));118 this->timer_.setTimer(this->destroydelay_, false, createExecutor(createFunctor(&ParticleSpawner::destroyParticleSpawner, this))); 119 119 } 120 120 else if (this->bLoop_) 121 121 { 122 this->timer_.setTimer(this->destroydelay_, false, this, createExecutor(createFunctor(&ParticleSpawner::startParticleSpawner)));122 this->timer_.setTimer(this->destroydelay_, false, createExecutor(createFunctor(&ParticleSpawner::startParticleSpawner, this))); 123 123 } 124 124 } … … 126 126 void ParticleSpawner::destroyParticleSpawner() 127 127 { 128 delete this;128 this->destroy(); 129 129 } 130 130 } -
code/trunk/src/orxonox/graphics/ParticleSpawner.h
r5781 r5929 44 44 45 45 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 46 virtual void processEvent(Event& event);46 virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode); 47 47 48 inline void destroy()49 { this->bForceDestroy_ = true; this->stopParticleSpawner(); }48 inline void stop(bool bDestroy) 49 { this->bForceDestroy_ = bDestroy; this->stopParticleSpawner(); } 50 50 inline void spawn() 51 51 { this->bSuppressStart_ = false; this->startParticleSpawner(); } … … 89 89 void destroyParticleSpawner(); 90 90 91 Timer <ParticleSpawner>timer_;91 Timer timer_; 92 92 93 93 bool bSuppressStart_;
Note: See TracChangeset
for help on using the changeset viewer.