From 242e79f5e965805879867aac72eb1df32201e54f Mon Sep 17 00:00:00 2001 From: James Turner Date: Thu, 26 Nov 2015 23:44:27 +0000 Subject: [PATCH] Fix some coastline issues. --- src/GUI/BaseDiagram.cxx | 4 ++-- src/GUI/BaseDiagram.hxx | 2 +- src/GUI/QtLauncher.cxx | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/GUI/BaseDiagram.cxx b/src/GUI/BaseDiagram.cxx index 8626a67df..4204626e5 100644 --- a/src/GUI/BaseDiagram.cxx +++ b/src/GUI/BaseDiagram.cxx @@ -113,7 +113,7 @@ void BaseDiagram::paintEvent(QPaintEvent* pe) QTransform t(transform()); p.setTransform(t); - paintCoastlines(&p); + paintPolygonData(&p); paintNavaids(&p); @@ -135,7 +135,7 @@ void BaseDiagram::paintAirplaneIcon(QPainter* painter, const SGGeod& geod, int h painter->drawPixmap(airplaneIconRect, pix); } -void BaseDiagram::paintCoastlines(QPainter* painter) +void BaseDiagram::paintPolygonData(QPainter* painter) { QTransform xf = painter->transform(); QTransform invT = xf.inverted(); diff --git a/src/GUI/BaseDiagram.hxx b/src/GUI/BaseDiagram.hxx index 153c0eda2..1ea041167 100644 --- a/src/GUI/BaseDiagram.hxx +++ b/src/GUI/BaseDiagram.hxx @@ -129,7 +129,7 @@ private: void paintNavaid(QPainter *painter, const QTransform& t, const FGPositionedRef &pos); - void paintCoastlines(QPainter *painter); + void paintPolygonData(QPainter *painter); void paintGeodVec(QPainter *painter, const flightgear::SGGeodVec &vec); void fillClosedGeodVec(QPainter *painter, const QColor &color, const flightgear::SGGeodVec &vec); }; diff --git a/src/GUI/QtLauncher.cxx b/src/GUI/QtLauncher.cxx index 583b2f2e1..121b79d0e 100644 --- a/src/GUI/QtLauncher.cxx +++ b/src/GUI/QtLauncher.cxx @@ -352,6 +352,9 @@ void loadNaturalEarthFile(const std::string& aFileName, SGPath path(globals->get_fg_root()); path.append( "Geodata" ); path.append(aFileName); + if (!path.exists()) + return; // silently fail for now + flightgear::PolyLineList lines; flightgear::SHPParser::parsePolyLines(path, aType, lines, areClosed); flightgear::PolyLineList::iterator it;