]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/heading_indicator_dg.cxx
Refactor morse and beacon as singleton
[flightgear.git] / src / Instrumentation / heading_indicator_dg.cxx
index bb9c1620e4f3e11d2f64f79633ed0a189f39b56b..0c4864912670168d9d8c3678b39e3f4bdb2f3efa 100644 (file)
@@ -115,7 +115,7 @@ HeadingIndicatorDG::update (double dt)
                                 // Next, calculate time-based precession
     double offset = _offset_node->getDoubleValue();
     offset -= dt * (0.25 / 60.0); // 360deg/day
-    SG_NORMALIZE_RANGE(offset, -360.0, 360.0);
+    offset = SGMiscd::normalizePeriodic(-360.0,360.0,offset);
     _offset_node->setDoubleValue(offset);
 
                                 // No magvar - set the alignment manually
@@ -153,7 +153,7 @@ HeadingIndicatorDG::update (double dt)
     _last_heading_deg = heading;
 
     heading += offset + align + error;
-    SG_NORMALIZE_RANGE(heading, 0.0, 360.0);
+    heading = SGMiscd::normalizePeriodic(0.0,360.0,heading);
 
     _heading_out_node->setDoubleValue(heading);