mirror of
https://github.com/minetest/irrlicht.git
synced 2024-11-10 09:43:52 +01:00
Change how SMaterial handles equality for UserData for more flexibility
Different UserData values are no longer by default causing materials to be different. It now always checks in this case the IUserData != operator. This allows more user control. Can still have them be different by checking pointers in overloaded compare function. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6569 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
parent
feaed624f7
commit
3fa020d03c
@ -496,7 +496,7 @@ namespace video
|
||||
bool UseMipMaps:1;
|
||||
|
||||
//! Allow users to add their own material data
|
||||
//! User is resonsible for the memory of this pointer
|
||||
//! User is responsible for the memory of this pointer
|
||||
//! You should override IUserData::compare for user custom data, so SMaterial knows when it changes
|
||||
io::IUserData* UserData;
|
||||
|
||||
@ -721,7 +721,8 @@ namespace video
|
||||
PolygonOffsetFactor != b.PolygonOffsetFactor ||
|
||||
PolygonOffsetDirection != b.PolygonOffsetDirection ||
|
||||
UseMipMaps != b.UseMipMaps ||
|
||||
UserData != b.UserData || (UserData && b.UserData && *UserData != *b.UserData)
|
||||
(UserData && !b.UserData) || (!UserData && b.UserData) || // can still equal with different pointers
|
||||
(UserData && b.UserData && *UserData != *b.UserData)
|
||||
;
|
||||
for (u32 i=0; (i<MATERIAL_MAX_TEXTURES_USED) && !different; ++i)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user