Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

113 lines
2.7 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #include "dt_shared.h"
  9. #if !defined (CLIENT_DLL)
  10. #include "sendproxy.h"
  11. #else
  12. #include "recvproxy.h"
  13. #endif
  14. // ------------------------------------------------------------------------ //
  15. // Just wrappers to make shared code look easier...
  16. // ------------------------------------------------------------------------ //
  17. // Use these functions to setup your data tables.
  18. DataTableProp PropFloat(
  19. char *pVarName, // Variable name.
  20. int offset, // Offset into container structure.
  21. int sizeofVar,
  22. int nBits, // Number of bits to use when encoding.
  23. int flags,
  24. float fLowValue, // For floating point, low and high values.
  25. float fHighValue // High value. If HIGH_DEFAULT, it's (1<<nBits).
  26. )
  27. {
  28. #if !defined (CLIENT_DLL)
  29. return SendPropFloat( pVarName, offset, sizeofVar, nBits, flags, fLowValue, fHighValue );
  30. #else
  31. return RecvPropFloat( pVarName, offset, sizeofVar, flags );
  32. #endif
  33. }
  34. DataTableProp PropVector(
  35. char *pVarName,
  36. int offset,
  37. int sizeofVar,
  38. int nBits, // Number of bits (for each floating-point component) to use when encoding.
  39. int flags,
  40. float fLowValue, // For floating point, low and high values.
  41. float fHighValue // High value. If HIGH_DEFAULT, it's (1<<nBits).
  42. )
  43. {
  44. #if !defined (CLIENT_DLL)
  45. return SendPropVector( pVarName, offset, sizeofVar, nBits, flags, fLowValue, fHighValue );
  46. #else
  47. return RecvPropVector( pVarName, offset, sizeofVar, flags );
  48. #endif
  49. }
  50. DataTableProp PropAngle(
  51. char *pVarName,
  52. int offset,
  53. int sizeofVar,
  54. int nBits,
  55. int flags
  56. )
  57. {
  58. #if !defined (CLIENT_DLL)
  59. return SendPropAngle( pVarName, offset, sizeofVar, nBits, flags );
  60. #else
  61. return RecvPropFloat( pVarName, offset, sizeofVar, flags );
  62. #endif
  63. }
  64. DataTableProp PropInt(
  65. char *pVarName,
  66. int offset,
  67. int sizeofVar, // Handled by SENDINFO macro.
  68. int nBits, // Set to -1 to automatically pick (max) number of bits based on size of element.
  69. int flags,
  70. int rightShift
  71. )
  72. {
  73. #if !defined (CLIENT_DLL)
  74. return SendPropInt( pVarName, offset, sizeofVar, nBits, flags, rightShift );
  75. #else
  76. return RecvPropInt( pVarName, offset, sizeofVar, flags );
  77. #endif
  78. }
  79. DataTableProp PropString(
  80. char *pVarName,
  81. int offset,
  82. int bufferLen,
  83. int flags
  84. )
  85. {
  86. #if !defined (CLIENT_DLL)
  87. return SendPropString( pVarName, offset, bufferLen, flags );
  88. #else
  89. return RecvPropString( pVarName, offset, bufferLen, flags );
  90. #endif
  91. }
  92. DataTableProp PropEHandle(
  93. char *pVarName,
  94. int offset,
  95. int sizeofVar )
  96. {
  97. #if !defined (CLIENT_DLL)
  98. return SendPropEHandle( pVarName, offset, sizeofVar );
  99. #else
  100. return RecvPropEHandle( pVarName, offset, sizeofVar );
  101. #endif
  102. }