Skip to content

Instantly share code, notes, and snippets.

@larsfu
Created June 20, 2010 11:05
Show Gist options
  • Save larsfu/445745 to your computer and use it in GitHub Desktop.
Save larsfu/445745 to your computer and use it in GitHub Desktop.
void CClient::OnDemoPlayerSnapshot(void *pData, int Size)
{
// update ticks, they could have changed
const CDemoPlayer::CPlaybackInfo *pInfo = m_DemoPlayer.Info();
CSnapshotStorage::CHolder *pTemp;
m_CurGameTick = pInfo->m_Info.m_CurrentTick;
m_PrevGameTick = pInfo->m_PreviousTick;
// handle snapshots
pTemp = m_aSnapshots[SNAP_PREV];
m_aSnapshots[SNAP_PREV] = m_aSnapshots[SNAP_CURRENT];
m_aSnapshots[SNAP_CURRENT] = pTemp;
mem_copy(m_aSnapshots[SNAP_CURRENT]->m_pSnap, pData, Size);
mem_copy(m_aSnapshots[SNAP_CURRENT]->m_pAltSnap, pData, Size);
GameClient()->OnNewSnapshot();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment