diff options
| author | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
| commit | 39ed87570bdb2f86969d4be821c94b722dc71179 (patch) | |
| tree | abc53757f75f40c80278e87650ea92808274aa59 /sp/src/game/shared/choreochannel.h | |
| download | source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip | |
First version of the SOurce SDK 2013
Diffstat (limited to 'sp/src/game/shared/choreochannel.h')
| -rw-r--r-- | sp/src/game/shared/choreochannel.h | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/sp/src/game/shared/choreochannel.h b/sp/src/game/shared/choreochannel.h new file mode 100644 index 00000000..6f9d6e05 --- /dev/null +++ b/sp/src/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
|