]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/panel.cxx
Use !strcmp for all property string-value comparisons.
[flightgear.git] / src / Cockpit / panel.cxx
index 29729192d679f4e2bed9a85dea91a8b8be168949..7538e29b673b5307083e7a2f2df0d9761ff5ed03 100644 (file)
@@ -89,7 +89,7 @@ fgPanelVisible ()
        return false;
      if(globals->get_viewmgr()->get_current() != 0)
        return false;
-     if(globals->get_current_view()->get_view_offset() != 0 &&
+     if(globals->get_current_view()->getHeadingOffset_deg() * SGD_DEGREES_TO_RADIANS != 0 &&
         !fgGetBool("/sim/virtual-cockpit"))
        return false;
      return true;
@@ -452,8 +452,8 @@ FGPanel::setupVirtualCockpit()
     // Generate a "look at" matrix using OpenGL (!) coordinate
     // conventions.
     float lookat[3];
-    float pitch = view->get_view_tilt();
-    float rot = view->get_view_offset();
+    float pitch = view->getPitchOffset_deg() * SGD_DEGREES_TO_RADIANS;
+    float rot = view->getHeadingOffset_deg() * SGD_DEGREES_TO_RADIANS;
     lookat[0] = -sin(rot);
     lookat[1] = sin(pitch) / cos(pitch);
     lookat[2] = -cos(rot);
@@ -1076,7 +1076,7 @@ FGTextLayer::Chunk::Chunk (const string &text, const string &fmt)
   : _type(FGTextLayer::TEXT), _fmt(fmt)
 {
   _text = text;
-  if (_fmt == ""
+  if (_fmt.empty()
     _fmt = "%s";
 }
 
@@ -1084,7 +1084,7 @@ FGTextLayer::Chunk::Chunk (ChunkType type, const SGPropertyNode * node,
                           const string &fmt, float mult)
   : _type(type), _fmt(fmt), _mult(mult)
 {
-  if (_fmt == "") {
+  if (_fmt.empty()) {
     if (type == TEXT_VALUE)
       _fmt = "%s";
     else
@@ -1102,7 +1102,7 @@ FGTextLayer::Chunk::getValue () const
       sprintf(_buf, _fmt.c_str(), _text.c_str());
       return _buf;
     case TEXT_VALUE:
-      sprintf(_buf, _fmt.c_str(), _node->getStringValue().c_str());
+      sprintf(_buf, _fmt.c_str(), _node->getStringValue());
       break;
     case DOUBLE_VALUE:
       sprintf(_buf, _fmt.c_str(), _node->getFloatValue() * _mult);
@@ -1150,3 +1150,4 @@ FGSwitchLayer::draw ()
 // end of panel.cxx
 
 
+