diff --git a/include/osgIntrospection/ReflectionMacros b/include/osgIntrospection/ReflectionMacros index 567eae363..96d79d20c 100644 --- a/include/osgIntrospection/ReflectionMacros +++ b/include/osgIntrospection/ReflectionMacros @@ -226,8 +226,8 @@ struct BaseTypeConverters #define I_PublicMemberProperty(t, n) \ cap=addProperty(new osgIntrospection::PropertyInfo(osgIntrospection::Reflection::getType(typeid(reflected_type)), osgIntrospection::Reflection::getType(typeid(t)), #n, 0, 0)); \ - cap->addAttribute(new osgIntrospection::CustomPropertyGetAttribute(new osgIntrospection::PublicMemberAccessor(&reflected_type::n))); \ - cap->addAttribute(new osgIntrospection::CustomPropertySetAttribute(new osgIntrospection::PublicMemberAccessor(&reflected_type::n))); + cap->addAttribute(new osgIntrospection::CustomPropertyGetAttribute(new osgIntrospection::PublicMemberAccessor< reflected_type, t >(&reflected_type::n))); \ + cap->addAttribute(new osgIntrospection::CustomPropertySetAttribute(new osgIntrospection::PublicMemberAccessor< reflected_type, t >(&reflected_type::n))); // -------------------------------------------------------------------------- diff --git a/src/osgPlugins/dae/README.txt b/src/osgPlugins/dae/README.txt index 405f46e69..71aa5f0e5 100644 --- a/src/osgPlugins/dae/README.txt +++ b/src/osgPlugins/dae/README.txt @@ -44,7 +44,7 @@ set the env vars: COLLADA_DEBUG_LIBS = yes - Note, Collda svn trunk currently defaults to debug build. + Note, Collada svn trunk currently defaults to debug build. The above env vars can also be setup in your own custom Make/depdendencies file (copy this and point to the locally modified copy using the env var OSG_DEPENDCIES so the the OSG's build system can find diff --git a/src/osgPlugins/dae/daeWGeometry.cpp b/src/osgPlugins/dae/daeWGeometry.cpp index 90e6718bc..d4511b35f 100644 --- a/src/osgPlugins/dae/daeWGeometry.cpp +++ b/src/osgPlugins/dae/daeWGeometry.cpp @@ -20,6 +20,8 @@ #include #include +#include + using namespace osgdae; //GEODE @@ -324,13 +326,10 @@ bool daeWriter::processGeometry( osg::Geometry *geom, domGeometry *geo, const st //TODO: Do the same as normal and colors for texcoods. But in a loop since you can have many for ( unsigned int ti = 0; ti < texcoords.size(); ti++ ) { - char intstr[6]; -#if 0 - itoa( ti, intstr, 10 ); -#else - snprintf(intstr,6,"%d",ti); -#endif - sName = name + "-texcoord_" + intstr; + std::ostringstream intstr; + intstr << std::dec << ti; + sName = name + "-texcoord_" + intstr.str(); + domSource *t = createSource( mesh, sName, texcoords[ti].mode, false, true ); switch( texcoords[ti].mode ) { diff --git a/src/osgPlugins/dae/daeWMaterials.cpp b/src/osgPlugins/dae/daeWMaterials.cpp index 3be10faed..9c84c7e31 100644 --- a/src/osgPlugins/dae/daeWMaterials.cpp +++ b/src/osgPlugins/dae/daeWMaterials.cpp @@ -18,6 +18,8 @@ #include #include +#include + //#include //#include @@ -305,21 +307,10 @@ void daeWriter::processMaterial( osg::StateSet *ss, domInstance_geometry *ig, co domTechnique *teq = daeSafeCast< domTechnique >( extra->createAndPlace( COLLADA_ELEMENT_TECHNIQUE ) ); teq->setProfile( "SCEI" ); domAny *any = (domAny*)(daeElement*)teq->createAndPlace( "color" ); - char colVal[256]; - colVal[0] = 0; - for ( unsigned int i = 0; i < 4; i++ ) - { - char val[16]; -#if 0 - itoa( dCol[i], val, 10 ); -#else - snprintf(val,16,"%d",int(dCol[i])); -#endif - //strncat( colVal, val,256 ); - strncat( colVal, " ",256 ); - } - any->setValue( colVal ); - + + std::ostringstream colVal; + colVal << std::dec << " " << int(dCol[0]) << " " << int(dCol[1]) << " " << int(dCol[2]) << " " << int(dCol[3]); + any->setValue( colVal.str().c_str() ); } cot = daeSafeCast< domCommon_color_or_texture_type >( phong->createAndPlace( "specular" ) ); diff --git a/src/osgPlugins/dae/daeWriter.cpp b/src/osgPlugins/dae/daeWriter.cpp index d22d582bb..c5519de91 100644 --- a/src/osgPlugins/dae/daeWriter.cpp +++ b/src/osgPlugins/dae/daeWriter.cpp @@ -18,6 +18,8 @@ #include #include +#include + using namespace osgdae; daeWriter::daeWriter( const std::string &fname,bool _usePolygons ) : osg::NodeVisitor( TRAVERSE_ALL_CHILDREN ), @@ -121,13 +123,9 @@ std::string daeWriter::uniquify( const std::string &name ) if ( iter != uniqueNames.end() ) { iter->second++; - char str[5]; -#if 0 - itoa( iter->second, str, 10 ); -#else - snprintf(str,5,"%d",iter->second); -#endif - return name + "_" + str; + std::ostringstream num; + num << std::dec << iter->second; + return name + "_" + num.str(); } else {