]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/HUD/HUD_tbi.cxx
NavDisplay enhancements for Syd.
[flightgear.git] / src / Instrumentation / HUD / HUD_tbi.cxx
index dc8384e48e0cc5661a268a4fa03812740d7cfb76..7ec4c2639163cfca18b65735c1f8b58dd3cdddc0 100644 (file)
@@ -129,18 +129,19 @@ void HUD::TurnBankIndicator::draw_scale()
 
     int dir = bank > 0 ? 1 : -1;
 
-    if (fabsf(bank) > 25) {
+    if (fabs(bank) > 25) {
         draw_tick(45, r, minor, dir);
         draw_tick(60, r, major, dir);
     }
 
-    if (fabsf(bank) > 55) {
+    if (fabs(bank) > 55) {
         draw_tick(90, r, major, dir);
         draw_tick(135, r, major, dir);
     }
 
     // bank marker
-    float a, rr = r + r * 2.0 / 70.0;
+    float a;
+    float rr = r + r * 0.5 / 70.0;  // little gap for the arrow peak
 
     a = (bank + 270.0) * SGD_DEGREES_TO_RADIANS;
     float x1 = cx + rr * cos(a);
@@ -161,7 +162,7 @@ void HUD::TurnBankIndicator::draw_scale()
 
 
     // sideslip marker
-    rr = r + r * 2.0 / 70.0;
+    rr = r + r * 0.5 / 70.0;
     a = (bank + sideslip + 270.0) * SGD_DEGREES_TO_RADIANS;
     x1 = cx + rr * cos(a);
     y1 = cy + rr * sin(a);
@@ -207,3 +208,13 @@ void HUD::TurnBankIndicator::draw_tick(float angle, float r1, float r2, int side
 }
 
 
+void HUD::TurnBankIndicator::draw_line(float x1, float y1, float x2, float y2)
+{
+    if (option_top()) {
+        float y = 2.0 * _center_y;  // mirror vertically
+        Item::draw_line(x1, y - y1, x2, y - y2);
+    } else
+        Item::draw_line(x1, y1, x2, y2);
+}
+
+