Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 12, 2009, 8:20:07 PM (15 years ago)
Author:
rgrieder
Message:

Merged core5 branch back to the trunk.
Key features include clean level unloading and an extended XML event system.

Two important notes:
Delete your keybindings.ini files! * or you will still get parser errors when loading the key bindings.
Delete build_dir/lib/modules/libgamestates.module! * or orxonox won't start.
Best thing to do is to delete the build folder ;)

Location:
code/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/graphics/CMakeLists.txt

    r5781 r5929  
    11ADD_SOURCE_FILES(ORXONOX_SRC_FILES
    2   Backlight.cc
    32  Billboard.cc
    43  BlinkingBillboard.cc
    5   Camera.cc
    64  FadingBillboard.cc
    75  GlobalShader.cc
    8   Light.cc
    96  Model.cc
    107  ParticleEmitter.cc
    118  ParticleSpawner.cc
     9COMPILATION_BEGIN GraphicsCompilation.cc
     10  Backlight.cc
     11  Camera.cc
     12  Light.cc
     13COMPILATION_END
    1214)
  • code/trunk/src/orxonox/graphics/Camera.cc

    r5781 r5929  
    3838#include "core/CoreIncludes.h"
    3939#include "core/ConfigValueIncludes.h"
     40#include "core/GameMode.h"
     41#include "core/GUIManager.h"
    4042#include "Scene.h"
    4143#include "CameraManager.h"
     
    4951        RegisterObject(Camera);
    5052
     53        if (!GameMode::showsGraphics())
     54            ThrowException(AbortLoading, "Can't create Camera, no graphics.");
    5155        if (!this->getScene())
    5256            ThrowException(AbortLoading, "Can't create Camera, no scene.");
     
    6569        this->nearClipDistance_ = 1;
    6670
    67         this->setObjectMode(0x0);
     71        this->setSyncMode(0x0);
    6872
    6973        this->setConfigValues();
     
    7579        if (this->isInitialized())
    7680        {
     81            if (GUIManager::getInstance().getCamera() == this->camera_)
     82                GUIManager::getInstance().setCamera(NULL);
    7783            this->releaseFocus();
    7884
  • code/trunk/src/orxonox/graphics/FadingBillboard.cc

    r5781 r5929  
    103103        {
    104104            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)));
    106106
    107107            if (this->isVisible())
     
    111111        {
    112112            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)));
    114114        }
    115115    }
     
    126126            this->fadedColour_ = ColourValue::ZERO;
    127127            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)));
    129129        }
    130130        this->changedirection_ = 0;
  • code/trunk/src/orxonox/graphics/FadingBillboard.h

    r5781 r5929  
    7474            float turnofftime_;
    7575            float postprocessingtime_;
    76             Timer<FadingBillboard> turnonofftimer_;
     76            Timer turnonofftimer_;
    7777            char changedirection_;
    7878            ColourValue fadedColour_;
  • code/trunk/src/orxonox/graphics/ParticleEmitter.cc

    r5781 r5929  
    6363        {
    6464            this->detachOgreObject(this->particles_->getParticleSystem());
    65             delete this->particles_;
     65            this->particles_->destroy();
    6666        }
    6767    }
     
    101101        if (this->particles_)
    102102        {
    103             delete this->particles_;
     103            this->particles_->destroy();
    104104            this->particles_ = 0;
    105105        }
  • code/trunk/src/orxonox/graphics/ParticleSpawner.cc

    r5781 r5929  
    7171    }
    7272
    73     void ParticleSpawner::processEvent(Event& event)
     73    void ParticleSpawner::XMLEventPort(Element& xmlelement, XMLPort::Mode mode)
    7474    {
    75         SUPER(ParticleSpawner, processEvent, event);
     75        SUPER(ParticleSpawner, XMLEventPort, xmlelement, mode);
    7676
    77         ORXONOX_SET_EVENT(ParticleSpawner, "spawn", spawn, event);
     77        XMLPortEventState(ParticleSpawner, BaseObject, "spawn", spawn, xmlelement, mode);
    7878    }
    7979
     
    8888    void ParticleSpawner::startParticleSpawner()
    8989    {
    90         if (!this->particles_)
    91             return;
    92 
    9390        this->setActive(false);
    9491
    9592        if (this->bForceDestroy_ || this->bSuppressStart_)
     93        {
     94            this->timer_.stopTimer();
    9695            return;
     96        }
    9797
    98         this->timer_.setTimer(this->startdelay_, false, this, createExecutor(createFunctor(&ParticleSpawner::fireParticleSpawner)));
     98        this->timer_.setTimer(this->startdelay_, false, createExecutor(createFunctor(&ParticleSpawner::fireParticleSpawner, this)));
    9999    }
    100100
     
    103103        this->setActive(true);
    104104        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)));
    106106    }
    107107
     
    116116
    117117            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)));
    119119        }
    120120        else if (this->bLoop_)
    121121        {
    122             this->timer_.setTimer(this->destroydelay_, false, this, createExecutor(createFunctor(&ParticleSpawner::startParticleSpawner)));
     122            this->timer_.setTimer(this->destroydelay_, false, createExecutor(createFunctor(&ParticleSpawner::startParticleSpawner, this)));
    123123        }
    124124    }
     
    126126    void ParticleSpawner::destroyParticleSpawner()
    127127    {
    128         delete this;
     128        this->destroy();
    129129    }
    130130}
  • code/trunk/src/orxonox/graphics/ParticleSpawner.h

    r5781 r5929  
    4444
    4545            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    46             virtual void processEvent(Event& event);
     46            virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
    4747
    48             inline void destroy()
    49                 { this->bForceDestroy_ = true; this->stopParticleSpawner(); }
     48            inline void stop(bool bDestroy)
     49                { this->bForceDestroy_ = bDestroy; this->stopParticleSpawner(); }
    5050            inline void spawn()
    5151                { this->bSuppressStart_ = false; this->startParticleSpawner(); }
     
    8989            void destroyParticleSpawner();
    9090
    91             Timer<ParticleSpawner> timer_;
     91            Timer timer_;
    9292
    9393            bool  bSuppressStart_;
Note: See TracChangeset for help on using the changeset viewer.