Team Fortress 2 Source Code as on 22/4/2020
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.

50 lines
1.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #include "cbase.h"
  9. // memdbgon must be the last include file in a .cpp file!!!
  10. #include "tier0/memdbgon.h"
  11. // -------------------------------------------------------------------------------- //
  12. // An entity used to access overlays (and change their texture)
  13. // -------------------------------------------------------------------------------- //
  14. class CInfoOverlayAccessor : public CPointEntity
  15. {
  16. public:
  17. DECLARE_CLASS( CInfoOverlayAccessor, CPointEntity );
  18. int UpdateTransmitState();
  19. DECLARE_SERVERCLASS();
  20. DECLARE_DATADESC();
  21. private:
  22. CNetworkVar( int, m_iOverlayID );
  23. };
  24. // This table encodes the CBaseEntity data.
  25. IMPLEMENT_SERVERCLASS_ST_NOBASE(CInfoOverlayAccessor, DT_InfoOverlayAccessor)
  26. SendPropInt ( SENDINFO(m_iTextureFrameIndex), 8, SPROP_UNSIGNED ),
  27. SendPropInt ( SENDINFO(m_iOverlayID), 32, SPROP_UNSIGNED ),
  28. END_SEND_TABLE()
  29. LINK_ENTITY_TO_CLASS( info_overlay_accessor, CInfoOverlayAccessor );
  30. BEGIN_DATADESC( CInfoOverlayAccessor )
  31. DEFINE_KEYFIELD( m_iOverlayID, FIELD_INTEGER, "OverlayID" ),
  32. END_DATADESC()
  33. int CInfoOverlayAccessor::UpdateTransmitState()
  34. {
  35. return SetTransmitState( FL_EDICT_ALWAYS );
  36. }