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-02-14 04:52:30 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:12:24 +0300
commit7b61f1e351b328886ada81f7f5b95751123f455f (patch)
treeab4706af745a431e5c88449cfbadb096878e1c42 /indexer/geometry_serialization.hpp
parent29ef8ca329bb3a460f5e291d12c1d219ae619897 (diff)
Fix bug in tesselator processing. Sgitess passes triangles in ONE list,
even if they are divided on many clusters.
Diffstat (limited to 'indexer/geometry_serialization.hpp')
-rw-r--r--indexer/geometry_serialization.hpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/indexer/geometry_serialization.hpp b/indexer/geometry_serialization.hpp
index 134388f0e3..ff52f55622 100644
--- a/indexer/geometry_serialization.hpp
+++ b/indexer/geometry_serialization.hpp
@@ -161,9 +161,11 @@ namespace serial
template <class TSink> void Save(TSink & sink)
{
+ // assume that 2 byte is enough for triangles count
size_t const count = m_buffers.size();
- CHECK_LESS(count, 256, ());
- WriteToSink(sink, static_cast<uint8_t>(count));
+ CHECK_LESS_OR_EQUAL(count, 0x3FFF, ());
+
+ WriteVarUint(sink, static_cast<uint32_t>(count));
for_each(m_buffers.begin(), m_buffers.end(), bind(&WriteBufferToSink<TSink>, _1, ref(sink)));
}
@@ -177,7 +179,7 @@ namespace serial
template <class TSource>
void LoadOuterTriangles(TSource & src, int64_t base, OutPointsT & triangles)
{
- int const count = ReadPrimitiveFromSource<uint8_t>(src);
+ int const count = ReadVarUint<uint32_t>(src);
for (int i = 0; i < count; ++i)
LoadOuter(&DecodeTriangles, src, base, triangles, 3);