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 /public/dt_utlvector_send.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'public/dt_utlvector_send.h')
| -rw-r--r-- | public/dt_utlvector_send.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/public/dt_utlvector_send.h b/public/dt_utlvector_send.h new file mode 100644 index 0000000..f2ba68c --- /dev/null +++ b/public/dt_utlvector_send.h @@ -0,0 +1,57 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: Player for HL1. +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef DT_UTLVECTOR_SEND_H +#define DT_UTLVECTOR_SEND_H +#pragma once + + +#include "dt_send.h" +#include "dt_utlvector_common.h" + + +#define SENDINFO_UTLVECTOR( varName ) #varName, \ + offsetof(currentSendDTClass, varName), \ + sizeof(((currentSendDTClass*)0)->varName[0]), \ + GetEnsureCapacityTemplate( ((currentSendDTClass*)0)->varName ) + + + +#define SendPropUtlVectorDataTable( varName, nMaxElements, dataTableName ) \ + SendPropUtlVector( \ + SENDINFO_UTLVECTOR( varName ), \ + nMaxElements, \ + SendPropDataTable( NULL, 0, &REFERENCE_SEND_TABLE( dataTableName ) ) \ + ) + +// +// Set it up to transmit a CUtlVector of basic types or of structures. +// +// pArrayProp doesn't need a name, offset, or size. You can pass 0 for all those. +// Example usage: +// +// SendPropUtlVectorDataTable( m_StructArray, 11, DT_TestStruct ) +// +// SendPropUtlVector( +// SENDINFO_UTLVECTOR( m_FloatArray ), +// 16, // max elements +// SendPropFloat( NULL, 0, 0, 0, SPROP_NOSCALE ) +// ) +// +SendProp SendPropUtlVector( + char *pVarName, // Use SENDINFO_UTLVECTOR to generate these first 4 parameters. + int offset, + int sizeofVar, + EnsureCapacityFn ensureFn, + + int nMaxElements, // Max # of elements in the array. Keep this as low as possible. + SendProp pArrayProp, // Describe the data inside of each element in the array. + SendTableProxyFn varProxy=SendProxy_DataTableToDataTable // This can be overridden to control who the array is sent to. + ); + + +#endif // DT_UTLVECTOR_SEND_H |