[Orxonox-commit 3514] r8200 - in code/branches/portals: data/levels src/modules src/modules/objects/triggers src/modules/portals

FelixSchulthess at orxonox.net FelixSchulthess at orxonox.net
Thu Apr 7 12:55:24 CEST 2011


Author: FelixSchulthess
Date: 2011-04-07 12:55:24 +0200 (Thu, 07 Apr 2011)
New Revision: 8200

Added:
   code/branches/portals/src/modules/portals/PortalsPrecompiledHeaders.h
   code/branches/portals/src/modules/portals/PortalsPrereqs.h
Removed:
   code/branches/portals/src/modules/portals/PortalPrecompiledHeaders.h
   code/branches/portals/src/modules/portals/PortalPrereqs.h
Modified:
   code/branches/portals/data/levels/portals.oxw
   code/branches/portals/src/modules/CMakeLists.txt
   code/branches/portals/src/modules/objects/triggers/MultiTrigger.cc
   code/branches/portals/src/modules/objects/triggers/TriggerBase.h
   code/branches/portals/src/modules/portals/CMakeLists.txt
   code/branches/portals/src/modules/portals/PortalEndPoint.cc
   code/branches/portals/src/modules/portals/PortalEndPoint.h
   code/branches/portals/src/modules/portals/PortalLink.cc
   code/branches/portals/src/modules/portals/PortalLink.h
Log:
blah

Modified: code/branches/portals/data/levels/portals.oxw
===================================================================
--- code/branches/portals/data/levels/portals.oxw	2011-04-07 10:13:19 UTC (rev 8199)
+++ code/branches/portals/data/levels/portals.oxw	2011-04-07 10:55:24 UTC (rev 8200)
@@ -26,9 +26,17 @@
   >
 
 
-   <PortalEndPoint position="0,0,0" material="Examples/Flare" id="1"/>
-   <PortalEndPoint position="-100,0,0" material="Examples/Flare" id="2"/>
-   <PortalLink fromID="1" toID="2" />
+	<PortalEndPoint position="0,0,0" id="1">
+		<attached>
+			<Billboard material="Examples/Flare" />
+		</attached>
+	</PortalEndPoint>
+	<PortalEndPoint position="-100,0,0" id="2">
+		<attached>
+			<Billboard material="Examples/Flare2" />
+		</attached>
+	</PortalEndPoint>
+	<PortalLink fromID="1" toID="2" />
 
     <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
 

Modified: code/branches/portals/src/modules/CMakeLists.txt
===================================================================
--- code/branches/portals/src/modules/CMakeLists.txt	2011-04-07 10:13:19 UTC (rev 8199)
+++ code/branches/portals/src/modules/CMakeLists.txt	2011-04-07 10:55:24 UTC (rev 8200)
@@ -31,5 +31,6 @@
 ADD_SUBDIRECTORY(overlays)
 ADD_SUBDIRECTORY(pickup)
 ADD_SUBDIRECTORY(pong)
+ADD_SUBDIRECTORY(portals)
 ADD_SUBDIRECTORY(questsystem)
 ADD_SUBDIRECTORY(weapons)

Modified: code/branches/portals/src/modules/objects/triggers/MultiTrigger.cc
===================================================================
--- code/branches/portals/src/modules/objects/triggers/MultiTrigger.cc	2011-04-07 10:13:19 UTC (rev 8199)
+++ code/branches/portals/src/modules/objects/triggers/MultiTrigger.cc	2011-04-07 10:55:24 UTC (rev 8200)
@@ -115,7 +115,7 @@
             this->broadcast(false);
         }
 
-        // Check if the object is active (this is NOT MultiTrigger::isActive()!)
+        // Check if the object is active (this is NOT MultiTrigger::isActive()!), it is whether the MultiTrigger actually does anything, ever. 
         if (!this->BaseObject::isActive())
             return;
 
