Only update events on PostThink to be extra sure
This commit is contained in:
parent
859232b6ab
commit
b9586237f1
6 changed files with 39 additions and 20 deletions
|
@ -45,15 +45,15 @@ public:
|
||||||
bool IsDying( void ) { return ((m_fFlags & ANIM_LAYER_DYING) != 0); }
|
bool IsDying( void ) { return ((m_fFlags & ANIM_LAYER_DYING) != 0); }
|
||||||
void Dead( void ) { m_fFlags &= ~ANIM_LAYER_DYING; }
|
void Dead( void ) { m_fFlags &= ~ANIM_LAYER_DYING; }
|
||||||
|
|
||||||
CRangeCheckedVar< int, -1, 65535, 0 > m_nSequence;
|
int m_nSequence;
|
||||||
CRangeCheckedVar< float, -2, 2, 0 > m_flPrevCycle;
|
float m_flPrevCycle;
|
||||||
CRangeCheckedVar< float, -5, 5, 0 > m_flWeight;
|
float m_flWeight;
|
||||||
int m_nOrder;
|
int m_nOrder;
|
||||||
int m_fFlags;
|
int m_fFlags;
|
||||||
|
|
||||||
// used for automatic crossfades between sequence changes
|
// used for automatic crossfades between sequence changes
|
||||||
CRangeCheckedVar<float, -50, 50, 1> m_flPlaybackRate;
|
float m_flPlaybackRate;
|
||||||
CRangeCheckedVar<float, -2, 2, 0> m_flCycle;
|
float m_flCycle;
|
||||||
|
|
||||||
float GetFadeout( float flCurTime );
|
float GetFadeout( float flCurTime );
|
||||||
|
|
||||||
|
|
|
@ -339,7 +339,7 @@ void C_BaseAnimatingOverlay::DoAnimationEvents( CStudioHdr *pStudioHdr )
|
||||||
{
|
{
|
||||||
Msg( "%i (seq: %d) FE %i Normal cycle %f, prev %f ev %f (time %.3f)\n",
|
Msg( "%i (seq: %d) FE %i Normal cycle %f, prev %f ev %f (time %.3f)\n",
|
||||||
gpGlobals->tickcount,
|
gpGlobals->tickcount,
|
||||||
m_AnimOverlay[j].m_nSequence.GetRaw(),
|
m_AnimOverlay[j].m_nSequence,
|
||||||
pevent[i].event,
|
pevent[i].event,
|
||||||
pevent[i].cycle,
|
pevent[i].cycle,
|
||||||
m_flOverlayPrevEventCycle[j],
|
m_flOverlayPrevEventCycle[j],
|
||||||
|
|
|
@ -2706,15 +2706,7 @@ float C_CSPlayer::GetDeathCamInterpolationTime()
|
||||||
|
|
||||||
bool C_CSPlayer::SetupBones( matrix3x4_t* pBoneToWorldOut, int nMaxBones, int boneMask, float currentTime )
|
bool C_CSPlayer::SetupBones( matrix3x4_t* pBoneToWorldOut, int nMaxBones, int boneMask, float currentTime )
|
||||||
{
|
{
|
||||||
// Just in case.
|
return BaseClass::SetupBones( pBoneToWorldOut, nMaxBones, boneMask, currentTime );
|
||||||
float oldCurtime = gpGlobals->curtime;
|
|
||||||
gpGlobals->curtime = currentTime;
|
|
||||||
|
|
||||||
auto ret = BaseClass::SetupBones( pBoneToWorldOut, nMaxBones, boneMask, currentTime );
|
|
||||||
|
|
||||||
gpGlobals->curtime = oldCurtime;
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
|
|
||||||
// memdbgon must be the last include file in a .cpp file!!!
|
// memdbgon must be the last include file in a .cpp file!!!
|
||||||
#include "tier0/memdbgon.h"
|
#include "tier0/memdbgon.h"
|
||||||
|
#include "tier3/tier3.h"
|
||||||
|
#include "vgui_controls/Controls.h"
|
||||||
|
|
||||||
static CPDumpPanel *g_pPDumpPanel = NULL;
|
static CPDumpPanel *g_pPDumpPanel = NULL;
|
||||||
|
|
||||||
|
@ -56,6 +58,10 @@ void CPDumpPanel::ApplySettings( KeyValues *inResourceData )
|
||||||
SetProportional( false );
|
SetProportional( false );
|
||||||
|
|
||||||
BaseClass::ApplySettings( inResourceData );
|
BaseClass::ApplySettings( inResourceData );
|
||||||
|
|
||||||
|
int x, y;
|
||||||
|
vgui::surface()->GetScreenSize( x, y );
|
||||||
|
SetBounds( 0, 0, x, y );
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPDumpPanel::ApplySchemeSettings( vgui::IScheme *pScheme )
|
void CPDumpPanel::ApplySchemeSettings( vgui::IScheme *pScheme )
|
||||||
|
@ -64,6 +70,10 @@ void CPDumpPanel::ApplySchemeSettings( vgui::IScheme *pScheme )
|
||||||
|
|
||||||
SetProportional( false );
|
SetProportional( false );
|
||||||
SetPaintBackgroundEnabled( false );
|
SetPaintBackgroundEnabled( false );
|
||||||
|
|
||||||
|
int x, y;
|
||||||
|
vgui::surface()->GetScreenSize( x, y );
|
||||||
|
SetBounds( 0, 0, x, y );
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -259,7 +269,7 @@ void CPDumpPanel::Paint()
|
||||||
// Now output the strings
|
// Now output the strings
|
||||||
int x[5];
|
int x[5];
|
||||||
x[0] = 20;
|
x[0] = 20;
|
||||||
int columnwidth = 375;
|
int columnwidth = 500;
|
||||||
int numcols = ScreenWidth() / columnwidth;
|
int numcols = ScreenWidth() / columnwidth;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
|
@ -1574,6 +1574,13 @@ void CCSPlayer::PostThink()
|
||||||
// Store the eye angles pitch so the client can compute its animation state correctly.
|
// Store the eye angles pitch so the client can compute its animation state correctly.
|
||||||
m_angEyeAngles = EyeAngles();
|
m_angEyeAngles = EyeAngles();
|
||||||
|
|
||||||
|
for (auto&& event : m_allEvents)
|
||||||
|
{
|
||||||
|
m_PlayerAnimState->DoAnimationEvent( event.m_currentWantedEvent, event.m_currentnData );
|
||||||
|
}
|
||||||
|
|
||||||
|
m_allEvents.RemoveAll();
|
||||||
|
|
||||||
m_PlayerAnimState->Update( m_angEyeAngles[YAW], m_angEyeAngles[PITCH] );
|
m_PlayerAnimState->Update( m_angEyeAngles[YAW], m_angEyeAngles[PITCH] );
|
||||||
|
|
||||||
m_angRenderAngles = m_PlayerAnimState->GetRenderAngles();
|
m_angRenderAngles = m_PlayerAnimState->GetRenderAngles();
|
||||||
|
@ -6628,7 +6635,7 @@ void CCSPlayer::DoAnimationEvent( PlayerAnimEvent_t event, int nData )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_PlayerAnimState->DoAnimationEvent( event, nData );
|
m_allEvents.AddToTail( { event, nData } );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1041,9 +1041,19 @@ private:
|
||||||
// HPE_END
|
// HPE_END
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
int m_iDeathFlags; // Flags holding revenge and domination info about a death
|
int m_iDeathFlags; // Flags holding revenge and domination info about a death
|
||||||
//=============================================================================
|
|
||||||
// HPE_END
|
// We really need to keep in sync with the server <=> client.
|
||||||
//=============================================================================
|
struct Events
|
||||||
|
{
|
||||||
|
PlayerAnimEvent_t m_currentWantedEvent;
|
||||||
|
int m_currentnData;
|
||||||
|
};
|
||||||
|
|
||||||
|
CUtlVector< Events > m_allEvents;
|
||||||
|
|
||||||
|
//=============================================================================
|
||||||
|
// HPE_END
|
||||||
|
//=============================================================================
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue