diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/shared/choreochannel.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/shared/choreochannel.h')
| -rw-r--r-- | game/shared/choreochannel.h | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/game/shared/choreochannel.h b/game/shared/choreochannel.h new file mode 100644 index 0000000..95a828c --- /dev/null +++ b/game/shared/choreochannel.h @@ -0,0 +1,95 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef CHOREOCHANNEL_H +#define CHOREOCHANNEL_H +#ifdef _WIN32 +#pragma once +#endif + +#include "tier1/utlvector.h" +#include "tier1/utlrbtree.h" + +class CChoreoEvent; +class CChoreoActor; +class CChoreoScene; +class CUtlBuffer; +class IChoreoStringPool; + +//----------------------------------------------------------------------------- +// Purpose: A channel is owned by an actor and contains zero or more events +//----------------------------------------------------------------------------- +class CChoreoChannel +{ +public: + // Construction + CChoreoChannel( void ); + CChoreoChannel( const char *name ); + + // Assignment + CChoreoChannel& operator=(const CChoreoChannel& src ); + + // Serialization + void SaveToBuffer( CUtlBuffer& buf, CChoreoScene *pScene, IChoreoStringPool *pStringPool ); + bool RestoreFromBuffer( CUtlBuffer& buf, CChoreoScene *pScene, CChoreoActor *pActor, IChoreoStringPool *pStringPool ); + + // Accessors + void SetName( const char *name ); + const char *GetName( void ); + + // Iterate children + int GetNumEvents( void ); + CChoreoEvent *GetEvent( int event ); + + // Manipulate children + void AddEvent( CChoreoEvent *event ); + void RemoveEvent( CChoreoEvent *event ); + int FindEventIndex( CChoreoEvent *event ); + void RemoveAllEvents(); + + CChoreoActor *GetActor( void ); + void SetActor( CChoreoActor *actor ); + + void SetActive( bool active ); + bool GetActive( void ) const; + + // Compute true start/end times for gesture events in this channel, factoring in "null" gestures as needed + void ReconcileGestureTimes(); + // Compute master/slave, count, endtime info for close captioning data + void ReconcileCloseCaption(); + + bool IsMarkedForSave() const { return m_bMarkedForSave; } + void SetMarkedForSave( bool mark ) { m_bMarkedForSave = mark; } + + void MarkForSaveAll( bool mark ); + + bool GetSortedCombinedEventList( char const *cctoken, CUtlRBTree< CChoreoEvent * >& sorted ); + +private: + // Initialize fields + void Init( void ); + + enum + { + MAX_CHANNEL_NAME = 128, + }; + + CChoreoActor *m_pActor; + + // Channels are just named + char m_szName[ MAX_CHANNEL_NAME ]; + + // All of the events for this channel + CUtlVector < CChoreoEvent * > m_Events; + + bool m_bActive; + + // Purely for save/load + bool m_bMarkedForSave; +}; + +#endif // CHOREOCHANNEL_H |