]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/HUD/HUD_instrument.cxx
httpd: better handling of first-time notifications
[flightgear.git] / src / Instrumentation / HUD / HUD_instrument.cxx
index a6769c60945f0b97408c8964a9f6ff91a9206912..69fb3309cbf817b97ddd8b8e5d6a3a33f65fe994 100644 (file)
 #endif
 
 #include <simgear/math/SGLimits.hxx>
+#include <simgear/props/condition.hxx>
+
 #include "HUD.hxx"
+#include "HUD_private.hxx"
+
+#include <Main/globals.hxx>
 
+using std::vector;
 
 HUD::Item::Item(HUD *hud, const SGPropertyNode *n, float x, float y) :
     _hud(hud),
@@ -118,6 +124,20 @@ void HUD::Item::draw_circle(float xoffs, float yoffs, float r) const
     glEnd();
 }
 
+void HUD::Item::draw_arc(float xoffs, float yoffs, float t0, float t1, float r) const
+{
+    glBegin(GL_LINE_STRIP);
+    float step = SG_PI / r;
+    t0 = t0 * SG_DEGREES_TO_RADIANS;
+    t1 = t1 * SG_DEGREES_TO_RADIANS;
+
+    for (float alpha = t0; alpha < t1; alpha += step) {
+        float x = r * cos(alpha);
+        float y = r * sin(alpha);
+        glVertex2f(x + xoffs, y + yoffs);
+    }
+    glEnd();
+}
 
 void HUD::Item::draw_bullet(float x, float y, float size)
 {