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:
authorYury Melnichek <melnichek@gmail.com>2011-04-24 05:16:18 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:16:20 +0300
commit60e2dcfbae9e9a766dfc24c05fa59b846822d8d2 (patch)
tree6c3c590729949b0235b7ee5717abbf9dd144518e /indexer/data_header.cpp
parent7e4bb0e4fd0800a9edb38d3b4c2e7d6c1abbd12d (diff)
Pass CodingParams everywhere.
Diffstat (limited to 'indexer/data_header.cpp')
-rw-r--r--indexer/data_header.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/indexer/data_header.cpp b/indexer/data_header.cpp
index dc5fd28e8e..000ae23f08 100644
--- a/indexer/data_header.cpp
+++ b/indexer/data_header.cpp
@@ -21,19 +21,14 @@ namespace feature
{
}
- void DataHeader::SetBase(m2::PointD const & p)
- {
- m_base = PointToInt64(p.x, p.y);
- }
-
m2::RectD const DataHeader::GetBounds() const
{
- return Int64ToRect(m_bounds);
+ return Int64ToRect(m_bounds, m_codingParams.GetCoordBits());
}
void DataHeader::SetBounds(m2::RectD const & r)
{
- m_bounds = RectToInt64(r);
+ m_bounds = RectToInt64(r, m_codingParams.GetCoordBits());
}
void DataHeader::SetScales(int * arr)
@@ -58,18 +53,18 @@ namespace feature
void DataHeader::Save(FileWriter & w) const
{
- WriteToSink(w, m_base);
- WriteVarInt(w, m_bounds.first - m_base);
- WriteVarInt(w, m_bounds.second - m_base);
+ m_codingParams.Save(w);
+ WriteVarInt(w, m_bounds.first - m_codingParams.GetBasePointInt64());
+ WriteVarInt(w, m_bounds.second - m_codingParams.GetBasePointInt64());
w.Write(m_scales.data(), m_scales.size());
}
void DataHeader::Load(FileReader const & r)
{
ReaderSource<FileReader> src(r);
- m_base = ReadPrimitiveFromSource<int64_t>(src);
- m_bounds.first = ReadVarInt<int64_t>(src) + m_base;
- m_bounds.second = ReadVarInt<int64_t>(src) + m_base;
+ m_codingParams.Load(src);
+ m_bounds.first = ReadVarInt<int64_t>(src) + m_codingParams.GetBasePointInt64();
+ m_bounds.second = ReadVarInt<int64_t>(src) + m_codingParams.GetBasePointInt64();
src.Read(m_scales.data(), m_scales.size());
}
}