]> git.mxchange.org Git - simgear.git/commitdiff
Canvas: warn for missing tff and png plugins.
authorThomas Geymayer <tomgey@gmail.com>
Sun, 27 Jul 2014 10:11:09 +0000 (12:11 +0200)
committerThomas Geymayer <tomgey@gmail.com>
Sun, 27 Jul 2014 10:11:09 +0000 (12:11 +0200)
simgear/canvas/elements/CanvasImage.cxx
simgear/canvas/elements/CanvasText.cxx

index 20d199088289dc12e729f646c77775e0597f9d3e..c7ca43d0f4090bbc37bcc95e40f2cbda3cb4c608 100644 (file)
@@ -100,6 +100,10 @@ namespace canvas
     addStyle("preserveAspectRatio", "", &Image::setPreserveAspectRatio);
     addStyle("slice", "", &Image::setSlice);
     addStyle("slice-width", "", &Image::setSliceWidth);
+
+    osgDB::Registry* reg = osgDB::Registry::instance();
+    if( !reg->getReaderWriterForExtension("png") )
+      SG_LOG(SG_GL, SG_ALERT, "canvas::Image: Missing 'png' image reader");
   }
 
   //----------------------------------------------------------------------------
index 6ef37819d35aed8ea2cfac38eca8a4aae08840c6..ebe76d416870555743a7464bd5f6d3963319729e 100644 (file)
@@ -21,6 +21,7 @@
 #include <simgear/canvas/CanvasSystemAdapter.hxx>
 #include <simgear/scene/util/parse_color.hxx>
 #include <osg/Version>
+#include <osgDB/Registry>
 #include <osgText/Text>
 
 namespace simgear
@@ -582,6 +583,10 @@ namespace canvas
     addStyle("font", "", &Text::setFont);
     addStyle("alignment", "", &Text::setAlignment);
     addStyle("text", "", &Text::setText, false);
+
+    osgDB::Registry* reg = osgDB::Registry::instance();
+    if( !reg->getReaderWriterForExtension("ttf") )
+      SG_LOG(SG_GL, SG_ALERT, "canvas::Text: Missing 'ttf' font reader");
   }
 
   //----------------------------------------------------------------------------