1#include "snapshot.h"
2
3#include <base/dbg.h>
4#include <base/mem.h>
5
6void CSnapshotBuilder::Init7(const CSnapshot *pSnapshot)
7{
8 dbg_assert(!m_Building, "Snapshot builder is already building snapshot. Call `Finish` for each call to `Init`.");
9
10 // the method is called Init7 because it is only used for 0.7 support
11 // but the snap we are building is a 0.6 snap
12 m_Building = true;
13 m_HasDroppedItem = false;
14 m_Sixup = false;
15
16 m_DataSize = pSnapshot->m_DataSize;
17 m_NumItems = pSnapshot->m_NumItems;
18 mem_copy(dest: m_aOffsets, source: pSnapshot->Offsets(), size: sizeof(int) * m_NumItems);
19 mem_copy(dest: m_aData, source: pSnapshot->DataStart(), size: m_DataSize);
20}
21