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), ...@@ -137,12 +137,12 @@ GAudioOutput::GAudioOutput(QObject* parent) : QObject(parent),
} }
} }
GAudioOutput::~GAudioOutput() //GAudioOutput::~GAudioOutput()
{ //{
#ifdef _MSC_VER2 //#ifdef _MSC_VER2
::CoUninitialize(); // ::CoUninitialize();
#endif //#endif
} //}
void GAudioOutput::mute(bool mute) void GAudioOutput::mute(bool mute)
{ {
......
...@@ -124,7 +124,7 @@ protected: ...@@ -124,7 +124,7 @@ protected:
bool muted; bool muted;
private: private:
GAudioOutput(QObject* parent=NULL); GAudioOutput(QObject* parent=NULL);
~GAudioOutput(); // ~GAudioOutput();
}; };
#endif // AUDIOOUTPUT_H #endif // AUDIOOUTPUT_H
...@@ -49,28 +49,28 @@ quint64 groundTimeMilliseconds() ...@@ -49,28 +49,28 @@ quint64 groundTimeMilliseconds()
float limitAngleToPMPIf(float angle) float limitAngleToPMPIf(float angle)
{ {
while (angle > ((float)M_PI+FLT_EPSILON)) { // while (angle > ((float)M_PI+FLT_EPSILON)) {
angle -= 2.0f * (float)M_PI; // angle -= 2.0f * (float)M_PI;
} // }
while (angle <= -((float)M_PI+FLT_EPSILON)) { // while (angle <= -((float)M_PI+FLT_EPSILON)) {
angle += 2.0f * (float)M_PI; // angle += 2.0f * (float)M_PI;
} // }
return angle; return angle;
} }
double limitAngleToPMPId(double angle) double limitAngleToPMPId(double angle)
{ {
if (angle < -M_PI) { // if (angle < -M_PI) {
while (angle < -M_PI) { // while (angle < -M_PI) {
angle += M_PI; // angle += M_PI;
} // }
} else if (angle > M_PI) { // } else if (angle > M_PI) {
while (angle > M_PI) { // while (angle > M_PI) {
angle -= M_PI; // angle -= M_PI;
} // }
} // }
return angle; return angle;
} }
......
...@@ -1047,10 +1047,10 @@ void HUD::paintPitchLines(float pitch, QPainter* painter) ...@@ -1047,10 +1047,10 @@ void HUD::paintPitchLines(float pitch, QPainter* painter)
float offset = pitch; float offset = pitch;
if (offset < 0) offset = -offset; if (offset < 0) offset = -offset;
int offsetCount = 0; int offsetCount = 0;
while (offset > lineDistance) { // while (offset > lineDistance) {
offset -= lineDistance; // offset -= lineDistance;
offsetCount++; // offsetCount++;
} // }
int iPos = (int)(0.5f + lineDistance); ///< The first line int iPos = (int)(0.5f + lineDistance); ///< The first line
int iNeg = (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