| 272 | } |
| 273 | |
| 274 | void FeatureType::ParseTypes() |
| 275 | { |
| 276 | if (m_parsed.m_types) |
| 277 | return; |
| 278 | |
| 279 | auto const typesOffset = sizeof(m_header); |
| 280 | Classificator & c = classif(); |
| 281 | ArrayByteSource source(m_data.data() + typesOffset); |
| 282 | |
| 283 | size_t const count = GetTypesCount(); |
| 284 | for (size_t i = 0; i < count; ++i) |
| 285 | { |
| 286 | uint32_t index = ReadVarUint<uint32_t>(source); |
| 287 | uint32_t const type = c.GetTypeForIndex(index); |
| 288 | if (type > 0) |
| 289 | m_types[i] = type; |
| 290 | else |
| 291 | { |
| 292 | // Possible for newer MWMs with added types. |
| 293 | LOG(LWARNING, ("Incorrect type index for feature. FeatureID:", m_id, ". Incorrect index:", index, |
| 294 | ". Loaded feature types:", m_types, ". Total count of types:", count)); |
| 295 | |
| 296 | m_types[i] = c.GetStubType(); |
| 297 | } |
| 298 | } |
| 299 | |
| 300 | m_offsets.m_common = CalcOffset(source, m_data.data()); |
| 301 | m_parsed.m_types = true; |
| 302 | } |
| 303 | |
| 304 | void FeatureType::ParseCommon() |
| 305 | { |
nothing calls this directly
no test coverage detected