From: ThorstenB Date: Sun, 13 Nov 2011 14:47:52 +0000 (+0100) Subject: Untangle subsystems by replacing direct TileCache call with callback. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=318e7ac7732b4dfc2a9c2ea591789e368eb2bbd6;p=flightgear.git Untangle subsystems by replacing direct TileCache call with callback. --- diff --git a/src/Scenery/tilemgr.cxx b/src/Scenery/tilemgr.cxx index 0e1c550c8..bfd3c9de0 100644 --- a/src/Scenery/tilemgr.cxx +++ b/src/Scenery/tilemgr.cxx @@ -121,6 +121,10 @@ void FGTileMgr::init() { reinit(); } +void FGTileMgr::refresh_tile(void* tileMgr, long tileIndex) +{ + ((FGTileMgr*) tileMgr)->tile_cache.refresh_tile(tileIndex); +} void FGTileMgr::reinit() { @@ -143,7 +147,7 @@ void FGTileMgr::reinit() _terra_sync = (simgear::SGTerraSync*) globals->get_subsystem("terrasync"); if (_terra_sync) - _terra_sync->setTileCache(&tile_cache); + _terra_sync->setTileRefreshCb(&refresh_tile, this); // force an update now update(0.0); diff --git a/src/Scenery/tilemgr.hxx b/src/Scenery/tilemgr.hxx index 87d1f1347..25e965a52 100644 --- a/src/Scenery/tilemgr.hxx +++ b/src/Scenery/tilemgr.hxx @@ -85,7 +85,9 @@ private: // Update the various queues maintained by the tilemagr (private // internal function, do not call directly.) void update_queues(); - + + static void refresh_tile(void* tileMgr, long tileIndex); + SGPropertyNode* _visibilityMeters; SGPropertyChangeListener* _propListener; SGPropertyNode_ptr _randomObjects;