From feaed624f7fe8e594be7fe3d9b1c298d26eda1d5 Mon Sep 17 00:00:00 2001 From: cutealien Date: Tue, 7 Nov 2023 17:43:01 +0000 Subject: [PATCH] Remove serialization again from IUserData This can't work as on deserialize it would need to have the type for IUserData already. And that's impossible with the way it's used right now. Would need some kind of factory or so probably, but I'll ignore this for now. Note that it's still possible to call some serialization manually on the derived classes by adding it there if needed. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6568 dfc29bdd-3216-0410-991c-e03cc46cb475 --- include/IUserData.h | 6 ------ source/Irrlicht/CNullDriver.cpp | 6 ------ 2 files changed, 12 deletions(-) diff --git a/include/IUserData.h b/include/IUserData.h index 05ab632f..26725730 100644 --- a/include/IUserData.h +++ b/include/IUserData.h @@ -29,12 +29,6 @@ namespace io return getType() == other.getType(); } - //! Writes data attributes - virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const {} - - //! Reads data attributes - virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) {} - //! Used internally by Irrlicht to check if data has changed bool operator!=(const IUserData& other) const { diff --git a/source/Irrlicht/CNullDriver.cpp b/source/Irrlicht/CNullDriver.cpp index c2238eee..dbb9dcfb 100644 --- a/source/Irrlicht/CNullDriver.cpp +++ b/source/Irrlicht/CNullDriver.cpp @@ -2164,9 +2164,6 @@ io::IAttributes* CNullDriver::createAttributesFromMaterial(const video::SMateria attr->addFloat("PolygonOffsetDepthBias", material.PolygonOffsetDepthBias); attr->addFloat("PolygonOffsetSlopeScale", material.PolygonOffsetSlopeScale); - if ( material.UserData ) - material.UserData->serializeAttributes(attr, options); - // TODO: Would be nice to have a flag that only serializes rest of texture data when a texture pointer exists. prefix = "BilinearFilter"; for (i=0; igetAttributeAsFloat("PolygonOffsetDepthBias", outMaterial.PolygonOffsetDepthBias); outMaterial.PolygonOffsetSlopeScale = attr->getAttributeAsFloat("PolygonOffsetSlopeScale", outMaterial.PolygonOffsetSlopeScale); - if ( outMaterial.UserData ) - outMaterial.UserData->deserializeAttributes(attr); - prefix = "BilinearFilter"; if (attr->existsAttribute(prefix.c_str())) // legacy outMaterial.setFlag(EMF_BILINEAR_FILTER, attr->getAttributeAsBool(prefix.c_str()));