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/public/dt_utlvector_send.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/public/dt_utlvector_send.h')
| -rw-r--r-- | sp/src/public/dt_utlvector_send.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/sp/src/public/dt_utlvector_send.h b/sp/src/public/dt_utlvector_send.h new file mode 100644 index 00000000..8ffee411 --- /dev/null +++ b/sp/src/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
|