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.

103 lines
2.7 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #ifndef DATATABLE_SHARED_H
  9. #define DATATABLE_SHARED_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #include "dt_common.h"
  14. // ------------------------------------------------------------------------ //
  15. // Client version
  16. // ------------------------------------------------------------------------ //
  17. #if defined (CLIENT_DLL)
  18. #include "dt_recv.h"
  19. #define PROPINFO(varName) RECVINFO(varName)
  20. #define PROPINFO_DT(varName) RECVINFO_DT(varName)
  21. #define PROPINFO_DT_NAME(varName, remoteVarName) RECVINFO_DTNAME(varName,remoteVarName)
  22. #define PROPINFO_NAME(varName,remoteVarName) RECVINFO_NAME(varName, remoteVarName)
  23. #define DataTableProp RecvProp
  24. #endif
  25. // ------------------------------------------------------------------------ //
  26. // Server version
  27. // ------------------------------------------------------------------------ //
  28. #if !defined (CLIENT_DLL)
  29. #include "dt_send.h"
  30. #define PROPINFO(varName) SENDINFO(varName)
  31. #define PROPINFO_DT(varName) SENDINFO_DT(varName)
  32. #define PROPINFO_DT_NAME(varName, remoteVarName) SENDINFO_DT_NAME(varName, remoteVarName)
  33. #define PROPINFO_NAME(varName,remoteVarName) SENDINFO_NAME(varName,remoteVarName)
  34. #define DataTableProp SendProp
  35. #endif
  36. // Use these functions to setup your data tables.
  37. DataTableProp PropFloat(
  38. char *pVarName, // Variable name.
  39. int offset, // Offset into container structure.
  40. int sizeofVar=SIZEOF_IGNORE,
  41. int nBits=32, // Number of bits to use when encoding.
  42. int flags=0,
  43. float fLowValue=0.0f, // For floating point, low and high values.
  44. float fHighValue=HIGH_DEFAULT // High value. If HIGH_DEFAULT, it's (1<<nBits).
  45. );
  46. DataTableProp PropVector(
  47. char *pVarName,
  48. int offset,
  49. int sizeofVar=SIZEOF_IGNORE,
  50. int nBits=32, // Number of bits (for each floating-point component) to use when encoding.
  51. int flags=SPROP_NOSCALE,
  52. float fLowValue=0.0f, // For floating point, low and high values.
  53. float fHighValue=HIGH_DEFAULT // High value. If HIGH_DEFAULT, it's (1<<nBits).
  54. );
  55. DataTableProp PropAngle(
  56. char *pVarName,
  57. int offset,
  58. int sizeofVar=SIZEOF_IGNORE,
  59. int nBits=32,
  60. int flags=0
  61. );
  62. DataTableProp PropInt(
  63. char *pVarName,
  64. int offset,
  65. int sizeofVar=SIZEOF_IGNORE, // Handled by SENDINFO macro.
  66. int nBits=-1, // Set to -1 to automatically pick (max) number of bits based on size of element.
  67. int flags=0,
  68. int rightShift=0
  69. );
  70. DataTableProp PropString(
  71. char *pVarName,
  72. int offset,
  73. int bufferLen,
  74. int flags=0
  75. );
  76. DataTableProp PropEHandle(
  77. char *pVarName,
  78. int offset,
  79. int sizeofVar=SIZEOF_IGNORE );
  80. #endif // DATATABLE_SHARED_H