Index: code/trunk/src/orxonox/graphics/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/graphics/CMakeLists.txt	(revision 5781)
+++ code/trunk/src/orxonox/graphics/CMakeLists.txt	(revision 5929)
@@ -1,12 +1,14 @@
 ADD_SOURCE_FILES(ORXONOX_SRC_FILES
-  Backlight.cc
   Billboard.cc
   BlinkingBillboard.cc
-  Camera.cc
   FadingBillboard.cc
   GlobalShader.cc
-  Light.cc
   Model.cc
   ParticleEmitter.cc
   ParticleSpawner.cc
+COMPILATION_BEGIN GraphicsCompilation.cc
+  Backlight.cc
+  Camera.cc
+  Light.cc
+COMPILATION_END
 )
Index: code/trunk/src/orxonox/graphics/Camera.cc
===================================================================
--- code/trunk/src/orxonox/graphics/Camera.cc	(revision 5781)
+++ code/trunk/src/orxonox/graphics/Camera.cc	(revision 5929)
@@ -38,4 +38,6 @@
 #include "core/CoreIncludes.h"
 #include "core/ConfigValueIncludes.h"
+#include "core/GameMode.h"
+#include "core/GUIManager.h"
 #include "Scene.h"
 #include "CameraManager.h"
@@ -49,4 +51,6 @@
         RegisterObject(Camera);
 
+        if (!GameMode::showsGraphics())
+            ThrowException(AbortLoading, "Can't create Camera, no graphics.");
         if (!this->getScene())
             ThrowException(AbortLoading, "Can't create Camera, no scene.");
@@ -65,5 +69,5 @@
         this->nearClipDistance_ = 1;
 
-        this->setObjectMode(0x0);
+        this->setSyncMode(0x0);
 
         this->setConfigValues();
@@ -75,4 +79,6 @@
         if (this->isInitialized())
         {
+            if (GUIManager::getInstance().getCamera() == this->camera_)
+                GUIManager::getInstance().setCamera(NULL);
             this->releaseFocus();
 
Index: code/trunk/src/orxonox/graphics/FadingBillboard.cc
===================================================================
--- code/trunk/src/orxonox/graphics/FadingBillboard.cc	(revision 5781)
+++ code/trunk/src/orxonox/graphics/FadingBillboard.cc	(revision 5929)
@@ -103,5 +103,5 @@
         {
             this->changedirection_ = 1;
-            this->turnonofftimer_.setTimer(this->turnontime_, false, this, createExecutor(createFunctor(&FadingBillboard::stopturnonoff)));
+            this->turnonofftimer_.setTimer(this->turnontime_, false, createExecutor(createFunctor(&FadingBillboard::stopturnonoff, this)));
 
             if (this->isVisible())
@@ -111,5 +111,5 @@
         {
             this->changedirection_ = -1;
-            this->turnonofftimer_.setTimer(this->turnofftime_, false, this, createExecutor(createFunctor(&FadingBillboard::stopturnonoff)));
+            this->turnonofftimer_.setTimer(this->turnofftime_, false, createExecutor(createFunctor(&FadingBillboard::stopturnonoff, this)));
         }
     }
@@ -126,5 +126,5 @@
             this->fadedColour_ = ColourValue::ZERO;
             this->getBillboardSet().setColour(this->fadedColour_);
-            this->turnonofftimer_.setTimer(this->postprocessingtime_, false, this, createExecutor(createFunctor(&FadingBillboard::poststopturnonoff)));
+            this->turnonofftimer_.setTimer(this->postprocessingtime_, false, createExecutor(createFunctor(&FadingBillboard::poststopturnonoff, this)));
         }
         this->changedirection_ = 0;
Index: code/trunk/src/orxonox/graphics/FadingBillboard.h
===================================================================
--- code/trunk/src/orxonox/graphics/FadingBillboard.h	(revision 5781)
+++ code/trunk/src/orxonox/graphics/FadingBillboard.h	(revision 5929)
@@ -74,5 +74,5 @@
             float turnofftime_;
             float postprocessingtime_;
-            Timer<FadingBillboard> turnonofftimer_;
+            Timer turnonofftimer_;
             char changedirection_;
             ColourValue fadedColour_;
