| 1521 | } |
| 1522 | |
| 1523 | void Map::initialiseModule(const IApplicationContext& ctx) |
| 1524 | { |
| 1525 | // Register for the startup event |
| 1526 | _mapPositionManager.reset(new MapPositionManager); |
| 1527 | |
| 1528 | GlobalSceneGraph().addSceneObserver(this); |
| 1529 | |
| 1530 | // Add the Map-related commands to the EventManager |
| 1531 | registerCommands(); |
| 1532 | |
| 1533 | _scaledModelExporter.initialise(); |
| 1534 | _modelScalePreserver.reset(new ModelScalePreserver); |
| 1535 | |
| 1536 | // Construct point trace and connect it to map signals |
| 1537 | _pointTrace.reset(new PointFile()); |
| 1538 | signal_mapEvent().connect([this](IMap::MapEvent e) |
| 1539 | { _pointTrace->onMapEvent(e); }); |
| 1540 | |
| 1541 | MapFileManager::registerFileTypes(); |
| 1542 | |
| 1543 | // Register an info file module to save the map property bag |
| 1544 | GlobalMapInfoFileManager().registerInfoFileModule( |
| 1545 | std::make_shared<MapPropertyInfoFileModule>() |
| 1546 | ); |
| 1547 | |
| 1548 | // Free the map right before all modules are shut down |
| 1549 | module::GlobalModuleRegistry().signal_modulesUninitialising().connect( |
| 1550 | sigc::mem_fun(this, &Map::freeMap) |
| 1551 | ); |
| 1552 | |
| 1553 | _shutdownListener = GlobalRadiantCore().getMessageBus().addListener( |
| 1554 | radiant::IMessage::Type::ApplicationShutdownRequest, |
| 1555 | radiant::TypeListener<radiant::ApplicationShutdownRequest>( |
| 1556 | sigc::mem_fun(this, &Map::handleShutdownRequest))); |
| 1557 | } |
| 1558 | |
| 1559 | void Map::shutdownModule() |
| 1560 | { |
nothing calls this directly
no test coverage detected