]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/model/SGText.cxx
Make return type from loadPagedModel explicit.
[simgear.git] / simgear / scene / model / SGText.cxx
index 4649c153319cea8a8c1e6bd9b171fb721a7df918..1da6c57cc2e8ac3aa1450fe5d8965511ce138d9d 100644 (file)
 #  include <simgear_config.h>
 #endif
 
 #  include <simgear_config.h>
 #endif
 
+#include <cstdio>
+
 #include "SGText.hxx"
 
 #include <simgear/math/SGMath.hxx>
 #include <simgear/misc/sg_path.hxx>
 #include "SGText.hxx"
 
 #include <simgear/math/SGMath.hxx>
 #include <simgear/misc/sg_path.hxx>
+#include <simgear/misc/strutils.hxx>
 
 #include <osg/Geode>
 #include <osg/MatrixTransform>
 #include <osgText/Text>
 #include <osgText/Font>
 
 
 #include <osg/Geode>
 #include <osg/MatrixTransform>
 #include <osgText/Text>
 #include <osgText/Font>
 
+using std::string;
+
 class SGText::UpdateCallback : public osg::NodeCallback {
 public:
 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 ),
     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";
     }
       if( numeric ) format = "%f";
       else format = "%s";
     }
@@ -82,12 +87,10 @@ void SGText::UpdateCallback::operator()(osg::Node * node, osg::NodeVisitor *nv )
 }
 
 osg::Node * SGText::appendText(const SGPropertyNode* configNode, 
 }
 
 osg::Node * SGText::appendText(const SGPropertyNode* configNode, 
-  SGPropertyNode* modelRoot, const osgDB::ReaderWriter::Options* options)
+  SGPropertyNode* modelRoot, const osgDB::Options* options)
 {
   SGConstPropertyNode_ptr p;
 
 {
   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 );
   osgText::Text * text = new osgText::Text();
   osg::Geode * g = new osg::Geode;
   g->addDrawable( text );