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.

64 lines
1.9 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef DT_LOCALTRANSFER_H
  8. #define DT_LOCALTRANSFER_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "dt_send.h"
  13. #include "dt_recv.h"
  14. #include "dt.h"
  15. // We have at most MAX_CHANGE_OFFSETS indices in an edict.
  16. // We need 3 entries because of SPROP_IS_A_VECTOR_ELEM (in which case we could generate 3 props for each offset).
  17. // Then we need 2 entries because we store up to 2 SendProp indices for each offset in PropIndicesCollection_t.
  18. #define MAX_PROP_OFFSET_TO_INDICES_RESULTS (MAX_CHANGE_OFFSETS * 3 * PROP_INDICES_COLLECTION_NUM_INDICES)
  19. class CBaseEdict;
  20. // This sets up the ability to copy an entity with the specified SendTable directly
  21. // into an entity with the specified RecvTable, thus avoiding compression overhead.
  22. void LocalTransfer_InitFastCopy(
  23. const SendTable *pSendTable,
  24. const CStandardSendProxies *pSendProxies,
  25. RecvTable *pRecvTable,
  26. const CStandardRecvProxies *pRecvProxies,
  27. int &nSlowCopyProps, // These are incremented to tell you how many fast copy props it found.
  28. int &nFastCopyProps
  29. );
  30. // Transfer the data from pSrcEnt to pDestEnt using the specified SendTable and RecvTable.
  31. void LocalTransfer_TransferEntity(
  32. const CBaseEdict *pEdict,
  33. const SendTable *pSendTable,
  34. const void *pSrcEnt,
  35. RecvTable *pRecvTable,
  36. void *pDestEnt,
  37. bool bNewlyCreated,
  38. bool bJustEnteredPVS,
  39. int objectID );
  40. // This returns at most MAX_PROP_OFFSET_TO_INDICES_RESULTS results into pOut, so make sure it has at least that much room.
  41. int MapPropOffsetsToIndices(
  42. const CBaseEdict *pEdict,
  43. CSendTablePrecalc *pPrecalc,
  44. const unsigned short *pOffsets,
  45. unsigned short nOffsets,
  46. unsigned short *pOut );
  47. // Call this after packing all the entities in a frame.
  48. void PrintPartialChangeEntsList();
  49. #endif // DT_LOCALTRANSFER_H