mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-10-31 07:25:22 +01: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
 | ||||
|   | ||||
| @@ -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) | ||||
| { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user