]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/HUD/HUD.cxx
Goodbye automake.
[flightgear.git] / src / Instrumentation / HUD / HUD.cxx
index eace97cc00e4a2a6746b093c298e607a5459b8d6..2f130ae9615166c4c05e2db00a3d3fc7b5920b85 100644 (file)
@@ -31,6 +31,7 @@
 
 #include <simgear/constants.h>
 #include <simgear/misc/sg_path.hxx>
+#include <simgear/props/props_io.hxx>
 #include <osg/GLU>
 
 #include <Main/globals.hxx>
@@ -39,6 +40,8 @@
 
 #include "HUD.hxx"
 
+using std::endl;
+using std::ifstream;
 
 static float clamp(float f)
 {
@@ -346,6 +349,11 @@ int HUD::load(const char *file, float x, float y, int level, const string& inden
     const int MAXNEST = 10;
 
     SGPath path(globals->resolve_maybe_aircraft_path(file));
+    if (path.isNull())
+    {
+        SG_LOG(SG_INPUT, SG_ALERT, "HUD: Cannot find configuration file '" << file << "'.");
+        return 0x2;
+    }
 
     if (!level) {
         SG_LOG(SG_INPUT, TREE, endl << "load " << file);
@@ -362,7 +370,7 @@ int HUD::load(const char *file, float x, float y, int level, const string& inden
     int ret = 0;
     ifstream input(path.c_str());
     if (!input.good()) {
-        SG_LOG(SG_INPUT, SG_ALERT, "HUD: Cannot read configuration from " << path.str());
+        SG_LOG(SG_INPUT, SG_ALERT, "HUD: Cannot read configuration from '" << path.c_str() << "'");
         return 0x4;
     }