| 257 | } |
| 258 | |
| 259 | void 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 | |
| 288 | void Screenshoter::OnCountryChanged(storage::CountryId countryId) |
| 289 | { |
nothing calls this directly
no test coverage detected