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 /engine/changeframelist.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'engine/changeframelist.h')
| -rw-r--r-- | engine/changeframelist.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/engine/changeframelist.h b/engine/changeframelist.h new file mode 100644 index 0000000..17ac034 --- /dev/null +++ b/engine/changeframelist.h @@ -0,0 +1,56 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef CHANGEFRAMELIST_H +#define CHANGEFRAMELIST_H +#ifdef _WIN32 +#pragma once +#endif + + +#include "bitbuf.h" + + +// This class holds the last tick (from host_tickcount) that each property in +// a datatable changed at. +// +// It provides fast access to a list of properties that changed within a certain frame range. +// +// These are created once per entity per frame. Since usually a very small percentage of an +// entity's properties actually change each frame, this allows you to get a small set of +// properties to delta for each client. +abstract_class IChangeFrameList +{ +public: + + // Call this to delete the object. + virtual void Release() = 0; + + // This just returns the value you passed into AllocChangeFrameList(). + virtual int GetNumProps() = 0; + + // Sets the change frames for the specified properties to iFrame. + virtual void SetChangeTick( const int *pPropIndices, int nPropIndices, const int iTick ) = 0; + + // Get a list of all properties with a change frame > iFrame. + virtual int GetPropsChangedAfterTick( int iTick, int *iOutProps, int nMaxOutProps ) = 0; + + virtual IChangeFrameList* Copy() = 0; // return a copy of itself + + +protected: + // Use Release to delete these. + virtual ~IChangeFrameList() {} +}; + + +// Call to initialize. Pass in the number of properties this CChangeFrameList will hold. +// All properties will be initialized to iCurFrame. +IChangeFrameList* AllocChangeFrameList( int nProperties, int iCurFrame ); + + +#endif // CHANGEFRAMELIST_H |