Support scenery reloading (needs simgear update).
TileMgr subsystem reinit: remove all scenery tiles from scenegraph and clear cache (simgear update required). "normal" sim resets: no TileMgr reset is needed (avoid reloading scenery).
This commit is contained in:
parent
4a351fdd8b
commit
7bc9749d91
2 changed files with 4 additions and 2 deletions
|
@ -1557,8 +1557,7 @@ void fgReInitSubsystems()
|
||||||
globals->get_viewmgr()->reinit();
|
globals->get_viewmgr()->reinit();
|
||||||
|
|
||||||
globals->get_subsystem("time")->reinit();
|
globals->get_subsystem("time")->reinit();
|
||||||
globals->get_subsystem("tile-manager")->reinit();
|
|
||||||
|
|
||||||
// setup state to end re-init
|
// setup state to end re-init
|
||||||
fgSetBool("/sim/signals/reinit", false);
|
fgSetBool("/sim/signals/reinit", false);
|
||||||
if ( !freeze ) {
|
if ( !freeze ) {
|
||||||
|
|
|
@ -117,6 +117,9 @@ void FGTileMgr::init() {
|
||||||
|
|
||||||
void FGTileMgr::reinit()
|
void FGTileMgr::reinit()
|
||||||
{
|
{
|
||||||
|
// remove all old scenery nodes from scenegraph and clear cache
|
||||||
|
osg::Group* group = globals->get_scenery()->get_terrain_branch();
|
||||||
|
group->removeChildren(0, group->getNumChildren());
|
||||||
tile_cache.init();
|
tile_cache.init();
|
||||||
|
|
||||||
state = Inited;
|
state = Inited;
|
||||||
|
|
Loading…
Reference in a new issue