コード例 #1
0
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
int CDebugHistory::Restore( IRestore &restore )
{
	ClearHistories();

	int iVersion = restore.ReadInt();

	if ( iVersion >= DEBUG_HISTORY_FIRST_VERSIONED )
	{
		int iMaxCategorys = restore.ReadInt();
		for ( int iCategory = 0; iCategory < MIN(iMaxCategorys,MAX_HISTORY_CATEGORIES); iCategory++ )
		{
			int iEnd = restore.ReadInt();
			m_DebugLineEnd[iCategory] = m_DebugLines[iCategory] + iEnd;
			restore.ReadData( m_DebugLines[iCategory], sizeof(m_DebugLines[iCategory]), 0 );
		}
	}
	else
	{
		int iMaxCategorys = iVersion;
		for ( int iCategory = 0; iCategory < MIN(iMaxCategorys,MAX_HISTORY_CATEGORIES); iCategory++ )
		{
			int iEnd = restore.ReadInt();
			m_DebugLineEnd[iCategory] = m_DebugLines[iCategory] + iEnd;
			restore.ReadData( m_DebugLines[iCategory], sizeof(m_DebugLines[iCategory]), 0 );
		}
	}

	return BaseClass::Restore(restore);
}
コード例 #2
0
ファイル: env_debughistory.cpp プロジェクト: paralin/hl2sdk
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
int CDebugHistory::Restore( IRestore &restore )
{
	ClearHistories();

	int iMaxCategorys = restore.ReadInt();
	for ( int iCategory = 0; iCategory < MIN(iMaxCategorys,MAX_HISTORY_CATEGORIES); iCategory++ )
	{
		int iEnd = restore.ReadInt();
		m_DebugLineEnd[iCategory] = m_DebugLines[iCategory] + iEnd;
		restore.ReadData( m_DebugLines[iCategory], sizeof(m_DebugLines[iCategory]), 0 );
	}

	return BaseClass::Restore(restore);
}