Skip to content

Commit

Permalink
[BUGFIX] fix nesting and order of OpenGL calls (#241)
Browse files Browse the repository at this point in the history
This removes an erroneous nesting of OpenGL calls and fixes the APP
border width call.

As a drive-by it sets a nicer color for the "Plan Flight" plotted route.
  • Loading branch information
jonaseberle committed May 15, 2023
1 parent cd68ef4 commit 15cc433
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Airport.cpp
Expand Up @@ -124,8 +124,8 @@ void Airport::appGl(const QColor &middleColor, const QColor &marginColor, const
}
glEnd();

glBegin(GL_LINE_STRIP);
glLineWidth(borderLineWidth);
glBegin(GL_LINE_STRIP);
glColor4f(borderColor.redF(), borderColor.greenF(), borderColor.blueF(), borderColor.alphaF());
for(short int i = 0; i <= 360; i += 1) {
auto _p = NavData::pointDistanceBearing(lat, lon, Airport::symbologyAppRadius_nm, i);
Expand Down
2 changes: 0 additions & 2 deletions src/GLWidget.cpp
Expand Up @@ -717,15 +717,13 @@ void GLWidget::createStaticLists() {
glLineWidth(Settings::countryLineStrength());
LineReader countries = LineReader(Settings::dataDirectory("data/countries.dat"));
QList<QPair<double, double> > line = countries.readLine();
glBegin(GL_LINE);
while (!line.isEmpty()) {
glBegin(GL_LINE_STRIP);
for (int i = 0; i < line.size(); i++)
VERTEX(line[i].first, line[i].second);
glEnd();
line = countries.readLine();
}
glEnd();
}
glEndList();

Expand Down
6 changes: 3 additions & 3 deletions src/PlanFlightDialog.cpp
Expand Up @@ -271,13 +271,13 @@ void PlanFlightDialog::plotPlannedRoute() const {

// @todo: make plot line color adjustable
// @todo: are we GLing here ouside a GL context?!
glColor4f(0., 0., 1., 1.);
glLineWidth(3.);
glColor4f(.7, 1., .4, .8);
glLineWidth(2.);
glBegin(GL_LINE_STRIP);
NavData::plotGreatCirclePoints(points);
glEnd();
glPointSize(4.);
glColor4f(1., 0., 0., 1.);
glColor4f(.5, .5, .5, .5);
glBegin(GL_POINTS);
foreach(const DoublePair p, points)
VERTEX(p.first, p.second);
Expand Down

0 comments on commit 15cc433

Please sign in to comment.