Fixed traffic enable

This commit is contained in:
r.kuznetsov 2018-07-02 14:21:55 +03:00 committed by Daria Volvenkova
parent a495549291
commit 7ec094b9f4
3 changed files with 8 additions and 5 deletions

View file

@ -487,6 +487,8 @@ Framework::Framework(FrameworkParams const & params)
LOG(LINFO, ("Editor initialized"));
m_trafficManager.SetCurrentDataVersion(m_storage.GetCurrentDataVersion());
m_trafficManager.SetSimplifiedColorScheme(LoadTrafficSimplifiedColors());
m_trafficManager.SetEnabled(LoadTrafficEnabled());
m_adsEngine = make_unique<ads::Engine>();
@ -1725,11 +1727,8 @@ void Framework::CreateDrapeEngine(ref_ptr<dp::OGLContextFactory> contextFactory,
Load3dMode(allow3d, allow3dBuildings);
bool const isAutozoomEnabled = LoadAutoZoom();
bool const trafficEnabled = LoadTrafficEnabled();
m_trafficManager.SetEnabled(trafficEnabled);
bool const simplifiedTrafficColors = LoadTrafficSimplifiedColors();
m_trafficManager.SetSimplifiedColorScheme(simplifiedTrafficColors);
bool const trafficEnabled = m_trafficManager.IsEnabled();
bool const simplifiedTrafficColors = m_trafficManager.HasSimplifiedColorScheme();
double const fontsScaleFactor = LoadLargeFontsSize() ? kLargeFontsScaleFactor : 1.0;
df::DrapeEngine::Params p(

View file

@ -560,6 +560,7 @@ void TrafficManager::Resume()
void TrafficManager::SetSimplifiedColorScheme(bool simplified)
{
m_hasSimplifiedColorScheme = simplified;
m_drapeEngine.SafeCall(&df::DrapeEngine::SetSimplifiedTrafficColors, simplified);
}

View file

@ -82,6 +82,7 @@ public:
void OnEnterBackground();
void SetSimplifiedColorScheme(bool simplified);
bool HasSimplifiedColorScheme() const { return m_hasSimplifiedColorScheme; }
private:
struct CacheEntry
@ -155,6 +156,8 @@ private:
atomic<TrafficState> m_state;
TrafficStateChangedFn m_onStateChangedFn;
bool m_hasSimplifiedColorScheme = true;
size_t m_maxCacheSizeBytes;
size_t m_currentCacheSizeBytes = 0;