[Orxonox-commit 6418] r11075 - in code/branches/shaders_merge/src/orxonox: . graphics
landauf at orxonox.net
landauf at orxonox.net
Mon Jan 18 22:35:11 CET 2016
Author: landauf
Date: 2016-01-18 22:35:11 +0100 (Mon, 18 Jan 2016)
New Revision: 11075
Modified:
code/branches/shaders_merge/src/orxonox/RenderQueueListener.cc
code/branches/shaders_merge/src/orxonox/RenderQueueListener.h
code/branches/shaders_merge/src/orxonox/graphics/Billboard.cc
code/branches/shaders_merge/src/orxonox/graphics/LensFlare.cc
code/branches/shaders_merge/src/orxonox/graphics/LensFlare.h
Log:
fixed author and added some c++11 features
Modified: code/branches/shaders_merge/src/orxonox/RenderQueueListener.cc
===================================================================
--- code/branches/shaders_merge/src/orxonox/RenderQueueListener.cc 2016-01-18 21:15:35 UTC (rev 11074)
+++ code/branches/shaders_merge/src/orxonox/RenderQueueListener.cc 2016-01-18 21:35:11 UTC (rev 11075)
@@ -20,8 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
- * Reto Grieder (physics)
+ * David 'davidsa' Salvisberg
* Co-authors:
* ...
*
@@ -40,7 +39,7 @@
namespace orxonox
{
- RenderQueueListener::RenderQueueListener() : pixelCount_(0), pixelState_(RenderQueueListener::READY_FOR_RENDER)
+ RenderQueueListener::RenderQueueListener() : pixelCount_(0), pixelState_(PixelState::READY_FOR_RENDER)
{
hardwareOcclusionQuery_ = Ogre::Root::getSingleton().getRenderSystem()->createHardwareOcclusionQuery(); //create a new HOQ for the scene this listener is used in
}
@@ -59,10 +58,10 @@
*/
unsigned int RenderQueueListener::getPixelCount()
{
- if(this->pixelState_==RenderQueueListener::READY_FOR_ACCESS)
+ if(this->pixelState_==PixelState::READY_FOR_ACCESS)
{
this->hardwareOcclusionQuery_->pullOcclusionQuery(&(this->pixelCount_));
- this->pixelState_=RenderQueueListener::READY_FOR_RENDER;
+ this->pixelState_=PixelState::READY_FOR_RENDER;
}
return this->pixelCount_;
}
@@ -93,10 +92,10 @@
STENCIL_VALUE_FOR_GLOW, STENCIL_FULL_MASK,
Ogre::SOP_KEEP,Ogre::SOP_KEEP,Ogre::SOP_REPLACE,false);
}
- if (queueGroupId == RENDER_QUEUE_HOQ && this->pixelState_==RenderQueueListener::READY_FOR_RENDER)
+ if (queueGroupId == RENDER_QUEUE_HOQ && this->pixelState_==PixelState::READY_FOR_RENDER)
{
this->hardwareOcclusionQuery_->beginOcclusionQuery();
- this->pixelState_=RenderQueueListener::QUERY_STARTED;
+ this->pixelState_=PixelState::QUERY_STARTED;
//TODO: Skip this rendering step altogheter if we haven't requested the pixel count yet, not sure if this is possible without a custom SceneManager
}
}
@@ -115,10 +114,10 @@
renderSystem->setStencilCheckEnabled(false);
renderSystem->setStencilBufferParams();
}
- if (queueGroupId == RENDER_QUEUE_HOQ && this->pixelState_==RenderQueueListener::QUERY_STARTED)
+ if (queueGroupId == RENDER_QUEUE_HOQ && this->pixelState_==PixelState::QUERY_STARTED)
{
this->hardwareOcclusionQuery_->endOcclusionQuery();
- this->pixelState_=RenderQueueListener::READY_FOR_ACCESS;
+ this->pixelState_=PixelState::READY_FOR_ACCESS;
}
}
}
\ No newline at end of file
Modified: code/branches/shaders_merge/src/orxonox/RenderQueueListener.h
===================================================================
--- code/branches/shaders_merge/src/orxonox/RenderQueueListener.h 2016-01-18 21:15:35 UTC (rev 11074)
+++ code/branches/shaders_merge/src/orxonox/RenderQueueListener.h 2016-01-18 21:35:11 UTC (rev 11075)
@@ -20,8 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
- * Reto Grieder (physics)
+ * David 'davidsa' Salvisberg
* Co-authors:
* ...
*
@@ -51,9 +50,9 @@
RENDER_QUEUE_HOQ = RENDER_QUEUE_STENCIL_LAST+1 //this is where we render the objects for occlusion queries (use transparent material)
};
- const int STENCIL_VALUE_FOR_GLOW = 1; //!< this is a reference value for our mask,
+ constexpr int STENCIL_VALUE_FOR_GLOW = 1; //!< this is a reference value for our mask,
//!< if more than one type of stencil mask is to be used, each of them need their own value
- const int STENCIL_FULL_MASK = 0xFFFFFFFF; //!< this is a reference mask used in our stencil buffer
+ constexpr int STENCIL_FULL_MASK = 0xFFFFFFFF; //!< this is a reference mask used in our stencil buffer
/**
@brief
@@ -84,20 +83,20 @@
In this case we use it to set the stencil buffer parameters of the render system
*/
- virtual void renderQueueStarted(Ogre::uint8 queueGroupId, const Ogre::String& invocation, bool& skipThisInvocation);
+ virtual void renderQueueStarted(Ogre::uint8 queueGroupId, const Ogre::String& invocation, bool& skipThisInvocation) override;
/**
@brief
This function is called just after a RenderQueueGroup has been rendered, this function is called by Ogre automatically with the correct parameters.
in this case we use it to unset the stencil buffer parameters, so the rest of the render queue is unaffected by it.
*/
- virtual void renderQueueEnded(Ogre::uint8 queueGroupId, const Ogre::String& invocation, bool& repeatThisInvocation);
+ virtual void renderQueueEnded(Ogre::uint8 queueGroupId, const Ogre::String& invocation, bool& repeatThisInvocation) override;
private:
Ogre::HardwareOcclusionQuery* hardwareOcclusionQuery_; //!< this stores the current instance of the HOQ used in the render system
unsigned int pixelCount_; //!< this stores the last pixel count returned by the last HOQ in the corresponding render group
- enum PixelState //!< enum to distinguish the several HOQ pixel count states
+ enum class PixelState //!< enum to distinguish the several HOQ pixel count states
{
READY_FOR_RENDER,
QUERY_STARTED,
Modified: code/branches/shaders_merge/src/orxonox/graphics/Billboard.cc
===================================================================
--- code/branches/shaders_merge/src/orxonox/graphics/Billboard.cc 2016-01-18 21:15:35 UTC (rev 11074)
+++ code/branches/shaders_merge/src/orxonox/graphics/Billboard.cc 2016-01-18 21:35:11 UTC (rev 11075)
@@ -174,7 +174,7 @@
void Billboard::setRenderQueueGroup(unsigned char groupID)
{
Ogre::BillboardSet* bSet = this->billboard_.getBillboardSet();
- if( bSet != NULL )
+ if( bSet != nullptr )
{
bSet->setRenderQueueGroup(groupID);
}
@@ -183,7 +183,7 @@
void Billboard::disableFrustumCulling()
{
Ogre::BillboardSet* bSet = this->billboard_.getBillboardSet();
- if( bSet != NULL )
+ if( bSet != nullptr )
{
bSet->setBounds(Ogre::AxisAlignedBox(Ogre::AxisAlignedBox::EXTENT_INFINITE),0);
}
Modified: code/branches/shaders_merge/src/orxonox/graphics/LensFlare.cc
===================================================================
--- code/branches/shaders_merge/src/orxonox/graphics/LensFlare.cc 2016-01-18 21:15:35 UTC (rev 11074)
+++ code/branches/shaders_merge/src/orxonox/graphics/LensFlare.cc 2016-01-18 21:35:11 UTC (rev 11075)
@@ -20,8 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
- * Reto Grieder (physics)
+ * David 'davidsa' Salvisberg
* Co-authors:
* ...
*
Modified: code/branches/shaders_merge/src/orxonox/graphics/LensFlare.h
===================================================================
--- code/branches/shaders_merge/src/orxonox/graphics/LensFlare.h 2016-01-18 21:15:35 UTC (rev 11074)
+++ code/branches/shaders_merge/src/orxonox/graphics/LensFlare.h 2016-01-18 21:35:11 UTC (rev 11075)
@@ -20,8 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Author:
- * Fabian 'x3n' Landau
- * Reto Grieder (physics)
+ * David 'davidsa' Salvisberg
* Co-authors:
* ...
*
@@ -163,11 +162,11 @@
inline bool isFadeOnViewBorder() const
{ return this->fadeOnViewBorder_; }
- virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
- virtual void tick(float dt);
+ virtual void tick(float dt) override;
- virtual void changedVisibility();
+ virtual void changedVisibility() override;
private:
void registerVariables();
More information about the Orxonox-commit
mailing list