]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/panel.cxx
Moved winWidth and winHeight out of FGViewer since these are set on a
[flightgear.git] / src / Cockpit / panel.cxx
index 7de4b43eabd447b888fb5371438e1b2a4d64ce4a..3e371f43e6392b84d98e6163ada299ab51829d78 100644 (file)
@@ -33,8 +33,7 @@
 
 #include <simgear/debug/logstream.hxx>
 #include <simgear/misc/fgpath.hxx>
-#include <Main/options.hxx>
-#include <Main/views.hxx>
+#include <Main/globals.hxx>
 #include <Objects/texload.h>
 
 #include "hud.hxx"
@@ -44,9 +43,9 @@
 bool
 fgPanelVisible ()
 {
-  return ((current_options.get_panel_status()) &&
-         (current_options.get_view_mode() == fgOPTIONS::FG_VIEW_PILOT) &&
-         (current_view.get_view_offset() == 0.0));
+  return ((globals->get_options()->get_panel_status()) &&
+         (globals->get_options()->get_view_mode() == FGOptions::FG_VIEW_PILOT) &&
+         (globals->get_current_view()->get_view_offset() == 0.0));
 }
 
 
@@ -63,7 +62,7 @@ FGTextureManager::createTexture (const string &relativePath)
   ssgTexture * texture = _textureMap[relativePath];
   if (texture == 0) {
     cerr << "Texture " << relativePath << " does not yet exist" << endl;
-    FGPath tpath(current_options.get_fg_root());
+    FGPath tpath(globals->get_options()->get_fg_root());
     tpath.append(relativePath);
     texture = new ssgTexture((char *)tpath.c_str(), false, false);
     _textureMap[relativePath] = texture;
@@ -305,8 +304,9 @@ FGPanel::doMouseAction (int button, int updown, int x, int y)
   }
 
                                // Scale for the real window size.
-  x = int(((float)x / current_view.get_winWidth()) * _winw);
-  y = int(_winh - (((float)y / current_view.get_winHeight()) * _winh));
+  x = int(((float)x / globals->get_options()->get_xsize()) * _winw);
+  y = int(_winh - (((float)y / globals->get_options()->get_ysize())
+                  * _winh));
 
                                // Adjust for offsets.
   x -= _x_offset;