Browse Source

Improved comments in HUD.cc

QGC4.4
Bryant 12 years ago
parent
commit
fc3080e84f
  1. 23
      src/ui/HUD.cc

23
src/ui/HUD.cc

@ -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()
} }
// 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()
// 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()
// 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()
// 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);

Loading…
Cancel
Save