mirror of
https://github.com/minetest/minetest.git
synced 2025-03-06 20:48:40 +01:00
Make Irrlicht identity material const
This commit is contained in:
parent
2796283550
commit
7abaa8d4cd
3 changed files with 7 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -88,7 +88,7 @@ const matrix4 IdentityMatrix(matrix4::EM4CONST_IDENTITY);
|
|||
|
||||
namespace video
|
||||
{
|
||||
SMaterial IdentityMaterial;
|
||||
const SMaterial IdentityMaterial;
|
||||
|
||||
extern "C" IRRLICHT_API bool IRRCALLCONV isDriverSupported(E_DRIVER_TYPE driver)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue