From dee19d0c4ef34039f26c4d3560f91c3a570ecd0e Mon Sep 17 00:00:00 2001 From: pixhawk Date: Thu, 8 Sep 2011 12:59:19 +0200 Subject: [PATCH] Solved bugs for large angles --- src/GAudioOutput.cc | 12 ++++++------ src/GAudioOutput.h | 2 +- src/QGC.cc | 30 +++++++++++++++--------------- src/ui/HUD.cc | 8 ++++---- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/GAudioOutput.cc b/src/GAudioOutput.cc index c8ba5a25b..18b36bed1 100644 --- a/src/GAudioOutput.cc +++ b/src/GAudioOutput.cc @@ -137,12 +137,12 @@ GAudioOutput::GAudioOutput(QObject* parent) : QObject(parent), } } -GAudioOutput::~GAudioOutput() -{ -#ifdef _MSC_VER2 - ::CoUninitialize(); -#endif -} +//GAudioOutput::~GAudioOutput() +//{ +//#ifdef _MSC_VER2 +// ::CoUninitialize(); +//#endif +//} void GAudioOutput::mute(bool mute) { diff --git a/src/GAudioOutput.h b/src/GAudioOutput.h index 6154a315c..2856ea19c 100644 --- a/src/GAudioOutput.h +++ b/src/GAudioOutput.h @@ -124,7 +124,7 @@ protected: bool muted; private: GAudioOutput(QObject* parent=NULL); - ~GAudioOutput(); +// ~GAudioOutput(); }; #endif // AUDIOOUTPUT_H diff --git a/src/QGC.cc b/src/QGC.cc index 08467d7e5..17f4c226f 100644 --- a/src/QGC.cc +++ b/src/QGC.cc @@ -49,28 +49,28 @@ quint64 groundTimeMilliseconds() float limitAngleToPMPIf(float angle) { - while (angle > ((float)M_PI+FLT_EPSILON)) { - angle -= 2.0f * (float)M_PI; - } +// while (angle > ((float)M_PI+FLT_EPSILON)) { +// angle -= 2.0f * (float)M_PI; +// } - while (angle <= -((float)M_PI+FLT_EPSILON)) { - angle += 2.0f * (float)M_PI; - } +// while (angle <= -((float)M_PI+FLT_EPSILON)) { +// angle += 2.0f * (float)M_PI; +// } return angle; } double limitAngleToPMPId(double angle) { - if (angle < -M_PI) { - while (angle < -M_PI) { - angle += M_PI; - } - } else if (angle > M_PI) { - while (angle > M_PI) { - angle -= M_PI; - } - } +// if (angle < -M_PI) { +// while (angle < -M_PI) { +// angle += M_PI; +// } +// } else if (angle > M_PI) { +// while (angle > M_PI) { +// angle -= M_PI; +// } +// } return angle; } diff --git a/src/ui/HUD.cc b/src/ui/HUD.cc index d5bf4bf0a..f9b3d0cc5 100644 --- a/src/ui/HUD.cc +++ b/src/ui/HUD.cc @@ -1047,10 +1047,10 @@ void HUD::paintPitchLines(float pitch, QPainter* painter) float offset = pitch; if (offset < 0) offset = -offset; int offsetCount = 0; - while (offset > lineDistance) { - offset -= lineDistance; - offsetCount++; - } +// while (offset > lineDistance) { +// offset -= lineDistance; +// offsetCount++; +// } int iPos = (int)(0.5f + lineDistance); ///< The first line int iNeg = (int)(-0.5f - lineDistance); ///< The first line -- 2.22.0