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.

55 lines
1.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: This is a panel which draws a viewcone
  4. //
  5. // $Revision: $
  6. // $NoKeywords: $
  7. //=============================================================================//
  8. #ifndef VIEWCONEIMAGE_H
  9. #define VIEWCONEIMAGE_H
  10. #include "shareddefs.h"
  11. #include "vgui_bitmapimage.h"
  12. namespace vgui
  13. {
  14. class Panel;
  15. }
  16. class C_BaseEntity;
  17. class KeyValues;
  18. //-----------------------------------------------------------------------------
  19. // A bitmap that renders a view cone based on angles
  20. //-----------------------------------------------------------------------------
  21. class CViewConeImage
  22. {
  23. public:
  24. // initialization
  25. bool Init( vgui::Panel *pParent, KeyValues* pInitData );
  26. // Paint the sucka
  27. void Paint( float yaw );
  28. void SetColor( int r, int g, int b );
  29. private:
  30. BitmapImage m_Image;
  31. };
  32. //-----------------------------------------------------------------------------
  33. // Helper method to initialize a view cone image from KeyValues data..
  34. // KeyValues contains the bitmap data, pSectionName, if it exists,
  35. // indicates which subsection of pInitData should be looked at to get at the
  36. // image data. The final argument is the bitmap image to initialize.
  37. // The function returns true if it succeeded.
  38. //
  39. // NOTE: This function looks for the key values 'material' and 'color'
  40. // and uses them to set up the material + modulation color of the image
  41. //-----------------------------------------------------------------------------
  42. bool InitializeViewConeImage( KeyValues *pInitData, const char* pSectionName,
  43. vgui::Panel *pParent, CViewConeImage* pViewConeImage );
  44. #endif // VIEWCONEIMAGE_H