From 3fa020d03c1013db7b8ea8f58f314227b1ef2ad3 Mon Sep 17 00:00:00 2001 From: cutealien Date: Fri, 10 Nov 2023 15:52:40 +0000 Subject: [PATCH] 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 --- include/SMaterial.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/SMaterial.h b/include/SMaterial.h index 58fab42f..b3a1f024 100644 --- a/include/SMaterial.h +++ b/include/SMaterial.h @@ -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