From 64ac22f50c8c9779ecd073cdf9f34c0f6bd0dc7e Mon Sep 17 00:00:00 2001 From: Thomas Geymayer Date: Sun, 27 Jul 2014 12:11:09 +0200 Subject: [PATCH] Canvas: warn for missing tff and png plugins. --- simgear/canvas/elements/CanvasImage.cxx | 4 ++++ simgear/canvas/elements/CanvasText.cxx | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/simgear/canvas/elements/CanvasImage.cxx b/simgear/canvas/elements/CanvasImage.cxx index 20d19908..c7ca43d0 100644 --- a/simgear/canvas/elements/CanvasImage.cxx +++ b/simgear/canvas/elements/CanvasImage.cxx @@ -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"); } //---------------------------------------------------------------------------- diff --git a/simgear/canvas/elements/CanvasText.cxx b/simgear/canvas/elements/CanvasText.cxx index 6ef37819..ebe76d41 100644 --- a/simgear/canvas/elements/CanvasText.cxx +++ b/simgear/canvas/elements/CanvasText.cxx @@ -21,6 +21,7 @@ #include #include #include +#include #include 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"); } //---------------------------------------------------------------------------- -- 2.39.5