1
0
Fork 0

Fix unwanted waypoint list transparency

Ticket: https://sourceforge.net/p/flightgear/codetickets/2009/
This commit is contained in:
James Turner 2018-01-28 15:59:43 +00:00
parent 087995448f
commit f076fe1c1b

View file

@ -358,6 +358,10 @@ void WaypointList::draw( int dx, int dy )
_blink = !_blink; _blink = !_blink;
} }
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE);
glEnable(GL_SCISSOR_TEST); glEnable(GL_SCISSOR_TEST);
GLint sx = (int) abox.min[0], GLint sx = (int) abox.min[0],
sy = abox.min[1]; sy = abox.min[1];
@ -371,7 +375,7 @@ void WaypointList::draw( int dx, int dy )
glScissor(sx + dx, sy + dy, w, h); glScissor(sx + dx, sy + dy, w, h);
int row = firstVisibleRow(), int row = firstVisibleRow(),
final = lastVisibleRow(), finalRow = lastVisibleRow(),
rowHeight = rowHeightPx(), rowHeight = rowHeightPx(),
y = rowHeight; y = rowHeight;
@ -381,7 +385,7 @@ void WaypointList::draw( int dx, int dy )
RoutePath path(_model->flightplan()); RoutePath path(_model->flightplan());
for ( ; row <= final; ++row, y += rowHeight) { for ( ; row <= finalRow; ++row, y += rowHeight) {
drawRow(dx, dy, row, y, path); drawRow(dx, dy, row, y, path);
} // of row drawing iteration } // of row drawing iteration
@ -399,6 +403,9 @@ void WaypointList::draw( int dx, int dy )
glVertex2f(dx + abox.max[0], dy + abox.max[1] - insertY); glVertex2f(dx + abox.max[0], dy + abox.max[1] - insertY);
glEnd(); glEnd();
} }
glDisable(GL_BLEND);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
} }
void WaypointList::drawRow(int dx, int dy, int rowIndex, int y, void WaypointList::drawRow(int dx, int dy, int rowIndex, int y,