@@ -204,7 +204,7 @@
                             if(bActive == true)
                             {
                                 // If the MultiTrigger has not exceeded its remaining activations.
-                                if(this->remainingActivations_ > 0)
+                                if(this->hasRemainingActivations())
                                 {
                                     this->active_.insert(state->originator);
                                     if(this->remainingActivations_ != INF_s)
@@ -217,7 +217,7 @@
                             else
                             {
                                 // If the MultiTrigger doesn't stay active or hasn't' exceeded its remaining activations.
-                                if(!this->getStayActive() || this->remainingActivations_ > 0)
+                                if(!this->getStayActive() || this->hasRemainingActivations())
                                     this->active_.erase(state->originator);
                                 else
                                     bFire = false;

Modified: code/branches/portals/src/modules/objects/triggers/TriggerBase.h
===================================================================
--- code/branches/portals/src/modules/objects/triggers/TriggerBase.h	2011-04-07 10:13:19 UTC (rev 8199)
+++ code/branches/portals/src/modules/objects/triggers/TriggerBase.h	2011-04-07 10:55:24 UTC (rev 8200)
@@ -185,6 +185,9 @@
             inline void setActivations(int activations)
                 { if(activations >= 0 || activations == INF_s) this->remainingActivations_ = activations; }
 
+			inline bool hasRemainingActivations(void)
+				{ return this->remainingActivations_ == INF_s || this->remainingActivations_  > 0; } 
+
             /**
             @brief Adds the parent of a MultiTrigger.
             @param parent A pointer to the parent MultiTrigger.

Modified: code/branches/portals/src/modules/portals/CMakeLists.txt
===================================================================
--- code/branches/portals/src/modules/portals/CMakeLists.txt	2011-04-07 10:13:19 UTC (rev 8199)
+++ code/branches/portals/src/modules/portals/CMakeLists.txt	2011-04-07 10:55:24 UTC (rev 8200)
@@ -8,7 +8,7 @@
   FIND_HEADER_FILES
   TOLUA_FILES
   PCH_FILE
-    PickupPrecompiledHeaders.h
+    PortalsPrecompiledHeaders.h
   LINK_LIBRARIES
     orxonox
     objects

Modified: code/branches/portals/src/modules/portals/PortalEndPoint.cc
===================================================================
--- code/branches/portals/src/modules/portals/PortalEndPoint.cc	2011-04-07 10:13:19 UTC (rev 8199)
+++ code/branches/portals/src/modules/portals/PortalEndPoint.cc	2011-04-07 10:55:24 UTC (rev 8200)
@@ -7,7 +7,7 @@
 
     std::map<unsigned int, PortalEndPoint *> PortalEndPoint::idMap_s;
 
-    PortalEndPoint::PortalEndPoint(BaseObject* creator) : StaticEntity(creator), id_(0), material_(""), billboard_(0)
+    PortalEndPoint::PortalEndPoint(BaseObject* creator) : DistanceMultiTrigger(creator), id_(0)
     {
         RegisterObject(PortalEndPoint);
     }
@@ -21,8 +21,6 @@
     {
         SUPER(PortalEndPoint, XMLPort, xmlelement, mode);
         XMLPortParam(PortalEndPoint, "id", setID, getID, xmlelement, mode);
-        XMLPortParamExtern(PortalEndPoint, Billboard, this->billboard_, "material", setMaterial, getMaterial, xmlelement, mode);
-        XMLPortParamExtern(PortalEndPoint, Billboard, this->billboard_, "colour", setColour, getColour, xmlelement, mode).defaultValues(ColourValue::White);
         
         if(mode == XMLPort::LoadObject)
         {
@@ -32,7 +30,7 @@
 
     void PortalEndPoint::tick(float dt)
     {
-        SUPER(PortalEndPoint, tick);
+        SUPER(PortalEndPoint, tick, dt);
     }
 
     void PortalEndPoint::jumpOut(WorldEntity* entity)

Modified: code/branches/portals/src/modules/portals/PortalEndPoint.h
===================================================================
--- code/branches/portals/src/modules/portals/PortalEndPoint.h	2011-04-07 10:13:19 UTC (rev 8199)
+++ code/branches/portals/src/modules/portals/PortalEndPoint.h	2011-04-07 10:55:24 UTC (rev 8200)
@@ -1,17 +1,19 @@
 #ifndef _PortalEndPoint_H__
 #define _PortalEndPoint_H__
 
+#include "portals/PortalsPrereqs.h"
+
 #include <set>
 #include <string>
 #include <map>
 
-#include "StaticEntity.h"
+#include "worldentities/StaticEntity.h"
 #include "graphics/Billboard.h"
-#include "modules/objects/triggers/DistanceMultiTrigger.h"
+#include "objects/triggers/DistanceMultiTrigger.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport PortalEndPoint : public DistanceMultiTrigger
+    class _PortalsExport PortalEndPoint : public DistanceMultiTrigger
     {
         public:
             PortalEndPoint(BaseObject* creator);
@@ -35,7 +37,6 @@
         private:
             unsigned int id_;
             std::set<WorldEntity *> recentlyJumpedOut_; //!< Entities which recently jumped out of this EndPoint, hence they shouldn't be pulled in again if the endpoint is the beginning of a link
-            Billboard billboard_;
     };
 
 }

Modified: code/branches/portals/src/modules/portals/PortalLink.cc
===================================================================
--- code/branches/portals/src/modules/portals/PortalLink.cc	2011-04-07 10:13:19 UTC (rev 8199)
+++ code/branches/portals/src/modules/portals/PortalLink.cc	2011-04-07 10:55:24 UTC (rev 8200)
@@ -6,7 +6,7 @@
 {
     CreateFactory(PortalLink);
     
-    PortalLink::PortalLink(BaseObject* creator) : BaseObject(creator), fromID_(0), toID_(0), from_(0), to_(0), activationRadius_(20)
+    PortalLink::PortalLink(BaseObject* creator) : EventListener(creator), fromID_(0), toID_(0), from_(0), to_(0), activationRadius_(20)
     {
         RegisterObject(PortalLink);
     }
@@ -31,12 +31,12 @@
     
     void PortalLink::tick(float dt)
     {
-        SUPER(PortalLink, tick)
+        SUPER(PortalLink, tick, dt);
     }
     
     void PortalLink::processEvent(Event& event)
     {
-        SUPER(PortalLink, processEvent);
+        EventListener::processEvent(event);
         if(!event.activate_)
         {
             return;
@@ -52,7 +52,7 @@
         {
             return;
         }
-        to_->jumpOut(entity);
+        to_->jumpOut(eventEntity);
     }
 
-}
\ No newline at end of file
+}

Modified: code/branches/portals/src/modules/portals/PortalLink.h
===================================================================
--- code/branches/portals/src/modules/portals/PortalLink.h	2011-04-07 10:13:19 UTC (rev 8199)
+++ code/branches/portals/src/modules/portals/PortalLink.h	2011-04-07 10:55:24 UTC (rev 8200)
@@ -1,7 +1,7 @@
 #ifndef _PortalLink_H__
 #define _PortalLink_H__
 
-#include "OrxonoxPrereqs.h"
+#include "portals/PortalsPrereqs.h"
 #include "tools/interfaces/Tickable.h"
 #include "core/BaseObject.h"
 #include "PortalEndPoint.h"
@@ -11,7 +11,7 @@
 
 namespace orxonox
 {
-    class _OrxonoxExport PortalLink : public EventListener
+    class _PortalsExport PortalLink : public EventListener
     {
         public:
             PortalLink(BaseObject* creator);
@@ -51,4 +51,4 @@
 
 }
 
-#endif /* _Portals_H__ */
\ No newline at end of file
+#endif /* _Portals_H__ */

Deleted: code/branches/portals/src/modules/portals/PortalPrecompiledHeaders.h
===================================================================
--- code/branches/portals/src/modules/portals/PortalPrecompiledHeaders.h	2011-04-07 10:13:19 UTC (rev 8199)
+++ code/branches/portals/src/modules/portals/PortalPrecompiledHeaders.h	2011-04-07 10:55:24 UTC (rev 8200)
@@ -1,53 +0,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-/**
- at file
- at brief
-*/
-
-#include "OrxonoxConfig.h"
-
-///////////////////////////////////////////
-/////          Stable Headers         /////
-///////////////////////////////////////////
-
-#include <LinearMath/btTransform.h>
-
-///////////////////////////////////////////
-/////       All Rebuild Headers       /////
-///////////////////////////////////////////
-
-#include "core/BaseObject.h"
-#include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
-
-
-// Just in case some header included windows.h
-#undef min
-#undef max

Deleted: code/branches/portals/src/modules/portals/PortalPrereqs.h
===================================================================
--- code/branches/portals/src/modules/portals/PortalPrereqs.h	2011-04-07 10:13:19 UTC (rev 8199)
+++ code/branches/portals/src/modules/portals/PortalPrereqs.h	2011-04-07 10:55:24 UTC (rev 8200)
@@ -1,73 +0,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Damian 'Mozork' Frick
- *   Co-authors:
- *      ...
- *
- */
-
-/**
- at file
- at brief
-    Shared library macros, enums, constants and forward declarations for the questsystem module
-*/
-
-#ifndef _PortalsPrereqs_H__
-#define _PortalsPrereqs_H__
-
-#include "OrxonoxConfig.h"
-#include "OrxonoxPrereqs.h"
-
-//-----------------------------------------------------------------------
-// Shared library settings
-//-----------------------------------------------------------------------
-
-#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(Portals_STATIC_BUILD)
-#  ifdef Portals_SHARED_BUILD
-#    define _PortalsExport __declspec(dllexport)
-#  else
-#    if defined( __MINGW32__ )
-#      define _PortalsExport
-#    else
-#      define _PortalsExport __declspec(dllimport)
-#    endif
-#  endif
-#elif defined ( ORXONOX_GCC_VISIBILITY )
-#  define _PortalsExport  __attribute__ ((visibility("default")))
-#else
-#  define _PortalsExport
-#endif
-
-//-----------------------------------------------------------------------
-// Forward declarations
-//-----------------------------------------------------------------------
-
-namespace orxonox
-{
-
-    class PortalEndPoint;
-    class PortalLink;
-
-}
-
-#endif /* _PortalsPrereqs_H__ */

Copied: code/branches/portals/src/modules/portals/PortalsPrecompiledHeaders.h (from rev 8199, code/branches/portals/src/modules/portals/PortalPrecompiledHeaders.h)
===================================================================
--- code/branches/portals/src/modules/portals/PortalsPrecompiledHeaders.h	                        (rev 0)
+++ code/branches/portals/src/modules/portals/PortalsPrecompiledHeaders.h	2011-04-07 10:55:24 UTC (rev 8200)
@@ -0,0 +1,53 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+ at file
+ at brief
+*/
+
+#include "OrxonoxConfig.h"
+
+///////////////////////////////////////////
+/////          Stable Headers         /////
+///////////////////////////////////////////
+
+#include <LinearMath/btTransform.h>
+
+///////////////////////////////////////////
+/////       All Rebuild Headers       /////
+///////////////////////////////////////////
+
+#include "core/BaseObject.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+
+// Just in case some header included windows.h
+#undef min
+#undef max

Copied: code/branches/portals/src/modules/portals/PortalsPrereqs.h (from rev 8199, code/branches/portals/src/modules/portals/PortalPrereqs.h)
===================================================================
--- code/branches/portals/src/modules/portals/PortalsPrereqs.h	                        (rev 0)
+++ code/branches/portals/src/modules/portals/PortalsPrereqs.h	2011-04-07 10:55:24 UTC (rev 8200)
@@ -0,0 +1,73 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+ at file
+ at brief
+    Shared library macros, enums, constants and forward declarations for the questsystem module
+*/
+
+#ifndef _PortalsPrereqs_H__
+#define _PortalsPrereqs_H__
+
+#include "OrxonoxConfig.h"
+#include "OrxonoxPrereqs.h"
+
+//-----------------------------------------------------------------------
+// Shared library settings
+//-----------------------------------------------------------------------
+
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(Portals_STATIC_BUILD)
+#  ifdef Portals_SHARED_BUILD
+#    define _PortalsExport __declspec(dllexport)
+#  else
+#    if defined( __MINGW32__ )
+#      define _PortalsExport
+#    else
+#      define _PortalsExport __declspec(dllimport)
+#    endif
+#  endif
+#elif defined ( ORXONOX_GCC_VISIBILITY )
+#  define _PortalsExport  __attribute__ ((visibility("default")))
+#else
+#  define _PortalsExport
+#endif
+
+//-----------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------
+
+namespace orxonox
+{
+
+    class PortalEndPoint;
+    class PortalLink;
+
+}
+
+#endif /* _PortalsPrereqs_H__ */




More information about the Orxonox-commit mailing list