mirror of
https://github.com/minetest/irrlicht.git
synced 2025-01-29 03:00:19 +01:00
More fixes for CCubeSceneNode with multi-material cube
CCubeSceneNode::getMaterialCount now returning correct count CCubeSceneNode::clone now cloning all materials git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6474 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
parent
8b0534d4b7
commit
80788a4198
@ -202,7 +202,9 @@ video::SMaterial& CCubeSceneNode::getMaterial(u32 i)
|
|||||||
//! returns amount of materials used by this scene node.
|
//! returns amount of materials used by this scene node.
|
||||||
u32 CCubeSceneNode::getMaterialCount() const
|
u32 CCubeSceneNode::getMaterialCount() const
|
||||||
{
|
{
|
||||||
return 1;
|
if ( Mesh )
|
||||||
|
return Mesh->getMeshBufferCount();
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -245,7 +247,8 @@ ISceneNode* CCubeSceneNode::clone(ISceneNode* newParent, ISceneManager* newManag
|
|||||||
newManager, ID, RelativeTranslation, RelativeRotation, RelativeScale, MeshType);
|
newManager, ID, RelativeTranslation, RelativeRotation, RelativeScale, MeshType);
|
||||||
|
|
||||||
nb->cloneMembers(this, newManager);
|
nb->cloneMembers(this, newManager);
|
||||||
nb->getMaterial(0) = getMaterial(0);
|
for ( irr::u32 i=0; i < getMaterialCount(); ++i )
|
||||||
|
nb->getMaterial(i) = getMaterial(i);
|
||||||
nb->Shadow = Shadow;
|
nb->Shadow = Shadow;
|
||||||
if ( nb->Shadow )
|
if ( nb->Shadow )
|
||||||
nb->Shadow->grab();
|
nb->Shadow->grab();
|
||||||
|
Loading…
Reference in New Issue
Block a user