Index: code/trunk/src/orxonox/graphics/ParticleEmitter.cc
===================================================================
--- code/trunk/src/orxonox/graphics/ParticleEmitter.cc	(revision 5781)
+++ code/trunk/src/orxonox/graphics/ParticleEmitter.cc	(revision 5929)
@@ -63,5 +63,5 @@
         {
             this->detachOgreObject(this->particles_->getParticleSystem());
-            delete this->particles_;
+            this->particles_->destroy();
         }
     }
@@ -101,5 +101,5 @@
         if (this->particles_)
         {
-            delete this->particles_;
+            this->particles_->destroy();
             this->particles_ = 0;
         }
Index: code/trunk/src/orxonox/graphics/ParticleSpawner.cc
===================================================================
--- code/trunk/src/orxonox/graphics/ParticleSpawner.cc	(revision 5781)
+++ code/trunk/src/orxonox/graphics/ParticleSpawner.cc	(revision 5929)
@@ -71,9 +71,9 @@
     }
 
-    void ParticleSpawner::processEvent(Event& event)
+    void ParticleSpawner::XMLEventPort(Element& xmlelement, XMLPort::Mode mode)
     {
-        SUPER(ParticleSpawner, processEvent, event);
+        SUPER(ParticleSpawner, XMLEventPort, xmlelement, mode);
 
-        ORXONOX_SET_EVENT(ParticleSpawner, "spawn", spawn, event);
+        XMLPortEventState(ParticleSpawner, BaseObject, "spawn", spawn, xmlelement, mode);
     }
 
@@ -88,13 +88,13 @@
     void ParticleSpawner::startParticleSpawner()
     {
-        if (!this->particles_)
-            return;
-
         this->setActive(false);
 
         if (this->bForceDestroy_ || this->bSuppressStart_)
+        {
+            this->timer_.stopTimer();
             return;
+        }
 
-        this->timer_.setTimer(this->startdelay_, false, this, createExecutor(createFunctor(&ParticleSpawner::fireParticleSpawner)));
+        this->timer_.setTimer(this->startdelay_, false, createExecutor(createFunctor(&ParticleSpawner::fireParticleSpawner, this)));
     }
 
@@ -103,5 +103,5 @@
         this->setActive(true);
         if (this->lifetime_ != 0)
-            this->timer_.setTimer(this->lifetime_, false, this, createExecutor(createFunctor(&ParticleSpawner::stopParticleSpawner)));
+            this->timer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&ParticleSpawner::stopParticleSpawner, this)));
     }
 
@@ -116,9 +116,9 @@
 
             if (!this->timer_.isActive() || this->timer_.getRemainingTime() > this->destroydelay_)
-                this->timer_.setTimer(this->destroydelay_, false, this, createExecutor(createFunctor(&ParticleSpawner::destroyParticleSpawner)));
+                this->timer_.setTimer(this->destroydelay_, false, createExecutor(createFunctor(&ParticleSpawner::destroyParticleSpawner, this)));
         }
         else if (this->bLoop_)
         {
-            this->timer_.setTimer(this->destroydelay_, false, this, createExecutor(createFunctor(&ParticleSpawner::startParticleSpawner)));
+            this->timer_.setTimer(this->destroydelay_, false, createExecutor(createFunctor(&ParticleSpawner::startParticleSpawner, this)));
         }
     }
@@ -126,5 +126,5 @@
     void ParticleSpawner::destroyParticleSpawner()
     {
-        delete this;
+        this->destroy();
     }
 }
Index: code/trunk/src/orxonox/graphics/ParticleSpawner.h
===================================================================
--- code/trunk/src/orxonox/graphics/ParticleSpawner.h	(revision 5781)
+++ code/trunk/src/orxonox/graphics/ParticleSpawner.h	(revision 5929)
@@ -44,8 +44,8 @@
 
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
-            virtual void processEvent(Event& event);
+            virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
 
-            inline void destroy()
-                { this->bForceDestroy_ = true; this->stopParticleSpawner(); }
+            inline void stop(bool bDestroy)
+                { this->bForceDestroy_ = bDestroy; this->stopParticleSpawner(); }
             inline void spawn()
                 { this->bSuppressStart_ = false; this->startParticleSpawner(); }
@@ -89,5 +89,5 @@
             void destroyParticleSpawner();
 
-            Timer<ParticleSpawner> timer_;
+            Timer timer_;
 
             bool  bSuppressStart_;
