Hello everyone!
The title should be self explanatory, even though let me give some background:
I had a working accessor attribute for an XML resource file and now with the changed macros I’m not able to set it right.
Before I had:
Now I’ve changed it to:
But that isn’t compiling, and gcc is not being helpful at all to point out the error:
.../Urho3D/Source/Engine/Scene/Serializable.h:262:316: error: no matching function for call to ?Urho3D::AttributeAccessorImpl<MapProperties, Urho3D::ResourceRef, Urho3D::AttributeTrait<Urho3D::ResourceRef> >::AttributeAccessorImpl(Urho3D::ResourceRef (MapProperties::*)() const, void (MapProperties::*)(Urho3D::ResourceRef))?
#define ACCESSOR_ATTRIBUTE(name, getFunction, setFunction, typeName, defaultValue, mode) context->RegisterAttribute<ClassName>(Urho3D::AttributeInfo(GetVariantType<typeName >(), name, new Urho3D::AttributeAccessorImpl<ClassName, typeName, AttributeTrait<typeName > >(&ClassName::getFunction, &ClassName::setFunction), defaultValue, mode))
^
.../Source/Components/Map/Properties/MapProperties.cpp:14:5: note: in expansion of macro ?ACCESSOR_ATTRIBUTE?
ACCESSOR_ATTRIBUTE("Map data", GetXmlAttr, SetXmlAttr, ResourceRef, ResourceRef(XMLFile::GetTypeStatic()), AM_DEFAULT);
^
.../Source/Engine/Scene/Serializable.h:262:316: note: candidate is:
#define ACCESSOR_ATTRIBUTE(name, getFunction, setFunction, typeName, defaultValue, mode) context->RegisterAttribute<ClassName>(Urho3D::AttributeInfo(GetVariantType<typeName >(), name, new Urho3D::AttributeAccessorImpl<ClassName, typeName, AttributeTrait<typeName > >(&ClassName::getFunction, &ClassName::setFunction), defaultValue, mode))
There’s more of it if it’s really relevant to solve the issue… (I’m not a huge fan of g++).
Thank you very much!
EDIT:
I’ve found this line searching the sources (Light.cpp):
MIXED_ACCESSOR_ATTRIBUTE("Attenuation Texture", GetRampTextureAttr, SetR ampTextureAttr, ResourceRef, ResourceRef(Texture2D::GetTypeStatic()), AM_DEFAULT);
I don’t know what a MIXED_ACCESSOR_ATTRIBUTE is but changing it doesn’t seem to solve the question. Anyway, what’s a mixed accessor attribute?