diff --git a/src/osgWrappers/deprecated-dotosg/osgText/IO_Text.cpp b/src/osgWrappers/deprecated-dotosg/osgText/IO_Text.cpp index 3665159d2..0d8b04c54 100644 --- a/src/osgWrappers/deprecated-dotosg/osgText/IO_Text.cpp +++ b/src/osgWrappers/deprecated-dotosg/osgText/IO_Text.cpp @@ -103,18 +103,6 @@ bool Text_readLocalData(osg::Object &obj, osgDB::Input &fr) bool itAdvanced = false; - // color - if (fr[0].matchWord("color")) - { - osg::Vec4 c; - if (fr[1].getFloat(c.x()) && fr[2].getFloat(c.y()) && fr[3].getFloat(c.z()) && fr[4].getFloat(c.w())) - { - text.setColor(c); - fr += 4; - itAdvanced = true; - } - } - // backdropType if (fr[0].matchWord("backdropType")) { @@ -253,10 +241,6 @@ bool Text_writeLocalData(const osg::Object &obj, osgDB::Output &fw) { const osgText::Text &text = static_cast(obj); - // color - osg::Vec4 c = text.getColor(); - fw.indent() << "color " << c.x() << " " << c.y() << " " << c.z() << " " << c.w() << std::endl; - // backdropType fw.indent() << "backdropType " << convertBackdropTypeEnumToString(text.getBackdropType()) << std::endl; @@ -267,7 +251,7 @@ bool Text_writeLocalData(const osg::Object &obj, osgDB::Output &fw) fw.indent() << "backdropVerticalOffset " << text.getBackdropVerticalOffset() << std::endl; // backdropColor - c = text.getBackdropColor(); + osg::Vec4 c = text.getBackdropColor(); fw.indent() << "backdropColor " << c.x() << " " << c.y() << " " << c.z() << " " << c.w() << std::endl; // backdropImplementation diff --git a/src/osgWrappers/deprecated-dotosg/osgText/IO_TextBase.cpp b/src/osgWrappers/deprecated-dotosg/osgText/IO_TextBase.cpp index 4d912ecde..0df8fd426 100644 --- a/src/osgWrappers/deprecated-dotosg/osgText/IO_TextBase.cpp +++ b/src/osgWrappers/deprecated-dotosg/osgText/IO_TextBase.cpp @@ -30,6 +30,18 @@ bool TextBase_readLocalData(osg::Object &obj, osgDB::Input &fr) osgText::Text &text = static_cast(obj); bool itAdvanced = false; + // color + if (fr[0].matchWord("color")) + { + osg::Vec4 c; + if (fr[1].getFloat(c.x()) && fr[2].getFloat(c.y()) && fr[3].getFloat(c.z()) && fr[4].getFloat(c.w())) + { + text.setColor(c); + fr += 4; + itAdvanced = true; + } + } + if (fr.matchSequence("font %w")) { text.setFont(fr[1].getStr()); @@ -288,6 +300,10 @@ bool TextBase_writeLocalData(const osg::Object &obj, osgDB::Output &fw) { const osgText::Text &text = static_cast(obj); + // color + osg::Vec4 c = text.getColor(); + fw.indent() << "color " << c.x() << " " << c.y() << " " << c.z() << " " << c.w() << std::endl; + if (text.getFont()) { fw.indent() << "font " << text.getFont()->getFileName() << std::endl; diff --git a/src/osgWrappers/serializers/osgText/Text3D.cpp b/src/osgWrappers/serializers/osgText/Text3D.cpp index 3b078d463..ac70b30fd 100644 --- a/src/osgWrappers/serializers/osgText/Text3D.cpp +++ b/src/osgWrappers/serializers/osgText/Text3D.cpp @@ -14,4 +14,9 @@ REGISTER_OBJECT_WRAPPER( osgText_Text3D, ADD_ENUM_VALUE( PER_FACE ); ADD_ENUM_VALUE( PER_GLYPH ); END_ENUM_SERIALIZER(); // _renderMode + + UPDATE_TO_VERSION( 68 ) + { + ADD_VEC4_SERIALIZER( Color, osg::Vec4(1.0,1.0,1.0,1.0) ); // _color + } }