MCPcopy Create free account
hub / github.com/comaps/comaps / PrepareCountries

Method PrepareCountries

qt/screenshoter.cpp:259–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257}
258
259void Screenshoter::PrepareCountries()
260{
261 CHECK(m_countriesToDownload.empty(), ());
262
263 auto & storage = m_framework.GetStorage();
264
265 int const kMinCountryZoom = 10;
266 if (m_framework.GetDrawScale() >= kMinCountryZoom)
267 {
268 auto countryIds = m_framework.GetCountryInfoGetter().GetRegionsCountryIdByRect(m_framework.GetCurrentViewport(),
269 false /* rough */);
270 for (auto const & countryId : countryIds)
271 {
272 if (storage.CountryStatusEx(countryId) == storage::Status::NotDownloaded)
273 {
274 ChangeState(State::WaitCountries);
275 m_countriesToDownload.insert(countryId);
276 storage.DownloadCountry(countryId, MapFileType::Map);
277 }
278 }
279 }
280
281 if (m_countriesToDownload.empty())
282 {
283 ChangeState(State::WaitGraphics);
284 WaitGraphics();
285 }
286}
287
288void Screenshoter::OnCountryChanged(storage::CountryId countryId)
289{

Callers

nothing calls this directly

Calls 7

GetDrawScaleMethod · 0.80
GetCurrentViewportMethod · 0.80
CountryStatusExMethod · 0.80
DownloadCountryMethod · 0.80
emptyMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected