irr: Add drawall types patch

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@13004 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
curaga 2013-06-28 12:10:42 +00:00
parent 56177bdc93
commit 9bfe9026ed
4 changed files with 40 additions and 4 deletions

View File

@ -2,3 +2,4 @@ The following changes have been made:
- config changes in IrrCompileConfig.h
- primary sort by material type
- stencil RTT support
- drawall types

View File

@ -1152,8 +1152,9 @@ namespace scene
/** This can only be invoked between
IVideoDriver::beginScene() and IVideoDriver::endScene(). Please note that
the scene is not only drawn when calling this, but also animated
by existing scene node animators, culling of scene nodes is done, etc. */
virtual void drawAll() = 0;
by existing scene node animators, culling of scene nodes is done, etc.
\param flags Allows you to disable/enable specific render passes by passing bitwise OR combinations of E_SCENE_NODE_RENDER_PASS values*/
virtual void drawAll(u32 flags = 0xFFFFFFFF) = 0;
//! Creates a rotation animator, which rotates the attached scene node around itself.
/** \param rotationSpeed Specifies the speed of the animation in degree per 10 milliseconds.

View File

@ -1343,7 +1343,7 @@ u32 CSceneManager::registerNodeForRendering(ISceneNode* node, E_SCENE_NODE_RENDE
//! This method is called just before the rendering process of the whole scene.
//! draws all scene nodes
void CSceneManager::drawAll()
void CSceneManager::drawAll(u32 flags)
{
if (!Driver)
return;
@ -1383,6 +1383,40 @@ void CSceneManager::drawAll()
// let all nodes register themselves
OnRegisterSceneNode();
//Disable unwanted render passes
if ( flags != 0xFFFFFFFF )
{
//Disable all but the specified passes
if ((flags & ESNRP_CAMERA) != ESNRP_CAMERA )
{
CameraList.clear();
}
if ((flags & ESNRP_LIGHT) != ESNRP_LIGHT )
{
LightList.clear();
}
if ((flags & ESNRP_SKY_BOX) != ESNRP_SKY_BOX )
{
SkyBoxList.clear();
}
if ((flags & ESNRP_SOLID) != ESNRP_SOLID )
{
SolidNodeList.clear();
}
if ((flags & ESNRP_TRANSPARENT) != ESNRP_TRANSPARENT )
{
TransparentNodeList.clear();
}
if ((flags & ESNRP_TRANSPARENT_EFFECT) != ESNRP_TRANSPARENT_EFFECT )
{
TransparentEffectNodeList.clear();
}
if ((flags & ESNRP_SHADOW) != ESNRP_SHADOW )
{
ShadowNodeList.clear();
}
}
if (LightManager)
LightManager->OnPreRender(LightList);

View File

@ -111,7 +111,7 @@ namespace scene
virtual u32 registerNodeForRendering(ISceneNode* node, E_SCENE_NODE_RENDER_PASS pass = ESNRP_AUTOMATIC);
//! draws all scene nodes
virtual void drawAll();
virtual void drawAll(u32 flags = 0xFFFFFFFF);
//! Adds a scene node for rendering using a octree to the scene graph. This a good method for rendering
//! scenes with lots of geometry. The Octree is built on the fly from the mesh, much