mirror of
https://github.com/minetest/irrlicht.git
synced 2024-11-10 01:33:51 +01:00
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
This commit is contained in:
parent
3c9a856e6d
commit
feaed624f7
@ -29,12 +29,6 @@ namespace io
|
|||||||
return getType() == other.getType();
|
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
|
//! Used internally by Irrlicht to check if data has changed
|
||||||
bool operator!=(const IUserData& other) const
|
bool operator!=(const IUserData& other) const
|
||||||
{
|
{
|
||||||
|
@ -2164,9 +2164,6 @@ io::IAttributes* CNullDriver::createAttributesFromMaterial(const video::SMateria
|
|||||||
attr->addFloat("PolygonOffsetDepthBias", material.PolygonOffsetDepthBias);
|
attr->addFloat("PolygonOffsetDepthBias", material.PolygonOffsetDepthBias);
|
||||||
attr->addFloat("PolygonOffsetSlopeScale", material.PolygonOffsetSlopeScale);
|
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.
|
// TODO: Would be nice to have a flag that only serializes rest of texture data when a texture pointer exists.
|
||||||
prefix = "BilinearFilter";
|
prefix = "BilinearFilter";
|
||||||
for (i=0; i<MATERIAL_MAX_TEXTURES; ++i)
|
for (i=0; i<MATERIAL_MAX_TEXTURES; ++i)
|
||||||
@ -2252,9 +2249,6 @@ void CNullDriver::fillMaterialStructureFromAttributes(video::SMaterial& outMater
|
|||||||
outMaterial.PolygonOffsetDepthBias = attr->getAttributeAsFloat("PolygonOffsetDepthBias", outMaterial.PolygonOffsetDepthBias);
|
outMaterial.PolygonOffsetDepthBias = attr->getAttributeAsFloat("PolygonOffsetDepthBias", outMaterial.PolygonOffsetDepthBias);
|
||||||
outMaterial.PolygonOffsetSlopeScale = attr->getAttributeAsFloat("PolygonOffsetSlopeScale", outMaterial.PolygonOffsetSlopeScale);
|
outMaterial.PolygonOffsetSlopeScale = attr->getAttributeAsFloat("PolygonOffsetSlopeScale", outMaterial.PolygonOffsetSlopeScale);
|
||||||
|
|
||||||
if ( outMaterial.UserData )
|
|
||||||
outMaterial.UserData->deserializeAttributes(attr);
|
|
||||||
|
|
||||||
prefix = "BilinearFilter";
|
prefix = "BilinearFilter";
|
||||||
if (attr->existsAttribute(prefix.c_str())) // legacy
|
if (attr->existsAttribute(prefix.c_str())) // legacy
|
||||||
outMaterial.setFlag(EMF_BILINEAR_FILTER, attr->getAttributeAsBool(prefix.c_str()));
|
outMaterial.setFlag(EMF_BILINEAR_FILTER, attr->getAttributeAsBool(prefix.c_str()));
|
||||||
|
Loading…
Reference in New Issue
Block a user