]> git.mxchange.org Git - flightgear.git/commitdiff
MapWidget: make partially use of the new colocated DME information.
authorChristian Schmitt <chris@ilovelinux.de>
Sun, 10 Mar 2013 17:18:45 +0000 (18:18 +0100)
committerChristian Schmitt <chris@ilovelinux.de>
Fri, 15 Mar 2013 13:07:32 +0000 (14:07 +0100)
Until a better way to draw proper symbols is implemented, this has to do.

src/GUI/MapWidget.cxx
src/GUI/MapWidget.hxx

index 80158939f935909140197f5cb8631d5471bf2ae4..b063bc79f8d8b0a6cf17e5800f430aa0dc12b782 100644 (file)
@@ -1061,7 +1061,11 @@ void MapWidget::drawVOR(bool tuned, FGNavRecord* vor)
     glColor3f(0.0, 0.0, 1.0);
   }
 
-  circleAt(pos, 6, 8);
+  circleAt(pos, 6, 9);
+  circleAt(pos, 8, 1);
+
+  if (vor->hasDME())
+  squareAt(pos, 9);
 
   if (validDataForKey(vor)) {
     setAnchorForKey(vor, pos);
@@ -1683,15 +1687,25 @@ void MapWidget::circleAt(const SGVec2d& center, int nSides, double r)
 {
   glBegin(GL_LINE_LOOP);
   double advance = (SGD_PI * 2) / nSides;
-  glVertex2d(center.x(), center.y() + r);
+  glVertex2d(center.x() +r, center.y());
   double t=advance;
   for (int i=1; i<nSides; ++i) {
-    glVertex2d(center.x() + (sin(t) * r), center.y() + (cos(t) * r));
+    glVertex2d(center.x() + (cos(t) * r), center.y() + (sin(t) * r));
     t += advance;
   }
   glEnd();
 }
 
+void MapWidget::squareAt(const SGVec2d& center, double r)
+{
+  glBegin(GL_LINE_LOOP);
+  glVertex2d(center.x() + r, center.y() + r);
+  glVertex2d(center.x() + r, center.y() - r);
+  glVertex2d(center.x() - r, center.y() - r);
+  glVertex2d(center.x() - r, center.y() + r);
+  glEnd();
+}
+
 void MapWidget::circleAtAlt(const SGVec2d& center, int nSides, double r, double r2)
 {
   glBegin(GL_LINE_LOOP);
index 780ff2e12ca633574617e0ccafa58e587660d27c..877ab7d53a907bbab8828ff6cb54ac19706eec28 100644 (file)
@@ -91,6 +91,7 @@ private:
   
   void circleAt(const SGVec2d& center, int nSides, double r);
   void circleAtAlt(const SGVec2d& center, int nSides, double r, double r2);
+  void squareAt(const SGVec2d& center, double r);
   void drawLine(const SGVec2d& p1, const SGVec2d& p2);
   void drawLegendBox(const SGVec2d& pos, const std::string& t);