Commit fc3080e8 authored by Bryant's avatar Bryant

Improved comments in HUD.cc

parent 6e5ad05a
...@@ -694,9 +694,11 @@ void HUD::paintHUD() ...@@ -694,9 +694,11 @@ void HUD::paintHUD()
glPushMatrix(); glPushMatrix();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Fill with black background // If video is enabled, get the next frame.
if (videoEnabled) { if (videoEnabled)
if (nextOfflineImage != "" && QFileInfo(nextOfflineImage).exists()) { {
if (nextOfflineImage != "" && QFileInfo(nextOfflineImage).exists())
{
qDebug() << __FILE__ << __LINE__ << "template image:" << nextOfflineImage; qDebug() << __FILE__ << __LINE__ << "template image:" << nextOfflineImage;
QImage fill = QImage(nextOfflineImage); QImage fill = QImage(nextOfflineImage);
...@@ -708,6 +710,7 @@ void HUD::paintHUD() ...@@ -708,6 +710,7 @@ void HUD::paintHUD()
} }
// And if either video or the data stream is enabled, draw the next frame.
if (dataStreamEnabled || videoEnabled) if (dataStreamEnabled || videoEnabled)
{ {
glRasterPos2i(0, 0); glRasterPos2i(0, 0);
...@@ -719,7 +722,10 @@ void HUD::paintHUD() ...@@ -719,7 +722,10 @@ void HUD::paintHUD()
// Resize to correct size and fill with image // Resize to correct size and fill with image
glDrawPixels(glImage.width(), glImage.height(), GL_RGBA, GL_UNSIGNED_BYTE, glImage.bits()); glDrawPixels(glImage.width(), glImage.height(), GL_RGBA, GL_UNSIGNED_BYTE, glImage.bits());
//qDebug() << "DRAWING GL IMAGE"; //qDebug() << "DRAWING GL IMAGE";
} else { }
// But if no video frame should be shown, paint the sky/ground background.
else
{
// Blue / brown background // Blue / brown background
paintCenterBackground(roll, pitch, yawTrans); paintCenterBackground(roll, pitch, yawTrans);
} }
...@@ -729,11 +735,9 @@ void HUD::paintHUD() ...@@ -729,11 +735,9 @@ void HUD::paintHUD()
// END OF OPENGL PAINTING // END OF OPENGL PAINTING
if (hudInstrumentsEnabled) { // Paint all the instrument data using Qt.
if (hudInstrumentsEnabled)
//glEnable(GL_MULTISAMPLE); {
// QT PAINTING
//makeCurrent(); //makeCurrent();
QPainter painter; QPainter painter;
painter.begin(this); painter.begin(this);
...@@ -743,7 +747,6 @@ void HUD::paintHUD() ...@@ -743,7 +747,6 @@ void HUD::paintHUD()
// COORDINATE FRAME IS NOW (0,0) at CENTER OF WIDGET // COORDINATE FRAME IS NOW (0,0) at CENTER OF WIDGET
// Draw all fixed indicators // Draw all fixed indicators
// BATTERY // BATTERY
paintText(fuelStatus, fuelColor, 6.0f, (-vwidth/2.0) + 10, -vheight/2.0 + 6, &painter); paintText(fuelStatus, fuelColor, 6.0f, (-vwidth/2.0) + 10, -vheight/2.0 + 6, &painter);
......
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