本文整理汇总了C++中CGameClient::GetClientFrame方法的典型用法代码示例。如果您正苦于以下问题:C++ CGameClient::GetClientFrame方法的具体用法?C++ CGameClient::GetClientFrame怎么用?C++ CGameClient::GetClientFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGameClient
的用法示例。
在下文中一共展示了CGameClient::GetClientFrame方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
CClientFrame *CGameClient::GetSendFrame()
{
CClientFrame *pFrame = m_pCurrentFrame;
// just return if replay is disabled
if ( sv_maxreplay.GetFloat() <= 0 )
return pFrame;
int followEntity;
int delayTicks = serverGameClients->GetReplayDelay( edict, followEntity );
bool isInReplayMode = ( delayTicks > 0 );
if ( isInReplayMode != m_bIsInReplayMode )
{
// force a full update when modes are switched
m_nDeltaTick = -1;
m_bIsInReplayMode = isInReplayMode;
if ( isInReplayMode )
{
m_nEntityIndex = followEntity;
}
else
{
m_nEntityIndex = m_nClientSlot+1;
}
}
Assert( (m_nClientSlot+1 == m_nEntityIndex) || isInReplayMode );
if ( isInReplayMode )
{
CGameClient *pFollowPlayer = sv.Client( followEntity-1 );
if ( !pFollowPlayer )
return NULL;
pFrame = pFollowPlayer->GetClientFrame( sv.GetTick() - delayTicks, false );
if ( !pFrame )
return NULL;
if ( m_pLastSnapshot == pFrame->GetSnapshot() )
return NULL;
}
return pFrame;
}
示例2: GetClientFrame
CClientFrame *CGameClient::GetDeltaFrame( int nTick )
{
#ifndef _XBOX
Assert ( !IsHLTV() ); // has no ClientFrames
#endif
if ( m_bIsInReplayMode )
{
int followEntity;
serverGameClients->GetReplayDelay( edict, followEntity );
Assert( followEntity > 0 );
CGameClient *pFollowEntity = sv.Client( followEntity-1 );
if ( pFollowEntity )
return pFollowEntity->GetClientFrame( nTick );
}
return GetClientFrame( nTick );
}