ObjLoading: Add possibility to go back to the beginning of a IPakEntryReadStream

This commit is contained in:
Jan 2020-02-09 10:01:09 +01:00
parent 4baca81210
commit 43fa845839

View File

@ -300,7 +300,20 @@ int64_t IPakEntryReadStream::Pos()
void IPakEntryReadStream::Goto(const int64_t pos) void IPakEntryReadStream::Goto(const int64_t pos)
{ {
if (pos > m_file_offset) if(pos == 0)
{
m_pos = m_base_pos;
m_file_head = 0;
m_file_offset = 0;
m_current_block = nullptr;
m_next_command = 0;
m_current_command_buffer = nullptr;
m_current_command_length = 0;
m_current_command_offset = 0;
}
else if (pos > m_file_offset)
{ {
Skip(pos - m_file_offset); Skip(pos - m_file_offset);
} }