summaryrefslogtreecommitdiff
path: root/game/shared/choreoactor.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/shared/choreoactor.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/shared/choreoactor.h')
-rw-r--r--game/shared/choreoactor.h89
1 files changed, 89 insertions, 0 deletions
diff --git a/game/shared/choreoactor.h b/game/shared/choreoactor.h
new file mode 100644
index 0000000..8749997
--- /dev/null
+++ b/game/shared/choreoactor.h
@@ -0,0 +1,89 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+#ifndef CHOREOACTOR_H
+#define CHOREOACTOR_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "tier1/utlvector.h"
+
+class CChoreoChannel;
+class CChoreoScene;
+class CUtlBuffer;
+class IChoreoStringPool;
+
+//-----------------------------------------------------------------------------
+// Purpose: The actor is the atomic element of a scene
+// A scene can have one or more actors, who have multiple events on one or
+// more channels
+//-----------------------------------------------------------------------------
+class CChoreoActor
+{
+public:
+
+ // Construction
+ CChoreoActor( void );
+ CChoreoActor( const char *name );
+ // Assignment
+ CChoreoActor& operator = ( const CChoreoActor& src );
+
+ // Serialization
+ void SaveToBuffer( CUtlBuffer& buf, CChoreoScene *pScene, IChoreoStringPool *pStringPool );
+ bool RestoreFromBuffer( CUtlBuffer& buf, CChoreoScene *pScene, IChoreoStringPool *pStringPool );
+
+ // Accessors
+ void SetName( const char *name );
+ const char *GetName( void );
+
+ // Iteration
+ int GetNumChannels( void );
+ CChoreoChannel *GetChannel( int channel );
+
+ CChoreoChannel *FindChannel( const char *name );
+
+ // Manipulate children
+ void AddChannel( CChoreoChannel *channel );
+ void RemoveChannel( CChoreoChannel *channel );
+ int FindChannelIndex( CChoreoChannel *channel );
+ void SwapChannels( int c1, int c2 );
+ void RemoveAllChannels();
+
+ void SetFacePoserModelName( const char *name );
+ char const *GetFacePoserModelName( void ) const;
+
+ void SetActive( bool active );
+ bool GetActive( void ) const;
+
+ bool IsMarkedForSave() const { return m_bMarkedForSave; }
+ void SetMarkedForSave( bool mark ) { m_bMarkedForSave = mark; }
+
+ void MarkForSaveAll( bool mark );
+
+private:
+ // Clear structure out
+ void Init( void );
+
+ enum
+ {
+ MAX_ACTOR_NAME = 128,
+ MAX_FACEPOSER_MODEL_NAME = 128
+ };
+
+ char m_szName[ MAX_ACTOR_NAME ];
+ char m_szFacePoserModelName[ MAX_FACEPOSER_MODEL_NAME ];
+
+ // Children
+ CUtlVector < CChoreoChannel * > m_Channels;
+
+ bool m_bActive;
+
+ // Purely for save/load
+ bool m_bMarkedForSave;
+};
+
+#endif // CHOREOACTOR_H