Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2011-10-16 15:36:08 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:26:06 +0300
commitc99c4df6bc11f76d37d51d75c96653143eaaa738 (patch)
tree97b555510688f380fbe045e4b632cbec9f72b578 /indexer/feature_loader.cpp
parentb5f74708130267036f4097f098eada2902957548 (diff)
Fix bug in geometry offsets loading after my changes with dynamic scales.
Diffstat (limited to 'indexer/feature_loader.cpp')
-rw-r--r--indexer/feature_loader.cpp23
1 files changed, 3 insertions, 20 deletions
diff --git a/indexer/feature_loader.cpp b/indexer/feature_loader.cpp
index 320fbea692..4fd1d502a8 100644
--- a/indexer/feature_loader.cpp
+++ b/indexer/feature_loader.cpp
@@ -259,23 +259,6 @@ uint32_t LoaderCurrent::ParseTriangles(int scale)
return sz;
}
-namespace
-{
- uint32_t const kInvalidOffset = uint32_t(-1);
-}
-
-void LoaderCurrent::ReadOffsets(ArrayByteSource & src, uint8_t mask, offsets_t & offsets) const
-{
- ASSERT ( offsets.empty(), () );
- ASSERT_GREATER ( mask, 0, () );
-
- while (mask > 0)
- {
- offsets.push_back((mask & 0x01) ? ReadVarUint<uint32_t>(src) : kInvalidOffset);
- mask = mask >> 1;
- }
-}
-
int LoaderCurrent::GetScaleIndex(int scale) const
{
int const count = m_Info.GetScalesCount();
@@ -312,13 +295,13 @@ int LoaderCurrent::GetScaleIndex(int scale, offsets_t const & offsets) const
case -1:
// Choose the best existing geometry for the last visible scale.
ind = count-1;
- while (ind >= 0 && offsets[ind] == kInvalidOffset) --ind;
+ while (ind >= 0 && offsets[ind] == s_InvalidOffset) --ind;
break;
case -2:
// Choose the worst existing geometry for the first visible scale.
ind = 0;
- while (ind < count && offsets[ind] == kInvalidOffset) ++ind;
+ while (ind < count && offsets[ind] == s_InvalidOffset) ++ind;
break;
default:
@@ -327,7 +310,7 @@ int LoaderCurrent::GetScaleIndex(int scale, offsets_t const & offsets) const
for (int i = 0; i < n; ++i)
{
if (scale <= m_Info.GetScale(i))
- return (offsets[i] != kInvalidOffset ? i : -1);
+ return (offsets[i] != s_InvalidOffset ? i : -1);
}
}
}