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.

58 lines
1.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef HUD_DOD_CROSSHAIR_H
  8. #define HUD_DOD_CROSSHAIR_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "hudelement.h"
  13. #include <vgui_controls/Panel.h>
  14. namespace vgui
  15. {
  16. class IScheme;
  17. };
  18. //-----------------------------------------------------------------------------
  19. // Purpose:
  20. //-----------------------------------------------------------------------------
  21. class CHudDODCrosshair : public CHudElement, public vgui::Panel
  22. {
  23. public:
  24. DECLARE_CLASS_SIMPLE( CHudDODCrosshair, vgui::Panel );
  25. CHudDODCrosshair( const char *name );
  26. virtual void Paint();
  27. virtual void Init();
  28. virtual bool ShouldDraw();
  29. virtual void ApplySchemeSettings( vgui::IScheme *scheme );
  30. virtual void LevelShutdown( void );
  31. //stub
  32. void SetCrosshair( CHudTexture *texture, Color& clr ) {}
  33. void ResetCrosshair() {}
  34. private:
  35. int m_iCrosshairTextureID;
  36. IVguiMatInfo *m_pCrosshair;
  37. IVguiMatInfoVar *m_pFrameVar; // interface for material frame
  38. int m_nNumFrames; // how many frames this crosshair has
  39. char m_szPreviousCrosshair[256]; // name of the current crosshair
  40. float m_flAccuracy;
  41. };
  42. // Enable/disable crosshair rendering.
  43. extern ConVar crosshair;
  44. #endif // HUD_DOD_CROSSHAIR_H