Make fixed header size that doesn't depend on mwm bounds rect.

Fix UpdateMWMRectsFromBoundaries.
This commit is contained in:
vng 2011-04-30 06:44:06 +03:00 committed by Alex Zolotarev
parent 7b81beed37
commit 413282b528
2 changed files with 15 additions and 5 deletions

View file

@ -35,7 +35,7 @@ namespace
{
FilesContainerW contW(name, FileWriter::OP_WRITE_EXISTING);
FileWriter w = contW.GetWriter(HEADER_FILE_TAG);
FileWriter w = contW.GetExistingWriter(HEADER_FILE_TAG);
h.Save(w);
}
}

View file

@ -54,8 +54,13 @@ namespace feature
void DataHeader::Save(FileWriter & w) const
{
m_codingParams.Save(w);
WriteVarInt(w, m_bounds.first - m_codingParams.GetBasePointInt64());
WriteVarInt(w, m_bounds.second - m_codingParams.GetBasePointInt64());
//int64_t const base = m_codingParams.GetBasePointInt64();
//WriteVarInt(w, m_bounds.first - base);
//WriteVarInt(w, m_bounds.second - base);
WriteToSink(w, m_bounds.first);
WriteToSink(w, m_bounds.second);
w.Write(m_scales.data(), m_scales.size());
}
@ -63,8 +68,13 @@ namespace feature
{
ReaderSource<FileReader> src(r);
m_codingParams.Load(src);
m_bounds.first = ReadVarInt<int64_t>(src) + m_codingParams.GetBasePointInt64();
m_bounds.second = ReadVarInt<int64_t>(src) + m_codingParams.GetBasePointInt64();
//int64_t const base = m_codingParams.GetBasePointInt64();
//m_bounds.first = ReadVarInt<int64_t>(src) + base;
//m_bounds.second = ReadVarInt<int64_t>(src) + base;
m_bounds.first = ReadPrimitiveFromSource<int64_t>(src);
m_bounds.second = ReadPrimitiveFromSource<int64_t>(src);
src.Read(m_scales.data(), m_scales.size());
}
}