X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fscene%2Fmodel%2FSGText.cxx;h=1da6c57cc2e8ac3aa1450fe5d8965511ce138d9d;hb=32a6bd78d8bf143f40922f1a0bc7a88ea7706a7d;hp=92b0d99461f45d5ccab17caf76279142ba265c04;hpb=c4b4c0ce59602a0b749e22b29d6ce5db6f654eae;p=simgear.git diff --git a/simgear/scene/model/SGText.cxx b/simgear/scene/model/SGText.cxx index 92b0d994..1da6c57c 100644 --- a/simgear/scene/model/SGText.cxx +++ b/simgear/scene/model/SGText.cxx @@ -20,10 +20,13 @@ # include #endif +#include + #include "SGText.hxx" #include #include +#include #include #include @@ -34,16 +37,16 @@ using std::string; class SGText::UpdateCallback : public osg::NodeCallback { public: - UpdateCallback( osgText::Text * aText, SGConstPropertyNode_ptr aProperty, double aScale, double aOffset, double aTruncate, double aNumeric, const char * aFormat ) : + UpdateCallback( osgText::Text * aText, SGConstPropertyNode_ptr aProperty, double aScale, double aOffset, bool aTruncate, bool aNumeric, const char * aFormat ) : text( aText ), property( aProperty ), scale( aScale ), offset( aOffset ), truncate( aTruncate ), numeric( aNumeric ), - format( aFormat ) + format( simgear::strutils::sanitizePrintfFormat( aFormat ) ) { - if( format.size() == 0 ) { + if( format.empty() ) { if( numeric ) format = "%f"; else format = "%s"; } @@ -84,12 +87,10 @@ void SGText::UpdateCallback::operator()(osg::Node * node, osg::NodeVisitor *nv ) } osg::Node * SGText::appendText(const SGPropertyNode* configNode, - SGPropertyNode* modelRoot, const osgDB::ReaderWriter::Options* options) + SGPropertyNode* modelRoot, const osgDB::Options* options) { SGConstPropertyNode_ptr p; - SG_LOG(SG_GENERAL, SG_DEBUG, "Creating a text object"); - osgText::Text * text = new osgText::Text(); osg::Geode * g = new osg::Geode; g->addDrawable( text );