mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-12 08:05:18 +02:00
Make Irrlicht identity material const
This commit is contained in:
@@ -310,7 +310,11 @@ public:
|
||||
\return The material at that index. */
|
||||
virtual video::SMaterial &getMaterial(u32 num)
|
||||
{
|
||||
return video::IdentityMaterial;
|
||||
// We return a default material since a reference can't be null,
|
||||
// but note that writing to this is a mistake either by a child class
|
||||
// or the caller, because getMaterialCount() is zero.
|
||||
// Doing so will helpfully cause a segfault.
|
||||
return const_cast<video::SMaterial&>(video::IdentityMaterial);
|
||||
}
|
||||
|
||||
//! Get amount of materials used by this scene node.
|
||||
|
@@ -472,7 +472,7 @@ public:
|
||||
};
|
||||
|
||||
//! global const identity Material
|
||||
IRRLICHT_API extern SMaterial IdentityMaterial;
|
||||
IRRLICHT_API extern const SMaterial IdentityMaterial;
|
||||
|
||||
} // end namespace video
|
||||
} // end namespace irr
|
||||
|
Reference in New Issue
Block a user