Commit dee19d0c authored by pixhawk's avatar pixhawk

Solved bugs for large angles

parent 758258fd
......@@ -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)
{
......
......@@ -124,7 +124,7 @@ protected:
bool muted;
private:
GAudioOutput(QObject* parent=NULL);
~GAudioOutput();
// ~GAudioOutput();
};
#endif // AUDIOOUTPUT_H
......@@ -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;
}
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment