#include <simgear/debug/logstream.hxx>
#include <simgear/misc/fgpath.hxx>
+
#include <Main/globals.hxx>
-#include <Main/options.hxx>
+#include <Main/fg_props.hxx>
#include <Objects/texload.h>
+#include <Time/light.hxx>
#include "hud.hxx"
#include "panel.hxx"
bool
fgPanelVisible ()
{
- return ((current_options.get_panel_status()) &&
- (current_options.get_view_mode() == fgOPTIONS::FG_VIEW_PILOT) &&
+ return ((globals->get_options()->get_panel_status()) &&
+ (globals->get_viewmgr()->get_current() == 0) &&
(globals->get_current_view()->get_view_offset() == 0.0));
}
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;
*/
FGPanel::~FGPanel ()
{
+ unbind();
for (instrument_list_type::iterator it = _instruments.begin();
it != _instruments.end();
it++) {
}
+/**
+ * Initialize the panel.
+ */
+void
+FGPanel::init ()
+{
+ // NO-OP
+}
+
+
+/**
+ * Bind panel properties.
+ */
+void
+FGPanel::bind ()
+{
+ fgTie("/sim/panel/visibility", &_visibility);
+ fgTie("/sim/panel/x-offset", &_x_offset);
+ fgTie("/sim/panel/y-offset", &_y_offset);
+}
+
+
+/**
+ * Unbind panel properties.
+ */
+void
+FGPanel::unbind ()
+{
+ fgUntie("/sim/panel/visibility");
+ fgUntie("/sim/panel/x-offset");
+ fgUntie("/sim/panel/y-offset");
+}
+
+
/**
* Update the panel.
*/
void
-FGPanel::update () const
+FGPanel::update ()
{
// Do nothing if the panel isn't visible.
if (!fgPanelVisible())
}
// Scale for the real window size.
- x = int(((float)x / globals->get_current_view()->get_winWidth()) * _winw);
- y = int(_winh - (((float)y / globals->get_current_view()->get_winHeight())
+ x = int(((float)x / globals->get_options()->get_xsize()) * _winw);
+ y = int(_winh - (((float)y / globals->get_options()->get_ysize())
* _winh));
// Adjust for offsets.