_scr_heightN->removeChangeListener(this);
_unitsN->removeChangeListener(this);
delete _font_renderer;
- delete _clip_box;
-
- deque<Item *>::const_iterator it, end = _items.end();
- for (it = _items.begin(); it != end; ++it)
- delete *it;
- end = _ladders.end();
- for (it = _ladders.begin(); it != end; ++it)
- delete *it;
+
+ deinit();
}
_path->fireValueChanged();
}
+void HUD::deinit()
+{
+ deque<Item *>::const_iterator it, end = _items.end();
+ for (it = _items.begin(); it != end; ++it)
+ delete *it;
+ end = _ladders.end();
+ for (it = _ladders.begin(); it != end; ++it)
+ delete *it;
+
+ _items.clear();
+ _ladders.clear();
+
+ delete _clip_box;
+ _clip_box = NULL;
+}
+
+void HUD::reinit()
+{
+ deinit();
+ _path->fireValueChanged();
+}
void HUD::update(double dt)
{
const sgDebugPriority TREE = SG_INFO;
const int MAXNEST = 10;
- SGPath path(globals->get_fg_root());
- path.append(file);
+ SGPath path(globals->resolve_maybe_aircraft_path(file));
if (!level) {
SG_LOG(SG_INPUT, TREE, endl << "load " << file);
void init();
void update(double);
+ void reinit();
+
// called from Main/renderer.cxx to draw 2D and 3D HUD
void draw(osg::State&);
int level = 0, const std::string& indent = "");
private:
+ void deinit();
+
void draw3D();
void draw2D(GLfloat, GLfloat, GLfloat, GLfloat);